From cdae0f6707f201ae239d90dce21f86f2901bfd69 Mon Sep 17 00:00:00 2001 From: esseffe Date: Thu, 25 Nov 2010 14:37:47 +0000 Subject: [PATCH] upgrading to SpatiaLite 2.4.0-RC4 git-svn-id: http://svn.osgeo.org/qgis/trunk@14763 c8812cc2-4d05-0410-92ff-de0c093fc19c --- AUTHORS | 1 + debian/copyright | 1 + python/core/qgsapplication.sip | 4 - src/app/qgsnewspatialitelayerdialog.cpp | 81 +- src/app/qgsnewspatialitelayerdialog.h | 3 + src/core/qgsapplication.cpp | 8 - src/core/qgsapplication.h | 4 - src/core/spatialite/headers/spatialite.h | 9 +- .../spatialite/headers/spatialite/gaiaaux.h | 4 +- .../spatialite/headers/spatialite/gaiaexif.h | 1 - .../spatialite/headers/spatialite/gaiageo.h | 184 +- .../headers/spatialite/spatialite.h | 1 + .../spatialite/headers/spatialite/sqlite3.h | 3986 +- .../headers/spatialite/sqlite3ext.h | 233 +- src/core/spatialite/spatialite.c | 136748 ++++++++++++++- src/core/spatialite/sqlite3.c | 42835 +++-- .../offline_editing/offline_editing.cpp | 78 +- src/plugins/offline_editing/offline_editing.h | 1 + .../spatialite/qgsspatialiteprovider.h | 1 + 19 files changed, 157477 insertions(+), 26706 deletions(-) diff --git a/AUTHORS b/AUTHORS index 6ee9ed6e368..8ebb1808e76 100644 --- a/AUTHORS +++ b/AUTHORS @@ -40,3 +40,4 @@ Carson J. Q. Farmer Lorenzo Masini Werner Macho Giuseppe Sucameli +Alessandro Furieri diff --git a/debian/copyright b/debian/copyright index c3ca2a39ef6..35b5bbc3b9d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -38,6 +38,7 @@ reported: Lorenzo Masini Werner Macho Giuseppe Sucameli + Alessandro Furieri Copyright: diff --git a/python/core/qgsapplication.sip b/python/core/qgsapplication.sip index de59325efb6..991ac04a667 100644 --- a/python/core/qgsapplication.sip +++ b/python/core/qgsapplication.sip @@ -139,10 +139,6 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv) //! Returns the path to the master qgis.db file. static const QString qgisMasterDbFilePath(); - //! Returns the path to the spatialite template db file. - //! @note added in 1.5 - static const QString qgisSpatialiteDbTemplatePath(); - //! Returns the path to the settings directory in user's home dir static const QString qgisSettingsDirPath(); diff --git a/src/app/qgsnewspatialitelayerdialog.cpp b/src/app/qgsnewspatialitelayerdialog.cpp index 96734e570d8..05fea16e1f0 100644 --- a/src/app/qgsnewspatialitelayerdialog.cpp +++ b/src/app/qgsnewspatialitelayerdialog.cpp @@ -187,9 +187,57 @@ void QgsNewSpatialiteLayerDialog::on_pbnFindSRID_clicked() } } +void QgsNewSpatialiteLayerDialog::initializeSpatialMetadata(sqlite3 *sqlite_handle) +{ +// attempting to perform self-initialization for a newly created DB + int ret; + char sql[1024]; + char *errMsg = NULL; + int count; + int i; + char **results; + int rows; + int columns; + + if (sqlite_handle == NULL) + return; + // checking if this DB is really empty + strcpy(sql, "SELECT Count(*) from sqlite_master"); + ret = sqlite3_get_table(sqlite_handle, sql, &results, &rows, &columns, NULL); + if (ret != SQLITE_OK) + return; + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + count = atoi(results[(i * columns) + 0]); + } + sqlite3_free_table(results); + + if (count > 0) + return; + + // all right, it's empty: proceding to initialize + strcpy(sql, "SELECT InitSpatialMetadata()"); + ret = sqlite3_exec(sqlite_handle, sql, NULL, NULL, &errMsg); + if (ret != SQLITE_OK) + { + QString errCause = tr( "Unable to initialize SpatialMetedata:\n" ); + errCause += QString::fromUtf8(errMsg); + QMessageBox::warning( 0, tr( "SpatiaLite Database" ), errCause ); + sqlite3_free(errMsg); + return; + } + spatial_ref_sys_init(sqlite_handle, 0); +} + bool QgsNewSpatialiteLayerDialog::createDb() { QSettings settings; + int ret; + sqlite3 *sqlite_handle; + char *errMsg = NULL; if ( mDatabaseComboBox->currentText().isEmpty() ) return false; @@ -199,10 +247,6 @@ bool QgsNewSpatialiteLayerDialog::createDb() { QgsDebugMsg( "creating a new db" ); - // copy the spatilite template to the user specified path - QString spatialiteTemplate = QgsApplication::qgisSpatialiteDbTemplatePath(); - QFile spatialiteTemplateDb( spatialiteTemplate ); - QFileInfo fullPath = QFileInfo( mDatabaseComboBox->currentText() ); QDir path = fullPath.dir(); QgsDebugMsg( QString( "making this dir: %1" ).arg( path.absolutePath() ) ); @@ -210,15 +254,34 @@ bool QgsNewSpatialiteLayerDialog::createDb() // Must be sure there is destination directory ~/.qgis QDir().mkpath( path.absolutePath( ) ); - QgsDebugMsg( QString( "Copying %1 to %2" ).arg( spatialiteTemplate ).arg( newDb.fileName() ) ); - - //now copy the template db file into the chosen location - if ( !spatialiteTemplateDb.copy( newDb.fileName() ) ) + // creating/opening the new database + QString dbPath = newDb.fileName(); + spatialite_init(0); + ret = sqlite3_open_v2(dbPath.toUtf8().constData(), &sqlite_handle, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL); + if (ret) { - QMessageBox::warning( 0, tr( "SpatiaLite Database" ), tr( "Could not copy the template database to new location" ) ); + // an error occurred + QString errCause = tr( "Could not create a new database\n" ); + errCause += QString::fromUtf8(sqlite3_errmsg(sqlite_handle)); + sqlite3_close(sqlite_handle); + QMessageBox::warning( 0, tr( "SpatiaLite Database" ), errCause ); pbnFindSRID->setEnabled( false ); return false; } + // activating Foreign Key constraints + ret = sqlite3_exec(sqlite_handle, "PRAGMA foreign_keys = 1", NULL, 0, &errMsg); + if (ret != SQLITE_OK) + { + QMessageBox::warning( 0, tr( "SpatiaLite Database" ), tr( "Unable to activate FOREIGN_KEY constraints" ) ); + sqlite3_free(errMsg); + sqlite3_close(sqlite_handle); + pbnFindSRID->setEnabled( false ); + return false; + } + initializeSpatialMetadata(sqlite_handle); + + // all done: closing the DB connection + sqlite3_close(sqlite_handle); } QFileInfo fi( newDb ); diff --git a/src/app/qgsnewspatialitelayerdialog.h b/src/app/qgsnewspatialitelayerdialog.h index 7f22291bbc8..bcb4c9ca740 100644 --- a/src/app/qgsnewspatialitelayerdialog.h +++ b/src/app/qgsnewspatialitelayerdialog.h @@ -59,6 +59,9 @@ class QgsNewSpatialiteLayerDialog: public QDialog, private Ui::QgsNewSpatialiteL /** Create a new database */ bool createDb(); + /** Initializes SpatialMetadata db-tables */ + void initializeSpatialMetadata( sqlite3 *sqlite_handle ); + static QString quotedIdentifier( QString id ); static QString quotedValue( QString value ); }; diff --git a/src/core/qgsapplication.cpp b/src/core/qgsapplication.cpp index 183f17620bd..9103fa9dfd4 100644 --- a/src/core/qgsapplication.cpp +++ b/src/core/qgsapplication.cpp @@ -277,14 +277,6 @@ const QString QgsApplication::qgisMasterDbFilePath() return mPkgDataPath + QString( "/resources/qgis.db" ); } -/*! - Returns the path to the spatialite template db file. -*/ -const QString QgsApplication::qgisSpatialiteDbTemplatePath() -{ - return mPkgDataPath + QString( "/resources/spatialite.db" ); -} - /*! Returns the path to the settings directory in user's home dir */ diff --git a/src/core/qgsapplication.h b/src/core/qgsapplication.h index 84baaf2c5f7..cbfb5e26383 100644 --- a/src/core/qgsapplication.h +++ b/src/core/qgsapplication.h @@ -90,10 +90,6 @@ class CORE_EXPORT QgsApplication: public QApplication //! Returns the path to the master qgis.db file. static const QString qgisMasterDbFilePath(); - //! Returns the path to the spatialite template db file. - //! @note added in 1.5 - static const QString qgisSpatialiteDbTemplatePath(); - //! Returns the path to the settings directory in user's home dir static const QString qgisSettingsDirPath(); diff --git a/src/core/spatialite/headers/spatialite.h b/src/core/spatialite/headers/spatialite.h index fd95ecbcce4..1512c58fb5b 100644 --- a/src/core/spatialite/headers/spatialite.h +++ b/src/core/spatialite/headers/spatialite.h @@ -57,7 +57,6 @@ extern "C" #endif SPATIALITE_DECLARE const char *spatialite_version (void); - SPATIALITE_DECLARE const char *virtualtext_version (void); SPATIALITE_DECLARE void spatialite_init (int verbose); SPATIALITE_DECLARE int dump_shapefile (sqlite3 * sqlite, char *table, char *column, char *charset, @@ -65,10 +64,16 @@ extern "C" int verbose, int *rows); SPATIALITE_DECLARE int load_shapefile (sqlite3 * sqlite, char *shp_path, char *table, char *charset, int srid, - char *column, int verbose, + char *column, int coerce2d, + int compressed, int verbose, int *rows); + SPATIALITE_DECLARE int load_dbf (sqlite3 * sqlite, char *shp_path, + char *table, char *charset, int verbose, + int *rows); SPATIALITE_DECLARE double math_round (double value); SPATIALITE_DECLARE sqlite3_int64 math_llabs (sqlite3_int64 value); + SPATIALITE_DECLARE void spatial_ref_sys_init (sqlite3 * sqlite, + int verbose); #ifdef __cplusplus } diff --git a/src/core/spatialite/headers/spatialite/gaiaaux.h b/src/core/spatialite/headers/spatialite/gaiaaux.h index ec93d85264b..bfdd302ee1e 100644 --- a/src/core/spatialite/headers/spatialite/gaiaaux.h +++ b/src/core/spatialite/headers/spatialite/gaiaaux.h @@ -58,11 +58,9 @@ extern "C" /* function prototipes */ - GAIAAUX_DECLARE const char *gaiaGetLocaleCharset (); + GAIAAUX_DECLARE const char *gaiaGetLocaleCharset (void); GAIAAUX_DECLARE int gaiaConvertCharset (char **buf, const char *fromCs, const char *toCs); - GAIAAUX_DECLARE int gaiaToUTF8 (char **buf, const char *fromCs, - const char *toCs); GAIAAUX_DECLARE void *gaiaCreateUTF8Converter (const char *fromCS); GAIAAUX_DECLARE void gaiaFreeUTF8Converter (void *cvtCS); GAIAAUX_DECLARE char *gaiaConvertToUTF8 (void *cvtCS, const char *buf, diff --git a/src/core/spatialite/headers/spatialite/gaiaexif.h b/src/core/spatialite/headers/spatialite/gaiaexif.h index 15ee69ea0f4..22f1efecdf5 100644 --- a/src/core/spatialite/headers/spatialite/gaiaexif.h +++ b/src/core/spatialite/headers/spatialite/gaiaexif.h @@ -67,7 +67,6 @@ extern "C" #define GAIA_PDF_BLOB 7 #define GAIA_GEOMETRY_BLOB 8 #define GAIA_TIFF_BLOB 9 -#define GAIA_WAVELET_BLOB 10 /* constants used for EXIF value types */ #define GAIA_EXIF_NONE 0 diff --git a/src/core/spatialite/headers/spatialite/gaiageo.h b/src/core/spatialite/headers/spatialite/gaiageo.h index 21c9a7dd62a..ffcdf1986bb 100644 --- a/src/core/spatialite/headers/spatialite/gaiageo.h +++ b/src/core/spatialite/headers/spatialite/gaiageo.h @@ -158,6 +158,7 @@ extern "C" /* constants used for VirtualNetwork */ #define GAIA_NET_START 0x67 #define GAIA_NET64_START 0x68 +#define GAIA_NET64_A_STAR_START 0x69 #define GAIA_NET_END 0x87 #define GAIA_NET_HEADER 0xc0 #define GAIA_NET_CODE 0xa6 @@ -169,6 +170,7 @@ extern "C" #define GAIA_NET_TO 0xa2 #define GAIA_NET_GEOM 0xa3 #define GAIA_NET_NAME 0xa4 +#define GAIA_NET_A_STAR_COEFF 0xa5 #define GAIA_NET_BLOCK 0xed /* constants used for Coordinate Dimensions */ @@ -346,6 +348,7 @@ extern "C" double MaxY; /* MBR - BBOX */ int DimensionModel; /* (x,y), (x,y,z), (x,y,m) or (x,y,z,m) */ int DeclaredType; /* the declared TYPE for this Geometry */ + struct gaiaGeomCollStruct *Next; /* Vanuatu - used for linked list */ } gaiaGeomColl; typedef gaiaGeomColl *gaiaGeomCollPtr; @@ -374,7 +377,7 @@ extern "C" char *Name; /* field name */ unsigned char Type; /* field type */ int Offset; /* buffer offset [this field begins at *buffer+offset* and extends for *length* bytes */ - unsigned char Length; /* field total length [in bytes] */ + unsigned char Length; /* field total lenght [in bytes] */ unsigned char Decimals; /* decimal positions */ gaiaValuePtr Value; /* the current multitype value for this attribute */ struct gaiaDbfFieldStruct *Next; /* pointer to next element in linked list */ @@ -391,12 +394,30 @@ extern "C" } gaiaDbfList; typedef gaiaDbfList *gaiaDbfListPtr; + typedef struct gaiaDbfStruct + { +/* DBF TYPE */ + int endian_arch; + int Valid; /* 1 = ready to process */ + char *Path; /* the DBF path */ + FILE *flDbf; /* the DBF file handle */ + gaiaDbfListPtr Dbf; /* the DBF attributes list */ + unsigned char *BufDbf; /* the DBF I/O buffer */ + int DbfHdsz; /* the DBF header length */ + int DbfReclen; /* the DBF record length */ + int DbfSize; /* current DBF size */ + int DbfRecno; /* current DBF record number */ + void *IconvObj; /* opaque reference to ICONV converter */ + char *LastError; /* last error message */ + } gaiaDbf; + typedef gaiaDbf *gaiaDbfPtr; + typedef struct gaiaShapefileStruct { /* SHAPEFILE TYPE */ int endian_arch; int Valid; /* 1 = ready to process */ - int ReadOnly; /* read or wite mode */ + int ReadOnly; /* read or write mode */ char *Path; /* the shapefile abstract path [no suffixes] */ FILE *flShx; /* the SHX file handle */ FILE *flShp; /* the SHP file handle */ @@ -423,6 +444,95 @@ extern "C" } gaiaShapefile; typedef gaiaShapefile *gaiaShapefilePtr; + typedef struct gaiaOutBufferStruct + { +/* a struct handling a dynamically growing output buffer */ + char *Buffer; + int WriteOffset; + int BufferSize; + int Error; + } gaiaOutBuffer; + typedef gaiaOutBuffer *gaiaOutBufferPtr; + +#ifndef OMIT_ICONV /* ICONV enabled: supporting text reader */ + +#define VRTTXT_FIELDS_MAX 65535 +#define VRTTXT_BLOCK_MAX 65535 + +#define VRTTXT_TEXT 1 +#define VRTTXT_INTEGER 2 +#define VRTTXT_DOUBLE 3 +#define VRTTXT_NULL 4 + + struct vrttxt_line + { +/* a struct representing a full LINE (aka Record) */ + off_t offset; + int len; + int field_offsets[VRTTXT_FIELDS_MAX]; + int num_fields; + int error; + }; + + struct vrttxt_row + { +/* a struct storing Row offsets */ + int line_no; + off_t offset; + int len; + int num_fields; + }; + + struct vrttxt_row_block + { +/* +/ for efficiency sake, individuale Row offsets +/ are grouped in reasonably sized blocks +*/ + struct vrttxt_row rows[VRTTXT_BLOCK_MAX]; + int num_rows; + int min_line_no; + int max_line_no; + struct vrttxt_row_block *next; + }; + + struct vrttxt_column_header + { +/* a struct representing a Column (aka Field) header */ + char *name; + int type; + }; + + typedef struct vrttxt_reader + { +/* the main TXT-Reader struct */ + struct vrttxt_column_header columns[VRTTXT_FIELDS_MAX]; + FILE *text_file; + void *toUtf8; /* the UTF-8 ICONV converter */ + char field_separator; + char text_separator; + char decimal_separator; + int first_line_titles; + int error; + struct vrttxt_row_block *first; + struct vrttxt_row_block *last; + struct vrttxt_row **rows; + int num_rows; + int line_no; + int max_fields; + int current_buf_sz; + int current_buf_off; + char *line_buffer; + char *field_buffer; + int field_offsets[VRTTXT_FIELDS_MAX]; + int field_lens[VRTTXT_FIELDS_MAX]; + int max_current_field; + int current_line_ready; + } gaiaTextReader; + typedef gaiaTextReader *gaiaTextReaderPtr; + +#endif /* end ICONV (text reader) */ + /* function prototipes */ GAIAGEO_DECLARE int gaiaEndianArch (void); @@ -608,13 +718,6 @@ extern "C" unsigned int size); GAIAGEO_DECLARE void gaiaToWkb (gaiaGeomCollPtr geom, unsigned char **result, int *size); - GAIAGEO_DECLARE int gaiaFromWkbNoCheck (const unsigned char *in, - unsigned int szin, - unsigned char **out, int *szout, - int srid); - GAIAGEO_DECLARE int gaiaToWkbNoCheck (const unsigned char *in, - unsigned int szin, - unsigned char **out, int *szout); GAIAGEO_DECLARE char *gaiaToHexWkb (gaiaGeomCollPtr geom); GAIAGEO_DECLARE void gaiaFreeValue (gaiaValuePtr p); GAIAGEO_DECLARE void gaiaSetNullValue (gaiaDbfFieldPtr field); @@ -659,11 +762,28 @@ extern "C" GAIAGEO_DECLARE int gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity); GAIAGEO_DECLARE void gaiaFlushShpHeaders (gaiaShapefilePtr shp); + GAIAGEO_DECLARE gaiaDbfPtr gaiaAllocDbf (void); + GAIAGEO_DECLARE void gaiaFreeDbf (gaiaDbfPtr dbf); + GAIAGEO_DECLARE void gaiaOpenDbfRead (gaiaDbfPtr dbf, + const char *path, + const char *charFrom, + const char *charTo); + GAIAGEO_DECLARE int gaiaReadDbfEntity (gaiaDbfPtr shp, int current_row, + int *deleted); GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseWkt (const unsigned char *dirty_buffer, short type); - GAIAGEO_DECLARE void gaiaOutWkt (gaiaGeomCollPtr geom, char **result); - GAIAGEO_DECLARE void gaiaOutSvg (gaiaGeomCollPtr geom, char **result, - int relative, int precision); + GAIAGEO_DECLARE void gaiaOutWkt (gaiaOutBufferPtr out_buf, + gaiaGeomCollPtr geom); + GAIAGEO_DECLARE void gaiaOutSvg (gaiaOutBufferPtr out_buf, + gaiaGeomCollPtr geom, int relative, + int precision); + GAIAGEO_DECLARE void gaiaOutBareKml (gaiaOutBufferPtr out_buf, + gaiaGeomCollPtr geom, int precision); + GAIAGEO_DECLARE void gaiaOutFullKml (gaiaOutBufferPtr out_buf, + const char *name, const char *desc, + gaiaGeomCollPtr geom, int precision); + GAIAGEO_DECLARE void gaiaOutGml (gaiaOutBufferPtr out_buf, int version, + int precision, gaiaGeomCollPtr geom); GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromFgf (const unsigned char *blob, unsigned int size); GAIAGEO_DECLARE void gaiaToFgf (gaiaGeomCollPtr geom, @@ -752,6 +872,21 @@ extern "C" double *coords, int vert); GAIAGEO_DECLARE int gaiaConvertLength (double value, int unit_from, int unit_to, double *cvt); + GAIAGEO_DECLARE int gaiaLineGetPoint (gaiaLinestringPtr ln, int v, + double *x, double *y, double *z, + double *m); + GAIAGEO_DECLARE int gaiaLineSetPoint (gaiaLinestringPtr ln, int v, double x, + double y, double z, double m); + GAIAGEO_DECLARE int gaiaRingGetPoint (gaiaRingPtr rng, int v, double *x, + double *y, double *z, double *m); + GAIAGEO_DECLARE int gaiaRingSetPoint (gaiaRingPtr rng, int v, double x, + double y, double z, double m); + GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSanitize (gaiaGeomCollPtr org); + GAIAGEO_DECLARE int gaiaIsToxic (gaiaGeomCollPtr org); + GAIAGEO_DECLARE void gaiaOutBufferInitialize (gaiaOutBufferPtr buf); + GAIAGEO_DECLARE void gaiaOutBufferReset (gaiaOutBufferPtr buf); + GAIAGEO_DECLARE void gaiaAppendToOutBuffer (gaiaOutBufferPtr buf, + const char *text); #ifndef OMIT_PROJ /* including PROJ.4 */ @@ -765,6 +900,12 @@ extern "C" #ifndef OMIT_GEOS /* including GEOS */ + GAIAGEO_DECLARE void gaiaResetGeosMsg (void); + GAIAGEO_DECLARE const char *gaiaGetGeosErrorMsg (void); + GAIAGEO_DECLARE const char *gaiaGetGeosWarningMsg (void); + GAIAGEO_DECLARE void gaiaSetGeosErrorMsg (const char *msg); + GAIAGEO_DECLARE void gaiaSetGeosWarningMsg (const char *msg); + GAIAGEO_DECLARE int gaiaGeomCollEquals (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2); GAIAGEO_DECLARE int gaiaGeomCollDisjoint (gaiaGeomCollPtr geom1, @@ -832,6 +973,25 @@ extern "C" #endif /* end including GEOS */ +#ifndef OMIT_ICONV /* ICONV enabled: supporting text reader */ + GAIAGEO_DECLARE gaiaTextReaderPtr gaiaTextReaderAlloc (const char *path, + char field_separator, + char text_separator, + char + decimal_separator, + int + first_line_titles, + const char + *encoding); + GAIAGEO_DECLARE void gaiaTextReaderDestroy (gaiaTextReaderPtr reader); + GAIAGEO_DECLARE int gaiaTextReaderParse (gaiaTextReaderPtr reader); + GAIAGEO_DECLARE int gaiaTextReaderGetRow (gaiaTextReaderPtr reader, + int row_num); + GAIAGEO_DECLARE int gaiaTextReaderFetchField (gaiaTextReaderPtr reader, + int field_num, int *type, + const char **value); +#endif /* end ICONV (text reader) */ + #ifdef __cplusplus } #endif diff --git a/src/core/spatialite/headers/spatialite/spatialite.h b/src/core/spatialite/headers/spatialite/spatialite.h index d7251f7a8eb..cc7a109f763 100644 --- a/src/core/spatialite/headers/spatialite/spatialite.h +++ b/src/core/spatialite/headers/spatialite/spatialite.h @@ -43,6 +43,7 @@ the terms of any one of the MPL, the GPL or the LGPL. */ int virtualshape_extension_init (sqlite3 * db); +int virtualdbf_extension_init (sqlite3 * db); int virtualtext_extension_init (sqlite3 * db); int virtualnetwork_extension_init (sqlite3 * db); int virtualfdo_extension_init (sqlite3 * db); diff --git a/src/core/spatialite/headers/spatialite/sqlite3.h b/src/core/spatialite/headers/spatialite/sqlite3.h index 182c72d370b..a4d2c1b0be4 100644 --- a/src/core/spatialite/headers/spatialite/sqlite3.h +++ b/src/core/spatialite/headers/spatialite/sqlite3.h @@ -1,3 +1,232 @@ +/* +** alias MACROs to avoid any potential collision +** for linker symbols declared into the sqlite3 code +** internally embedded into SpatiaLite +*/ +#define sqlite3_version SPLite3_version +#define sqlite3_libversion SPLite3_libversion +#define sqlite3_sourceid SPLite3_sourceid +#define sqlite3_libversion_number SPLite3_libversion_number +#define sqlite3_compileoption_used SPLite3_compileoption_used +#define sqlite3_compileoption_get SPLite3_compileoption_get +#define sqlite3_threadsafe SPLite3_threadsafe +#define sqlite3_close SPLite3_close +#define sqlite3_exec SPLite3_exec +#define sqlite3_initialize SPLite3_initialize +#define sqlite3_shutdown SPLite3_shutdown +#define sqlite3_os_init SPLite3_os_init +#define sqlite3_os_end SPLite3_os_end +#define sqlite3_config SPLite3_config +#define sqlite3_db_config SPLite3_db_config +#define sqlite3_extended_result_codes SPLite3_extended_result_codes +#define sqlite3_last_insert_rowid SPLite3_last_insert_rowid +#define sqlite3_changes SPLite3_changes +#define sqlite3_total_changes SPLite3_total_changes +#define sqlite3_interrupt SPLite3_interrupt +#define sqlite3_complete SPLite3_complete +#define sqlite3_complete16 SPLite3_complete16 +#define sqlite3_busy_handler SPLite3_busy_handler +#define sqlite3_busy_timeout SPLite3_busy_timeout +#define sqlite3_get_table SPLite3_get_table +#define sqlite3_free_table SPLite3_free_table +#define sqlite3_mprintf SPLite3_mprintf +#define sqlite3_vmprintf SPLite3_vmprintf +#define sqlite3_snprintf SPLite3_snprintf +#define sqlite3_malloc SPLite3_malloc +#define sqlite3_realloc SPLite3_realloc +#define sqlite3_free SPLite3_free +#define sqlite3_memory_used SPLite3_memory_used +#define sqlite3_memory_highwater SPLite3_memory_highwater +#define sqlite3_randomness SPLite3_randomness +#define sqlite3_set_authorizer SPLite3_set_authorizer +#define sqlite3_trace SPLite3_trace +#define sqlite3_progress_handler SPLite3_progress_handler +#define sqlite3_open SPLite3_open +#define sqlite3_open16 SPLite3_open16 +#define sqlite3_open_v2 SPLite3_open_v2 +#define sqlite3_errcode SPLite3_errcode +#define sqlite3_extended_errcode SPLite3_extended_errcode +#define sqlite3_errmsg SPLite3_errmsg +#define sqlite3_errmsg16 SPLite3_errmsg16 +#define sqlite3_limit SPLite3_limit +#define sqlite3_prepare SPLite3_prepare +#define sqlite3_prepare_v2 SPLite3_prepare_v2 +#define sqlite3_prepare16 SPLite3_prepare16 +#define sqlite3_prepare16_v2 SPLite3_prepare16_v2 +#define sqlite3_sql SPLite3_sql +#define sqlite3_bind_blob SPLite3_bind_blob +#define sqlite3_bind_double SPLite3_bind_double +#define sqlite3_bind_int SPLite3_bind_int +#define sqlite3_bind_int64 SPLite3_bind_int64 +#define sqlite3_bind_null SPLite3_bind_null +#define sqlite3_bind_text SPLite3_bind_text +#define sqlite3_bind_text16 SPLite3_bind_text16 +#define sqlite3_bind_value SPLite3_bind_value +#define sqlite3_bind_zeroblob SPLite3_bind_zeroblob +#define sqlite3_bind_parameter_count SPLite3_bind_parameter_count +#define sqlite3_bind_parameter_name SPLite3_bind_parameter_name +#define sqlite3_bind_parameter_index SPLite3_bind_parameter_index +#define sqlite3_clear_bindings SPLite3_clear_bindings +#define sqlite3_column_count SPLite3_column_count +#define sqlite3_column_name SPLite3_column_name +#define sqlite3_column_name16 SPLite3_column_name16 +#define sqlite3_column_database_name SPLite3_column_database_name +#define sqlite3_column_database_name16 SPLite3_column_database_name16 +#define sqlite3_column_table_name SPLite3_column_table_name +#define sqlite3_column_table_name16 SPLite3_column_table_name16 +#define sqlite3_column_origin_name SPLite3_column_origin_name +#define sqlite3_column_origin_name16 SPLite3_column_origin_name16 +#define sqlite3_column_decltype SPLite3_column_decltype +#define sqlite3_column_decltype16 SPLite3_column_decltype16 +#define sqlite3_step SPLite3_step +#define sqlite3_data_count SPLite3_data_count +#define sqlite3_column_blob SPLite3_column_blob +#define sqlite3_column_bytes SPLite3_column_bytes +#define sqlite3_column_bytes16 SPLite3_column_bytes16 +#define sqlite3_column_double SPLite3_column_double +#define sqlite3_column_int SPLite3_column_int +#define sqlite3_column_int64 SPLite3_column_int64 +#define sqlite3_column_text SPLite3_column_text +#define sqlite3_column_text16 SPLite3_column_text16 +#define sqlite3_column_type SPLite3_column_type +#define sqlite3_column_value SPLite3_column_value +#define sqlite3_finalize SPLite3_finalize +#define sqlite3_reset SPLite3_reset +#define sqlite3_create_function SPLite3_create_function +#define sqlite3_create_function16 SPLite3_create_function16 +#define sqlite3_create_function_v2 SPLite3_create_function_v2 +#define sqlite3_value_blob SPLite3_value_blob +#define sqlite3_value_bytes SPLite3_value_bytes +#define sqlite3_value_bytes16 SPLite3_value_bytes16 +#define sqlite3_value_double SPLite3_value_double +#define sqlite3_value_int SPLite3_value_int +#define sqlite3_value_int64 SPLite3_value_int64 +#define sqlite3_value_text SPLite3_value_text +#define sqlite3_value_text16 SPLite3_value_text16 +#define sqlite3_value_text16le SPLite3_value_text16le +#define sqlite3_value_text16be SPLite3_value_text16be +#define sqlite3_value_type SPLite3_value_type +#define sqlite3_value_numeric_type SPLite3_value_numeric_type +#define sqlite3_aggregate_context SPLite3_aggregate_context +#define sqlite3_user_data SPLite3_user_data +#define sqlite3_context_db_handle SPLite3_context_db_handle +#define sqlite3_get_auxdata SPLite3_get_auxdata +#define sqlite3_set_auxdata SPLite3_set_auxdata +#define sqlite3_result_blob SPLite3_result_blob +#define sqlite3_result_double SPLite3_result_double +#define sqlite3_result_error SPLite3_result_error +#define sqlite3_result_error16 SPLite3_result_error16 +#define sqlite3_result_error_toobig SPLite3_result_error_toobig +#define sqlite3_result_error_nomem SPLite3_result_error_nomem +#define sqlite3_result_error_code SPLite3_result_error_code +#define sqlite3_result_int SPLite3_result_int +#define sqlite3_result_int64 SPLite3_result_int64 +#define sqlite3_result_null SPLite3_result_null +#define sqlite3_result_text SPLite3_result_text +#define sqlite3_result_text16 SPLite3_result_text16 +#define sqlite3_result_text16le SPLite3_result_text16le +#define sqlite3_result_text16be SPLite3_result_text16be +#define sqlite3_result_value SPLite3_result_value +#define sqlite3_result_zeroblob SPLite3_result_zeroblob +#define sqlite3_create_collation SPLite3_create_collation +#define sqlite3_create_collation_v2 SPLite3_create_collation_v2 +#define sqlite3_create_collation16 SPLite3_create_collation16 +#define sqlite3_collation_needed SPLite3_collation_needed +#define sqlite3_collation_needed16 SPLite3_collation_needed16 +#define sqlite3_key SPLite3_key +#define sqlite3_rekey SPLite3_rekey +#define sqlite3_activate_see SPLite3_activate_see +#define sqlite3_activate_cerod SPLite3_activate_cerod +#define sqlite3_sleep SPLite3_sleep +#define sqlite3_temp_directory SPLite3_temp_directory +#define sqlite3_get_autocommit SPLite3_get_autocommit +#define sqlite3_db_handle SPLite3_db_handle +#define sqlite3_next_stmt SPLite3_next_stmt +#define sqlite3_commit_hook SPLite3_commit_hook +#define sqlite3_rollback_hook SPLite3_rollback_hook +#define sqlite3_update_hook SPLite3_update_hook +#define sqlite3_enable_shared_cache SPLite3_enable_shared_cache +#define sqlite3_release_memory SPLite3_release_memory +#define sqlite3_soft_heap_limit64 SPLite3_soft_heap_limit64 +#define sqlite3_table_column_metadata SPLite3_table_column_metadata +#define sqlite3_load_extension SPLite3_load_extension +#define sqlite3_enable_load_extension SPLite3_enable_load_extension +#define sqlite3_auto_extension SPLite3_auto_extension +#define sqlite3_reset_auto_extension SPLite3_reset_auto_extension +#define sqlite3_create_module SPLite3_create_module +#define sqlite3_create_module_v2 SPLite3_create_module_v2 +#define sqlite3_declare_vtab SPLite3_declare_vtab +#define sqlite3_overload_function SPLite3_overload_function +#define sqlite3_blob_open SPLite3_blob_open +#define sqlite3_blob_close SPLite3_blob_close +#define sqlite3_blob_bytes SPLite3_blob_bytes +#define sqlite3_blob_read SPLite3_blob_read +#define sqlite3_blob_write SPLite3_blob_write +#define sqlite3_vfs_find SPLite3_vfs_find +#define sqlite3_vfs_register SPLite3_vfs_register +#define sqlite3_vfs_unregister SPLite3_vfs_unregister +#define sqlite3_mutex_alloc SPLite3_mutex_alloc +#define sqlite3_mutex_free SPLite3_mutex_free +#define sqlite3_mutex_enter SPLite3_mutex_enter +#define sqlite3_mutex_try SPLite3_mutex_try +#define sqlite3_mutex_leave SPLite3_mutex_leave +#define sqlite3_mutex_held SPLite3_mutex_held +#define sqlite3_mutex_notheld SPLite3_mutex_notheld +#define sqlite3_db_mutex SPLite3_db_mutex +#define sqlite3_file_control SPLite3_file_control +#define sqlite3_test_control SPLite3_test_control +#define sqlite3_status SPLite3_status +#define sqlite3_db_status SPLite3_db_status +#define sqlite3_stmt_status SPLite3_stmt_status +#define sqlite3_backup_init SPLite3_backup_init +#define sqlite3_backup_step SPLite3_backup_step +#define sqlite3_backup_finish SPLite3_backup_finish +#define sqlite3_backup_remaining SPLite3_backup_remaining +#define sqlite3_backup_pagecount SPLite3_backup_pagecount +#define sqlite3_unlock_notify SPLite3_unlock_notify +#define sqlite3_strnicmp SPLite3_strnicmp +#define sqlite3_log SPLite3_log +#define sqlite3_wal_hook SPLite3_wal_hook +#define sqlite3_wal_autocheckpoint SPLite3_wal_autocheckpoint +#define sqlite3_wal_checkpoint SPLite3_wal_checkpoint +#define sqlite3_rtree_geometry_callback SPLite3_rtree_geometry_callback +#define sqlite3_memdebug_vfs_oom_test SPLite3_memdebug_vfs_oom_test +#define sqlite3_memory_alarm SPLite3_memory_alarm +#define sqlite3_soft_heap_limit SPLite3_soft_heap_limit +#define sqlite3_io_error_hit SPLite3_io_error_hit +#define sqlite3_io_error_hardhit SPLite3_io_error_hardhit +#define sqlite3_io_error_pending SPLite3_io_error_pending +#define sqlite3_io_error_persist SPLite3_io_error_persist +#define sqlite3_io_error_benign SPLite3_io_error_benign +#define sqlite3_diskfull_pending SPLite3_diskfull_pending +#define sqlite3_diskfull SPLite3_diskfull +#define sqlite3_open_file_count SPLite3_open_file_count +#define sqlite3_sync_count SPLite3_sync_count +#define sqlite3_fullsync_count SPLite3_fullsync_count +#define sqlite3_current_time SPLite3_current_time +#define sqlite3_hostid_num SPLite3_hostid_num +#define sqlite3_os_type SPLite3_os_type +#define sqlite3_win32_mbcs_to_utf8 SPLite3_win32_mbcs_to_utf8 +#define sqlite3_pager_readdb_count SPLite3_pager_readdb_count +#define sqlite3_pager_writedb_count SPLite3_pager_writedb_count +#define sqlite3_pager_writej_count SPLite3_pager_writej_count +#define sqlite3_opentemp_count SPLite3_opentemp_count +#define sqlite3_expired SPLite3_expired +#define sqlite3_aggregate_count SPLite3_aggregate_count +#define sqlite3_transfer_bindings SPLite3_transfer_bindings +#define sqlite3_search_count SPLite3_search_count +#define sqlite3_interrupt_count SPLite3_interrupt_count +#define sqlite3_sort_count SPLite3_sort_count +#define sqlite3_max_blobsize SPLite3_max_blobsize +#define sqlite3_found_count SPLite3_found_count +#define sqlite3_like_count SPLite3_like_count +#define sqlite3_xferopt_count SPLite3_xferopt_count +#define sqlite3_profile SPLite3_profile +#define sqlite3_global_recover SPLite3_global_recover +#define sqlite3_thread_cleanup SPLite3_thread_cleanup +#define sqlite3_fts3_enable_parentheses SPLite3_fts3_enable_parentheses +/* end SpatiaLite/sqlite3 alias macros */ + /* ** 2001 September 15 ** @@ -81,55 +310,43 @@ extern "C" { #endif /* -** CAPI3REF: Compile-Time Library Version Numbers {H10010} +** CAPI3REF: Compile-Time Library Version Numbers ** -** The SQLITE_VERSION and SQLITE_VERSION_NUMBER #defines in -** the sqlite3.h file specify the version of SQLite with which -** that header file is associated. -** -** The "version" of SQLite is a string of the form "W.X.Y" or "W.X.Y.Z". -** The W value is major version number and is always 3 in SQLite3. -** The W value only changes when backwards compatibility is -** broken and we intend to never break backwards compatibility. -** The X value is the minor version number and only changes when -** there are major feature enhancements that are forwards compatible -** but not backwards compatible. -** The Y value is the release number and is incremented with -** each release but resets back to 0 whenever X is incremented. -** The Z value only appears on branch releases. -** -** The SQLITE_VERSION_NUMBER is an integer that is computed as -** follows: -** -**
-** SQLITE_VERSION_NUMBER = W*1000000 + X*1000 + Y
-** 
+** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header +** evaluates to a string literal that is the SQLite version in the +** format "X.Y.Z" where X is the major version number (always 3 for +** SQLite3) and Y is the minor version number and Z is the release number.)^ +** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer +** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same +** numbers used in [SQLITE_VERSION].)^ +** The SQLITE_VERSION_NUMBER for any given release of SQLite will also +** be larger than the release from which it is derived. Either Y will +** be held constant and Z will be incremented or else Y will be incremented +** and Z will be reset to zero. ** ** Since version 3.6.18, SQLite source code has been stored in the -** fossil configuration management -** system. The SQLITE_SOURCE_ID -** macro is a string which identifies a particular check-in of SQLite -** within its configuration management system. The string contains the -** date and time of the check-in (UTC) and an SHA1 hash of the entire -** source tree. +** Fossil configuration management +** system. ^The SQLITE_SOURCE_ID macro evaluates to +** a string which identifies a particular check-in of SQLite +** within its configuration management system. ^The SQLITE_SOURCE_ID +** string contains the date and time of the check-in (UTC) and an SHA1 +** hash of the entire source tree. ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. -** -** Requirements: [H10011] [H10014] */ -#define SQLITE_VERSION "3.6.20" -#define SQLITE_VERSION_NUMBER 3006020 -#define SQLITE_SOURCE_ID "2009-11-04 13:30:02 eb7a544fe49d1626bacecfe53ddc03fe082e3243" +#define SQLITE_VERSION "3.7.3" +#define SQLITE_VERSION_NUMBER 3007003 +#define SQLITE_SOURCE_ID "2010-10-08 02:34:02 2677848087c9c090efb17c1893e77d6136a9111d" /* -** CAPI3REF: Run-Time Library Version Numbers {H10020} -** KEYWORDS: sqlite3_version +** CAPI3REF: Run-Time Library Version Numbers +** KEYWORDS: sqlite3_version, sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], -** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] #defines in the header, -** but are associated with the library instead of the header file. Cautious +** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros +** but are associated with the library instead of the header file. ^(Cautious ** programmers might include assert() statements in their application to ** verify that values returned by these interfaces match the macros in ** the header, and thus insure that the application is @@ -138,19 +355,20 @@ extern "C" { **
 ** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
 ** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
-** assert( strcmp(sqlite3_libversion,SQLITE_VERSION)==0 );
-** 
+** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 ); +** )^ ** -** The sqlite3_libversion() function returns the same information as is -** in the sqlite3_version[] string constant. The function is provided -** for use in DLLs since DLL users usually do not have direct access to string -** constants within the DLL. Similarly, the sqlite3_sourceid() function -** returns the same information as is in the [SQLITE_SOURCE_ID] #define of -** the header file. +** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION] +** macro. ^The sqlite3_libversion() function returns a pointer to the +** to the sqlite3_version[] string constant. The sqlite3_libversion() +** function is provided for use in DLLs since DLL users usually do not have +** direct access to string constants within the DLL. ^The +** sqlite3_libversion_number() function returns an integer equal to +** [SQLITE_VERSION_NUMBER]. ^The sqlite3_sourceid() function returns +** a pointer to a string constant whose value is the same as the +** [SQLITE_SOURCE_ID] C preprocessor macro. ** ** See also: [sqlite_version()] and [sqlite_source_id()]. -** -** Requirements: [H10021] [H10022] [H10023] */ SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; SQLITE_API const char *sqlite3_libversion(void); @@ -158,7 +376,38 @@ SQLITE_API const char *sqlite3_sourceid(void); SQLITE_API int sqlite3_libversion_number(void); /* -** CAPI3REF: Test To See If The Library Is Threadsafe {H10100} +** CAPI3REF: Run-Time Library Compilation Options Diagnostics +** +** ^The sqlite3_compileoption_used() function returns 0 or 1 +** indicating whether the specified option was defined at +** compile time. ^The SQLITE_ prefix may be omitted from the +** option name passed to sqlite3_compileoption_used(). +** +** ^The sqlite3_compileoption_get() function allows iterating +** over the list of options that were defined at compile time by +** returning the N-th compile time option string. ^If N is out of range, +** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ +** prefix is omitted from any strings returned by +** sqlite3_compileoption_get(). +** +** ^Support for the diagnostic functions sqlite3_compileoption_used() +** and sqlite3_compileoption_get() may be omitted by specifying the +** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. +** +** See also: SQL functions [sqlite_compileoption_used()] and +** [sqlite_compileoption_get()] and the [compile_options pragma]. +*/ +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS +SQLITE_API int sqlite3_compileoption_used(const char *zOptName); +SQLITE_API const char *sqlite3_compileoption_get(int N); +#endif + +/* +** CAPI3REF: Test To See If The Library Is Threadsafe +** +** ^The sqlite3_threadsafe() function returns zero if and only if +** SQLite was compiled mutexing code omitted due to the +** [SQLITE_THREADSAFE] compile-time option being set to 0. ** ** SQLite can be compiled with or without mutexes. When ** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes @@ -170,7 +419,7 @@ SQLITE_API int sqlite3_libversion_number(void); ** Enabling mutexes incurs a measurable performance penalty. ** So if speed is of utmost importance, it makes sense to disable ** the mutexes. But for maximum safety, mutexes should be enabled. -** The default behavior is for mutexes to be enabled. +** ^The default behavior is for mutexes to be enabled. ** ** This interface can be used by an application to make sure that the ** version of SQLite that it is linking against was compiled with @@ -178,21 +427,21 @@ SQLITE_API int sqlite3_libversion_number(void); ** ** This interface only reports on the compile-time mutex setting ** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with -** SQLITE_THREADSAFE=1 then mutexes are enabled by default but +** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but ** can be fully or partially disabled using a call to [sqlite3_config()] ** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD], -** or [SQLITE_CONFIG_MUTEX]. The return value of this function shows -** only the default compile-time setting, not any run-time changes -** to that setting. +** or [SQLITE_CONFIG_MUTEX]. ^(The return value of the +** sqlite3_threadsafe() function shows only the compile-time setting of +** thread safety, not any run-time changes to that setting made by +** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() +** is unchanged by calls to sqlite3_config().)^ ** ** See the [threading mode] documentation for additional information. -** -** Requirements: [H10101] [H10102] */ SQLITE_API int sqlite3_threadsafe(void); /* -** CAPI3REF: Database Connection Handle {H12000} +** CAPI3REF: Database Connection Handle ** KEYWORDS: {database connection} {database connections} ** ** Each open SQLite database is represented by a pointer to an instance of @@ -207,7 +456,7 @@ SQLITE_API int sqlite3_threadsafe(void); typedef struct sqlite3 sqlite3; /* -** CAPI3REF: 64-Bit Integer Types {H10200} +** CAPI3REF: 64-Bit Integer Types ** KEYWORDS: sqlite_int64 sqlite_uint64 ** ** Because there is no cross-platform way to specify 64-bit integer types @@ -217,7 +466,10 @@ typedef struct sqlite3 sqlite3; ** The sqlite_int64 and sqlite_uint64 types are supported for backwards ** compatibility only. ** -** Requirements: [H10201] [H10202] +** ^The sqlite3_int64 and sqlite_int64 types can store integer values +** between -9223372036854775808 and +9223372036854775807 inclusive. ^The +** sqlite3_uint64 and sqlite_uint64 types can store integer values +** between 0 and +18446744073709551615 inclusive. */ #ifdef SQLITE_INT64_TYPE typedef SQLITE_INT64_TYPE sqlite_int64; @@ -241,24 +493,28 @@ typedef sqlite_uint64 sqlite3_uint64; #endif /* -** CAPI3REF: Closing A Database Connection {H12010} +** CAPI3REF: Closing A Database Connection ** -** This routine is the destructor for the [sqlite3] object. +** ^The sqlite3_close() routine is the destructor for the [sqlite3] object. +** ^Calls to sqlite3_close() return SQLITE_OK if the [sqlite3] object is +** successfully destroyed and all associated resources are deallocated. ** ** Applications must [sqlite3_finalize | finalize] all [prepared statements] ** and [sqlite3_blob_close | close] all [BLOB handles] associated with -** the [sqlite3] object prior to attempting to close the object. +** the [sqlite3] object prior to attempting to close the object. ^If +** sqlite3_close() is called on a [database connection] that still has +** outstanding [prepared statements] or [BLOB handles], then it returns +** SQLITE_BUSY. ** -** If [sqlite3_close()] is invoked while a transaction is open, +** ^If [sqlite3_close()] is invoked while a transaction is open, ** the transaction is automatically rolled back. ** ** The C parameter to [sqlite3_close(C)] must be either a NULL ** pointer or an [sqlite3] object pointer obtained ** from [sqlite3_open()], [sqlite3_open16()], or ** [sqlite3_open_v2()], and not previously closed. -** -** Requirements: -** [H12011] [H12012] [H12013] [H12014] [H12015] [H12019] +** ^Calling sqlite3_close() with a NULL pointer argument is a +** harmless no-op. */ SQLITE_API int sqlite3_close(sqlite3 *); @@ -270,48 +526,65 @@ SQLITE_API int sqlite3_close(sqlite3 *); typedef int (*sqlite3_callback)(void*,int,char**, char**); /* -** CAPI3REF: One-Step Query Execution Interface {H12100} +** CAPI3REF: One-Step Query Execution Interface ** -** The sqlite3_exec() interface is a convenient way of running one or more -** SQL statements without having to write a lot of C code. The UTF-8 encoded -** SQL statements are passed in as the second parameter to sqlite3_exec(). -** The statements are evaluated one by one until either an error or -** an interrupt is encountered, or until they are all done. The 3rd parameter -** is an optional callback that is invoked once for each row of any query -** results produced by the SQL statements. The 5th parameter tells where -** to write any error messages. +** The sqlite3_exec() interface is a convenience wrapper around +** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], +** that allows an application to run multiple statements of SQL +** without having to use a lot of C code. ** -** The error message passed back through the 5th parameter is held -** in memory obtained from [sqlite3_malloc()]. To avoid a memory leak, -** the calling application should call [sqlite3_free()] on any error -** message returned through the 5th parameter when it has finished using -** the error message. +** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, +** semicolon-separate SQL statements passed into its 2nd argument, +** in the context of the [database connection] passed in as its 1st +** argument. ^If the callback function of the 3rd argument to +** sqlite3_exec() is not NULL, then it is invoked for each result row +** coming out of the evaluated SQL statements. ^The 4th argument to +** to sqlite3_exec() is relayed through to the 1st argument of each +** callback invocation. ^If the callback pointer to sqlite3_exec() +** is NULL, then no callback is ever invoked and result rows are +** ignored. ** -** If the SQL statement in the 2nd parameter is NULL or an empty string -** or a string containing only whitespace and comments, then no SQL -** statements are evaluated and the database is not changed. +** ^If an error occurs while evaluating the SQL statements passed into +** sqlite3_exec(), then execution of the current statement stops and +** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec() +** is not NULL then any error message is written into memory obtained +** from [sqlite3_malloc()] and passed back through the 5th parameter. +** To avoid memory leaks, the application should invoke [sqlite3_free()] +** on error message strings returned through the 5th parameter of +** of sqlite3_exec() after the error message string is no longer needed. +** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors +** occur, then sqlite3_exec() sets the pointer in its 5th parameter to +** NULL before returning. ** -** The sqlite3_exec() interface is implemented in terms of -** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()]. -** The sqlite3_exec() routine does nothing to the database that cannot be done -** by [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()]. +** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec() +** routine returns SQLITE_ABORT without invoking the callback again and +** without running any subsequent SQL statements. ** -** The first parameter to [sqlite3_exec()] must be an valid and open -** [database connection]. +** ^The 2nd argument to the sqlite3_exec() callback function is the +** number of columns in the result. ^The 3rd argument to the sqlite3_exec() +** callback is an array of pointers to strings obtained as if from +** [sqlite3_column_text()], one for each column. ^If an element of a +** result row is NULL then the corresponding string pointer for the +** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the +** sqlite3_exec() callback is an array of pointers to strings where each +** entry represents the name of corresponding result column as obtained +** from [sqlite3_column_name()]. ** -** The database connection must not be closed while -** [sqlite3_exec()] is running. +** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer +** to an empty string, or a pointer that contains only whitespace and/or +** SQL comments, then no SQL statements are evaluated and the database +** is not changed. ** -** The calling function should use [sqlite3_free()] to free -** the memory that *errmsg is left pointing at once the error -** message is no longer needed. +** Restrictions: ** -** The SQL statement text in the 2nd parameter to [sqlite3_exec()] -** must remain unchanged while [sqlite3_exec()] is running. -** -** Requirements: -** [H12101] [H12102] [H12104] [H12105] [H12107] [H12110] [H12113] [H12116] -** [H12119] [H12122] [H12125] [H12131] [H12134] [H12137] [H12138] +**
    +**
  • The application must insure that the 1st parameter to sqlite3_exec() +** is a valid and open [database connection]. +**
  • The application must not close [database connection] specified by +** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. +**
  • The application must not modify the SQL statement text passed into +** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. +**
*/ SQLITE_API int sqlite3_exec( sqlite3*, /* An open database */ @@ -322,7 +595,7 @@ SQLITE_API int sqlite3_exec( ); /* -** CAPI3REF: Result Codes {H10210} +** CAPI3REF: Result Codes ** KEYWORDS: SQLITE_OK {error code} {error codes} ** KEYWORDS: {result code} {result codes} ** @@ -349,7 +622,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */ #define SQLITE_FULL 13 /* Insertion failed because database is full */ #define SQLITE_CANTOPEN 14 /* Unable to open the database file */ -#define SQLITE_PROTOCOL 15 /* NOT USED. Database lock protocol error */ +#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ #define SQLITE_EMPTY 16 /* Database is empty */ #define SQLITE_SCHEMA 17 /* The database schema changed */ #define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */ @@ -366,7 +639,7 @@ SQLITE_API int sqlite3_exec( /* end-of-error-codes */ /* -** CAPI3REF: Extended Result Codes {H10220} +** CAPI3REF: Extended Result Codes ** KEYWORDS: {extended error code} {extended error codes} ** KEYWORDS: {extended result code} {extended result codes} ** @@ -405,10 +678,15 @@ SQLITE_API int sqlite3_exec( #define SQLITE_IOERR_LOCK (SQLITE_IOERR | (15<<8)) #define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) #define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) -#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8) ) +#define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8)) +#define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8)) +#define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) +#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) +#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) +#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) /* -** CAPI3REF: Flags For File Open Operations {H10230} +** CAPI3REF: Flags For File Open Operations ** ** These bit values are intended for use in the ** 3rd parameter to the [sqlite3_open_v2()] interface and @@ -420,6 +698,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_DELETEONCLOSE 0x00000008 /* VFS only */ #define SQLITE_OPEN_EXCLUSIVE 0x00000010 /* VFS only */ +#define SQLITE_OPEN_AUTOPROXY 0x00000020 /* VFS only */ #define SQLITE_OPEN_MAIN_DB 0x00000100 /* VFS only */ #define SQLITE_OPEN_TEMP_DB 0x00000200 /* VFS only */ #define SQLITE_OPEN_TRANSIENT_DB 0x00000400 /* VFS only */ @@ -431,11 +710,12 @@ SQLITE_API int sqlite3_exec( #define SQLITE_OPEN_FULLMUTEX 0x00010000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ /* -** CAPI3REF: Device Characteristics {H10240} +** CAPI3REF: Device Characteristics ** -** The xDeviceCapabilities method of the [sqlite3_io_methods] +** The xDeviceCharacteristics method of the [sqlite3_io_methods] ** object returns an integer which is a vector of the these ** bit values expressing I/O characteristics of the mass storage ** device that holds the file that the [sqlite3_io_methods] @@ -452,20 +732,21 @@ SQLITE_API int sqlite3_exec( ** information is written to disk in the same order as calls ** to xWrite(). */ -#define SQLITE_IOCAP_ATOMIC 0x00000001 -#define SQLITE_IOCAP_ATOMIC512 0x00000002 -#define SQLITE_IOCAP_ATOMIC1K 0x00000004 -#define SQLITE_IOCAP_ATOMIC2K 0x00000008 -#define SQLITE_IOCAP_ATOMIC4K 0x00000010 -#define SQLITE_IOCAP_ATOMIC8K 0x00000020 -#define SQLITE_IOCAP_ATOMIC16K 0x00000040 -#define SQLITE_IOCAP_ATOMIC32K 0x00000080 -#define SQLITE_IOCAP_ATOMIC64K 0x00000100 -#define SQLITE_IOCAP_SAFE_APPEND 0x00000200 -#define SQLITE_IOCAP_SEQUENTIAL 0x00000400 +#define SQLITE_IOCAP_ATOMIC 0x00000001 +#define SQLITE_IOCAP_ATOMIC512 0x00000002 +#define SQLITE_IOCAP_ATOMIC1K 0x00000004 +#define SQLITE_IOCAP_ATOMIC2K 0x00000008 +#define SQLITE_IOCAP_ATOMIC4K 0x00000010 +#define SQLITE_IOCAP_ATOMIC8K 0x00000020 +#define SQLITE_IOCAP_ATOMIC16K 0x00000040 +#define SQLITE_IOCAP_ATOMIC32K 0x00000080 +#define SQLITE_IOCAP_ATOMIC64K 0x00000100 +#define SQLITE_IOCAP_SAFE_APPEND 0x00000200 +#define SQLITE_IOCAP_SEQUENTIAL 0x00000400 +#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800 /* -** CAPI3REF: File Locking Levels {H10250} +** CAPI3REF: File Locking Levels ** ** SQLite uses one of these integer values as the second ** argument to calls it makes to the xLock() and xUnlock() methods @@ -478,7 +759,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_LOCK_EXCLUSIVE 4 /* -** CAPI3REF: Synchronization Type Flags {H10260} +** CAPI3REF: Synchronization Type Flags ** ** When SQLite invokes the xSync() method of an ** [sqlite3_io_methods] object it uses a combination of @@ -496,7 +777,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_SYNC_DATAONLY 0x00010 /* -** CAPI3REF: OS Interface Open File Handle {H11110} +** CAPI3REF: OS Interface Open File Handle ** ** An [sqlite3_file] object represents an open file in the ** [sqlite3_vfs | OS interface layer]. Individual OS interface @@ -512,7 +793,7 @@ struct sqlite3_file { }; /* -** CAPI3REF: OS Interface File Virtual Methods Object {H11120} +** CAPI3REF: OS Interface File Virtual Methods Object ** ** Every file opened by the [sqlite3_vfs] xOpen method populates an ** [sqlite3_file] object (or, more commonly, a subclass of the @@ -613,11 +894,17 @@ struct sqlite3_io_methods { int (*xFileControl)(sqlite3_file*, int op, void *pArg); int (*xSectorSize)(sqlite3_file*); int (*xDeviceCharacteristics)(sqlite3_file*); + /* Methods above are valid for version 1 */ + int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); + int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); + void (*xShmBarrier)(sqlite3_file*); + int (*xShmUnmap)(sqlite3_file*, int deleteFlag); + /* Methods above are valid for version 2 */ /* Additional methods may be added in future releases */ }; /* -** CAPI3REF: Standard File Control Opcodes {H11310} +** CAPI3REF: Standard File Control Opcodes ** ** These integer constants are opcodes for the xFileControl method ** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] @@ -630,14 +917,31 @@ struct sqlite3_io_methods { ** into an integer that the pArg argument points to. This capability ** is used during testing and only needs to be supported when SQLITE_TEST ** is defined. +** +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. */ #define SQLITE_FCNTL_LOCKSTATE 1 #define SQLITE_GET_LOCKPROXYFILE 2 #define SQLITE_SET_LOCKPROXYFILE 3 #define SQLITE_LAST_ERRNO 4 +#define SQLITE_FCNTL_SIZE_HINT 5 +#define SQLITE_FCNTL_CHUNK_SIZE 6 /* -** CAPI3REF: Mutex Handle {H17110} +** CAPI3REF: Mutex Handle ** ** The mutex module within SQLite defines [sqlite3_mutex] to be an ** abstract type for a mutex object. The SQLite core never looks @@ -649,7 +953,7 @@ struct sqlite3_io_methods { typedef struct sqlite3_mutex sqlite3_mutex; /* -** CAPI3REF: OS Interface Object {H11140} +** CAPI3REF: OS Interface Object ** ** An instance of the sqlite3_vfs object defines the interface between ** the SQLite core and the underlying operating system. The "vfs" @@ -682,15 +986,19 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** The zName field holds the name of the VFS module. The name must ** be unique across all VFS modules. ** -** SQLite will guarantee that the zFilename parameter to xOpen +** ^SQLite guarantees that the zFilename parameter to xOpen ** is either a NULL pointer or string obtained -** from xFullPathname(). SQLite further guarantees that +** from xFullPathname() with an optional suffix added. +** ^If a suffix is added to the zFilename parameter, it will +** consist of a single "-" character followed by no more than +** 10 alphanumeric and/or "-" characters. +** ^SQLite further guarantees that ** the string will be valid and unchanged until xClose() is ** called. Because of the previous sentence, ** the [sqlite3_file] can safely store a pointer to the ** filename if it needs to remember the filename for some reason. -** If the zFilename parameter is xOpen is a NULL pointer then xOpen -** must invent its own temporary name for the file. Whenever the +** If the zFilename parameter to xOpen is a NULL pointer then xOpen +** must invent its own temporary name for the file. ^Whenever the ** xFilename parameter is NULL it will also be the case that the ** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. ** @@ -701,7 +1009,7 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** If xOpen() opens a file read-only then it sets *pOutFlags to ** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. ** -** SQLite will also add one of the following flags to the xOpen() +** ^(SQLite will also add one of the following flags to the xOpen() ** call, depending on the object being opened: ** **
    @@ -712,7 +1020,8 @@ typedef struct sqlite3_mutex sqlite3_mutex; **
  • [SQLITE_OPEN_TRANSIENT_DB] **
  • [SQLITE_OPEN_SUBJOURNAL] **
  • [SQLITE_OPEN_MASTER_JOURNAL] -**
+**
  • [SQLITE_OPEN_WAL] +** )^ ** ** The file I/O implementation can use the object type flags to ** change the way it deals with files. For example, an application @@ -731,10 +1040,11 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** ** ** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be -** deleted when it is closed. The [SQLITE_OPEN_DELETEONCLOSE] -** will be set for TEMP databases, journals and for subjournals. +** deleted when it is closed. ^The [SQLITE_OPEN_DELETEONCLOSE] +** will be set for TEMP databases and their journals, transient +** databases, and subjournals. ** -** The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction +** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction ** with the [SQLITE_OPEN_CREATE] flag, which are both directly ** analogous to the O_EXCL and O_CREAT flags of the POSIX open() ** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the @@ -743,7 +1053,7 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** It is not used to indicate the file should be opened ** for exclusive access. ** -** At least szOsFile bytes of memory are allocated by SQLite +** ^At least szOsFile bytes of memory are allocated by SQLite ** to hold the [sqlite3_file] structure passed as the third ** argument to xOpen. The xOpen method does not have to ** allocate the structure; it should just fill it in. Note that @@ -753,33 +1063,40 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** element will be valid after xOpen returns regardless of the success ** or failure of the xOpen call. ** -** The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] +** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] ** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to ** test whether a file is readable and writable, or [SQLITE_ACCESS_READ] ** to test whether a file is at least readable. The file can be a ** directory. ** -** SQLite will always allocate at least mxPathname+1 bytes for the +** ^SQLite will always allocate at least mxPathname+1 bytes for the ** output buffer xFullPathname. The exact size of the output buffer ** is also passed as a parameter to both methods. If the output buffer ** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is ** handled as a fatal error by SQLite, vfs implementations should endeavor ** to prevent this by setting mxPathname to a sufficiently large value. ** -** The xRandomness(), xSleep(), and xCurrentTime() interfaces -** are not strictly a part of the filesystem, but they are +** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64() +** interfaces are not strictly a part of the filesystem, but they are ** included in the VFS structure for completeness. ** The xRandomness() function attempts to return nBytes bytes ** of good-quality randomness into zOut. The return value is ** the actual number of bytes of randomness obtained. ** The xSleep() method causes the calling thread to sleep for at -** least the number of microseconds given. The xCurrentTime() -** method returns a Julian Day Number for the current date and time. -** +** least the number of microseconds given. ^The xCurrentTime() +** method returns a Julian Day Number for the current date and time as +** a floating point value. +** ^The xCurrentTimeInt64() method returns, as an integer, the Julian +** Day Number multipled by 86400000 (the number of milliseconds in +** a 24-hour day). +** ^SQLite will use the xCurrentTimeInt64() method to get the current +** date and time if that method is available (if iVersion is 2 or +** greater and the function pointer is not NULL) and will fall back +** to xCurrentTime() if xCurrentTimeInt64() is unavailable. */ typedef struct sqlite3_vfs sqlite3_vfs; struct sqlite3_vfs { - int iVersion; /* Structure version number */ + int iVersion; /* Structure version number (currently 2) */ int szOsFile; /* Size of subclassed sqlite3_file */ int mxPathname; /* Maximum file pathname length */ sqlite3_vfs *pNext; /* Next registered VFS */ @@ -798,48 +1115,101 @@ struct sqlite3_vfs { int (*xSleep)(sqlite3_vfs*, int microseconds); int (*xCurrentTime)(sqlite3_vfs*, double*); int (*xGetLastError)(sqlite3_vfs*, int, char *); - /* New fields may be appended in figure versions. The iVersion - ** value will increment whenever this happens. */ + /* + ** The methods above are in version 1 of the sqlite_vfs object + ** definition. Those that follow are added in version 2 or later + */ + int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); + /* + ** The methods above are in versions 1 and 2 of the sqlite_vfs object. + ** New fields may be appended in figure versions. The iVersion + ** value will increment whenever this happens. + */ }; /* -** CAPI3REF: Flags for the xAccess VFS method {H11190} +** CAPI3REF: Flags for the xAccess VFS method ** ** These integer constants can be used as the third parameter to -** the xAccess method of an [sqlite3_vfs] object. {END} They determine +** the xAccess method of an [sqlite3_vfs] object. They determine ** what kind of permissions the xAccess method is looking for. ** With SQLITE_ACCESS_EXISTS, the xAccess method ** simply checks whether the file exists. ** With SQLITE_ACCESS_READWRITE, the xAccess method -** checks whether the file is both readable and writable. +** checks whether the named directory is both readable and writable +** (in other words, if files can be added, removed, and renamed within +** the directory). +** The SQLITE_ACCESS_READWRITE constant is currently used only by the +** [temp_store_directory pragma], though this could change in a future +** release of SQLite. ** With SQLITE_ACCESS_READ, the xAccess method -** checks whether the file is readable. +** checks whether the file is readable. The SQLITE_ACCESS_READ constant is +** currently unused, though it might be used in a future release of +** SQLite. */ #define SQLITE_ACCESS_EXISTS 0 -#define SQLITE_ACCESS_READWRITE 1 -#define SQLITE_ACCESS_READ 2 +#define SQLITE_ACCESS_READWRITE 1 /* Used by PRAGMA temp_store_directory */ +#define SQLITE_ACCESS_READ 2 /* Unused */ /* -** CAPI3REF: Initialize The SQLite Library {H10130} +** CAPI3REF: Flags for the xShmLock VFS method ** -** The sqlite3_initialize() routine initializes the -** SQLite library. The sqlite3_shutdown() routine +** These integer constants define the various locking operations +** allowed by the xShmLock method of [sqlite3_io_methods]. The +** following are the only legal combinations of flags to the +** xShmLock method: +** +**
      +**
    • SQLITE_SHM_LOCK | SQLITE_SHM_SHARED +**
    • SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE +**
    • SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED +**
    • SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE +**
    +** +** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as +** was given no the corresponding lock. +** +** The xShmLock method can transition between unlocked and SHARED or +** between unlocked and EXCLUSIVE. It cannot transition between SHARED +** and EXCLUSIVE. +*/ +#define SQLITE_SHM_UNLOCK 1 +#define SQLITE_SHM_LOCK 2 +#define SQLITE_SHM_SHARED 4 +#define SQLITE_SHM_EXCLUSIVE 8 + +/* +** CAPI3REF: Maximum xShmLock index +** +** The xShmLock method on [sqlite3_io_methods] may use values +** between 0 and this upper bound as its "offset" argument. +** The SQLite core will never attempt to acquire or release a +** lock outside of this range +*/ +#define SQLITE_SHM_NLOCK 8 + + +/* +** CAPI3REF: Initialize The SQLite Library +** +** ^The sqlite3_initialize() routine initializes the +** SQLite library. ^The sqlite3_shutdown() routine ** deallocates any resources that were allocated by sqlite3_initialize(). -** This routines are designed to aid in process initialization and +** These routines are designed to aid in process initialization and ** shutdown on embedded systems. Workstation applications using ** SQLite normally do not need to invoke either of these routines. ** ** A call to sqlite3_initialize() is an "effective" call if it is ** the first time sqlite3_initialize() is invoked during the lifetime of ** the process, or if it is the first time sqlite3_initialize() is invoked -** following a call to sqlite3_shutdown(). Only an effective call +** following a call to sqlite3_shutdown(). ^(Only an effective call ** of sqlite3_initialize() does any initialization. All other calls -** are harmless no-ops. +** are harmless no-ops.)^ ** ** A call to sqlite3_shutdown() is an "effective" call if it is the first -** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only +** call to sqlite3_shutdown() since the last sqlite3_initialize(). ^(Only ** an effective call to sqlite3_shutdown() does any deinitialization. -** All other valid calls to sqlite3_shutdown() are harmless no-ops. +** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^ ** ** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown() ** is not. The sqlite3_shutdown() interface must only be called from a @@ -847,21 +1217,21 @@ struct sqlite3_vfs { ** other SQLite resources must be deallocated prior to invoking ** sqlite3_shutdown(). ** -** Among other things, sqlite3_initialize() will invoke -** sqlite3_os_init(). Similarly, sqlite3_shutdown() +** Among other things, ^sqlite3_initialize() will invoke +** sqlite3_os_init(). Similarly, ^sqlite3_shutdown() ** will invoke sqlite3_os_end(). ** -** The sqlite3_initialize() routine returns [SQLITE_OK] on success. -** If for some reason, sqlite3_initialize() is unable to initialize +** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success. +** ^If for some reason, sqlite3_initialize() is unable to initialize ** the library (perhaps it is unable to allocate a needed resource such ** as a mutex) it returns an [error code] other than [SQLITE_OK]. ** -** The sqlite3_initialize() routine is called internally by many other +** ^The sqlite3_initialize() routine is called internally by many other ** SQLite interfaces so that an application usually does not need to ** invoke sqlite3_initialize() directly. For example, [sqlite3_open()] ** calls sqlite3_initialize() so the SQLite library will be automatically ** initialized when [sqlite3_open()] is called if it has not be initialized -** already. However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] +** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] ** compile-time option, then the automatic calls to sqlite3_initialize() ** are omitted and the application must call sqlite3_initialize() directly ** prior to using any other SQLite interface. For maximum portability, @@ -900,8 +1270,7 @@ SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void); /* -** CAPI3REF: Configuring The SQLite Library {H14100} -** EXPERIMENTAL +** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of @@ -914,7 +1283,9 @@ SQLITE_API int sqlite3_os_end(void); ** threads while sqlite3_config() is running. Furthermore, sqlite3_config() ** may only be invoked prior to library initialization using ** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()]. -** Note, however, that sqlite3_config() can be called as part of the +** ^If sqlite3_config() is called after [sqlite3_initialize()] and before +** [sqlite3_shutdown()] then it will return SQLITE_MISUSE. +** Note, however, that ^sqlite3_config() can be called as part of the ** implementation of an application-defined [sqlite3_os_init()]. ** ** The first argument to sqlite3_config() is an integer @@ -923,26 +1294,20 @@ SQLITE_API int sqlite3_os_end(void); ** vary depending on the [SQLITE_CONFIG_SINGLETHREAD | configuration option] ** in the first argument. ** -** When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. -** If the option is unknown or SQLite is unable to set the option +** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. +** ^If the option is unknown or SQLite is unable to set the option ** then this routine returns a non-zero [error code]. -** -** Requirements: -** [H14103] [H14106] [H14120] [H14123] [H14126] [H14129] [H14132] [H14135] -** [H14138] [H14141] [H14144] [H14147] [H14150] [H14153] [H14156] [H14159] -** [H14162] [H14165] [H14168] */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_config(int, ...); +SQLITE_API int sqlite3_config(int, ...); /* -** CAPI3REF: Configure database connections {H14200} -** EXPERIMENTAL +** CAPI3REF: Configure database connections ** ** The sqlite3_db_config() interface is used to make configuration ** changes to a [database connection]. The interface is similar to ** [sqlite3_config()] except that the changes apply to a single ** [database connection] (specified in the first argument). The -** sqlite3_db_config() interface can only be used immediately after +** sqlite3_db_config() interface should only be used immediately after ** the database connection is created using [sqlite3_open()], ** [sqlite3_open16()], or [sqlite3_open_v2()]. ** @@ -953,14 +1318,13 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_config(int, ...); ** New verbs are likely to be added in future releases of SQLite. ** Additional arguments depend on the verb. ** -** Requirements: -** [H14203] [H14206] [H14209] [H14212] [H14215] +** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if +** the call is considered successful. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_config(sqlite3*, int op, ...); +SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); /* -** CAPI3REF: Memory Allocation Routines {H10155} -** EXPERIMENTAL +** CAPI3REF: Memory Allocation Routines ** ** An instance of this object defines the interface between SQLite ** and low-level memory allocation routines. @@ -989,7 +1353,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_config(sqlite3*, int op, ...); ** The xRealloc method must work like realloc() from the standard C library ** with the exception that if the second argument to xRealloc is zero, ** xRealloc must be a no-op - it must not perform any allocation or -** deallocation. SQLite guaranteeds that the second argument to +** deallocation. ^SQLite guarantees that the second argument to ** xRealloc is always a value returned by a prior call to xRoundup. ** And so in cases where xRoundup always returns a positive number, ** xRealloc can perform exactly as the standard library realloc() and @@ -1041,8 +1405,7 @@ struct sqlite3_mem_methods { }; /* -** CAPI3REF: Configuration Options {H10160} -** EXPERIMENTAL +** CAPI3REF: Configuration Options ** ** These constants are the available integer configuration options that ** can be passed as the first argument to the [sqlite3_config()] interface. @@ -1056,22 +1419,33 @@ struct sqlite3_mem_methods { ** **
    **
    SQLITE_CONFIG_SINGLETHREAD
    -**
    There are no arguments to this option. This option disables +**
    There are no arguments to this option. ^This option sets the +** [threading mode] to Single-thread. In other words, it disables ** all mutexing and puts SQLite into a mode where it can only be used -** by a single thread.
    +** by a single thread. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to change the [threading mode] from its default +** value of Single-thread and so [sqlite3_config()] will return +** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD +** configuration option. ** **
    SQLITE_CONFIG_MULTITHREAD
    -**
    There are no arguments to this option. This option disables +**
    There are no arguments to this option. ^This option sets the +** [threading mode] to Multi-thread. In other words, it disables ** mutexing on [database connection] and [prepared statement] objects. ** The application is responsible for serializing access to ** [database connections] and [prepared statements]. But other mutexes ** are enabled so that SQLite will be safe to use in a multi-threaded ** environment as long as no two threads attempt to use the same -** [database connection] at the same time. See the [threading mode] -** documentation for additional information.
    +** [database connection] at the same time. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to set the Multi-thread [threading mode] and +** [sqlite3_config()] will return [SQLITE_ERROR] if called with the +** SQLITE_CONFIG_MULTITHREAD configuration option. ** **
    SQLITE_CONFIG_SERIALIZED
    -**
    There are no arguments to this option. This option enables +**
    There are no arguments to this option. ^This option sets the +** [threading mode] to Serialized. In other words, this option enables ** all mutexes including the recursive ** mutexes on [database connection] and [prepared statement] objects. ** In this mode (which is the default when SQLite is compiled with @@ -1079,55 +1453,62 @@ struct sqlite3_mem_methods { ** to [database connections] and [prepared statements] so that the ** application is free to use the same [database connection] or the ** same [prepared statement] in different threads at the same time. -** See the [threading mode] documentation for additional information.
    +** ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to set the Serialized [threading mode] and +** [sqlite3_config()] will return [SQLITE_ERROR] if called with the +** SQLITE_CONFIG_SERIALIZED configuration option. ** **
    SQLITE_CONFIG_MALLOC
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mem_methods] structure. The argument specifies ** alternative low-level memory allocation routines to be used in place of -** the memory allocation routines built into SQLite.
    +** the memory allocation routines built into SQLite.)^ ^SQLite makes +** its own private copy of the content of the [sqlite3_mem_methods] structure +** before the [sqlite3_config()] call returns. ** **
    SQLITE_CONFIG_GETMALLOC
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mem_methods] structure. The [sqlite3_mem_methods] -** structure is filled with the currently defined memory allocation routines. +** structure is filled with the currently defined memory allocation routines.)^ ** This option can be used to overload the default memory allocation ** routines with a wrapper that simulations memory allocation failure or -** tracks memory usage, for example.
    +** tracks memory usage, for example. ** **
    SQLITE_CONFIG_MEMSTATUS
    -**
    This option takes single argument of type int, interpreted as a +**
    ^This option takes single argument of type int, interpreted as a ** boolean, which enables or disables the collection of memory allocation -** statistics. When disabled, the following SQLite interfaces become -** non-operational: +** statistics. ^(When memory allocation statistics are disabled, the +** following SQLite interfaces become non-operational: **
      **
    • [sqlite3_memory_used()] **
    • [sqlite3_memory_highwater()] -**
    • [sqlite3_soft_heap_limit()] +**
    • [sqlite3_soft_heap_limit64()] **
    • [sqlite3_status()] -**
    +** )^ +** ^Memory allocation statistics are enabled by default unless SQLite is +** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory +** allocation statistics are disabled by default. **
    ** **
    SQLITE_CONFIG_SCRATCH
    -**
    This option specifies a static memory buffer that SQLite can use for +**
    ^This option specifies a static memory buffer that SQLite can use for ** scratch memory. There are three arguments: A pointer an 8-byte ** aligned memory buffer from which the scrach allocations will be ** drawn, the size of each scratch allocation (sz), ** and the maximum number of scratch allocations (N). The sz -** argument must be a multiple of 16. The sz parameter should be a few bytes -** larger than the actual scratch space required due to internal overhead. -** The first argument should pointer to an 8-byte aligned buffer +** argument must be a multiple of 16. +** The first argument must be a pointer to an 8-byte aligned buffer ** of at least sz*N bytes of memory. -** SQLite will use no more than one scratch buffer at once per thread, so -** N should be set to the expected maximum number of threads. The sz -** parameter should be 6 times the size of the largest database page size. -** Scratch buffers are used as part of the btree balance operation. If -** The btree balancer needs additional memory beyond what is provided by -** scratch buffers or if no scratch buffer space is specified, then SQLite -** goes to [sqlite3_malloc()] to obtain the memory it needs.
    +** ^SQLite will use no more than two scratch buffers per thread. So +** N should be set to twice the expected maximum number of threads. +** ^SQLite will never require a scratch buffer that is more than 6 +** times the database page size. ^If SQLite needs needs additional +** scratch memory beyond what is provided by this configuration option, then +** [sqlite3_malloc()] will be used to obtain the memory needed. ** **
    SQLITE_CONFIG_PAGECACHE
    -**
    This option specifies a static memory buffer that SQLite can use for +**
    ^This option specifies a static memory buffer that SQLite can use for ** the database page cache with the default page cache implemenation. ** This configuration should not be used if an application-define page ** cache implementation is loaded using the SQLITE_CONFIG_PCACHE option. @@ -1135,28 +1516,27 @@ struct sqlite3_mem_methods { ** memory, the size of each page buffer (sz), and the number of pages (N). ** The sz argument should be the size of the largest database page ** (a power of two between 512 and 32768) plus a little extra for each -** page header. The page header size is 20 to 40 bytes depending on -** the host architecture. It is harmless, apart from the wasted memory, +** page header. ^The page header size is 20 to 40 bytes depending on +** the host architecture. ^It is harmless, apart from the wasted memory, ** to make sz a little too large. The first ** argument should point to an allocation of at least sz*N bytes of memory. -** SQLite will use the memory provided by the first argument to satisfy its -** memory needs for the first N pages that it adds to cache. If additional +** ^SQLite will use the memory provided by the first argument to satisfy its +** memory needs for the first N pages that it adds to cache. ^If additional ** page cache memory is needed beyond what is provided by this option, then ** SQLite goes to [sqlite3_malloc()] for the additional storage space. -** The implementation might use one or more of the N buffers to hold -** memory accounting information. The pointer in the first argument must +** The pointer in the first argument must ** be aligned to an 8-byte boundary or subsequent behavior of SQLite ** will be undefined.
    ** **
    SQLITE_CONFIG_HEAP
    -**
    This option specifies a static memory buffer that SQLite will use +**
    ^This option specifies a static memory buffer that SQLite will use ** for all of its dynamic memory allocation needs beyond those provided ** for by [SQLITE_CONFIG_SCRATCH] and [SQLITE_CONFIG_PAGECACHE]. ** There are three arguments: An 8-byte aligned pointer to the memory, ** the number of bytes in the memory buffer, and the minimum allocation size. -** If the first pointer (the memory pointer) is NULL, then SQLite reverts +** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts ** to using its default memory allocator (the system malloc() implementation), -** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. If the +** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. ^If the ** memory pointer is not NULL and either [SQLITE_ENABLE_MEMSYS3] or ** [SQLITE_ENABLE_MEMSYS5] are defined, then the alternative memory ** allocator is engaged to handle all of SQLites memory allocation needs. @@ -1164,39 +1544,68 @@ struct sqlite3_mem_methods { ** boundary or subsequent behavior of SQLite will be undefined.
    ** **
    SQLITE_CONFIG_MUTEX
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mutex_methods] structure. The argument specifies ** alternative low-level mutex routines to be used in place -** the mutex routines built into SQLite.
    +** the mutex routines built into SQLite.)^ ^SQLite makes a copy of the +** content of the [sqlite3_mutex_methods] structure before the call to +** [sqlite3_config()] returns. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** the entire mutexing subsystem is omitted from the build and hence calls to +** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will +** return [SQLITE_ERROR]. ** **
    SQLITE_CONFIG_GETMUTEX
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mutex_methods] structure. The ** [sqlite3_mutex_methods] -** structure is filled with the currently defined mutex routines. +** structure is filled with the currently defined mutex routines.)^ ** This option can be used to overload the default mutex allocation ** routines with a wrapper used to track mutex usage for performance -** profiling or testing, for example.
    +** profiling or testing, for example. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** the entire mutexing subsystem is omitted from the build and hence calls to +** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will +** return [SQLITE_ERROR]. ** **
    SQLITE_CONFIG_LOOKASIDE
    -**
    This option takes two arguments that determine the default -** memory allocation lookaside optimization. The first argument is the +**
    ^(This option takes two arguments that determine the default +** memory allocation for the lookaside memory allocator on each +** [database connection]. The first argument is the ** size of each lookaside buffer slot and the second is the number of -** slots allocated to each database connection. This option sets the -** default lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] +** slots allocated to each database connection.)^ ^(This option sets the +** default lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] ** verb to [sqlite3_db_config()] can be used to change the lookaside -** configuration on individual connections.
    +** configuration on individual connections.)^ ** **
    SQLITE_CONFIG_PCACHE
    -**
    This option takes a single argument which is a pointer to +**
    ^(This option takes a single argument which is a pointer to ** an [sqlite3_pcache_methods] object. This object specifies the interface -** to a custom page cache implementation. SQLite makes a copy of the +** to a custom page cache implementation.)^ ^SQLite makes a copy of the ** object and uses it for page cache memory allocations.
    ** **
    SQLITE_CONFIG_GETPCACHE
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** [sqlite3_pcache_methods] object. SQLite copies of the current -** page cache implementation into that object.
    +** page cache implementation into that object.)^ +** +**
    SQLITE_CONFIG_LOG
    +**
    ^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a +** function with a call signature of void(*)(void*,int,const char*), +** and a pointer to void. ^If the function pointer is not NULL, it is +** invoked by [sqlite3_log()] to process each logging event. ^If the +** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. +** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is +** passed through as the first parameter to the application-defined logger +** function whenever that function is invoked. ^The second parameter to +** the logger function is a copy of the first parameter to the corresponding +** [sqlite3_log()] call and is intended to be a [result code] or an +** [extended result code]. ^The third parameter passed to the logger is +** log message after formatting via [sqlite3_snprintf()]. +** The SQLite logging interface is not reentrant; the logger function +** supplied by the application must not invoke any SQLite interface. +** In a multi-threaded application, the application-defined logger +** function must be threadsafe.
    ** **
    */ @@ -1215,10 +1624,10 @@ struct sqlite3_mem_methods { #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ #define SQLITE_CONFIG_PCACHE 14 /* sqlite3_pcache_methods* */ #define SQLITE_CONFIG_GETPCACHE 15 /* sqlite3_pcache_methods* */ +#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ /* -** CAPI3REF: Configuration Options {H10170} -** EXPERIMENTAL +** CAPI3REF: Database Connection Configuration Options ** ** These constants are the available integer configuration options that ** can be passed as the second argument to the [sqlite3_db_config()] interface. @@ -1226,24 +1635,32 @@ struct sqlite3_mem_methods { ** New configuration options may be added in future releases of SQLite. ** Existing configuration options might be discontinued. Applications ** should check the return code from [sqlite3_db_config()] to make sure that -** the call worked. The [sqlite3_db_config()] interface will return a +** the call worked. ^The [sqlite3_db_config()] interface will return a ** non-zero [error code] if a discontinued or unsupported configuration option ** is invoked. ** **
    **
    SQLITE_DBCONFIG_LOOKASIDE
    -**
    This option takes three additional arguments that determine the +**
    ^This option takes three additional arguments that determine the ** [lookaside memory allocator] configuration for the [database connection]. -** The first argument (the third parameter to [sqlite3_db_config()] is a +** ^The first argument (the third parameter to [sqlite3_db_config()] is a ** pointer to an memory buffer to use for lookaside memory. -** The first argument may be NULL in which case SQLite will allocate the -** lookaside buffer itself using [sqlite3_malloc()]. The second argument is the -** size of each lookaside buffer slot and the third argument is the number of +** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb +** may be NULL in which case SQLite will allocate the +** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the +** size of each lookaside buffer slot. ^The third argument is the number of ** slots. The size of the buffer in the first argument must be greater than ** or equal to the product of the second and third arguments. The buffer -** must be aligned to an 8-byte boundary. If the second argument is not -** a multiple of 8, it is internally rounded down to the next smaller -** multiple of 8. See also: [SQLITE_CONFIG_LOOKASIDE]
    +** must be aligned to an 8-byte boundary. ^If the second argument to +** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally +** rounded down to the next smaller multiple of 8. ^(The lookaside memory +** configuration for a database connection can only be changed when that +** connection is not currently using lookaside memory, or in other words +** when the "current value" returned by +** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero. +** Any attempt to change the lookaside memory configuration when lookaside +** memory is in use leaves the configuration unchanged and returns +** [SQLITE_BUSY].)^ ** **
    */ @@ -1251,52 +1668,49 @@ struct sqlite3_mem_methods { /* -** CAPI3REF: Enable Or Disable Extended Result Codes {H12200} +** CAPI3REF: Enable Or Disable Extended Result Codes ** -** The sqlite3_extended_result_codes() routine enables or disables the -** [extended result codes] feature of SQLite. The extended result -** codes are disabled by default for historical compatibility considerations. -** -** Requirements: -** [H12201] [H12202] +** ^The sqlite3_extended_result_codes() routine enables or disables the +** [extended result codes] feature of SQLite. ^The extended result +** codes are disabled by default for historical compatibility. */ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); /* -** CAPI3REF: Last Insert Rowid {H12220} +** CAPI3REF: Last Insert Rowid ** -** Each entry in an SQLite table has a unique 64-bit signed -** integer key called the [ROWID | "rowid"]. The rowid is always available +** ^Each entry in an SQLite table has a unique 64-bit signed +** integer key called the [ROWID | "rowid"]. ^The rowid is always available ** as an undeclared column named ROWID, OID, or _ROWID_ as long as those -** names are not also used by explicitly declared columns. If +** names are not also used by explicitly declared columns. ^If ** the table has a column of type [INTEGER PRIMARY KEY] then that column ** is another alias for the rowid. ** -** This routine returns the [rowid] of the most recent +** ^This routine returns the [rowid] of the most recent ** successful [INSERT] into the database from the [database connection] -** in the first argument. If no successful [INSERT]s +** in the first argument. ^If no successful [INSERT]s ** have ever occurred on that database connection, zero is returned. ** -** If an [INSERT] occurs within a trigger, then the [rowid] of the inserted +** ^(If an [INSERT] occurs within a trigger, then the [rowid] of the inserted ** row is returned by this routine as long as the trigger is running. ** But once the trigger terminates, the value returned by this routine -** reverts to the last value inserted before the trigger fired. +** reverts to the last value inserted before the trigger fired.)^ ** -** An [INSERT] that fails due to a constraint violation is not a +** ^An [INSERT] that fails due to a constraint violation is not a ** successful [INSERT] and does not change the value returned by this -** routine. Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, +** routine. ^Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, ** and INSERT OR ABORT make no changes to the return value of this -** routine when their insertion fails. When INSERT OR REPLACE +** routine when their insertion fails. ^(When INSERT OR REPLACE ** encounters a constraint violation, it does not fail. The ** INSERT continues to completion after deleting rows that caused ** the constraint problem so INSERT OR REPLACE will always change -** the return value of this interface. +** the return value of this interface.)^ ** -** For the purposes of this routine, an [INSERT] is considered to +** ^For the purposes of this routine, an [INSERT] is considered to ** be successful even if it is subsequently rolled back. ** -** Requirements: -** [H12221] [H12223] +** This function is accessible to SQL statements via the +** [last_insert_rowid() SQL function]. ** ** If a separate thread performs a new [INSERT] on the same ** database connection while the [sqlite3_last_insert_rowid()] @@ -1308,25 +1722,25 @@ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); /* -** CAPI3REF: Count The Number Of Rows Modified {H12240} +** CAPI3REF: Count The Number Of Rows Modified ** -** This function returns the number of database rows that were changed +** ^This function returns the number of database rows that were changed ** or inserted or deleted by the most recently completed SQL statement ** on the [database connection] specified by the first parameter. -** Only changes that are directly specified by the [INSERT], [UPDATE], +** ^(Only changes that are directly specified by the [INSERT], [UPDATE], ** or [DELETE] statement are counted. Auxiliary changes caused by -** triggers or [foreign key actions] are not counted. Use the +** triggers or [foreign key actions] are not counted.)^ Use the ** [sqlite3_total_changes()] function to find the total number of changes ** including changes caused by triggers and foreign key actions. ** -** Changes to a view that are simulated by an [INSTEAD OF trigger] +** ^Changes to a view that are simulated by an [INSTEAD OF trigger] ** are not counted. Only real table changes are counted. ** -** A "row change" is a change to a single row of a single table +** ^(A "row change" is a change to a single row of a single table ** caused by an INSERT, DELETE, or UPDATE statement. Rows that ** are changed as side effects of [REPLACE] constraint resolution, ** rollback, ABORT processing, [DROP TABLE], or by any other -** mechanisms do not count as direct row changes. +** mechanisms do not count as direct row changes.)^ ** ** A "trigger context" is a scope of execution that begins and ** ends with the script of a [CREATE TRIGGER | trigger]. @@ -1336,27 +1750,24 @@ SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); ** new trigger context is entered for the duration of that one ** trigger. Subtriggers create subcontexts for their duration. ** -** Calling [sqlite3_exec()] or [sqlite3_step()] recursively does +** ^Calling [sqlite3_exec()] or [sqlite3_step()] recursively does ** not create a new trigger context. ** -** This function returns the number of direct row changes in the +** ^This function returns the number of direct row changes in the ** most recent INSERT, UPDATE, or DELETE statement within the same ** trigger context. ** -** Thus, when called from the top level, this function returns the +** ^Thus, when called from the top level, this function returns the ** number of changes in the most recent INSERT, UPDATE, or DELETE -** that also occurred at the top level. Within the body of a trigger, +** that also occurred at the top level. ^(Within the body of a trigger, ** the sqlite3_changes() interface can be called to find the number of ** changes in the most recently completed INSERT, UPDATE, or DELETE ** statement within the body of the same trigger. ** However, the number returned does not include changes -** caused by subtriggers since those have their own context. +** caused by subtriggers since those have their own context.)^ ** -** See also the [sqlite3_total_changes()] interface and the -** [count_changes pragma]. -** -** Requirements: -** [H12241] [H12243] +** See also the [sqlite3_total_changes()] interface, the +** [count_changes pragma], and the [changes() SQL function]. ** ** If a separate thread makes changes on the same database connection ** while [sqlite3_changes()] is running then the value returned @@ -1365,26 +1776,24 @@ SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); SQLITE_API int sqlite3_changes(sqlite3*); /* -** CAPI3REF: Total Number Of Rows Modified {H12260} +** CAPI3REF: Total Number Of Rows Modified ** -** This function returns the number of row changes caused by [INSERT], +** ^This function returns the number of row changes caused by [INSERT], ** [UPDATE] or [DELETE] statements since the [database connection] was opened. -** The count includes all changes from all [CREATE TRIGGER | trigger] -** contexts and changes made by [foreign key actions]. However, +** ^(The count returned by sqlite3_total_changes() includes all changes +** from all [CREATE TRIGGER | trigger] contexts and changes made by +** [foreign key actions]. However, ** the count does not include changes used to implement [REPLACE] constraints, ** do rollbacks or ABORT processing, or [DROP TABLE] processing. The ** count does not include rows of views that fire an [INSTEAD OF trigger], ** though if the INSTEAD OF trigger makes changes of its own, those changes -** are counted. -** The changes are counted as soon as the statement that makes them is -** completed (when the statement handle is passed to [sqlite3_reset()] or -** [sqlite3_finalize()]). +** are counted.)^ +** ^The sqlite3_total_changes() function counts the changes as soon as +** the statement that makes them is completed (when the statement handle +** is passed to [sqlite3_reset()] or [sqlite3_finalize()]). ** -** See also the [sqlite3_changes()] interface and the -** [count_changes pragma]. -** -** Requirements: -** [H12261] [H12263] +** See also the [sqlite3_changes()] interface, the +** [count_changes pragma], and the [total_changes() SQL function]. ** ** If a separate thread makes changes on the same database connection ** while [sqlite3_total_changes()] is running then the value @@ -1393,75 +1802,70 @@ SQLITE_API int sqlite3_changes(sqlite3*); SQLITE_API int sqlite3_total_changes(sqlite3*); /* -** CAPI3REF: Interrupt A Long-Running Query {H12270} +** CAPI3REF: Interrupt A Long-Running Query ** -** This function causes any pending database operation to abort and +** ^This function causes any pending database operation to abort and ** return at its earliest opportunity. This routine is typically ** called in response to a user action such as pressing "Cancel" ** or Ctrl-C where the user wants a long query operation to halt ** immediately. ** -** It is safe to call this routine from a thread different from the +** ^It is safe to call this routine from a thread different from the ** thread that is currently running the database operation. But it ** is not safe to call this routine with a [database connection] that ** is closed or might close before sqlite3_interrupt() returns. ** -** If an SQL operation is very nearly finished at the time when +** ^If an SQL operation is very nearly finished at the time when ** sqlite3_interrupt() is called, then it might not have an opportunity ** to be interrupted and might continue to completion. ** -** An SQL operation that is interrupted will return [SQLITE_INTERRUPT]. -** If the interrupted SQL operation is an INSERT, UPDATE, or DELETE +** ^An SQL operation that is interrupted will return [SQLITE_INTERRUPT]. +** ^If the interrupted SQL operation is an INSERT, UPDATE, or DELETE ** that is inside an explicit transaction, then the entire transaction ** will be rolled back automatically. ** -** The sqlite3_interrupt(D) call is in effect until all currently running -** SQL statements on [database connection] D complete. Any new SQL statements +** ^The sqlite3_interrupt(D) call is in effect until all currently running +** SQL statements on [database connection] D complete. ^Any new SQL statements ** that are started after the sqlite3_interrupt() call and before the ** running statements reaches zero are interrupted as if they had been -** running prior to the sqlite3_interrupt() call. New SQL statements +** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are ** not effected by the sqlite3_interrupt(). -** A call to sqlite3_interrupt(D) that occurs when there are no running +** ^A call to sqlite3_interrupt(D) that occurs when there are no running ** SQL statements is a no-op and has no effect on SQL statements ** that are started after the sqlite3_interrupt() call returns. ** -** Requirements: -** [H12271] [H12272] -** ** If the database connection closes while [sqlite3_interrupt()] ** is running then bad things will likely happen. */ SQLITE_API void sqlite3_interrupt(sqlite3*); /* -** CAPI3REF: Determine If An SQL Statement Is Complete {H10510} +** CAPI3REF: Determine If An SQL Statement Is Complete ** ** These routines are useful during command-line input to determine if the ** currently entered text seems to form a complete SQL statement or ** if additional input is needed before sending the text into -** SQLite for parsing. These routines return 1 if the input string -** appears to be a complete SQL statement. A statement is judged to be +** SQLite for parsing. ^These routines return 1 if the input string +** appears to be a complete SQL statement. ^A statement is judged to be ** complete if it ends with a semicolon token and is not a prefix of a -** well-formed CREATE TRIGGER statement. Semicolons that are embedded within +** well-formed CREATE TRIGGER statement. ^Semicolons that are embedded within ** string literals or quoted identifier names or comments are not ** independent tokens (they are part of the token in which they are -** embedded) and thus do not count as a statement terminator. Whitespace +** embedded) and thus do not count as a statement terminator. ^Whitespace ** and comments that follow the final semicolon are ignored. ** -** These routines return 0 if the statement is incomplete. If a +** ^These routines return 0 if the statement is incomplete. ^If a ** memory allocation fails, then SQLITE_NOMEM is returned. ** -** These routines do not parse the SQL statements thus +** ^These routines do not parse the SQL statements thus ** will not detect syntactically incorrect SQL. ** -** If SQLite has not been initialized using [sqlite3_initialize()] prior +** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked ** automatically by sqlite3_complete16(). If that initialization fails, ** then the return value from sqlite3_complete16() will be non-zero -** regardless of whether or not the input SQL is complete. -** -** Requirements: [H10511] [H10512] +** regardless of whether or not the input SQL is complete.)^ ** ** The input to [sqlite3_complete()] must be a zero-terminated ** UTF-8 string. @@ -1473,27 +1877,27 @@ SQLITE_API int sqlite3_complete(const char *sql); SQLITE_API int sqlite3_complete16(const void *sql); /* -** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors {H12310} +** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors ** -** This routine sets a callback function that might be invoked whenever +** ^This routine sets a callback function that might be invoked whenever ** an attempt is made to open a database table that another thread ** or process has locked. ** -** If the busy callback is NULL, then [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] -** is returned immediately upon encountering the lock. If the busy callback -** is not NULL, then the callback will be invoked with two arguments. +** ^If the busy callback is NULL, then [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] +** is returned immediately upon encountering the lock. ^If the busy callback +** is not NULL, then the callback might be invoked with two arguments. ** -** The first argument to the handler is a copy of the void* pointer which -** is the third argument to sqlite3_busy_handler(). The second argument to -** the handler callback is the number of times that the busy handler has -** been invoked for this locking event. If the +** ^The first argument to the busy handler is a copy of the void* pointer which +** is the third argument to sqlite3_busy_handler(). ^The second argument to +** the busy handler callback is the number of times that the busy handler has +** been invoked for this locking event. ^If the ** busy callback returns 0, then no additional attempts are made to ** access the database and [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] is returned. -** If the callback returns non-zero, then another attempt +** ^If the callback returns non-zero, then another attempt ** is made to open the database for reading and the cycle repeats. ** ** The presence of a busy handler does not guarantee that it will be invoked -** when there is lock contention. If SQLite determines that invoking the busy +** when there is lock contention. ^If SQLite determines that invoking the busy ** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] ** or [SQLITE_IOERR_BLOCKED] instead of invoking the busy handler. ** Consider a scenario where one process is holding a read lock that @@ -1507,65 +1911,62 @@ SQLITE_API int sqlite3_complete16(const void *sql); ** will induce the first process to release its read lock and allow ** the second process to proceed. ** -** The default busy callback is NULL. +** ^The default busy callback is NULL. ** -** The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED] +** ^The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED] ** when SQLite is in the middle of a large transaction where all the ** changes will not fit into the in-memory cache. SQLite will ** already hold a RESERVED lock on the database file, but it needs ** to promote this lock to EXCLUSIVE so that it can spill cache ** pages into the database file without harm to concurrent -** readers. If it is unable to promote the lock, then the in-memory +** readers. ^If it is unable to promote the lock, then the in-memory ** cache will be left in an inconsistent state and so the error ** code is promoted from the relatively benign [SQLITE_BUSY] to -** the more severe [SQLITE_IOERR_BLOCKED]. This error code promotion +** the more severe [SQLITE_IOERR_BLOCKED]. ^This error code promotion ** forces an automatic rollback of the changes. See the ** ** CorruptionFollowingBusyError wiki page for a discussion of why ** this is important. ** -** There can only be a single busy handler defined for each +** ^(There can only be a single busy handler defined for each ** [database connection]. Setting a new busy handler clears any -** previously set handler. Note that calling [sqlite3_busy_timeout()] +** previously set handler.)^ ^Note that calling [sqlite3_busy_timeout()] ** will also set or clear the busy handler. ** ** The busy callback should not take any actions which modify the ** database connection that invoked the busy handler. Any such actions ** result in undefined behavior. ** -** Requirements: -** [H12311] [H12312] [H12314] [H12316] [H12318] -** ** A busy handler must not close the database connection ** or [prepared statement] that invoked the busy handler. */ SQLITE_API int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); /* -** CAPI3REF: Set A Busy Timeout {H12340} +** CAPI3REF: Set A Busy Timeout ** -** This routine sets a [sqlite3_busy_handler | busy handler] that sleeps -** for a specified amount of time when a table is locked. The handler +** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps +** for a specified amount of time when a table is locked. ^The handler ** will sleep multiple times until at least "ms" milliseconds of sleeping -** have accumulated. {H12343} After "ms" milliseconds of sleeping, +** have accumulated. ^After at least "ms" milliseconds of sleeping, ** the handler returns 0 which causes [sqlite3_step()] to return ** [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED]. ** -** Calling this routine with an argument less than or equal to zero +** ^Calling this routine with an argument less than or equal to zero ** turns off all busy handlers. ** -** There can only be a single busy handler for a particular +** ^(There can only be a single busy handler for a particular ** [database connection] any any given moment. If another busy handler ** was defined (using [sqlite3_busy_handler()]) prior to calling -** this routine, that other busy handler is cleared. -** -** Requirements: -** [H12341] [H12343] [H12344] +** this routine, that other busy handler is cleared.)^ */ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); /* -** CAPI3REF: Convenience Routines For Running Queries {H12370} +** CAPI3REF: Convenience Routines For Running Queries +** +** This is a legacy interface that is preserved for backwards compatibility. +** Use of this interface is not recommended. ** ** Definition: A result table is memory data structure created by the ** [sqlite3_get_table()] interface. A result table records the @@ -1587,7 +1988,7 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); ** It is not safe to pass a result table directly to [sqlite3_free()]. ** A result table should be deallocated using [sqlite3_free_table()]. ** -** As an example of the result table format, suppose a query result +** ^(As an example of the result table format, suppose a query result ** is as follows: ** **
    @@ -1611,15 +2012,15 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
     **        azResult[5] = "28";
     **        azResult[6] = "Cindy";
     **        azResult[7] = "21";
    -** 
    +** )^ ** -** The sqlite3_get_table() function evaluates one or more +** ^The sqlite3_get_table() function evaluates one or more ** semicolon-separated SQL statements in the zero-terminated UTF-8 -** string of its 2nd parameter. It returns a result table to the +** string of its 2nd parameter and returns a result table to the ** pointer given in its 3rd parameter. ** -** After the calling function has finished using the result, it should -** pass the pointer to the result table to sqlite3_free_table() in order to +** After the application has finished with the result from sqlite3_get_table(), +** it must pass the result table pointer to sqlite3_free_table() in order to ** release the memory that was malloced. Because of the way the ** [sqlite3_malloc()] happens within sqlite3_get_table(), the calling ** function must not try to call [sqlite3_free()] directly. Only @@ -1630,10 +2031,8 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); ** to any internal data structures of SQLite. It uses only the public ** interface defined here. As a consequence, errors that occur in the ** wrapper layer outside of the internal [sqlite3_exec()] call are not -** reflected in subsequent calls to [sqlite3_errcode()] or [sqlite3_errmsg()]. -** -** Requirements: -** [H12371] [H12373] [H12374] [H12376] [H12379] [H12382] +** reflected in subsequent calls to [sqlite3_errcode()] or +** [sqlite3_errmsg()]. */ SQLITE_API int sqlite3_get_table( sqlite3 *db, /* An open database */ @@ -1646,33 +2045,33 @@ SQLITE_API int sqlite3_get_table( SQLITE_API void sqlite3_free_table(char **result); /* -** CAPI3REF: Formatted String Printing Functions {H17400} +** CAPI3REF: Formatted String Printing Functions ** ** These routines are work-alikes of the "printf()" family of functions ** from the standard C library. ** -** The sqlite3_mprintf() and sqlite3_vmprintf() routines write their +** ^The sqlite3_mprintf() and sqlite3_vmprintf() routines write their ** results into memory obtained from [sqlite3_malloc()]. ** The strings returned by these two routines should be -** released by [sqlite3_free()]. Both routines return a +** released by [sqlite3_free()]. ^Both routines return a ** NULL pointer if [sqlite3_malloc()] is unable to allocate enough ** memory to hold the resulting string. ** -** In sqlite3_snprintf() routine is similar to "snprintf()" from +** ^(In sqlite3_snprintf() routine is similar to "snprintf()" from ** the standard C library. The result is written into the ** buffer supplied as the second parameter whose size is given by ** the first parameter. Note that the order of the -** first two parameters is reversed from snprintf(). This is an +** first two parameters is reversed from snprintf().)^ This is an ** historical accident that cannot be fixed without breaking -** backwards compatibility. Note also that sqlite3_snprintf() +** backwards compatibility. ^(Note also that sqlite3_snprintf() ** returns a pointer to its buffer instead of the number of -** characters actually written into the buffer. We admit that +** characters actually written into the buffer.)^ We admit that ** the number of characters written would be a more useful return ** value but we cannot change the implementation of sqlite3_snprintf() ** now without breaking compatibility. ** -** As long as the buffer size is greater than zero, sqlite3_snprintf() -** guarantees that the buffer is always zero-terminated. The first +** ^As long as the buffer size is greater than zero, sqlite3_snprintf() +** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. @@ -1682,9 +2081,9 @@ SQLITE_API void sqlite3_free_table(char **result); ** All of the usual printf() formatting options apply. In addition, there ** is are "%q", "%Q", and "%z" options. ** -** The %q option works like %s in that it substitutes a null-terminated +** ^(The %q option works like %s in that it substitutes a null-terminated ** string from the argument list. But %q also doubles every '\'' character. -** %q is designed for use inside a string literal. By doubling each '\'' +** %q is designed for use inside a string literal.)^ By doubling each '\'' ** character it escapes that character and allows it to be inserted into ** the string. ** @@ -1719,10 +2118,10 @@ SQLITE_API void sqlite3_free_table(char **result); ** This second example is an SQL syntax error. As a general rule you should ** always use %q instead of %s when inserting text into a string literal. ** -** The %Q option works like %q except it also adds single quotes around +** ^(The %Q option works like %q except it also adds single quotes around ** the outside of the total string. Additionally, if the parameter in the ** argument list is a NULL pointer, %Q substitutes the text "NULL" (without -** single quotes) in place of the %Q option. So, for example, one could say: +** single quotes).)^ So, for example, one could say: ** **
     **  char *zSQL = sqlite3_mprintf("INSERT INTO table VALUES(%Q)", zText);
    @@ -1733,35 +2132,32 @@ SQLITE_API void sqlite3_free_table(char **result);
     ** The code above will render a correct SQL statement in the zSQL
     ** variable even if the zText variable is a NULL pointer.
     **
    -** The "%z" formatting option works exactly like "%s" with the
    +** ^(The "%z" formatting option works like "%s" but with the
     ** addition that after the string has been read and copied into
    -** the result, [sqlite3_free()] is called on the input string. {END}
    -**
    -** Requirements:
    -** [H17403] [H17406] [H17407]
    +** the result, [sqlite3_free()] is called on the input string.)^
     */
     SQLITE_API char *sqlite3_mprintf(const char*,...);
     SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
     SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
     
     /*
    -** CAPI3REF: Memory Allocation Subsystem {H17300} 
    +** CAPI3REF: Memory Allocation Subsystem
     **
    -** The SQLite core  uses these three routines for all of its own
    +** The SQLite core uses these three routines for all of its own
     ** internal memory allocation needs. "Core" in the previous sentence
     ** does not include operating-system specific VFS implementation.  The
     ** Windows VFS uses native malloc() and free() for some operations.
     **
    -** The sqlite3_malloc() routine returns a pointer to a block
    +** ^The sqlite3_malloc() routine returns a pointer to a block
     ** of memory at least N bytes in length, where N is the parameter.
    -** If sqlite3_malloc() is unable to obtain sufficient free
    -** memory, it returns a NULL pointer.  If the parameter N to
    +** ^If sqlite3_malloc() is unable to obtain sufficient free
    +** memory, it returns a NULL pointer.  ^If the parameter N to
     ** sqlite3_malloc() is zero or negative then sqlite3_malloc() returns
     ** a NULL pointer.
     **
    -** Calling sqlite3_free() with a pointer previously returned
    +** ^Calling sqlite3_free() with a pointer previously returned
     ** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
    -** that it might be reused.  The sqlite3_free() routine is
    +** that it might be reused.  ^The sqlite3_free() routine is
     ** a no-op if is called with a NULL pointer.  Passing a NULL pointer
     ** to sqlite3_free() is harmless.  After being freed, memory
     ** should neither be read nor written.  Even reading previously freed
    @@ -1770,34 +2166,27 @@ SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
     ** might result if sqlite3_free() is called with a non-NULL pointer that
     ** was not obtained from sqlite3_malloc() or sqlite3_realloc().
     **
    -** The sqlite3_realloc() interface attempts to resize a
    +** ^(The sqlite3_realloc() interface attempts to resize a
     ** prior memory allocation to be at least N bytes, where N is the
     ** second parameter.  The memory allocation to be resized is the first
    -** parameter.  If the first parameter to sqlite3_realloc()
    +** parameter.)^ ^ If the first parameter to sqlite3_realloc()
     ** is a NULL pointer then its behavior is identical to calling
     ** sqlite3_malloc(N) where N is the second parameter to sqlite3_realloc().
    -** If the second parameter to sqlite3_realloc() is zero or
    +** ^If the second parameter to sqlite3_realloc() is zero or
     ** negative then the behavior is exactly the same as calling
     ** sqlite3_free(P) where P is the first parameter to sqlite3_realloc().
    -** sqlite3_realloc() returns a pointer to a memory allocation
    +** ^sqlite3_realloc() returns a pointer to a memory allocation
     ** of at least N bytes in size or NULL if sufficient memory is unavailable.
    -** If M is the size of the prior allocation, then min(N,M) bytes
    +** ^If M is the size of the prior allocation, then min(N,M) bytes
     ** of the prior allocation are copied into the beginning of buffer returned
     ** by sqlite3_realloc() and the prior allocation is freed.
    -** If sqlite3_realloc() returns NULL, then the prior allocation
    +** ^If sqlite3_realloc() returns NULL, then the prior allocation
     ** is not freed.
     **
    -** The memory returned by sqlite3_malloc() and sqlite3_realloc()
    -** is always aligned to at least an 8 byte boundary. {END}
    -**
    -** The default implementation of the memory allocation subsystem uses
    -** the malloc(), realloc() and free() provided by the standard C library.
    -** {H17382} However, if SQLite is compiled with the
    -** SQLITE_MEMORY_SIZE=NNN C preprocessor macro (where NNN
    -** is an integer), then SQLite create a static array of at least
    -** NNN bytes in size and uses that array for all of its dynamic
    -** memory allocation needs. {END}  Additional memory allocator options
    -** may be added in future releases.
    +** ^The memory returned by sqlite3_malloc() and sqlite3_realloc()
    +** is always aligned to at least an 8 byte boundary, or to a
    +** 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time
    +** option is used.
     **
     ** In SQLite version 3.5.0 and 3.5.1, it was possible to define
     ** the SQLITE_OMIT_MEMORY_ALLOCATION which would cause the built-in
    @@ -1812,10 +2201,6 @@ SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
     ** they are reported back as [SQLITE_CANTOPEN] or
     ** [SQLITE_IOERR] rather than [SQLITE_NOMEM].
     **
    -** Requirements:
    -** [H17303] [H17304] [H17305] [H17306] [H17310] [H17312] [H17315] [H17318]
    -** [H17321] [H17322] [H17323]
    -**
     ** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()]
     ** must be either NULL or else pointers obtained from a prior
     ** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have
    @@ -1830,20 +2215,33 @@ SQLITE_API void *sqlite3_realloc(void*, int);
     SQLITE_API void sqlite3_free(void*);
     
     /*
    -** CAPI3REF: Memory Allocator Statistics {H17370} 
    +** CAPI3REF: Memory Allocator Statistics
     **
     ** SQLite provides these two interfaces for reporting on the status
     ** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()]
     ** routines, which form the built-in memory allocation subsystem.
     **
    -** Requirements:
    -** [H17371] [H17373] [H17374] [H17375]
    +** ^The [sqlite3_memory_used()] routine returns the number of bytes
    +** of memory currently outstanding (malloced but not freed).
    +** ^The [sqlite3_memory_highwater()] routine returns the maximum
    +** value of [sqlite3_memory_used()] since the high-water mark
    +** was last reset.  ^The values returned by [sqlite3_memory_used()] and
    +** [sqlite3_memory_highwater()] include any overhead
    +** added by SQLite in its implementation of [sqlite3_malloc()],
    +** but not overhead added by the any underlying system library
    +** routines that [sqlite3_malloc()] may call.
    +**
    +** ^The memory high-water mark is reset to the current value of
    +** [sqlite3_memory_used()] if and only if the parameter to
    +** [sqlite3_memory_highwater()] is true.  ^The value returned
    +** by [sqlite3_memory_highwater(1)] is the high-water mark
    +** prior to the reset.
     */
     SQLITE_API sqlite3_int64 sqlite3_memory_used(void);
     SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
     
     /*
    -** CAPI3REF: Pseudo-Random Number Generator {H17390} 
    +** CAPI3REF: Pseudo-Random Number Generator
     **
     ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
     ** select random [ROWID | ROWIDs] when inserting new records into a table that
    @@ -1851,60 +2249,57 @@ SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
     ** the build-in random() and randomblob() SQL functions.  This interface allows
     ** applications to access the same PRNG for other purposes.
     **
    -** A call to this routine stores N bytes of randomness into buffer P.
    +** ^A call to this routine stores N bytes of randomness into buffer P.
     **
    -** The first time this routine is invoked (either internally or by
    +** ^The first time this routine is invoked (either internally or by
     ** the application) the PRNG is seeded using randomness obtained
     ** from the xRandomness method of the default [sqlite3_vfs] object.
    -** On all subsequent invocations, the pseudo-randomness is generated
    +** ^On all subsequent invocations, the pseudo-randomness is generated
     ** internally and without recourse to the [sqlite3_vfs] xRandomness
     ** method.
    -**
    -** Requirements:
    -** [H17392]
     */
     SQLITE_API void sqlite3_randomness(int N, void *P);
     
     /*
    -** CAPI3REF: Compile-Time Authorization Callbacks {H12500} 
    +** CAPI3REF: Compile-Time Authorization Callbacks
     **
    -** This routine registers a authorizer callback with a particular
    +** ^This routine registers a authorizer callback with a particular
     ** [database connection], supplied in the first argument.
    -** The authorizer callback is invoked as SQL statements are being compiled
    +** ^The authorizer callback is invoked as SQL statements are being compiled
     ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()],
    -** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()].  At various
    +** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()].  ^At various
     ** points during the compilation process, as logic is being created
     ** to perform various actions, the authorizer callback is invoked to
    -** see if those actions are allowed.  The authorizer callback should
    +** see if those actions are allowed.  ^The authorizer callback should
     ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the
     ** specific action but allow the SQL statement to continue to be
     ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
    -** rejected with an error.  If the authorizer callback returns
    +** rejected with an error.  ^If the authorizer callback returns
     ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY]
     ** then the [sqlite3_prepare_v2()] or equivalent call that triggered
     ** the authorizer will fail with an error message.
     **
     ** When the callback returns [SQLITE_OK], that means the operation
    -** requested is ok.  When the callback returns [SQLITE_DENY], the
    +** requested is ok.  ^When the callback returns [SQLITE_DENY], the
     ** [sqlite3_prepare_v2()] or equivalent call that triggered the
     ** authorizer will fail with an error message explaining that
     ** access is denied. 
     **
    -** The first parameter to the authorizer callback is a copy of the third
    -** parameter to the sqlite3_set_authorizer() interface. The second parameter
    +** ^The first parameter to the authorizer callback is a copy of the third
    +** parameter to the sqlite3_set_authorizer() interface. ^The second parameter
     ** to the callback is an integer [SQLITE_COPY | action code] that specifies
    -** the particular action to be authorized. The third through sixth parameters
    +** the particular action to be authorized. ^The third through sixth parameters
     ** to the callback are zero-terminated strings that contain additional
     ** details about the action to be authorized.
     **
    -** If the action code is [SQLITE_READ]
    +** ^If the action code is [SQLITE_READ]
     ** and the callback returns [SQLITE_IGNORE] then the
     ** [prepared statement] statement is constructed to substitute
     ** a NULL value in place of the table column that would have
     ** been read if [SQLITE_OK] had been returned.  The [SQLITE_IGNORE]
     ** return can be used to deny an untrusted user access to individual
     ** columns of a table.
    -** If the action code is [SQLITE_DELETE] and the callback returns
    +** ^If the action code is [SQLITE_DELETE] and the callback returns
     ** [SQLITE_IGNORE] then the [DELETE] operation proceeds but the
     ** [truncate optimization] is disabled and all rows are deleted individually.
     **
    @@ -1924,9 +2319,9 @@ SQLITE_API void sqlite3_randomness(int N, void *P);
     ** and limiting database size using the [max_page_count] [PRAGMA]
     ** in addition to using an authorizer.
     **
    -** Only a single authorizer can be in place on a database connection
    +** ^(Only a single authorizer can be in place on a database connection
     ** at a time.  Each call to sqlite3_set_authorizer overrides the
    -** previous call.  Disable the authorizer by installing a NULL callback.
    +** previous call.)^  ^Disable the authorizer by installing a NULL callback.
     ** The authorizer is disabled by default.
     **
     ** The authorizer callback must not do anything that will modify
    @@ -1934,20 +2329,16 @@ SQLITE_API void sqlite3_randomness(int N, void *P);
     ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
     ** database connections for the meaning of "modify" in this paragraph.
     **
    -** When [sqlite3_prepare_v2()] is used to prepare a statement, the
    +** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the
     ** statement might be re-prepared during [sqlite3_step()] due to a 
     ** schema change.  Hence, the application should ensure that the
     ** correct authorizer callback remains in place during the [sqlite3_step()].
     **
    -** Note that the authorizer callback is invoked only during
    +** ^Note that the authorizer callback is invoked only during
     ** [sqlite3_prepare()] or its variants.  Authorization is not
     ** performed during statement evaluation in [sqlite3_step()], unless
     ** as stated in the previous paragraph, sqlite3_step() invokes
     ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
    -**
    -** Requirements:
    -** [H12501] [H12502] [H12503] [H12504] [H12505] [H12506] [H12507] [H12510]
    -** [H12511] [H12512] [H12520] [H12521] [H12522]
     */
     SQLITE_API int sqlite3_set_authorizer(
       sqlite3*,
    @@ -1956,7 +2347,7 @@ SQLITE_API int sqlite3_set_authorizer(
     );
     
     /*
    -** CAPI3REF: Authorizer Return Codes {H12590} 
    +** CAPI3REF: Authorizer Return Codes
     **
     ** The [sqlite3_set_authorizer | authorizer callback function] must
     ** return either [SQLITE_OK] or one of these two constants in order
    @@ -1968,7 +2359,7 @@ SQLITE_API int sqlite3_set_authorizer(
     #define SQLITE_IGNORE 2   /* Don't allow access, but don't generate an error */
     
     /*
    -** CAPI3REF: Authorizer Action Codes {H12550} 
    +** CAPI3REF: Authorizer Action Codes
     **
     ** The [sqlite3_set_authorizer()] interface registers a callback function
     ** that is invoked to authorize certain SQL statement actions.  The
    @@ -1979,15 +2370,12 @@ SQLITE_API int sqlite3_set_authorizer(
     ** These action code values signify what kind of operation is to be
     ** authorized.  The 3rd and 4th parameters to the authorization
     ** callback function will be parameters or NULL depending on which of these
    -** codes is used as the second parameter.  The 5th parameter to the
    +** codes is used as the second parameter.  ^(The 5th parameter to the
     ** authorizer callback is the name of the database ("main", "temp",
    -** etc.) if applicable.  The 6th parameter to the authorizer callback
    +** etc.) if applicable.)^  ^The 6th parameter to the authorizer callback
     ** is the name of the inner-most trigger or view that is responsible for
     ** the access attempt or NULL if this access attempt is directly from
     ** top-level SQL code.
    -**
    -** Requirements:
    -** [H12551] [H12552] [H12553] [H12554]
     */
     /******************************************* 3rd ************ 4th ***********/
     #define SQLITE_CREATE_INDEX          1   /* Index Name      Table Name      */
    @@ -2025,72 +2413,83 @@ SQLITE_API int sqlite3_set_authorizer(
     #define SQLITE_COPY                  0   /* No longer used */
     
     /*
    -** CAPI3REF: Tracing And Profiling Functions {H12280} 
    -** EXPERIMENTAL
    +** CAPI3REF: Tracing And Profiling Functions
     **
     ** These routines register callback functions that can be used for
     ** tracing and profiling the execution of SQL statements.
     **
    -** The callback function registered by sqlite3_trace() is invoked at
    +** ^The callback function registered by sqlite3_trace() is invoked at
     ** various times when an SQL statement is being run by [sqlite3_step()].
    -** The callback returns a UTF-8 rendering of the SQL statement text
    -** as the statement first begins executing.  Additional callbacks occur
    +** ^The sqlite3_trace() callback is invoked with a UTF-8 rendering of the
    +** SQL statement text as the statement first begins executing.
    +** ^(Additional sqlite3_trace() callbacks might occur
     ** as each triggered subprogram is entered.  The callbacks for triggers
    -** contain a UTF-8 SQL comment that identifies the trigger.
    +** contain a UTF-8 SQL comment that identifies the trigger.)^
     **
    -** The callback function registered by sqlite3_profile() is invoked
    -** as each SQL statement finishes.  The profile callback contains
    +** ^The callback function registered by sqlite3_profile() is invoked
    +** as each SQL statement finishes.  ^The profile callback contains
     ** the original statement text and an estimate of wall-clock time
    -** of how long that statement took to run.
    -**
    -** Requirements:
    -** [H12281] [H12282] [H12283] [H12284] [H12285] [H12287] [H12288] [H12289]
    -** [H12290]
    +** of how long that statement took to run.  ^The profile callback
    +** time is in units of nanoseconds, however the current implementation
    +** is only capable of millisecond resolution so the six least significant
    +** digits in the time are meaningless.  Future versions of SQLite
    +** might provide greater resolution on the profiler callback.  The
    +** sqlite3_profile() function is considered experimental and is
    +** subject to change in future versions of SQLite.
     */
    -SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
    +SQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
     SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
        void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
     
     /*
    -** CAPI3REF: Query Progress Callbacks {H12910} 
    +** CAPI3REF: Query Progress Callbacks
     **
    -** This routine configures a callback function - the
    -** progress callback - that is invoked periodically during long
    -** running calls to [sqlite3_exec()], [sqlite3_step()] and
    -** [sqlite3_get_table()].  An example use for this
    +** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback
    +** function X to be invoked periodically during long running calls to
    +** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for
    +** database connection D.  An example use for this
     ** interface is to keep a GUI updated during a large query.
     **
    -** If the progress callback returns non-zero, the operation is
    +** ^The parameter P is passed through as the only parameter to the 
    +** callback function X.  ^The parameter N is the number of 
    +** [virtual machine instructions] that are evaluated between successive
    +** invocations of the callback X.
    +**
    +** ^Only a single progress handler may be defined at one time per
    +** [database connection]; setting a new progress handler cancels the
    +** old one.  ^Setting parameter X to NULL disables the progress handler.
    +** ^The progress handler is also disabled by setting N to a value less
    +** than 1.
    +**
    +** ^If the progress callback returns non-zero, the operation is
     ** interrupted.  This feature can be used to implement a
     ** "Cancel" button on a GUI progress dialog box.
     **
    -** The progress handler must not do anything that will modify
    +** The progress handler callback must not do anything that will modify
     ** the database connection that invoked the progress handler.
     ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
     ** database connections for the meaning of "modify" in this paragraph.
     **
    -** Requirements:
    -** [H12911] [H12912] [H12913] [H12914] [H12915] [H12916] [H12917] [H12918]
    -**
     */
     SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
     
     /*
    -** CAPI3REF: Opening A New Database Connection {H12700} 
    +** CAPI3REF: Opening A New Database Connection
     **
    -** These routines open an SQLite database file whose name is given by the
    -** filename argument. The filename argument is interpreted as UTF-8 for
    +** ^These routines open an SQLite database file whose name is given by the
    +** filename argument. ^The filename argument is interpreted as UTF-8 for
     ** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte
    -** order for sqlite3_open16(). A [database connection] handle is usually
    +** order for sqlite3_open16(). ^(A [database connection] handle is usually
     ** returned in *ppDb, even if an error occurs.  The only exception is that
     ** if SQLite is unable to allocate memory to hold the [sqlite3] object,
     ** a NULL will be written into *ppDb instead of a pointer to the [sqlite3]
    -** object. If the database is opened (and/or created) successfully, then
    -** [SQLITE_OK] is returned.  Otherwise an [error code] is returned.  The
    +** object.)^ ^(If the database is opened (and/or created) successfully, then
    +** [SQLITE_OK] is returned.  Otherwise an [error code] is returned.)^ ^The
     ** [sqlite3_errmsg()] or [sqlite3_errmsg16()] routines can be used to obtain
    -** an English language description of the error.
    +** an English language description of the error following a failure of any
    +** of the sqlite3_open() routines.
     **
    -** The default encoding for the database will be UTF-8 if
    +** ^The default encoding for the database will be UTF-8 if
     ** sqlite3_open() or sqlite3_open_v2() is called and
     ** UTF-16 in the native byte order if sqlite3_open16() is used.
     **
    @@ -2100,60 +2499,61 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
     **
     ** The sqlite3_open_v2() interface works like sqlite3_open()
     ** except that it accepts two additional parameters for additional control
    -** over the new database connection.  The flags parameter can take one of
    +** over the new database connection.  ^(The flags parameter to
    +** sqlite3_open_v2() can take one of
     ** the following three values, optionally combined with the 
     ** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE],
    -** and/or [SQLITE_OPEN_PRIVATECACHE] flags:
    +** and/or [SQLITE_OPEN_PRIVATECACHE] flags:)^
     **
     ** 
    -**
    [SQLITE_OPEN_READONLY]
    +** ^(
    [SQLITE_OPEN_READONLY]
    **
    The database is opened in read-only mode. If the database does not -** already exist, an error is returned.
    +** already exist, an error is returned.)^ ** -**
    [SQLITE_OPEN_READWRITE]
    +** ^(
    [SQLITE_OPEN_READWRITE]
    **
    The database is opened for reading and writing if possible, or reading ** only if the file is write protected by the operating system. In either -** case the database must already exist, otherwise an error is returned.
    +** case the database must already exist, otherwise an error is returned.)^ ** -**
    [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]
    +** ^(
    [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]
    **
    The database is opened for reading and writing, and is creates it if ** it does not already exist. This is the behavior that is always used for -** sqlite3_open() and sqlite3_open16().
    +** sqlite3_open() and sqlite3_open16().)^ **
    ** ** If the 3rd parameter to sqlite3_open_v2() is not one of the ** combinations shown above or one of the combinations shown above combined ** with the [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], -** [SQLITE_OPEN_SHAREDCACHE] and/or [SQLITE_OPEN_SHAREDCACHE] flags, +** [SQLITE_OPEN_SHAREDCACHE] and/or [SQLITE_OPEN_PRIVATECACHE] flags, ** then the behavior is undefined. ** -** If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection +** ^If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection ** opens in the multi-thread [threading mode] as long as the single-thread -** mode has not been set at compile-time or start-time. If the +** mode has not been set at compile-time or start-time. ^If the ** [SQLITE_OPEN_FULLMUTEX] flag is set then the database connection opens ** in the serialized [threading mode] unless single-thread was ** previously selected at compile-time or start-time. -** The [SQLITE_OPEN_SHAREDCACHE] flag causes the database connection to be +** ^The [SQLITE_OPEN_SHAREDCACHE] flag causes the database connection to be ** eligible to use [shared cache mode], regardless of whether or not shared -** cache is enabled using [sqlite3_enable_shared_cache()]. The +** cache is enabled using [sqlite3_enable_shared_cache()]. ^The ** [SQLITE_OPEN_PRIVATECACHE] flag causes the database connection to not ** participate in [shared cache mode] even if it is enabled. ** -** If the filename is ":memory:", then a private, temporary in-memory database -** is created for the connection. This in-memory database will vanish when +** ^If the filename is ":memory:", then a private, temporary in-memory database +** is created for the connection. ^This in-memory database will vanish when ** the database connection is closed. Future versions of SQLite might ** make use of additional special filenames that begin with the ":" character. ** It is recommended that when a database filename actually does begin with ** a ":" character you should prefix the filename with a pathname such as ** "./" to avoid ambiguity. ** -** If the filename is an empty string, then a private, temporary -** on-disk database will be created. This private database will be +** ^If the filename is an empty string, then a private, temporary +** on-disk database will be created. ^This private database will be ** automatically deleted as soon as the database connection is closed. ** -** The fourth parameter to sqlite3_open_v2() is the name of the +** ^The fourth parameter to sqlite3_open_v2() is the name of the ** [sqlite3_vfs] object that defines the operating system interface that -** the new database connection should use. If the fourth parameter is +** the new database connection should use. ^If the fourth parameter is ** a NULL pointer then the default [sqlite3_vfs] object is used. ** ** Note to Windows users: The encoding used for the filename argument @@ -2161,10 +2561,6 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** codepage is currently defined. Filenames containing international ** characters must be converted to UTF-8 prior to passing them into ** sqlite3_open() or sqlite3_open_v2(). -** -** Requirements: -** [H12701] [H12702] [H12703] [H12704] [H12706] [H12707] [H12709] [H12711] -** [H12712] [H12713] [H12714] [H12717] [H12719] [H12721] [H12723] */ SQLITE_API int sqlite3_open( const char *filename, /* Database filename (UTF-8) */ @@ -2182,23 +2578,23 @@ SQLITE_API int sqlite3_open_v2( ); /* -** CAPI3REF: Error Codes And Messages {H12800} +** CAPI3REF: Error Codes And Messages ** -** The sqlite3_errcode() interface returns the numeric [result code] or +** ^The sqlite3_errcode() interface returns the numeric [result code] or ** [extended result code] for the most recent failed sqlite3_* API call ** associated with a [database connection]. If a prior API call failed ** but the most recent API call succeeded, the return value from -** sqlite3_errcode() is undefined. The sqlite3_extended_errcode() +** sqlite3_errcode() is undefined. ^The sqlite3_extended_errcode() ** interface is the same except that it always returns the ** [extended result code] even when extended result codes are ** disabled. ** -** The sqlite3_errmsg() and sqlite3_errmsg16() return English-language +** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language ** text that describes the error, as either UTF-8 or UTF-16 respectively. -** Memory to hold the error message string is managed internally. +** ^(Memory to hold the error message string is managed internally. ** The application does not need to worry about freeing the result. ** However, the error string might be overwritten or deallocated by -** subsequent calls to other SQLite interface functions. +** subsequent calls to other SQLite interface functions.)^ ** ** When the serialized [threading mode] is in use, it might be the ** case that a second error occurs on a separate thread in between @@ -2213,9 +2609,6 @@ SQLITE_API int sqlite3_open_v2( ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. -** -** Requirements: -** [H12801] [H12802] [H12803] [H12807] [H12808] [H12809] */ SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); @@ -2223,7 +2616,7 @@ SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); /* -** CAPI3REF: SQL Statement Object {H13000} +** CAPI3REF: SQL Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement. @@ -2249,25 +2642,30 @@ SQLITE_API const void *sqlite3_errmsg16(sqlite3*); typedef struct sqlite3_stmt sqlite3_stmt; /* -** CAPI3REF: Run-time Limits {H12760} +** CAPI3REF: Run-time Limits ** -** This interface allows the size of various constructs to be limited +** ^(This interface allows the size of various constructs to be limited ** on a connection by connection basis. The first parameter is the ** [database connection] whose limit is to be set or queried. The ** second parameter is one of the [limit categories] that define a ** class of constructs to be size limited. The third parameter is the -** new limit for that construct. The function returns the old limit. +** new limit for that construct.)^ ** -** If the new limit is a negative number, the limit is unchanged. -** For the limit category of SQLITE_LIMIT_XYZ there is a +** ^If the new limit is a negative number, the limit is unchanged. +** ^(For each limit category SQLITE_LIMIT_NAME there is a ** [limits | hard upper bound] -** set by a compile-time C preprocessor macro named -** [limits | SQLITE_MAX_XYZ]. -** (The "_LIMIT_" in the name is changed to "_MAX_".) -** Attempts to increase a limit above its hard upper bound are -** silently truncated to the hard upper limit. +** set at compile-time by a C preprocessor macro called +** [limits | SQLITE_MAX_NAME]. +** (The "_LIMIT_" in the name is changed to "_MAX_".))^ +** ^Attempts to increase a limit above its hard upper bound are +** silently truncated to the hard upper bound. ** -** Run time limits are intended for use in applications that manage +** ^Regardless of whether or not the limit was changed, the +** [sqlite3_limit()] interface returns the prior value of the limit. +** ^Hence, to find the current value of a limit without changing it, +** simply invoke this interface with the third parameter set to -1. +** +** Run-time limits are intended for use in applications that manage ** both their own internal database and also databases that are controlled ** by untrusted external sources. An example application might be a ** web browser that has its own databases for storing history and @@ -2281,14 +2679,11 @@ typedef struct sqlite3_stmt sqlite3_stmt; ** [max_page_count] [PRAGMA]. ** ** New run-time limit categories may be added in future releases. -** -** Requirements: -** [H12762] [H12766] [H12769] */ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); /* -** CAPI3REF: Run-Time Limit Categories {H12790} +** CAPI3REF: Run-Time Limit Categories ** KEYWORDS: {limit category} {*limit categories} ** ** These constants define various performance limits @@ -2297,43 +2692,44 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); ** Additional information is available at [limits | Limits in SQLite]. ** **
    -**
    SQLITE_LIMIT_LENGTH
    -**
    The maximum size of any string or BLOB or table row.
    +** ^(
    SQLITE_LIMIT_LENGTH
    +**
    The maximum size of any string or BLOB or table row, in bytes.
    )^ ** -**
    SQLITE_LIMIT_SQL_LENGTH
    -**
    The maximum length of an SQL statement.
    +** ^(
    SQLITE_LIMIT_SQL_LENGTH
    +**
    The maximum length of an SQL statement, in bytes.
    )^ ** -**
    SQLITE_LIMIT_COLUMN
    +** ^(
    SQLITE_LIMIT_COLUMN
    **
    The maximum number of columns in a table definition or in the ** result set of a [SELECT] or the maximum number of columns in an index -** or in an ORDER BY or GROUP BY clause.
    +** or in an ORDER BY or GROUP BY clause.)^ ** -**
    SQLITE_LIMIT_EXPR_DEPTH
    -**
    The maximum depth of the parse tree on any expression.
    +** ^(
    SQLITE_LIMIT_EXPR_DEPTH
    +**
    The maximum depth of the parse tree on any expression.
    )^ ** -**
    SQLITE_LIMIT_COMPOUND_SELECT
    -**
    The maximum number of terms in a compound SELECT statement.
    +** ^(
    SQLITE_LIMIT_COMPOUND_SELECT
    +**
    The maximum number of terms in a compound SELECT statement.
    )^ ** -**
    SQLITE_LIMIT_VDBE_OP
    +** ^(
    SQLITE_LIMIT_VDBE_OP
    **
    The maximum number of instructions in a virtual machine program -** used to implement an SQL statement.
    +** used to implement an SQL statement. This limit is not currently +** enforced, though that might be added in some future release of +** SQLite.)^ ** -**
    SQLITE_LIMIT_FUNCTION_ARG
    -**
    The maximum number of arguments on a function.
    +** ^(
    SQLITE_LIMIT_FUNCTION_ARG
    +**
    The maximum number of arguments on a function.
    )^ ** -**
    SQLITE_LIMIT_ATTACHED
    -**
    The maximum number of [ATTACH | attached databases].
    +** ^(
    SQLITE_LIMIT_ATTACHED
    +**
    The maximum number of [ATTACH | attached databases].)^
    ** -**
    SQLITE_LIMIT_LIKE_PATTERN_LENGTH
    +** ^(
    SQLITE_LIMIT_LIKE_PATTERN_LENGTH
    **
    The maximum length of the pattern argument to the [LIKE] or -** [GLOB] operators.
    +** [GLOB] operators.)^ ** -**
    SQLITE_LIMIT_VARIABLE_NUMBER
    -**
    The maximum number of variables in an SQL statement that can -** be bound.
    +** ^(
    SQLITE_LIMIT_VARIABLE_NUMBER
    +**
    The maximum index number of any [parameter] in an SQL statement.)^ ** -**
    SQLITE_LIMIT_TRIGGER_DEPTH
    -**
    The maximum depth of recursion for triggers.
    +** ^(
    SQLITE_LIMIT_TRIGGER_DEPTH
    +**
    The maximum depth of recursion for triggers.
    )^ **
    */ #define SQLITE_LIMIT_LENGTH 0 @@ -2349,7 +2745,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); #define SQLITE_LIMIT_TRIGGER_DEPTH 10 /* -** CAPI3REF: Compiling An SQL Statement {H13010} +** CAPI3REF: Compiling An SQL Statement ** KEYWORDS: {SQL statement compiler} ** ** To execute an SQL query, it must first be compiled into a byte-code @@ -2364,9 +2760,9 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); ** interfaces use UTF-8, and sqlite3_prepare16() and sqlite3_prepare16_v2() ** use UTF-16. ** -** If the nByte argument is less than zero, then zSql is read up to the -** first zero terminator. If nByte is non-negative, then it is the maximum -** number of bytes read from zSql. When nByte is non-negative, the +** ^If the nByte argument is less than zero, then zSql is read up to the +** first zero terminator. ^If nByte is non-negative, then it is the maximum +** number of bytes read from zSql. ^When nByte is non-negative, the ** zSql string ends at either the first '\000' or '\u0000' character or ** the nByte-th byte, whichever comes first. If the caller knows ** that the supplied string is nul-terminated, then there is a small @@ -2374,62 +2770,59 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); ** is equal to the number of bytes in the input string including ** the nul-terminator bytes. ** -** If pzTail is not NULL then *pzTail is made to point to the first byte +** ^If pzTail is not NULL then *pzTail is made to point to the first byte ** past the end of the first SQL statement in zSql. These routines only ** compile the first statement in zSql, so *pzTail is left pointing to ** what remains uncompiled. ** -** *ppStmt is left pointing to a compiled [prepared statement] that can be -** executed using [sqlite3_step()]. If there is an error, *ppStmt is set -** to NULL. If the input text contains no SQL (if the input is an empty +** ^*ppStmt is left pointing to a compiled [prepared statement] that can be +** executed using [sqlite3_step()]. ^If there is an error, *ppStmt is set +** to NULL. ^If the input text contains no SQL (if the input is an empty ** string or a comment) then *ppStmt is set to NULL. ** The calling procedure is responsible for deleting the compiled ** SQL statement using [sqlite3_finalize()] after it has finished with it. ** ppStmt may not be NULL. ** -** On success, [SQLITE_OK] is returned, otherwise an [error code] is returned. +** ^On success, the sqlite3_prepare() family of routines return [SQLITE_OK]; +** otherwise an [error code] is returned. ** ** The sqlite3_prepare_v2() and sqlite3_prepare16_v2() interfaces are ** recommended for all new programs. The two older interfaces are retained ** for backwards compatibility, but their use is discouraged. -** In the "v2" interfaces, the prepared statement +** ^In the "v2" interfaces, the prepared statement ** that is returned (the [sqlite3_stmt] object) contains a copy of the ** original SQL text. This causes the [sqlite3_step()] interface to -** behave a differently in three ways: +** behave differently in three ways: ** **
      **
    1. -** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it +** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it ** always used to do, [sqlite3_step()] will automatically recompile the SQL -** statement and try to run it again. If the schema has changed in -** a way that makes the statement no longer valid, [sqlite3_step()] will still -** return [SQLITE_SCHEMA]. But unlike the legacy behavior, [SQLITE_SCHEMA] is -** now a fatal error. Calling [sqlite3_prepare_v2()] again will not make the -** error go away. Note: use [sqlite3_errmsg()] to find the text -** of the parsing error that results in an [SQLITE_SCHEMA] return. +** statement and try to run it again. **
    2. ** **
    3. -** When an error occurs, [sqlite3_step()] will return one of the detailed -** [error codes] or [extended error codes]. The legacy behavior was that +** ^When an error occurs, [sqlite3_step()] will return one of the detailed +** [error codes] or [extended error codes]. ^The legacy behavior was that ** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code -** and you would have to make a second call to [sqlite3_reset()] in order -** to find the underlying cause of the problem. With the "v2" prepare +** and the application would have to make a second call to [sqlite3_reset()] +** in order to find the underlying cause of the problem. With the "v2" prepare ** interfaces, the underlying reason for the error is returned immediately. **
    4. ** **
    5. -** ^If the value of a [parameter | host parameter] in the WHERE clause might -** change the query plan for a statement, then the statement may be -** automatically recompiled (as if there had been a schema change) on the first -** [sqlite3_step()] call following any change to the -** [sqlite3_bind_text | bindings] of the [parameter]. +** ^If the specific value bound to [parameter | host parameter] in the +** WHERE clause might influence the choice of query plan for a statement, +** then the statement will be automatically recompiled, as if there had been +** a schema change, on the first [sqlite3_step()] call following any change +** to the [sqlite3_bind_text | bindings] of that [parameter]. +** ^The specific value of WHERE-clause [parameter] might influence the +** choice of query plan if the parameter is the left-hand side of a [LIKE] +** or [GLOB] operator or if the parameter is compared to an indexed column +** and the [SQLITE_ENABLE_STAT2] compile-time option is enabled. +** the **
    6. **
    -** -** Requirements: -** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021] -** */ SQLITE_API int sqlite3_prepare( sqlite3 *db, /* Database handle */ @@ -2461,24 +2854,21 @@ SQLITE_API int sqlite3_prepare16_v2( ); /* -** CAPI3REF: Retrieving Statement SQL {H13100} +** CAPI3REF: Retrieving Statement SQL ** -** This interface can be used to retrieve a saved copy of the original +** ^This interface can be used to retrieve a saved copy of the original ** SQL text used to create a [prepared statement] if that statement was ** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()]. -** -** Requirements: -** [H13101] [H13102] [H13103] */ SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); /* -** CAPI3REF: Dynamically Typed Value Object {H15000} +** CAPI3REF: Dynamically Typed Value Object ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} ** ** SQLite uses the sqlite3_value object to represent all values ** that can be stored in a database table. SQLite uses dynamic typing -** for the values it stores. Values stored in sqlite3_value objects +** for the values it stores. ^Values stored in sqlite3_value objects ** can be integers, floating point values, strings, BLOBs, or NULL. ** ** An sqlite3_value object may be either "protected" or "unprotected". @@ -2497,12 +2887,12 @@ SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); ** then there is no distinction between protected and unprotected ** sqlite3_value objects and they can be used interchangeably. However, ** for maximum code portability it is recommended that applications -** still make the distinction between between protected and unprotected +** still make the distinction between protected and unprotected ** sqlite3_value objects even when not strictly required. ** -** The sqlite3_value objects that are passed as parameters into the +** ^The sqlite3_value objects that are passed as parameters into the ** implementation of [application-defined SQL functions] are protected. -** The sqlite3_value object returned by +** ^The sqlite3_value object returned by ** [sqlite3_column_value()] is unprotected. ** Unprotected sqlite3_value objects may only be used with ** [sqlite3_result_value()] and [sqlite3_bind_value()]. @@ -2512,10 +2902,10 @@ SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); typedef struct Mem sqlite3_value; /* -** CAPI3REF: SQL Function Context Object {H16001} +** CAPI3REF: SQL Function Context Object ** ** The context in which an SQL function executes is stored in an -** sqlite3_context object. A pointer to an sqlite3_context object +** sqlite3_context object. ^A pointer to an sqlite3_context object ** is always first parameter to [application-defined SQL functions]. ** The application-defined SQL function implementation will pass this ** pointer through into calls to [sqlite3_result_int | sqlite3_result()], @@ -2526,11 +2916,11 @@ typedef struct Mem sqlite3_value; typedef struct sqlite3_context sqlite3_context; /* -** CAPI3REF: Binding Values To Prepared Statements {H13500} +** CAPI3REF: Binding Values To Prepared Statements ** KEYWORDS: {host parameter} {host parameters} {host parameter name} ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} ** -** In the SQL strings input to [sqlite3_prepare_v2()] and its variants, +** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants, ** literals may be replaced by a [parameter] that matches one of following ** templates: ** @@ -2543,72 +2933,66 @@ typedef struct sqlite3_context sqlite3_context; ** ** ** In the templates above, NNN represents an integer literal, -** and VVV represents an alphanumeric identifer. The values of these +** and VVV represents an alphanumeric identifier.)^ ^The values of these ** parameters (also called "host parameter names" or "SQL parameters") ** can be set using the sqlite3_bind_*() routines defined here. ** -** The first argument to the sqlite3_bind_*() routines is always +** ^The first argument to the sqlite3_bind_*() routines is always ** a pointer to the [sqlite3_stmt] object returned from ** [sqlite3_prepare_v2()] or its variants. ** -** The second argument is the index of the SQL parameter to be set. -** The leftmost SQL parameter has an index of 1. When the same named +** ^The second argument is the index of the SQL parameter to be set. +** ^The leftmost SQL parameter has an index of 1. ^When the same named ** SQL parameter is used more than once, second and subsequent ** occurrences have the same index as the first occurrence. -** The index for named parameters can be looked up using the -** [sqlite3_bind_parameter_index()] API if desired. The index +** ^The index for named parameters can be looked up using the +** [sqlite3_bind_parameter_index()] API if desired. ^The index ** for "?NNN" parameters is the value of NNN. -** The NNN value must be between 1 and the [sqlite3_limit()] +** ^The NNN value must be between 1 and the [sqlite3_limit()] ** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999). ** -** The third argument is the value to bind to the parameter. +** ^The third argument is the value to bind to the parameter. ** -** In those routines that have a fourth argument, its value is the +** ^(In those routines that have a fourth argument, its value is the ** number of bytes in the parameter. To be clear: the value is the -** number of bytes in the value, not the number of characters. -** If the fourth parameter is negative, the length of the string is +** number of bytes in the value, not the number of characters.)^ +** ^If the fourth parameter is negative, the length of the string is ** the number of bytes up to the first zero terminator. ** -** The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and +** ^The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and ** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or -** string after SQLite has finished with it. If the fifth argument is +** string after SQLite has finished with it. ^If the fifth argument is ** the special value [SQLITE_STATIC], then SQLite assumes that the ** information is in static, unmanaged space and does not need to be freed. -** If the fifth argument has the value [SQLITE_TRANSIENT], then +** ^If the fifth argument has the value [SQLITE_TRANSIENT], then ** SQLite makes its own private copy of the data immediately, before ** the sqlite3_bind_*() routine returns. ** -** The sqlite3_bind_zeroblob() routine binds a BLOB of length N that -** is filled with zeroes. A zeroblob uses a fixed amount of memory +** ^The sqlite3_bind_zeroblob() routine binds a BLOB of length N that +** is filled with zeroes. ^A zeroblob uses a fixed amount of memory ** (just an integer to hold its size) while it is being processed. ** Zeroblobs are intended to serve as placeholders for BLOBs whose ** content is later written using ** [sqlite3_blob_open | incremental BLOB I/O] routines. -** A negative value for the zeroblob results in a zero-length BLOB. +** ^A negative value for the zeroblob results in a zero-length BLOB. ** -** The sqlite3_bind_*() routines must be called after -** [sqlite3_prepare_v2()] (and its variants) or [sqlite3_reset()] and -** before [sqlite3_step()]. -** Bindings are not cleared by the [sqlite3_reset()] routine. -** Unbound parameters are interpreted as NULL. +** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer +** for the [prepared statement] or with a prepared statement for which +** [sqlite3_step()] has been called more recently than [sqlite3_reset()], +** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_() +** routine is passed a [prepared statement] that has been finalized, the +** result is undefined and probably harmful. ** -** These routines return [SQLITE_OK] on success or an error code if -** anything goes wrong. [SQLITE_RANGE] is returned if the parameter -** index is out of range. [SQLITE_NOMEM] is returned if malloc() fails. -** [SQLITE_MISUSE] might be returned if these routines are called on a -** virtual machine that is the wrong state or which has already been finalized. -** Detection of misuse is unreliable. Applications should not depend -** on SQLITE_MISUSE returns. SQLITE_MISUSE is intended to indicate a -** a logic error in the application. Future versions of SQLite might -** panic rather than return SQLITE_MISUSE. +** ^Bindings are not cleared by the [sqlite3_reset()] routine. +** ^Unbound parameters are interpreted as NULL. +** +** ^The sqlite3_bind_* routines return [SQLITE_OK] on success or an +** [error code] if anything goes wrong. +** ^[SQLITE_RANGE] is returned if the parameter +** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. ** ** See also: [sqlite3_bind_parameter_count()], ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13506] [H13509] [H13512] [H13515] [H13518] [H13521] [H13524] [H13527] -** [H13530] [H13533] [H13536] [H13539] [H13542] [H13545] [H13548] [H13551] -** */ SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double); @@ -2621,45 +3005,42 @@ SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); /* -** CAPI3REF: Number Of SQL Parameters {H13600} +** CAPI3REF: Number Of SQL Parameters ** -** This routine can be used to find the number of [SQL parameters] +** ^This routine can be used to find the number of [SQL parameters] ** in a [prepared statement]. SQL parameters are tokens of the ** form "?", "?NNN", ":AAA", "$AAA", or "@AAA" that serve as ** placeholders for values that are [sqlite3_bind_blob | bound] ** to the parameters at a later time. ** -** This routine actually returns the index of the largest (rightmost) +** ^(This routine actually returns the index of the largest (rightmost) ** parameter. For all forms except ?NNN, this will correspond to the -** number of unique parameters. If parameters of the ?NNN are used, -** there may be gaps in the list. +** number of unique parameters. If parameters of the ?NNN form are used, +** there may be gaps in the list.)^ ** ** See also: [sqlite3_bind_blob|sqlite3_bind()], ** [sqlite3_bind_parameter_name()], and ** [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13601] */ SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*); /* -** CAPI3REF: Name Of A Host Parameter {H13620} +** CAPI3REF: Name Of A Host Parameter ** -** This routine returns a pointer to the name of the n-th -** [SQL parameter] in a [prepared statement]. -** SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA" +** ^The sqlite3_bind_parameter_name(P,N) interface returns +** the name of the N-th [SQL parameter] in the [prepared statement] P. +** ^(SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA" ** have a name which is the string "?NNN" or ":AAA" or "@AAA" or "$AAA" ** respectively. ** In other words, the initial ":" or "$" or "@" or "?" -** is included as part of the name. -** Parameters of the form "?" without a following integer have no name -** and are also referred to as "anonymous parameters". +** is included as part of the name.)^ +** ^Parameters of the form "?" without a following integer have no name +** and are referred to as "nameless" or "anonymous parameters". ** -** The first host parameter has an index of 1, not 0. +** ^The first host parameter has an index of 1, not 0. ** -** If the value n is out of range or if the n-th parameter is -** nameless, then NULL is returned. The returned string is +** ^If the value N is out of range or if the N-th parameter is +** nameless, then NULL is returned. ^The returned string is ** always in UTF-8 encoding even if the named parameter was ** originally specified as UTF-16 in [sqlite3_prepare16()] or ** [sqlite3_prepare16_v2()]. @@ -2667,125 +3048,110 @@ SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*); ** See also: [sqlite3_bind_blob|sqlite3_bind()], ** [sqlite3_bind_parameter_count()], and ** [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13621] */ SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int); /* -** CAPI3REF: Index Of A Parameter With A Given Name {H13640} +** CAPI3REF: Index Of A Parameter With A Given Name ** -** Return the index of an SQL parameter given its name. The +** ^Return the index of an SQL parameter given its name. ^The ** index value returned is suitable for use as the second -** parameter to [sqlite3_bind_blob|sqlite3_bind()]. A zero -** is returned if no matching parameter is found. The parameter +** parameter to [sqlite3_bind_blob|sqlite3_bind()]. ^A zero +** is returned if no matching parameter is found. ^The parameter ** name must be given in UTF-8 even if the original statement ** was prepared from UTF-16 text using [sqlite3_prepare16_v2()]. ** ** See also: [sqlite3_bind_blob|sqlite3_bind()], ** [sqlite3_bind_parameter_count()], and ** [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13641] */ SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); /* -** CAPI3REF: Reset All Bindings On A Prepared Statement {H13660} +** CAPI3REF: Reset All Bindings On A Prepared Statement ** -** Contrary to the intuition of many, [sqlite3_reset()] does not reset +** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset ** the [sqlite3_bind_blob | bindings] on a [prepared statement]. -** Use this routine to reset all host parameters to NULL. -** -** Requirements: -** [H13661] +** ^Use this routine to reset all host parameters to NULL. */ SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*); /* -** CAPI3REF: Number Of Columns In A Result Set {H13710} +** CAPI3REF: Number Of Columns In A Result Set ** -** Return the number of columns in the result set returned by the -** [prepared statement]. This routine returns 0 if pStmt is an SQL +** ^Return the number of columns in the result set returned by the +** [prepared statement]. ^This routine returns 0 if pStmt is an SQL ** statement that does not return data (for example an [UPDATE]). ** -** Requirements: -** [H13711] +** See also: [sqlite3_data_count()] */ SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt); /* -** CAPI3REF: Column Names In A Result Set {H13720} +** CAPI3REF: Column Names In A Result Set ** -** These routines return the name assigned to a particular column -** in the result set of a [SELECT] statement. The sqlite3_column_name() +** ^These routines return the name assigned to a particular column +** in the result set of a [SELECT] statement. ^The sqlite3_column_name() ** interface returns a pointer to a zero-terminated UTF-8 string ** and sqlite3_column_name16() returns a pointer to a zero-terminated -** UTF-16 string. The first parameter is the [prepared statement] -** that implements the [SELECT] statement. The second parameter is the -** column number. The leftmost column is number 0. +** UTF-16 string. ^The first parameter is the [prepared statement] +** that implements the [SELECT] statement. ^The second parameter is the +** column number. ^The leftmost column is number 0. ** -** The returned string pointer is valid until either the [prepared statement] +** ^The returned string pointer is valid until either the [prepared statement] ** is destroyed by [sqlite3_finalize()] or until the next call to ** sqlite3_column_name() or sqlite3_column_name16() on the same column. ** -** If sqlite3_malloc() fails during the processing of either routine +** ^If sqlite3_malloc() fails during the processing of either routine ** (for example during a conversion from UTF-8 to UTF-16) then a ** NULL pointer is returned. ** -** The name of a result column is the value of the "AS" clause for +** ^The name of a result column is the value of the "AS" clause for ** that column, if there is an AS clause. If there is no AS clause ** then the name of the column is unspecified and may change from ** one release of SQLite to the next. -** -** Requirements: -** [H13721] [H13723] [H13724] [H13725] [H13726] [H13727] */ SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N); SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N); /* -** CAPI3REF: Source Of Data In A Query Result {H13740} +** CAPI3REF: Source Of Data In A Query Result ** -** These routines provide a means to determine what column of what -** table in which database a result of a [SELECT] statement comes from. -** The name of the database or table or column can be returned as -** either a UTF-8 or UTF-16 string. The _database_ routines return +** ^These routines provide a means to determine the database, table, and +** table column that is the origin of a particular result column in +** [SELECT] statement. +** ^The name of the database or table or column can be returned as +** either a UTF-8 or UTF-16 string. ^The _database_ routines return ** the database name, the _table_ routines return the table name, and ** the origin_ routines return the column name. -** The returned string is valid until the [prepared statement] is destroyed +** ^The returned string is valid until the [prepared statement] is destroyed ** using [sqlite3_finalize()] or until the same information is requested ** again in a different encoding. ** -** The names returned are the original un-aliased names of the +** ^The names returned are the original un-aliased names of the ** database, table, and column. ** -** The first argument to the following calls is a [prepared statement]. -** These functions return information about the Nth column returned by +** ^The first argument to these interfaces is a [prepared statement]. +** ^These functions return information about the Nth result column returned by ** the statement, where N is the second function argument. +** ^The left-most column is column 0 for these routines. ** -** If the Nth column returned by the statement is an expression or +** ^If the Nth column returned by the statement is an expression or ** subquery and is not a column value, then all of these functions return -** NULL. These routine might also return NULL if a memory allocation error -** occurs. Otherwise, they return the name of the attached database, table -** and column that query result column was extracted from. +** NULL. ^These routine might also return NULL if a memory allocation error +** occurs. ^Otherwise, they return the name of the attached database, table, +** or column that query result column was extracted from. ** -** As with all other SQLite APIs, those postfixed with "16" return -** UTF-16 encoded strings, the other functions return UTF-8. {END} +** ^As with all other SQLite APIs, those whose names end with "16" return +** UTF-16 encoded strings and the other functions return UTF-8. ** -** These APIs are only available if the library was compiled with the -** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined. +** ^These APIs are only available if the library was compiled with the +** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** -** {A13751} ** If two or more threads call one or more of these routines against the same ** prepared statement and column at the same time then the results are ** undefined. ** -** Requirements: -** [H13741] [H13742] [H13743] [H13744] [H13745] [H13746] [H13748] -** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column @@ -2799,17 +3165,17 @@ SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); /* -** CAPI3REF: Declared Datatype Of A Query Result {H13760} +** CAPI3REF: Declared Datatype Of A Query Result ** -** The first parameter is a [prepared statement]. +** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table -** column is returned. If the Nth column of the result set is an +** column is returned.)^ ^If the Nth column of the result set is an ** expression or subquery, then a NULL pointer is returned. -** The returned string is always UTF-8 encoded. {END} +** ^The returned string is always UTF-8 encoded. ** -** For example, given the database schema: +** ^(For example, given the database schema: ** ** CREATE TABLE t1(c1 VARIANT); ** @@ -2818,23 +3184,20 @@ SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); ** SELECT c1 + 1, c1 FROM t1; ** ** this routine would return the string "VARIANT" for the second result -** column (i==1), and a NULL pointer for the first result column (i==0). +** column (i==1), and a NULL pointer for the first result column (i==0).)^ ** -** SQLite uses dynamic run-time typing. So just because a column +** ^SQLite uses dynamic run-time typing. ^So just because a column ** is declared to contain a particular type does not mean that the ** data stored in that column is of the declared type. SQLite is -** strongly typed, but the typing is dynamic not static. Type +** strongly typed, but the typing is dynamic not static. ^Type ** is associated with individual values, not with the containers ** used to hold those values. -** -** Requirements: -** [H13761] [H13762] [H13763] */ SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); /* -** CAPI3REF: Evaluate An SQL Statement {H13200} +** CAPI3REF: Evaluate An SQL Statement ** ** After a [prepared statement] has been prepared using either ** [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] or one of the legacy @@ -2848,35 +3211,35 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** new "v2" interface is recommended for new applications but the legacy ** interface will continue to be supported. ** -** In the legacy interface, the return value will be either [SQLITE_BUSY], +** ^In the legacy interface, the return value will be either [SQLITE_BUSY], ** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. -** With the "v2" interface, any of the other [result codes] or +** ^With the "v2" interface, any of the other [result codes] or ** [extended result codes] might be returned as well. ** -** [SQLITE_BUSY] means that the database engine was unable to acquire the -** database locks it needs to do its job. If the statement is a [COMMIT] +** ^[SQLITE_BUSY] means that the database engine was unable to acquire the +** database locks it needs to do its job. ^If the statement is a [COMMIT] ** or occurs outside of an explicit transaction, then you can retry the ** statement. If the statement is not a [COMMIT] and occurs within a ** explicit transaction then you should rollback the transaction before ** continuing. ** -** [SQLITE_DONE] means that the statement has finished executing +** ^[SQLITE_DONE] means that the statement has finished executing ** successfully. sqlite3_step() should not be called again on this virtual ** machine without first calling [sqlite3_reset()] to reset the virtual ** machine back to its initial state. ** -** If the SQL statement being executed returns any data, then [SQLITE_ROW] +** ^If the SQL statement being executed returns any data, then [SQLITE_ROW] ** is returned each time a new row of data is ready for processing by the ** caller. The values may be accessed using the [column access functions]. ** sqlite3_step() is called again to retrieve the next row of data. ** -** [SQLITE_ERROR] means that a run-time error (such as a constraint +** ^[SQLITE_ERROR] means that a run-time error (such as a constraint ** violation) has occurred. sqlite3_step() should not be called again on ** the VM. More information may be found by calling [sqlite3_errmsg()]. -** With the legacy interface, a more specific error code (for example, +** ^With the legacy interface, a more specific error code (for example, ** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) ** can be obtained by calling [sqlite3_reset()] on the -** [prepared statement]. In the "v2" interface, +** [prepared statement]. ^In the "v2" interface, ** the more specific error code is returned directly by sqlite3_step(). ** ** [SQLITE_MISUSE] means that the this routine was called inappropriately. @@ -2886,6 +3249,14 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** be the case that the same database connection is being used by two or ** more threads at the same moment in time. ** +** For all versions of SQLite up to and including 3.6.23.1, it was required +** after sqlite3_step() returned anything other than [SQLITE_ROW] that +** [sqlite3_reset()] be called before any subsequent invocation of +** sqlite3_step(). Failure to invoke [sqlite3_reset()] in this way would +** result in an [SQLITE_MISUSE] return from sqlite3_step(). But after +** version 3.6.23.1, sqlite3_step() began calling [sqlite3_reset()] +** automatically in this circumstance rather than returning [SQLITE_MISUSE]. +** ** Goofy Interface Alert: In the legacy interface, the sqlite3_step() ** API always returns a generic error code, [SQLITE_ERROR], following any ** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call @@ -2897,27 +3268,28 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, ** then the more specific [error codes] are returned directly ** by sqlite3_step(). The use of the "v2" interface is recommended. -** -** Requirements: -** [H13202] [H15304] [H15306] [H15308] [H15310] */ SQLITE_API int sqlite3_step(sqlite3_stmt*); /* -** CAPI3REF: Number of columns in a result set {H13770} +** CAPI3REF: Number of columns in a result set ** -** Returns the number of values in the current row of the result set. +** ^The sqlite3_data_count(P) interface returns the number of columns in the +** current row of the result set of [prepared statement] P. +** ^If prepared statement P does not have results ready to return +** (via calls to the [sqlite3_column_int | sqlite3_column_*()] of +** interfaces) then sqlite3_data_count(P) returns 0. +** ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer. ** -** Requirements: -** [H13771] [H13772] +** See also: [sqlite3_column_count()] */ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); /* -** CAPI3REF: Fundamental Datatypes {H10265} +** CAPI3REF: Fundamental Datatypes ** KEYWORDS: SQLITE_TEXT ** -** {H10266} Every value in SQLite has one of five fundamental datatypes: +** ^(Every value in SQLite has one of five fundamental datatypes: ** **
      **
    • 64-bit signed integer @@ -2925,7 +3297,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); **
    • string **
    • BLOB **
    • NULL -**
    {END} +** )^ ** ** These constants are codes for each of those types. ** @@ -2946,18 +3318,18 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); #define SQLITE3_TEXT 3 /* -** CAPI3REF: Result Values From A Query {H13800} +** CAPI3REF: Result Values From A Query ** KEYWORDS: {column access functions} ** -** These routines form the "result set query" interface. +** These routines form the "result set" interface. ** -** These routines return information about a single column of the current -** result row of a query. In every case the first argument is a pointer +** ^These routines return information about a single column of the current +** result row of a query. ^In every case the first argument is a pointer ** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*] ** that was returned from [sqlite3_prepare_v2()] or one of its variants) ** and the second argument is the index of the column for which information -** should be returned. The leftmost column of the result set has the index 0. -** The number of columns in the result can be determined using +** should be returned. ^The leftmost column of the result set has the index 0. +** ^The number of columns in the result can be determined using ** [sqlite3_column_count()]. ** ** If the SQL statement does not currently point to a valid row, or if the @@ -2972,9 +3344,9 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** are called from a different thread while any of these routines ** are pending, then the results are undefined. ** -** The sqlite3_column_type() routine returns the +** ^The sqlite3_column_type() routine returns the ** [SQLITE_INTEGER | datatype code] for the initial data type -** of the result column. The returned value is one of [SQLITE_INTEGER], +** of the result column. ^The returned value is one of [SQLITE_INTEGER], ** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL]. The value ** returned by sqlite3_column_type() is only meaningful if no type ** conversions have occurred as described below. After a type conversion, @@ -2982,27 +3354,35 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** versions of SQLite may change the behavior of sqlite3_column_type() ** following a type conversion. ** -** If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() +** ^If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() ** routine returns the number of bytes in that BLOB or string. -** If the result is a UTF-16 string, then sqlite3_column_bytes() converts +** ^If the result is a UTF-16 string, then sqlite3_column_bytes() converts ** the string to UTF-8 and then returns the number of bytes. -** If the result is a numeric value then sqlite3_column_bytes() uses +** ^If the result is a numeric value then sqlite3_column_bytes() uses ** [sqlite3_snprintf()] to convert that value to a UTF-8 string and returns ** the number of bytes in that string. -** The value returned does not include the zero terminator at the end -** of the string. For clarity: the value returned is the number of +** ^If the result is NULL, then sqlite3_column_bytes() returns zero. +** +** ^If the result is a BLOB or UTF-16 string then the sqlite3_column_bytes16() +** routine returns the number of bytes in that BLOB or string. +** ^If the result is a UTF-8 string, then sqlite3_column_bytes16() converts +** the string to UTF-16 and then returns the number of bytes. +** ^If the result is a numeric value then sqlite3_column_bytes16() uses +** [sqlite3_snprintf()] to convert that value to a UTF-16 string and returns +** the number of bytes in that string. +** ^If the result is NULL, then sqlite3_column_bytes16() returns zero. +** +** ^The values returned by [sqlite3_column_bytes()] and +** [sqlite3_column_bytes16()] do not include the zero terminators at the end +** of the string. ^For clarity: the values returned by +** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of ** bytes in the string, not the number of characters. ** -** Strings returned by sqlite3_column_text() and sqlite3_column_text16(), -** even empty strings, are always zero terminated. The return -** value from sqlite3_column_blob() for a zero-length BLOB is an arbitrary -** pointer, possibly even a NULL pointer. +** ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(), +** even empty strings, are always zero terminated. ^The return +** value from sqlite3_column_blob() for a zero-length BLOB is a NULL pointer. ** -** The sqlite3_column_bytes16() routine is similar to sqlite3_column_bytes() -** but leaves the result in UTF-16 in native byte order instead of UTF-8. -** The zero terminator is not included in this count. -** -** The object returned by [sqlite3_column_value()] is an +** ^The object returned by [sqlite3_column_value()] is an ** [unprotected sqlite3_value] object. An unprotected sqlite3_value object ** may only be used with [sqlite3_bind_value()] and [sqlite3_result_value()]. ** If the [unprotected sqlite3_value] object returned by @@ -3010,10 +3390,10 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** to routines like [sqlite3_value_int()], [sqlite3_value_text()], ** or [sqlite3_value_bytes()], then the behavior is undefined. ** -** These routines attempt to convert the value where appropriate. For +** These routines attempt to convert the value where appropriate. ^For ** example, if the internal representation is FLOAT and a text result ** is requested, [sqlite3_snprintf()] is used internally to perform the -** conversion automatically. The following table details the conversions +** conversion automatically. ^(The following table details the conversions ** that are applied: ** **
    @@ -3037,7 +3417,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** BLOB FLOAT Convert to TEXT then use atof() ** BLOB TEXT Add a zero terminator if needed ** -**
    +**
    )^ ** ** The table above makes reference to standard C library functions atoi() ** and atof(). SQLite does not really use these functions. It has its @@ -3063,9 +3443,9 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** to UTF-8.
  • ** ** -** Conversions between UTF-16be and UTF-16le are always done in place and do +** ^Conversions between UTF-16be and UTF-16le are always done in place and do ** not invalidate a prior pointer, though of course the content of the buffer -** that the prior pointer points to will have been modified. Other kinds +** that the prior pointer references will have been modified. Other kinds ** of conversion are done in place when it is possible, but sometimes they ** are not possible and in those cases prior pointers are invalidated. ** @@ -3086,22 +3466,18 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16() ** with calls to sqlite3_column_bytes(). ** -** The pointers returned are valid until a type conversion occurs as +** ^The pointers returned are valid until a type conversion occurs as ** described above, or until [sqlite3_step()] or [sqlite3_reset()] or -** [sqlite3_finalize()] is called. The memory space used to hold strings +** [sqlite3_finalize()] is called. ^The memory space used to hold strings ** and BLOBs is freed automatically. Do not pass the pointers returned ** [sqlite3_column_blob()], [sqlite3_column_text()], etc. into ** [sqlite3_free()]. ** -** If a memory allocation error occurs during the evaluation of any +** ^(If a memory allocation error occurs during the evaluation of any ** of these routines, a default value is returned. The default value ** is either the integer 0, the floating point number 0.0, or a NULL ** pointer. Subsequent calls to [sqlite3_errcode()] will return -** [SQLITE_NOMEM]. -** -** Requirements: -** [H13803] [H13806] [H13809] [H13812] [H13815] [H13818] [H13821] [H13824] -** [H13827] [H13830] +** [SQLITE_NOMEM].)^ */ SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol); SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol); @@ -3115,135 +3491,142 @@ SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol); SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol); /* -** CAPI3REF: Destroy A Prepared Statement Object {H13300} +** CAPI3REF: Destroy A Prepared Statement Object ** -** The sqlite3_finalize() function is called to delete a [prepared statement]. -** If the statement was executed successfully or not executed at all, then -** SQLITE_OK is returned. If execution of the statement failed then an -** [error code] or [extended error code] is returned. +** ^The sqlite3_finalize() function is called to delete a [prepared statement]. +** ^If the most recent evaluation of the statement encountered no errors or +** or if the statement is never been evaluated, then sqlite3_finalize() returns +** SQLITE_OK. ^If the most recent evaluation of statement S failed, then +** sqlite3_finalize(S) returns the appropriate [error code] or +** [extended error code]. ** -** This routine can be called at any point during the execution of the -** [prepared statement]. If the virtual machine has not -** completed execution when this routine is called, that is like -** encountering an error or an [sqlite3_interrupt | interrupt]. -** Incomplete updates may be rolled back and transactions canceled, -** depending on the circumstances, and the -** [error code] returned will be [SQLITE_ABORT]. +** ^The sqlite3_finalize(S) routine can be called at any point during +** the life cycle of [prepared statement] S: +** before statement S is ever evaluated, after +** one or more calls to [sqlite3_reset()], or after any call +** to [sqlite3_step()] regardless of whether or not the statement has +** completed execution. ** -** Requirements: -** [H11302] [H11304] +** ^Invoking sqlite3_finalize() on a NULL pointer is a harmless no-op. +** +** The application must finalize every [prepared statement] in order to avoid +** resource leaks. It is a grievous error for the application to try to use +** a prepared statement after it has been finalized. Any use of a prepared +** statement after it has been finalized can result in undefined and +** undesirable behavior such as segfaults and heap corruption. */ SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt); /* -** CAPI3REF: Reset A Prepared Statement Object {H13330} +** CAPI3REF: Reset A Prepared Statement Object ** ** The sqlite3_reset() function is called to reset a [prepared statement] ** object back to its initial state, ready to be re-executed. -** Any SQL statement variables that had values bound to them using +** ^Any SQL statement variables that had values bound to them using ** the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values. ** Use [sqlite3_clear_bindings()] to reset the bindings. ** -** {H11332} The [sqlite3_reset(S)] interface resets the [prepared statement] S -** back to the beginning of its program. +** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S +** back to the beginning of its program. ** -** {H11334} If the most recent call to [sqlite3_step(S)] for the -** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], -** or if [sqlite3_step(S)] has never before been called on S, -** then [sqlite3_reset(S)] returns [SQLITE_OK]. +** ^If the most recent call to [sqlite3_step(S)] for the +** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], +** or if [sqlite3_step(S)] has never before been called on S, +** then [sqlite3_reset(S)] returns [SQLITE_OK]. ** -** {H11336} If the most recent call to [sqlite3_step(S)] for the -** [prepared statement] S indicated an error, then -** [sqlite3_reset(S)] returns an appropriate [error code]. +** ^If the most recent call to [sqlite3_step(S)] for the +** [prepared statement] S indicated an error, then +** [sqlite3_reset(S)] returns an appropriate [error code]. ** -** {H11338} The [sqlite3_reset(S)] interface does not change the values -** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. +** ^The [sqlite3_reset(S)] interface does not change the values +** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. */ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); /* -** CAPI3REF: Create Or Redefine SQL Functions {H16100} +** CAPI3REF: Create Or Redefine SQL Functions ** KEYWORDS: {function creation routines} ** KEYWORDS: {application-defined SQL function} ** KEYWORDS: {application-defined SQL functions} ** -** These two functions (collectively known as "function creation routines") +** ^These functions (collectively known as "function creation routines") ** are used to add SQL functions or aggregates or to redefine the behavior -** of existing SQL functions or aggregates. The only difference between the -** two is that the second parameter, the name of the (scalar) function or -** aggregate, is encoded in UTF-8 for sqlite3_create_function() and UTF-16 -** for sqlite3_create_function16(). +** of existing SQL functions or aggregates. The only differences between +** these routines are the text encoding expected for +** the the second parameter (the name of the function being created) +** and the presence or absence of a destructor callback for +** the application data pointer. ** -** The first parameter is the [database connection] to which the SQL -** function is to be added. If a single program uses more than one database -** connection internally, then SQL functions must be added individually to -** each database connection. +** ^The first parameter is the [database connection] to which the SQL +** function is to be added. ^If an application uses more than one database +** connection then application-defined SQL functions must be added +** to each database connection separately. ** -** The second parameter is the name of the SQL function to be created or -** redefined. The length of the name is limited to 255 bytes, exclusive of -** the zero-terminator. Note that the name length limit is in bytes, not -** characters. Any attempt to create a function with a longer name -** will result in [SQLITE_ERROR] being returned. +** ^The second parameter is the name of the SQL function to be created or +** redefined. ^The length of the name is limited to 255 bytes in a UTF-8 +** representation, exclusive of the zero-terminator. ^Note that the name +** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. +** ^Any attempt to create a function with a longer name +** will result in [SQLITE_MISUSE] being returned. ** -** The third parameter (nArg) +** ^The third parameter (nArg) ** is the number of arguments that the SQL function or -** aggregate takes. If this parameter is -1, then the SQL function or +** aggregate takes. ^If this parameter is -1, then the SQL function or ** aggregate may take any number of arguments between 0 and the limit ** set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]). If the third ** parameter is less than -1 or greater than 127 then the behavior is ** undefined. ** -** The fourth parameter, eTextRep, specifies what +** ^The fourth parameter, eTextRep, specifies what ** [SQLITE_UTF8 | text encoding] this SQL function prefers for -** its parameters. Any SQL function implementation should be able to work -** work with UTF-8, UTF-16le, or UTF-16be. But some implementations may be -** more efficient with one encoding than another. An application may +** its parameters. Every SQL function implementation must be able to work +** with UTF-8, UTF-16le, or UTF-16be. But some implementations may be +** more efficient with one encoding than another. ^An application may ** invoke sqlite3_create_function() or sqlite3_create_function16() multiple ** times with the same function but with different values of eTextRep. -** When multiple implementations of the same function are available, SQLite +** ^When multiple implementations of the same function are available, SQLite ** will pick the one that involves the least amount of data conversion. ** If there is only a single implementation which does not care what text ** encoding is used, then the fourth argument should be [SQLITE_ANY]. ** -** The fifth parameter is an arbitrary pointer. The implementation of the -** function can gain access to this pointer using [sqlite3_user_data()]. +** ^(The fifth parameter is an arbitrary pointer. The implementation of the +** function can gain access to this pointer using [sqlite3_user_data()].)^ ** -** The seventh, eighth and ninth parameters, xFunc, xStep and xFinal, are +** ^The seventh, eighth and ninth parameters, xFunc, xStep and xFinal, are ** pointers to C-language functions that implement the SQL function or -** aggregate. A scalar SQL function requires an implementation of the xFunc -** callback only, NULL pointers should be passed as the xStep and xFinal -** parameters. An aggregate SQL function requires an implementation of xStep -** and xFinal and NULL should be passed for xFunc. To delete an existing -** SQL function or aggregate, pass NULL for all three function callbacks. +** aggregate. ^A scalar SQL function requires an implementation of the xFunc +** callback only; NULL pointers must be passed as the xStep and xFinal +** parameters. ^An aggregate SQL function requires an implementation of xStep +** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing +** SQL function or aggregate, pass NULL poiners for all three function +** callbacks. ** -** It is permitted to register multiple implementations of the same +** ^If the tenth parameter to sqlite3_create_function_v2() is not NULL, +** then it is invoked when the function is deleted, either by being +** overloaded or when the database connection closes. +** ^When the destructure callback of the tenth parameter is invoked, it +** is passed a single argument which is a copy of the pointer which was +** the fifth parameter to sqlite3_create_function_v2(). +** +** ^It is permitted to register multiple implementations of the same ** functions with the same name but with either differing numbers of -** arguments or differing preferred text encodings. SQLite will use +** arguments or differing preferred text encodings. ^SQLite will use ** the implementation that most closely matches the way in which the -** SQL function is used. A function implementation with a non-negative +** SQL function is used. ^A function implementation with a non-negative ** nArg parameter is a better match than a function implementation with -** a negative nArg. A function where the preferred text encoding +** a negative nArg. ^A function where the preferred text encoding ** matches the database encoding is a better ** match than a function where the encoding is different. -** A function where the encoding difference is between UTF16le and UTF16be +** ^A function where the encoding difference is between UTF16le and UTF16be ** is a closer match than a function where the encoding difference is ** between UTF8 and UTF16. ** -** Built-in functions may be overloaded by new application-defined functions. -** The first application-defined function with a given name overrides all -** built-in functions in the same [database connection] with the same name. -** Subsequent application-defined functions of the same name only override -** prior application-defined functions that are an exact match for the -** number of parameters and preferred encoding. +** ^Built-in functions may be overloaded by new application-defined functions. ** -** An application-defined function is permitted to call other +** ^An application-defined function is permitted to call other ** SQLite interfaces. However, such calls must not ** close the database connection nor finalize or reset the prepared ** statement in which the function is running. -** -** Requirements: -** [H16103] [H16106] [H16109] [H16112] [H16118] [H16121] [H16127] -** [H16130] [H16133] [H16136] [H16139] [H16142] */ SQLITE_API int sqlite3_create_function( sqlite3 *db, @@ -3265,9 +3648,20 @@ SQLITE_API int sqlite3_create_function16( void (*xStep)(sqlite3_context*,int,sqlite3_value**), void (*xFinal)(sqlite3_context*) ); +SQLITE_API int sqlite3_create_function_v2( + sqlite3 *db, + const char *zFunctionName, + int nArg, + int eTextRep, + void *pApp, + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*), + void(*xDestroy)(void*) +); /* -** CAPI3REF: Text Encodings {H10267} +** CAPI3REF: Text Encodings ** ** These constant define integer codes that represent the various ** text encodings supported by SQLite. @@ -3299,7 +3693,7 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 #endif /* -** CAPI3REF: Obtaining SQL Function Parameter Values {H15100} +** CAPI3REF: Obtaining SQL Function Parameter Values ** ** The C-language implementation of SQL functions and aggregates uses ** this set of interface routines to access the parameter values on @@ -3317,22 +3711,22 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 ** Any attempt to use these routines on an [unprotected sqlite3_value] ** object results in undefined behavior. ** -** These routines work just like the corresponding [column access functions] +** ^These routines work just like the corresponding [column access functions] ** except that these routines take a single [protected sqlite3_value] object ** pointer instead of a [sqlite3_stmt*] pointer and an integer column number. ** -** The sqlite3_value_text16() interface extracts a UTF-16 string -** in the native byte-order of the host machine. The +** ^The sqlite3_value_text16() interface extracts a UTF-16 string +** in the native byte-order of the host machine. ^The ** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces ** extract UTF-16 strings as big-endian and little-endian respectively. ** -** The sqlite3_value_numeric_type() interface attempts to apply +** ^(The sqlite3_value_numeric_type() interface attempts to apply ** numeric affinity to the value. This means that an attempt is ** made to convert the value to an integer or floating point. If ** such a conversion is possible without loss of information (in other ** words, if the value is a string that looks like a number) ** then the conversion is performed. Otherwise no conversion occurs. -** The [SQLITE_INTEGER | datatype] after conversion is returned. +** The [SQLITE_INTEGER | datatype] after conversion is returned.)^ ** ** Please pay particular attention to the fact that the pointer returned ** from [sqlite3_value_blob()], [sqlite3_value_text()], or @@ -3342,10 +3736,6 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 ** ** These routines must be called from the same thread as ** the SQL function that supplied the [sqlite3_value*] parameters. -** -** Requirements: -** [H15103] [H15106] [H15109] [H15112] [H15115] [H15118] [H15121] [H15124] -** [H15127] [H15130] [H15133] [H15136] */ SQLITE_API const void *sqlite3_value_blob(sqlite3_value*); SQLITE_API int sqlite3_value_bytes(sqlite3_value*); @@ -3361,66 +3751,73 @@ SQLITE_API int sqlite3_value_type(sqlite3_value*); SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*); /* -** CAPI3REF: Obtain Aggregate Function Context {H16210} +** CAPI3REF: Obtain Aggregate Function Context ** -** The implementation of aggregate SQL functions use this routine to allocate -** a structure for storing their state. +** Implementations of aggregate SQL functions use this +** routine to allocate memory for storing their state. ** -** The first time the sqlite3_aggregate_context() routine is called for a -** particular aggregate, SQLite allocates nBytes of memory, zeroes out that -** memory, and returns a pointer to it. On second and subsequent calls to -** sqlite3_aggregate_context() for the same aggregate function index, -** the same buffer is returned. The implementation of the aggregate can use -** the returned buffer to accumulate data. +** ^The first time the sqlite3_aggregate_context(C,N) routine is called +** for a particular aggregate function, SQLite +** allocates N of memory, zeroes out that memory, and returns a pointer +** to the new memory. ^On second and subsequent calls to +** sqlite3_aggregate_context() for the same aggregate function instance, +** the same buffer is returned. Sqlite3_aggregate_context() is normally +** called once for each invocation of the xStep callback and then one +** last time when the xFinal callback is invoked. ^(When no rows match +** an aggregate query, the xStep() callback of the aggregate function +** implementation is never called and xFinal() is called exactly once. +** In those cases, sqlite3_aggregate_context() might be called for the +** first time from within xFinal().)^ ** -** SQLite automatically frees the allocated buffer when the aggregate -** query concludes. +** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer if N is +** less than or equal to zero or if a memory allocate error occurs. ** -** The first parameter should be a copy of the +** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is +** determined by the N parameter on first successful call. Changing the +** value of N in subsequent call to sqlite3_aggregate_context() within +** the same aggregate function instance will not resize the memory +** allocation.)^ +** +** ^SQLite automatically frees the memory allocated by +** sqlite3_aggregate_context() when the aggregate query concludes. +** +** The first parameter must be a copy of the ** [sqlite3_context | SQL function context] that is the first parameter -** to the callback routine that implements the aggregate function. +** to the xStep or xFinal callback routine that implements the aggregate +** function. ** ** This routine must be called from the same thread in which ** the aggregate SQL function is running. -** -** Requirements: -** [H16211] [H16213] [H16215] [H16217] */ SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes); /* -** CAPI3REF: User Data For Functions {H16240} +** CAPI3REF: User Data For Functions ** -** The sqlite3_user_data() interface returns a copy of +** ^The sqlite3_user_data() interface returns a copy of ** the pointer that was the pUserData parameter (the 5th parameter) ** of the [sqlite3_create_function()] ** and [sqlite3_create_function16()] routines that originally -** registered the application defined function. {END} -** -** This routine must be called from the same thread in which -** the application-defined function is running. -** -** Requirements: -** [H16243] -*/ -SQLITE_API void *sqlite3_user_data(sqlite3_context*); - -/* -** CAPI3REF: Database Connection For Functions {H16250} -** -** The sqlite3_context_db_handle() interface returns a copy of -** the pointer to the [database connection] (the 1st parameter) -** of the [sqlite3_create_function()] -** and [sqlite3_create_function16()] routines that originally ** registered the application defined function. ** -** Requirements: -** [H16253] +** This routine must be called from the same thread in which +** the application-defined function is running. +*/ +SQLITE_API void *sqlite3_user_data(sqlite3_context*); + +/* +** CAPI3REF: Database Connection For Functions +** +** ^The sqlite3_context_db_handle() interface returns a copy of +** the pointer to the [database connection] (the 1st parameter) +** of the [sqlite3_create_function()] +** and [sqlite3_create_function16()] routines that originally +** registered the application defined function. */ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); /* -** CAPI3REF: Function Auxiliary Data {H16270} +** CAPI3REF: Function Auxiliary Data ** ** The following two functions may be used by scalar SQL functions to ** associate metadata with argument values. If the same value is passed to @@ -3433,48 +3830,45 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** invocations of the same function so that the original pattern string ** does not need to be recompiled on each invocation. ** -** The sqlite3_get_auxdata() interface returns a pointer to the metadata +** ^The sqlite3_get_auxdata() interface returns a pointer to the metadata ** associated by the sqlite3_set_auxdata() function with the Nth argument -** value to the application-defined function. If no metadata has been ever +** value to the application-defined function. ^If no metadata has been ever ** been set for the Nth argument of the function, or if the corresponding ** function parameter has changed since the meta-data was set, ** then sqlite3_get_auxdata() returns a NULL pointer. ** -** The sqlite3_set_auxdata() interface saves the metadata +** ^The sqlite3_set_auxdata() interface saves the metadata ** pointed to by its 3rd parameter as the metadata for the N-th ** argument of the application-defined function. Subsequent ** calls to sqlite3_get_auxdata() might return this data, if it has ** not been destroyed. -** If it is not NULL, SQLite will invoke the destructor +** ^If it is not NULL, SQLite will invoke the destructor ** function given by the 4th parameter to sqlite3_set_auxdata() on ** the metadata when the corresponding function parameter changes ** or when the SQL statement completes, whichever comes first. ** ** SQLite is free to call the destructor and drop metadata on any -** parameter of any function at any time. The only guarantee is that +** parameter of any function at any time. ^The only guarantee is that ** the destructor will be called before the metadata is dropped. ** -** In practice, metadata is preserved between function calls for +** ^(In practice, metadata is preserved between function calls for ** expressions that are constant at compile time. This includes literal -** values and SQL variables. +** values and [parameters].)^ ** ** These routines must be called from the same thread in which ** the SQL function is running. -** -** Requirements: -** [H16272] [H16274] [H16276] [H16277] [H16278] [H16279] */ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); /* -** CAPI3REF: Constants Defining Special Destructor Behavior {H10280} +** CAPI3REF: Constants Defining Special Destructor Behavior ** ** These are special values for the destructor that is passed in as the -** final argument to routines like [sqlite3_result_blob()]. If the destructor +** final argument to routines like [sqlite3_result_blob()]. ^If the destructor ** argument is SQLITE_STATIC, it means that the content pointer is constant -** and will never change. It does not need to be destroyed. The +** and will never change. It does not need to be destroyed. ^The ** SQLITE_TRANSIENT value means that the content will likely change in ** the near future and that SQLite should make its own private copy of ** the content before returning. @@ -3487,7 +3881,7 @@ typedef void (*sqlite3_destructor_type)(void*); #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) /* -** CAPI3REF: Setting The Result Of An SQL Function {H16400} +** CAPI3REF: Setting The Result Of An SQL Function ** ** These routines are used by the xFunc or xFinal callbacks that ** implement SQL functions and aggregates. See @@ -3498,103 +3892,98 @@ typedef void (*sqlite3_destructor_type)(void*); ** functions used to bind values to host parameters in prepared statements. ** Refer to the [SQL parameter] documentation for additional information. ** -** The sqlite3_result_blob() interface sets the result from +** ^The sqlite3_result_blob() interface sets the result from ** an application-defined function to be the BLOB whose content is pointed ** to by the second parameter and which is N bytes long where N is the ** third parameter. ** -** The sqlite3_result_zeroblob() interfaces set the result of +** ^The sqlite3_result_zeroblob() interfaces set the result of ** the application-defined function to be a BLOB containing all zero ** bytes and N bytes in size, where N is the value of the 2nd parameter. ** -** The sqlite3_result_double() interface sets the result from +** ^The sqlite3_result_double() interface sets the result from ** an application-defined function to be a floating point value specified ** by its 2nd argument. ** -** The sqlite3_result_error() and sqlite3_result_error16() functions +** ^The sqlite3_result_error() and sqlite3_result_error16() functions ** cause the implemented SQL function to throw an exception. -** SQLite uses the string pointed to by the +** ^SQLite uses the string pointed to by the ** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16() -** as the text of an error message. SQLite interprets the error -** message string from sqlite3_result_error() as UTF-8. SQLite +** as the text of an error message. ^SQLite interprets the error +** message string from sqlite3_result_error() as UTF-8. ^SQLite ** interprets the string from sqlite3_result_error16() as UTF-16 in native -** byte order. If the third parameter to sqlite3_result_error() +** byte order. ^If the third parameter to sqlite3_result_error() ** or sqlite3_result_error16() is negative then SQLite takes as the error ** message all text up through the first zero character. -** If the third parameter to sqlite3_result_error() or +** ^If the third parameter to sqlite3_result_error() or ** sqlite3_result_error16() is non-negative then SQLite takes that many ** bytes (not characters) from the 2nd parameter as the error message. -** The sqlite3_result_error() and sqlite3_result_error16() +** ^The sqlite3_result_error() and sqlite3_result_error16() ** routines make a private copy of the error message text before ** they return. Hence, the calling function can deallocate or ** modify the text after they return without harm. -** The sqlite3_result_error_code() function changes the error code -** returned by SQLite as a result of an error in a function. By default, -** the error code is SQLITE_ERROR. A subsequent call to sqlite3_result_error() +** ^The sqlite3_result_error_code() function changes the error code +** returned by SQLite as a result of an error in a function. ^By default, +** the error code is SQLITE_ERROR. ^A subsequent call to sqlite3_result_error() ** or sqlite3_result_error16() resets the error code to SQLITE_ERROR. ** -** The sqlite3_result_toobig() interface causes SQLite to throw an error -** indicating that a string or BLOB is to long to represent. +** ^The sqlite3_result_toobig() interface causes SQLite to throw an error +** indicating that a string or BLOB is too long to represent. ** -** The sqlite3_result_nomem() interface causes SQLite to throw an error +** ^The sqlite3_result_nomem() interface causes SQLite to throw an error ** indicating that a memory allocation failed. ** -** The sqlite3_result_int() interface sets the return value +** ^The sqlite3_result_int() interface sets the return value ** of the application-defined function to be the 32-bit signed integer ** value given in the 2nd argument. -** The sqlite3_result_int64() interface sets the return value +** ^The sqlite3_result_int64() interface sets the return value ** of the application-defined function to be the 64-bit signed integer ** value given in the 2nd argument. ** -** The sqlite3_result_null() interface sets the return value +** ^The sqlite3_result_null() interface sets the return value ** of the application-defined function to be NULL. ** -** The sqlite3_result_text(), sqlite3_result_text16(), +** ^The sqlite3_result_text(), sqlite3_result_text16(), ** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces ** set the return value of the application-defined function to be ** a text string which is represented as UTF-8, UTF-16 native byte order, ** UTF-16 little endian, or UTF-16 big endian, respectively. -** SQLite takes the text result from the application from +** ^SQLite takes the text result from the application from ** the 2nd parameter of the sqlite3_result_text* interfaces. -** If the 3rd parameter to the sqlite3_result_text* interfaces +** ^If the 3rd parameter to the sqlite3_result_text* interfaces ** is negative, then SQLite takes result text from the 2nd parameter ** through the first zero character. -** If the 3rd parameter to the sqlite3_result_text* interfaces +** ^If the 3rd parameter to the sqlite3_result_text* interfaces ** is non-negative, then as many bytes (not characters) of the text ** pointed to by the 2nd parameter are taken as the application-defined ** function result. -** If the 4th parameter to the sqlite3_result_text* interfaces +** ^If the 4th parameter to the sqlite3_result_text* interfaces ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that ** function as the destructor on the text or BLOB result when it has ** finished using that result. -** If the 4th parameter to the sqlite3_result_text* interfaces or to +** ^If the 4th parameter to the sqlite3_result_text* interfaces or to ** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite ** assumes that the text or BLOB result is in constant space and does not ** copy the content of the parameter nor call a destructor on the content ** when it has finished using that result. -** If the 4th parameter to the sqlite3_result_text* interfaces +** ^If the 4th parameter to the sqlite3_result_text* interfaces ** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT ** then SQLite makes a copy of the result into space obtained from ** from [sqlite3_malloc()] before it returns. ** -** The sqlite3_result_value() interface sets the result of +** ^The sqlite3_result_value() interface sets the result of ** the application-defined function to be a copy the -** [unprotected sqlite3_value] object specified by the 2nd parameter. The +** [unprotected sqlite3_value] object specified by the 2nd parameter. ^The ** sqlite3_result_value() interface makes a copy of the [sqlite3_value] ** so that the [sqlite3_value] specified in the parameter may change or ** be deallocated after sqlite3_result_value() returns without harm. -** A [protected sqlite3_value] object may always be used where an +** ^A [protected sqlite3_value] object may always be used where an ** [unprotected sqlite3_value] object is required, so either ** kind of [sqlite3_value] object can be used with this interface. ** ** If these routines are called from within the different thread ** than the one containing the application-defined function that received ** the [sqlite3_context] pointer, the results are undefined. -** -** Requirements: -** [H16403] [H16406] [H16409] [H16412] [H16415] [H16418] [H16421] [H16424] -** [H16427] [H16430] [H16433] [H16436] [H16439] [H16442] [H16445] [H16448] -** [H16451] [H16454] [H16457] [H16460] [H16463] */ SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); SQLITE_API void sqlite3_result_double(sqlite3_context*, double); @@ -3614,67 +4003,87 @@ SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*); SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n); /* -** CAPI3REF: Define New Collating Sequences {H16600} +** CAPI3REF: Define New Collating Sequences ** -** These functions are used to add new collation sequences to the -** [database connection] specified as the first argument. +** ^These functions add, remove, or modify a [collation] associated +** with the [database connection] specified as the first argument. ** -** The name of the new collation sequence is specified as a UTF-8 string +** ^The name of the collation is a UTF-8 string ** for sqlite3_create_collation() and sqlite3_create_collation_v2() -** and a UTF-16 string for sqlite3_create_collation16(). In all cases -** the name is passed as the second function argument. +** and a UTF-16 string in native byte order for sqlite3_create_collation16(). +** ^Collation names that compare equal according to [sqlite3_strnicmp()] are +** considered to be the same name. ** -** The third argument may be one of the constants [SQLITE_UTF8], -** [SQLITE_UTF16LE], or [SQLITE_UTF16BE], indicating that the user-supplied -** routine expects to be passed pointers to strings encoded using UTF-8, -** UTF-16 little-endian, or UTF-16 big-endian, respectively. The -** third argument might also be [SQLITE_UTF16] to indicate that the routine -** expects pointers to be UTF-16 strings in the native byte order, or the -** argument can be [SQLITE_UTF16_ALIGNED] if the -** the routine expects pointers to 16-bit word aligned strings -** of UTF-16 in the native byte order. +** ^(The third argument (eTextRep) must be one of the constants: +**
      +**
    • [SQLITE_UTF8], +**
    • [SQLITE_UTF16LE], +**
    • [SQLITE_UTF16BE], +**
    • [SQLITE_UTF16], or +**
    • [SQLITE_UTF16_ALIGNED]. +**
    )^ +** ^The eTextRep argument determines the encoding of strings passed +** to the collating function callback, xCallback. +** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep +** force strings to be UTF16 with native byte order. +** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin +** on an even byte address. ** -** A pointer to the user supplied routine must be passed as the fifth -** argument. If it is NULL, this is the same as deleting the collation -** sequence (so that SQLite cannot call it anymore). -** Each time the application supplied function is invoked, it is passed -** as its first parameter a copy of the void* passed as the fourth argument -** to sqlite3_create_collation() or sqlite3_create_collation16(). +** ^The fourth argument, pArg, is a application data pointer that is passed +** through as the first argument to the collating function callback. ** -** The remaining arguments to the application-supplied routine are two strings, -** each represented by a (length, data) pair and encoded in the encoding -** that was passed as the third argument when the collation sequence was -** registered. {END} The application defined collation routine should -** return negative, zero or positive if the first string is less than, -** equal to, or greater than the second string. i.e. (STRING1 - STRING2). +** ^The fifth argument, xCallback, is a pointer to the collating function. +** ^Multiple collating functions can be registered using the same name but +** with different eTextRep parameters and SQLite will use whichever +** function requires the least amount of data transformation. +** ^If the xCallback argument is NULL then the collating function is +** deleted. ^When all collating functions having the same name are deleted, +** that collation is no longer usable. ** -** The sqlite3_create_collation_v2() works like sqlite3_create_collation() -** except that it takes an extra argument which is a destructor for -** the collation. The destructor is called when the collation is -** destroyed and is passed a copy of the fourth parameter void* pointer -** of the sqlite3_create_collation_v2(). -** Collations are destroyed when they are overridden by later calls to the -** collation creation functions or when the [database connection] is closed -** using [sqlite3_close()]. +** ^The collating function callback is invoked with a copy of the pArg +** application data pointer and with two strings in the encoding specified +** by the eTextRep argument. The collating function must return an +** integer that is negative, zero, or positive +** if the first string is less than, equal to, or greater than the second, +** respectively. A collating function must alway return the same answer +** given the same inputs. If two or more collating functions are registered +** to the same collation name (using different eTextRep values) then all +** must give an equivalent answer when invoked with equivalent strings. +** The collating function must obey the following properties for all +** strings A, B, and C: +** +**
      +**
    1. If A==B then B==A. +**
    2. If A==B and B==C then A==C. +**
    3. If A<B THEN B>A. +**
    4. If A<B and B<C then A<C. +**
    +** +** If a collating function fails any of the above constraints and that +** collating function is registered and used, then the behavior of SQLite +** is undefined. +** +** ^The sqlite3_create_collation_v2() works like sqlite3_create_collation() +** with the addition that the xDestroy callback is invoked on pArg when +** the collating function is deleted. +** ^Collating functions are deleted when they are overridden by later +** calls to the collation creation functions or when the +** [database connection] is closed using [sqlite3_close()]. ** ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. -** -** Requirements: -** [H16603] [H16604] [H16606] [H16609] [H16612] [H16615] [H16618] [H16621] -** [H16624] [H16627] [H16630] */ SQLITE_API int sqlite3_create_collation( sqlite3*, const char *zName, int eTextRep, - void*, + void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); SQLITE_API int sqlite3_create_collation_v2( sqlite3*, const char *zName, int eTextRep, - void*, + void *pArg, int(*xCompare)(void*,int,const void*,int,const void*), void(*xDestroy)(void*) ); @@ -3682,38 +4091,35 @@ SQLITE_API int sqlite3_create_collation16( sqlite3*, const void *zName, int eTextRep, - void*, + void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); /* -** CAPI3REF: Collation Needed Callbacks {H16700} +** CAPI3REF: Collation Needed Callbacks ** -** To avoid having to register all collation sequences before a database +** ^To avoid having to register all collation sequences before a database ** can be used, a single callback function may be registered with the -** [database connection] to be called whenever an undefined collation +** [database connection] to be invoked whenever an undefined collation ** sequence is required. ** -** If the function is registered using the sqlite3_collation_needed() API, +** ^If the function is registered using the sqlite3_collation_needed() API, ** then it is passed the names of undefined collation sequences as strings -** encoded in UTF-8. {H16703} If sqlite3_collation_needed16() is used, +** encoded in UTF-8. ^If sqlite3_collation_needed16() is used, ** the names are passed as UTF-16 in machine native byte order. -** A call to either function replaces any existing callback. +** ^A call to either function replaces the existing collation-needed callback. ** -** When the callback is invoked, the first argument passed is a copy +** ^(When the callback is invoked, the first argument passed is a copy ** of the second argument to sqlite3_collation_needed() or ** sqlite3_collation_needed16(). The second argument is the database ** connection. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE], ** or [SQLITE_UTF16LE], indicating the most desirable form of the collation ** sequence function required. The fourth parameter is the name of the -** required collation sequence. +** required collation sequence.)^ ** ** The callback function should register the desired collation using ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or ** [sqlite3_create_collation_v2()]. -** -** Requirements: -** [H16702] [H16704] [H16706] */ SQLITE_API int sqlite3_collation_needed( sqlite3*, @@ -3726,6 +4132,7 @@ SQLITE_API int sqlite3_collation_needed16( void(*)(void*,sqlite3*,int eTextRep,const void*) ); +#ifdef SQLITE_HAS_CODEC /* ** Specify the key for an encrypted database. This routine should be ** called right after sqlite3_open(). @@ -3752,7 +4159,26 @@ SQLITE_API int sqlite3_rekey( ); /* -** CAPI3REF: Suspend Execution For A Short Time {H10530} +** Specify the activation key for a SEE database. Unless +** activated, none of the SEE routines will work. +*/ +SQLITE_API void sqlite3_activate_see( + const char *zPassPhrase /* Activation phrase */ +); +#endif + +#ifdef SQLITE_ENABLE_CEROD +/* +** Specify the activation key for a CEROD database. Unless +** activated, none of the CEROD routines will work. +*/ +SQLITE_API void sqlite3_activate_cerod( + const char *zPassPhrase /* Activation phrase */ +); +#endif + +/* +** CAPI3REF: Suspend Execution For A Short Time ** ** The sqlite3_sleep() function causes the current thread to suspend execution ** for at least a number of milliseconds specified in its parameter. @@ -3762,19 +4188,21 @@ SQLITE_API int sqlite3_rekey( ** the nearest second. The number of milliseconds of sleep actually ** requested from the operating system is returned. ** -** SQLite implements this interface by calling the xSleep() -** method of the default [sqlite3_vfs] object. -** -** Requirements: [H10533] [H10536] +** ^SQLite implements this interface by calling the xSleep() +** method of the default [sqlite3_vfs] object. If the xSleep() method +** of the default VFS is not implemented correctly, or not implemented at +** all, then the behavior of sqlite3_sleep() may deviate from the description +** in the previous paragraphs. */ SQLITE_API int sqlite3_sleep(int); /* -** CAPI3REF: Name Of The Folder Holding Temporary Files {H10310} +** CAPI3REF: Name Of The Folder Holding Temporary Files ** -** If this global variable is made to point to a string which is +** ^(If this global variable is made to point to a string which is ** the name of a folder (a.k.a. directory), then all temporary files -** created by SQLite will be placed in that directory. If this variable +** created by SQLite when using a built-in [sqlite3_vfs | VFS] +** will be placed in that directory.)^ ^If this variable ** is a NULL pointer, then SQLite performs a search for an appropriate ** temporary file directory. ** @@ -3787,8 +4215,8 @@ SQLITE_API int sqlite3_sleep(int); ** routines have been called and that this variable remain unchanged ** thereafter. ** -** The [temp_store_directory pragma] may modify this variable and cause -** it to point to memory obtained from [sqlite3_malloc]. Furthermore, +** ^The [temp_store_directory pragma] may modify this variable and cause +** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, ** the [temp_store_directory pragma] always assumes that any string ** that this variable points to is held in memory obtained from ** [sqlite3_malloc] and the pragma may attempt to free that memory @@ -3800,14 +4228,14 @@ SQLITE_API int sqlite3_sleep(int); SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; /* -** CAPI3REF: Test For Auto-Commit Mode {H12930} +** CAPI3REF: Test For Auto-Commit Mode ** KEYWORDS: {autocommit mode} ** -** The sqlite3_get_autocommit() interface returns non-zero or +** ^The sqlite3_get_autocommit() interface returns non-zero or ** zero if the given database connection is or is not in autocommit mode, -** respectively. Autocommit mode is on by default. -** Autocommit mode is disabled by a [BEGIN] statement. -** Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK]. +** respectively. ^Autocommit mode is on by default. +** ^Autocommit mode is disabled by a [BEGIN] statement. +** ^Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK]. ** ** If certain kinds of errors occur on a statement within a multi-statement ** transaction (errors including [SQLITE_FULL], [SQLITE_IOERR], @@ -3819,58 +4247,55 @@ SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; ** If another thread changes the autocommit status of the database ** connection while this routine is running, then the return value ** is undefined. -** -** Requirements: [H12931] [H12932] [H12933] [H12934] */ SQLITE_API int sqlite3_get_autocommit(sqlite3*); /* -** CAPI3REF: Find The Database Handle Of A Prepared Statement {H13120} +** CAPI3REF: Find The Database Handle Of A Prepared Statement ** -** The sqlite3_db_handle interface returns the [database connection] handle -** to which a [prepared statement] belongs. The [database connection] -** returned by sqlite3_db_handle is the same [database connection] that was the first argument +** ^The sqlite3_db_handle interface returns the [database connection] handle +** to which a [prepared statement] belongs. ^The [database connection] +** returned by sqlite3_db_handle is the same [database connection] +** that was the first argument ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to ** create the statement in the first place. -** -** Requirements: [H13123] */ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); /* -** CAPI3REF: Find the next prepared statement {H13140} +** CAPI3REF: Find the next prepared statement ** -** This interface returns a pointer to the next [prepared statement] after -** pStmt associated with the [database connection] pDb. If pStmt is NULL +** ^This interface returns a pointer to the next [prepared statement] after +** pStmt associated with the [database connection] pDb. ^If pStmt is NULL ** then this interface returns a pointer to the first prepared statement -** associated with the database connection pDb. If no prepared statement +** associated with the database connection pDb. ^If no prepared statement ** satisfies the conditions of this routine, it returns NULL. ** ** The [database connection] pointer D in a call to ** [sqlite3_next_stmt(D,S)] must refer to an open database ** connection and in particular must not be a NULL pointer. -** -** Requirements: [H13143] [H13146] [H13149] [H13152] */ SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); /* -** CAPI3REF: Commit And Rollback Notification Callbacks {H12950} +** CAPI3REF: Commit And Rollback Notification Callbacks ** -** The sqlite3_commit_hook() interface registers a callback +** ^The sqlite3_commit_hook() interface registers a callback ** function to be invoked whenever a transaction is [COMMIT | committed]. -** Any callback set by a previous call to sqlite3_commit_hook() +** ^Any callback set by a previous call to sqlite3_commit_hook() ** for the same database connection is overridden. -** The sqlite3_rollback_hook() interface registers a callback +** ^The sqlite3_rollback_hook() interface registers a callback ** function to be invoked whenever a transaction is [ROLLBACK | rolled back]. -** Any callback set by a previous call to sqlite3_commit_hook() +** ^Any callback set by a previous call to sqlite3_rollback_hook() ** for the same database connection is overridden. -** The pArg argument is passed through to the callback. -** If the callback on a commit hook function returns non-zero, +** ^The pArg argument is passed through to the callback. +** ^If the callback on a commit hook function returns non-zero, ** then the commit is converted into a rollback. ** -** If another function was previously registered, its -** pArg value is returned. Otherwise NULL is returned. +** ^The sqlite3_commit_hook(D,C,P) and sqlite3_rollback_hook(D,C,P) functions +** return the P argument from the previous call of the same function +** on the same [database connection] D, or NULL for +** the first call for each function on D. ** ** The callback implementation must not do anything that will modify ** the database connection that invoked the callback. Any actions @@ -3880,59 +4305,52 @@ SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their ** database connections for the meaning of "modify" in this paragraph. ** -** Registering a NULL function disables the callback. +** ^Registering a NULL function disables the callback. ** -** When the commit hook callback routine returns zero, the [COMMIT] -** operation is allowed to continue normally. If the commit hook +** ^When the commit hook callback routine returns zero, the [COMMIT] +** operation is allowed to continue normally. ^If the commit hook ** returns non-zero, then the [COMMIT] is converted into a [ROLLBACK]. -** The rollback hook is invoked on a rollback that results from a commit +** ^The rollback hook is invoked on a rollback that results from a commit ** hook returning non-zero, just as it would be with any other rollback. ** -** For the purposes of this API, a transaction is said to have been +** ^For the purposes of this API, a transaction is said to have been ** rolled back if an explicit "ROLLBACK" statement is executed, or ** an error or constraint causes an implicit rollback to occur. -** The rollback callback is not invoked if a transaction is +** ^The rollback callback is not invoked if a transaction is ** automatically rolled back because the database connection is closed. -** The rollback callback is not invoked if a transaction is -** rolled back because a commit callback returned non-zero. -** Check on this ** ** See also the [sqlite3_update_hook()] interface. -** -** Requirements: -** [H12951] [H12952] [H12953] [H12954] [H12955] -** [H12961] [H12962] [H12963] [H12964] */ SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); /* -** CAPI3REF: Data Change Notification Callbacks {H12970} +** CAPI3REF: Data Change Notification Callbacks ** -** The sqlite3_update_hook() interface registers a callback function +** ^The sqlite3_update_hook() interface registers a callback function ** with the [database connection] identified by the first argument ** to be invoked whenever a row is updated, inserted or deleted. -** Any callback set by a previous call to this function +** ^Any callback set by a previous call to this function ** for the same database connection is overridden. ** -** The second argument is a pointer to the function to invoke when a +** ^The second argument is a pointer to the function to invoke when a ** row is updated, inserted or deleted. -** The first argument to the callback is a copy of the third argument +** ^The first argument to the callback is a copy of the third argument ** to sqlite3_update_hook(). -** The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], +** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], ** or [SQLITE_UPDATE], depending on the operation that caused the callback ** to be invoked. -** The third and fourth arguments to the callback contain pointers to the +** ^The third and fourth arguments to the callback contain pointers to the ** database and table name containing the affected row. -** The final callback parameter is the [rowid] of the row. -** In the case of an update, this is the [rowid] after the update takes place. +** ^The final callback parameter is the [rowid] of the row. +** ^In the case of an update, this is the [rowid] after the update takes place. ** -** The update hook is not invoked when internal system tables are -** modified (i.e. sqlite_master and sqlite_sequence). +** ^(The update hook is not invoked when internal system tables are +** modified (i.e. sqlite_master and sqlite_sequence).)^ ** -** In the current implementation, the update hook +** ^In the current implementation, the update hook ** is not invoked when duplication rows are deleted because of an -** [ON CONFLICT | ON CONFLICT REPLACE] clause. Nor is the update hook +** [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook ** invoked when rows are deleted using the [truncate optimization]. ** The exceptions defined in this paragraph might change in a future ** release of SQLite. @@ -3944,14 +4362,13 @@ SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their ** database connections for the meaning of "modify" in this paragraph. ** -** If another function was previously registered, its pArg value -** is returned. Otherwise NULL is returned. +** ^The sqlite3_update_hook(D,C,P) function +** returns the P argument from the previous call +** on the same [database connection] D, or NULL for +** the first call on D. ** ** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()] ** interfaces. -** -** Requirements: -** [H12971] [H12973] [H12975] [H12977] [H12979] [H12981] [H12983] [H12986] */ SQLITE_API void *sqlite3_update_hook( sqlite3*, @@ -3960,112 +4377,134 @@ SQLITE_API void *sqlite3_update_hook( ); /* -** CAPI3REF: Enable Or Disable Shared Pager Cache {H10330} +** CAPI3REF: Enable Or Disable Shared Pager Cache ** KEYWORDS: {shared cache} ** -** This routine enables or disables the sharing of the database cache +** ^(This routine enables or disables the sharing of the database cache ** and schema data structures between [database connection | connections] ** to the same database. Sharing is enabled if the argument is true -** and disabled if the argument is false. +** and disabled if the argument is false.)^ ** -** Cache sharing is enabled and disabled for an entire process. +** ^Cache sharing is enabled and disabled for an entire process. ** This is a change as of SQLite version 3.5.0. In prior versions of SQLite, ** sharing was enabled or disabled for each thread separately. ** -** The cache sharing mode set by this interface effects all subsequent +** ^(The cache sharing mode set by this interface effects all subsequent ** calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()]. ** Existing database connections continue use the sharing mode -** that was in effect at the time they were opened. +** that was in effect at the time they were opened.)^ ** -** Virtual tables cannot be used with a shared cache. When shared -** cache is enabled, the [sqlite3_create_module()] API used to register -** virtual tables will always return an error. +** ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled +** successfully. An [error code] is returned otherwise.)^ ** -** This routine returns [SQLITE_OK] if shared cache was enabled or disabled -** successfully. An [error code] is returned otherwise. -** -** Shared cache is disabled by default. But this might change in +** ^Shared cache is disabled by default. But this might change in ** future releases of SQLite. Applications that care about shared ** cache setting should set it explicitly. ** ** See Also: [SQLite Shared-Cache Mode] -** -** Requirements: [H10331] [H10336] [H10337] [H10339] */ SQLITE_API int sqlite3_enable_shared_cache(int); /* -** CAPI3REF: Attempt To Free Heap Memory {H17340} +** CAPI3REF: Attempt To Free Heap Memory ** -** The sqlite3_release_memory() interface attempts to free N bytes +** ^The sqlite3_release_memory() interface attempts to free N bytes ** of heap memory by deallocating non-essential memory allocations -** held by the database library. {END} Memory used to cache database +** held by the database library. Memory used to cache database ** pages to improve performance is an example of non-essential memory. -** sqlite3_release_memory() returns the number of bytes actually freed, +** ^sqlite3_release_memory() returns the number of bytes actually freed, ** which might be more or less than the amount requested. -** -** Requirements: [H17341] [H17342] +** ^The sqlite3_release_memory() routine is a no-op returning zero +** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. */ SQLITE_API int sqlite3_release_memory(int); /* -** CAPI3REF: Impose A Limit On Heap Size {H17350} +** CAPI3REF: Impose A Limit On Heap Size ** -** The sqlite3_soft_heap_limit() interface places a "soft" limit -** on the amount of heap memory that may be allocated by SQLite. -** If an internal allocation is requested that would exceed the -** soft heap limit, [sqlite3_release_memory()] is invoked one or -** more times to free up some space before the allocation is performed. +** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the +** soft limit on the amount of heap memory that may be allocated by SQLite. +** ^SQLite strives to keep heap memory utilization below the soft heap +** limit by reducing the number of pages held in the page cache +** as heap memory usages approaches the limit. +** ^The soft heap limit is "soft" because even though SQLite strives to stay +** below the limit, it will exceed the limit rather than generate +** an [SQLITE_NOMEM] error. In other words, the soft heap limit +** is advisory only. ** -** The limit is called "soft", because if [sqlite3_release_memory()] -** cannot free sufficient memory to prevent the limit from being exceeded, -** the memory is allocated anyway and the current operation proceeds. +** ^The return value from sqlite3_soft_heap_limit64() is the size of +** the soft heap limit prior to the call. ^If the argument N is negative +** then no change is made to the soft heap limit. Hence, the current +** size of the soft heap limit can be determined by invoking +** sqlite3_soft_heap_limit64() with a negative argument. ** -** A negative or zero value for N means that there is no soft heap limit and -** [sqlite3_release_memory()] will only be called when memory is exhausted. -** The default value for the soft heap limit is zero. +** ^If the argument N is zero then the soft heap limit is disabled. ** -** SQLite makes a best effort to honor the soft heap limit. -** But if the soft heap limit cannot be honored, execution will -** continue without error or notification. This is why the limit is -** called a "soft" limit. It is advisory only. +** ^(The soft heap limit is not enforced in the current implementation +** if one or more of following conditions are true: ** -** Prior to SQLite version 3.5.0, this routine only constrained the memory -** allocated by a single thread - the same thread in which this routine -** runs. Beginning with SQLite version 3.5.0, the soft heap limit is -** applied to all threads. The value specified for the soft heap limit -** is an upper bound on the total memory allocation for all threads. In -** version 3.5.0 there is no mechanism for limiting the heap usage for -** individual threads. +**
      +**
    • The soft heap limit is set to zero. +**
    • Memory accounting is disabled using a combination of the +** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and +** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. +**
    • An alternative page cache implementation is specifed using +** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...). +**
    • The page cache allocates from its own memory pool supplied +** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than +** from the heap. +**
    )^ ** -** Requirements: -** [H16351] [H16352] [H16353] [H16354] [H16355] [H16358] +** Beginning with SQLite version 3.7.3, the soft heap limit is enforced +** regardless of whether or not the [SQLITE_ENABLE_MEMORY_MANAGEMENT] +** compile-time option is invoked. With [SQLITE_ENABLE_MEMORY_MANAGEMENT], +** the soft heap limit is enforced on every memory allocation. Without +** [SQLITE_ENABLE_MEMORY_MANAGEMENT], the soft heap limit is only enforced +** when memory is allocated by the page cache. Testing suggests that because +** the page cache is the predominate memory user in SQLite, most +** applications will achieve adequate soft heap limit enforcement without +** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. +** +** The circumstances under which SQLite will enforce the soft heap limit may +** changes in future releases of SQLite. */ -SQLITE_API void sqlite3_soft_heap_limit(int); +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); /* -** CAPI3REF: Extract Metadata About A Column Of A Table {H12850} +** CAPI3REF: Deprecated Soft Heap Limit Interface +** DEPRECATED ** -** This routine returns metadata about a specific column of a specific +** This is a deprecated version of the [sqlite3_soft_heap_limit64()] +** interface. This routine is provided for historical compatibility +** only. All new applications should use the +** [sqlite3_soft_heap_limit64()] interface rather than this one. +*/ +SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); + + +/* +** CAPI3REF: Extract Metadata About A Column Of A Table +** +** ^This routine returns metadata about a specific column of a specific ** database table accessible using the [database connection] handle ** passed as the first function argument. ** -** The column is identified by the second, third and fourth parameters to -** this function. The second parameter is either the name of the database -** (i.e. "main", "temp" or an attached database) containing the specified -** table or NULL. If it is NULL, then all attached databases are searched +** ^The column is identified by the second, third and fourth parameters to +** this function. ^The second parameter is either the name of the database +** (i.e. "main", "temp", or an attached database) containing the specified +** table or NULL. ^If it is NULL, then all attached databases are searched ** for the table using the same algorithm used by the database engine to ** resolve unqualified table references. ** -** The third and fourth parameters to this function are the table and column +** ^The third and fourth parameters to this function are the table and column ** name of the desired column, respectively. Neither of these parameters ** may be NULL. ** -** Metadata is returned by writing to the memory locations passed as the 5th -** and subsequent parameters to this function. Any of these arguments may be +** ^Metadata is returned by writing to the memory locations passed as the 5th +** and subsequent parameters to this function. ^Any of these arguments may be ** NULL, in which case the corresponding element of metadata is omitted. ** -**
    +** ^(
    ** **
    Parameter Output
    Type
    Description ** @@ -4075,17 +4514,17 @@ SQLITE_API void sqlite3_soft_heap_limit(int); **
    8th int True if column is part of the PRIMARY KEY **
    9th int True if column is [AUTOINCREMENT] **
    -**
    +**
    )^ ** -** The memory pointed to by the character pointers returned for the +** ^The memory pointed to by the character pointers returned for the ** declaration type and collation sequence is valid only until the next ** call to any SQLite API function. ** -** If the specified table is actually a view, an [error code] is returned. +** ^If the specified table is actually a view, an [error code] is returned. ** -** If the specified column is "rowid", "oid" or "_rowid_" and an +** ^If the specified column is "rowid", "oid" or "_rowid_" and an ** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output -** parameters are set for the explicitly declared column. If there is no +** parameters are set for the explicitly declared column. ^(If there is no ** explicitly declared [INTEGER PRIMARY KEY] column, then the output ** parameters are set as follows: ** @@ -4095,14 +4534,14 @@ SQLITE_API void sqlite3_soft_heap_limit(int); ** not null: 0 ** primary key: 1 ** auto increment: 0 -** +** )^ ** -** This function may load one or more schemas from database files. If an +** ^(This function may load one or more schemas from database files. If an ** error occurs during this process, or if the requested table or column ** cannot be found, an [error code] is returned and an error message left -** in the [database connection] (to be retrieved using sqlite3_errmsg()). +** in the [database connection] (to be retrieved using sqlite3_errmsg()).)^ ** -** This API is only available if the library was compiled with the +** ^This API is only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined. */ SQLITE_API int sqlite3_table_column_metadata( @@ -4118,30 +4557,29 @@ SQLITE_API int sqlite3_table_column_metadata( ); /* -** CAPI3REF: Load An Extension {H12600} +** CAPI3REF: Load An Extension ** -** This interface loads an SQLite extension library from the named file. +** ^This interface loads an SQLite extension library from the named file. ** -** {H12601} The sqlite3_load_extension() interface attempts to load an -** SQLite extension library contained in the file zFile. +** ^The sqlite3_load_extension() interface attempts to load an +** SQLite extension library contained in the file zFile. ** -** {H12602} The entry point is zProc. +** ^The entry point is zProc. +** ^zProc may be 0, in which case the name of the entry point +** defaults to "sqlite3_extension_init". +** ^The sqlite3_load_extension() interface returns +** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. +** ^If an error occurs and pzErrMsg is not 0, then the +** [sqlite3_load_extension()] interface shall attempt to +** fill *pzErrMsg with error message text stored in memory +** obtained from [sqlite3_malloc()]. The calling function +** should free this memory by calling [sqlite3_free()]. ** -** {H12603} zProc may be 0, in which case the name of the entry point -** defaults to "sqlite3_extension_init". +** ^Extension loading must be enabled using +** [sqlite3_enable_load_extension()] prior to calling this API, +** otherwise an error will be returned. ** -** {H12604} The sqlite3_load_extension() interface shall return -** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. -** -** {H12605} If an error occurs and pzErrMsg is not 0, then the -** [sqlite3_load_extension()] interface shall attempt to -** fill *pzErrMsg with error message text stored in memory -** obtained from [sqlite3_malloc()]. {END} The calling function -** should free this memory by calling [sqlite3_free()]. -** -** {H12606} Extension loading must be enabled using -** [sqlite3_enable_load_extension()] prior to calling this API, -** otherwise an error will be returned. +** See also the [load_extension() SQL function]. */ SQLITE_API int sqlite3_load_extension( sqlite3 *db, /* Load the extension into this database connection */ @@ -4151,67 +4589,66 @@ SQLITE_API int sqlite3_load_extension( ); /* -** CAPI3REF: Enable Or Disable Extension Loading {H12620} +** CAPI3REF: Enable Or Disable Extension Loading ** -** So as not to open security holes in older applications that are +** ^So as not to open security holes in older applications that are ** unprepared to deal with extension loading, and as a means of disabling ** extension loading while evaluating user-entered SQL, the following API ** is provided to turn the [sqlite3_load_extension()] mechanism on and off. ** -** Extension loading is off by default. See ticket #1863. -** -** {H12621} Call the sqlite3_enable_load_extension() routine with onoff==1 -** to turn extension loading on and call it with onoff==0 to turn -** it back off again. -** -** {H12622} Extension loading is off by default. +** ^Extension loading is off by default. See ticket #1863. +** ^Call the sqlite3_enable_load_extension() routine with onoff==1 +** to turn extension loading on and call it with onoff==0 to turn +** it back off again. */ SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff); /* -** CAPI3REF: Automatically Load An Extensions {H12640} +** CAPI3REF: Automatically Load Statically Linked Extensions ** -** This API can be invoked at program startup in order to register -** one or more statically linked extensions that will be available -** to all new [database connections]. {END} +** ^This interface causes the xEntryPoint() function to be invoked for +** each new [database connection] that is created. The idea here is that +** xEntryPoint() is the entry point for a statically linked SQLite extension +** that is to be automatically loaded into all new database connections. ** -** This routine stores a pointer to the extension in an array that is -** obtained from [sqlite3_malloc()]. If you run a memory leak checker -** on your program and it reports a leak because of this array, invoke -** [sqlite3_reset_auto_extension()] prior to shutdown to free the memory. +** ^(Even though the function prototype shows that xEntryPoint() takes +** no arguments and returns void, SQLite invokes xEntryPoint() with three +** arguments and expects and integer result as if the signature of the +** entry point where as follows: ** -** {H12641} This function registers an extension entry point that is -** automatically invoked whenever a new [database connection] -** is opened using [sqlite3_open()], [sqlite3_open16()], -** or [sqlite3_open_v2()]. +**
    +**    int xEntryPoint(
    +**      sqlite3 *db,
    +**      const char **pzErrMsg,
    +**      const struct sqlite3_api_routines *pThunk
    +**    );
    +** 
    )^ ** -** {H12642} Duplicate extensions are detected so calling this routine -** multiple times with the same extension is harmless. +** If the xEntryPoint routine encounters an error, it should make *pzErrMsg +** point to an appropriate error message (obtained from [sqlite3_mprintf()]) +** and return an appropriate [error code]. ^SQLite ensures that *pzErrMsg +** is NULL before calling the xEntryPoint(). ^SQLite will invoke +** [sqlite3_free()] on *pzErrMsg after xEntryPoint() returns. ^If any +** xEntryPoint() returns an error, the [sqlite3_open()], [sqlite3_open16()], +** or [sqlite3_open_v2()] call that provoked the xEntryPoint() will fail. ** -** {H12643} This routine stores a pointer to the extension in an array -** that is obtained from [sqlite3_malloc()]. +** ^Calling sqlite3_auto_extension(X) with an entry point X that is already +** on the list of automatic extensions is a harmless no-op. ^No entry point +** will be called more than once for each database connection that is opened. ** -** {H12644} Automatic extensions apply across all threads. +** See also: [sqlite3_reset_auto_extension()]. */ SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void)); /* -** CAPI3REF: Reset Automatic Extension Loading {H12660} +** CAPI3REF: Reset Automatic Extension Loading ** -** This function disables all previously registered automatic -** extensions. {END} It undoes the effect of all prior -** [sqlite3_auto_extension()] calls. -** -** {H12661} This function disables all previously registered -** automatic extensions. -** -** {H12662} This function disables automatic extensions in all threads. +** ^This interface disables all automatic extensions previously +** registered using [sqlite3_auto_extension()]. */ SQLITE_API void sqlite3_reset_auto_extension(void); /* -****** EXPERIMENTAL - subject to change without notice ************** -** ** The interface to the virtual-table mechanism is currently considered ** to be experimental. The interface might change in incompatible ways. ** If this is a problem for you, do not use the interface at this time. @@ -4229,18 +4666,17 @@ typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor; typedef struct sqlite3_module sqlite3_module; /* -** CAPI3REF: Virtual Table Object {H18000} +** CAPI3REF: Virtual Table Object ** KEYWORDS: sqlite3_module {virtual table module} -** EXPERIMENTAL ** ** This structure, sometimes called a a "virtual table module", ** defines the implementation of a [virtual tables]. ** This structure consists mostly of methods for the module. ** -** A virtual table module is created by filling in a persistent +** ^A virtual table module is created by filling in a persistent ** instance of this structure and passing a pointer to that instance ** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** The registration remains valid until it is replaced by a different +** ^The registration remains valid until it is replaced by a different ** module or until the [database connection] closes. The content ** of this structure must not change while it is registered with ** any database connection. @@ -4276,52 +4712,54 @@ struct sqlite3_module { }; /* -** CAPI3REF: Virtual Table Indexing Information {H18100} +** CAPI3REF: Virtual Table Indexing Information ** KEYWORDS: sqlite3_index_info -** EXPERIMENTAL ** -** The sqlite3_index_info structure and its substructures is used to +** The sqlite3_index_info structure and its substructures is used as part +** of the [virtual table] interface to ** pass information into and receive the reply from the [xBestIndex] ** method of a [virtual table module]. The fields under **Inputs** are the ** inputs to xBestIndex and are read-only. xBestIndex inserts its ** results into the **Outputs** fields. ** -** The aConstraint[] array records WHERE clause constraints of the form: +** ^(The aConstraint[] array records WHERE clause constraints of the form: ** -**
    column OP expr
    +**
    column OP expr
    ** -** where OP is =, <, <=, >, or >=. The particular operator is -** stored in aConstraint[].op. The index of the column is stored in -** aConstraint[].iColumn. aConstraint[].usable is TRUE if the +** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is +** stored in aConstraint[].op using one of the +** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ +** ^(The index of the column is stored in +** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the ** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot. +** is usable) and false if it cannot.)^ ** -** The optimizer automatically inverts terms of the form "expr OP column" +** ^The optimizer automatically inverts terms of the form "expr OP column" ** and makes other simplifications to the WHERE clause in an attempt to ** get as many WHERE clause terms into the form shown above as possible. -** The aConstraint[] array only reports WHERE clause terms in the correct -** form that refer to the particular virtual table being queried. +** ^The aConstraint[] array only reports WHERE clause terms that are +** relevant to the particular virtual table being queried. ** -** Information about the ORDER BY clause is stored in aOrderBy[]. -** Each term of aOrderBy records a column of the ORDER BY clause. +** ^Information about the ORDER BY clause is stored in aOrderBy[]. +** ^Each term of aOrderBy records a column of the ORDER BY clause. ** ** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. If argvIndex>0 then +** about what parameters to pass to xFilter. ^If argvIndex>0 then ** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. If aConstraintUsage[].omit +** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit ** is true, then the constraint is assumed to be fully handled by the -** virtual table and is not checked again by SQLite. +** virtual table and is not checked again by SQLite.)^ ** -** The idxNum and idxPtr values are recorded and passed into the +** ^The idxNum and idxPtr values are recorded and passed into the ** [xFilter] method. -** [sqlite3_free()] is used to free idxPtr if and only iff +** ^[sqlite3_free()] is used to free idxPtr if and only if ** needToFreeIdxPtr is true. ** -** The orderByConsumed means that output from [xFilter]/[xNext] will occur in +** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in ** the correct order to satisfy the ORDER BY clause so that no separate ** sorting step is required. ** -** The estimatedCost value is an estimate of the cost of doing the +** ^The estimatedCost value is an estimate of the cost of doing the ** particular lookup. A full scan of a table with N entries should have ** a cost of N. A binary search of a table of N entries should have a ** cost of approximately log(N). @@ -4351,6 +4789,15 @@ struct sqlite3_index_info { int orderByConsumed; /* True if output is already ordered */ double estimatedCost; /* Estimated cost of using this index */ }; + +/* +** CAPI3REF: Virtual Table Constraint Operator Codes +** +** These macros defined the allowed values for the +** [sqlite3_index_info].aConstraint[].op field. Each value represents +** an operator that is part of a constraint term in the wHERE clause of +** a query that uses a [virtual table]. +*/ #define SQLITE_INDEX_CONSTRAINT_EQ 2 #define SQLITE_INDEX_CONSTRAINT_GT 4 #define SQLITE_INDEX_CONSTRAINT_LE 8 @@ -4359,43 +4806,35 @@ struct sqlite3_index_info { #define SQLITE_INDEX_CONSTRAINT_MATCH 64 /* -** CAPI3REF: Register A Virtual Table Implementation {H18200} -** EXPERIMENTAL +** CAPI3REF: Register A Virtual Table Implementation ** -** This routine is used to register a new [virtual table module] name. -** Module names must be registered before -** creating a new [virtual table] using the module, or before using a +** ^These routines are used to register a new [virtual table module] name. +** ^Module names must be registered before +** creating a new [virtual table] using the module and before using a ** preexisting [virtual table] for the module. ** -** The module name is registered on the [database connection] specified -** by the first parameter. The name of the module is given by the -** second parameter. The third parameter is a pointer to -** the implementation of the [virtual table module]. The fourth +** ^The module name is registered on the [database connection] specified +** by the first parameter. ^The name of the module is given by the +** second parameter. ^The third parameter is a pointer to +** the implementation of the [virtual table module]. ^The fourth ** parameter is an arbitrary client data pointer that is passed through ** into the [xCreate] and [xConnect] methods of the virtual table module ** when a new virtual table is be being created or reinitialized. ** -** This interface has exactly the same effect as calling -** [sqlite3_create_module_v2()] with a NULL client data destructor. +** ^The sqlite3_create_module_v2() interface has a fifth parameter which +** is a pointer to a destructor for the pClientData. ^SQLite will +** invoke the destructor function (if it is not NULL) when SQLite +** no longer needs the pClientData pointer. ^The sqlite3_create_module() +** interface is equivalent to sqlite3_create_module_v2() with a NULL +** destructor. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_create_module( +SQLITE_API int sqlite3_create_module( sqlite3 *db, /* SQLite connection to register module with */ const char *zName, /* Name of the module */ const sqlite3_module *p, /* Methods for the module */ void *pClientData /* Client data for xCreate/xConnect */ ); - -/* -** CAPI3REF: Register A Virtual Table Implementation {H18210} -** EXPERIMENTAL -** -** This routine is identical to the [sqlite3_create_module()] method, -** except that it has an extra parameter to specify -** a destructor function for the client data pointer. SQLite will -** invoke the destructor function (if it is not NULL) when SQLite -** no longer needs the pClientData pointer. -*/ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_create_module_v2( +SQLITE_API int sqlite3_create_module_v2( sqlite3 *db, /* SQLite connection to register module with */ const char *zName, /* Name of the module */ const sqlite3_module *p, /* Methods for the module */ @@ -4404,21 +4843,20 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_create_module_v2( ); /* -** CAPI3REF: Virtual Table Instance Object {H18010} +** CAPI3REF: Virtual Table Instance Object ** KEYWORDS: sqlite3_vtab -** EXPERIMENTAL ** ** Every [virtual table module] implementation uses a subclass -** of the following structure to describe a particular instance +** of this object to describe a particular instance ** of the [virtual table]. Each subclass will ** be tailored to the specific needs of the module implementation. ** The purpose of this superclass is to define certain fields that are ** common to all module implementations. ** -** Virtual tables methods can set an error message by assigning a +** ^Virtual tables methods can set an error message by assigning a ** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should ** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. After the error message +** prior to assigning a new string to zErrMsg. ^After the error message ** is delivered up to the client application, the string will be automatically ** freed by sqlite3_free() and the zErrMsg field will be zeroed. */ @@ -4430,16 +4868,15 @@ struct sqlite3_vtab { }; /* -** CAPI3REF: Virtual Table Cursor Object {H18020} +** CAPI3REF: Virtual Table Cursor Object ** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** EXPERIMENTAL ** ** Every [virtual table module] implementation uses a subclass of the ** following structure to describe cursors that point into the ** [virtual table] and are used ** to loop through the virtual table. Cursors are created using the ** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cussors are used +** by the [sqlite3_module.xClose | xClose] method. Cursors are used ** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods ** of the module. Each module implementation will define ** the content of a cursor structure to suit its own needs. @@ -4453,34 +4890,32 @@ struct sqlite3_vtab_cursor { }; /* -** CAPI3REF: Declare The Schema Of A Virtual Table {H18280} -** EXPERIMENTAL +** CAPI3REF: Declare The Schema Of A Virtual Table ** -** The [xCreate] and [xConnect] methods of a +** ^The [xCreate] and [xConnect] methods of a ** [virtual table module] call this interface ** to declare the format (the names and datatypes of the columns) of ** the virtual tables they implement. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_declare_vtab(sqlite3*, const char *zSQL); +SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL); /* -** CAPI3REF: Overload A Function For A Virtual Table {H18300} -** EXPERIMENTAL +** CAPI3REF: Overload A Function For A Virtual Table ** -** Virtual tables can provide alternative implementations of functions +** ^(Virtual tables can provide alternative implementations of functions ** using the [xFindFunction] method of the [virtual table module]. ** But global versions of those functions -** must exist in order to be overloaded. +** must exist in order to be overloaded.)^ ** -** This API makes sure a global version of a function with a particular +** ^(This API makes sure a global version of a function with a particular ** name and number of parameters exists. If no such function exists -** before this API is called, a new function is created. The implementation +** before this API is called, a new function is created.)^ ^The implementation ** of the new function always causes an exception to be thrown. So ** the new function is not good for anything by itself. Its only ** purpose is to be a placeholder function that can be overloaded ** by a [virtual table]. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); +SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); /* ** The interface to the virtual-table mechanism defined above (back up @@ -4490,82 +4925,77 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_overload_function(sqlite3*, const cha ** ** When the virtual-table mechanism stabilizes, we will declare the ** interface fixed, support it indefinitely, and remove this comment. -** -****** EXPERIMENTAL - subject to change without notice ************** */ /* -** CAPI3REF: A Handle To An Open BLOB {H17800} +** CAPI3REF: A Handle To An Open BLOB ** KEYWORDS: {BLOB handle} {BLOB handles} ** ** An instance of this object represents an open BLOB on which ** [sqlite3_blob_open | incremental BLOB I/O] can be performed. -** Objects of this type are created by [sqlite3_blob_open()] +** ^Objects of this type are created by [sqlite3_blob_open()] ** and destroyed by [sqlite3_blob_close()]. -** The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces +** ^The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces ** can be used to read or write small subsections of the BLOB. -** The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes. +** ^The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes. */ typedef struct sqlite3_blob sqlite3_blob; /* -** CAPI3REF: Open A BLOB For Incremental I/O {H17810} +** CAPI3REF: Open A BLOB For Incremental I/O ** -** This interfaces opens a [BLOB handle | handle] to the BLOB located +** ^(This interfaces opens a [BLOB handle | handle] to the BLOB located ** in row iRow, column zColumn, table zTable in database zDb; ** in other words, the same BLOB that would be selected by: ** **
     **     SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
    -** 
    {END} +** )^ ** -** If the flags parameter is non-zero, then the BLOB is opened for read -** and write access. If it is zero, the BLOB is opened for read access. -** It is not possible to open a column that is part of an index or primary +** ^If the flags parameter is non-zero, then the BLOB is opened for read +** and write access. ^If it is zero, the BLOB is opened for read access. +** ^It is not possible to open a column that is part of an index or primary ** key for writing. ^If [foreign key constraints] are enabled, it is ** not possible to open a column that is part of a [child key] for writing. ** -** Note that the database name is not the filename that contains +** ^Note that the database name is not the filename that contains ** the database but rather the symbolic name of the database that -** is assigned when the database is connected using [ATTACH]. -** For the main database file, the database name is "main". -** For TEMP tables, the database name is "temp". +** appears after the AS keyword when the database is connected using [ATTACH]. +** ^For the main database file, the database name is "main". +** ^For TEMP tables, the database name is "temp". ** -** On success, [SQLITE_OK] is returned and the new [BLOB handle] is written +** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is written ** to *ppBlob. Otherwise an [error code] is returned and *ppBlob is set -** to be a null pointer. -** This function sets the [database connection] error code and message +** to be a null pointer.)^ +** ^This function sets the [database connection] error code and message ** accessible via [sqlite3_errcode()] and [sqlite3_errmsg()] and related -** functions. Note that the *ppBlob variable is always initialized in a +** functions. ^Note that the *ppBlob variable is always initialized in a ** way that makes it safe to invoke [sqlite3_blob_close()] on *ppBlob ** regardless of the success or failure of this routine. ** -** If the row that a BLOB handle points to is modified by an +** ^(If the row that a BLOB handle points to is modified by an ** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects ** then the BLOB handle is marked as "expired". ** This is true if any column of the row is changed, even a column -** other than the one the BLOB handle is open on. -** Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for +** other than the one the BLOB handle is open on.)^ +** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for ** a expired BLOB handle fail with an return code of [SQLITE_ABORT]. -** Changes written into a BLOB prior to the BLOB expiring are not -** rollback by the expiration of the BLOB. Such changes will eventually -** commit if the transaction continues to completion. +** ^(Changes written into a BLOB prior to the BLOB expiring are not +** rolled back by the expiration of the BLOB. Such changes will eventually +** commit if the transaction continues to completion.)^ ** -** Use the [sqlite3_blob_bytes()] interface to determine the size of -** the opened blob. The size of a blob may not be changed by this +** ^Use the [sqlite3_blob_bytes()] interface to determine the size of +** the opened blob. ^The size of a blob may not be changed by this ** interface. Use the [UPDATE] SQL command to change the size of a ** blob. ** -** The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces +** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces ** and the built-in [zeroblob] SQL function can be used, if desired, ** to create an empty, zero-filled blob in which to read or write using ** this interface. ** ** To avoid a resource leak, every open [BLOB handle] should eventually ** be released by a call to [sqlite3_blob_close()]. -** -** Requirements: -** [H17813] [H17814] [H17816] [H17819] [H17821] [H17824] */ SQLITE_API int sqlite3_blob_open( sqlite3*, @@ -4578,37 +5008,34 @@ SQLITE_API int sqlite3_blob_open( ); /* -** CAPI3REF: Close A BLOB Handle {H17830} +** CAPI3REF: Close A BLOB Handle ** -** Closes an open [BLOB handle]. +** ^Closes an open [BLOB handle]. ** -** Closing a BLOB shall cause the current transaction to commit +** ^Closing a BLOB shall cause the current transaction to commit ** if there are no other BLOBs, no pending prepared statements, and the ** database connection is in [autocommit mode]. -** If any writes were made to the BLOB, they might be held in cache +** ^If any writes were made to the BLOB, they might be held in cache ** until the close operation if they will fit. ** -** Closing the BLOB often forces the changes +** ^(Closing the BLOB often forces the changes ** out to disk and so if any I/O errors occur, they will likely occur ** at the time when the BLOB is closed. Any errors that occur during -** closing are reported as a non-zero return value. +** closing are reported as a non-zero return value.)^ ** -** The BLOB is closed unconditionally. Even if this routine returns -** an error code, the BLOB is still closed. +** ^(The BLOB is closed unconditionally. Even if this routine returns +** an error code, the BLOB is still closed.)^ ** -** Calling this routine with a null pointer (which as would be returned -** by failed call to [sqlite3_blob_open()]) is a harmless no-op. -** -** Requirements: -** [H17833] [H17836] [H17839] +** ^Calling this routine with a null pointer (such as would be returned +** by a failed call to [sqlite3_blob_open()]) is a harmless no-op. */ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); /* -** CAPI3REF: Return The Size Of An Open BLOB {H17840} +** CAPI3REF: Return The Size Of An Open BLOB ** -** Returns the size in bytes of the BLOB accessible via the -** successfully opened [BLOB handle] in its only argument. The +** ^Returns the size in bytes of the BLOB accessible via the +** successfully opened [BLOB handle] in its only argument. ^The ** incremental blob I/O routines can only read or overwriting existing ** blob content; they cannot change the size of a blob. ** @@ -4616,30 +5043,27 @@ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); ** by a prior successful call to [sqlite3_blob_open()] and which has not ** been closed by [sqlite3_blob_close()]. Passing any other pointer in ** to this routine results in undefined and probably undesirable behavior. -** -** Requirements: -** [H17843] */ SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *); /* -** CAPI3REF: Read Data From A BLOB Incrementally {H17850} +** CAPI3REF: Read Data From A BLOB Incrementally ** -** This function is used to read data from an open [BLOB handle] into a +** ^(This function is used to read data from an open [BLOB handle] into a ** caller-supplied buffer. N bytes of data are copied into buffer Z -** from the open BLOB, starting at offset iOffset. +** from the open BLOB, starting at offset iOffset.)^ ** -** If offset iOffset is less than N bytes from the end of the BLOB, -** [SQLITE_ERROR] is returned and no data is read. If N or iOffset is +** ^If offset iOffset is less than N bytes from the end of the BLOB, +** [SQLITE_ERROR] is returned and no data is read. ^If N or iOffset is ** less than zero, [SQLITE_ERROR] is returned and no data is read. -** The size of the blob (and hence the maximum value of N+iOffset) +** ^The size of the blob (and hence the maximum value of N+iOffset) ** can be determined using the [sqlite3_blob_bytes()] interface. ** -** An attempt to read from an expired [BLOB handle] fails with an +** ^An attempt to read from an expired [BLOB handle] fails with an ** error code of [SQLITE_ABORT]. ** -** On success, SQLITE_OK is returned. -** Otherwise, an [error code] or an [extended error code] is returned. +** ^(On success, sqlite3_blob_read() returns SQLITE_OK. +** Otherwise, an [error code] or an [extended error code] is returned.)^ ** ** This routine only works on a [BLOB handle] which has been created ** by a prior successful call to [sqlite3_blob_open()] and which has not @@ -4647,40 +5071,37 @@ SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *); ** to this routine results in undefined and probably undesirable behavior. ** ** See also: [sqlite3_blob_write()]. -** -** Requirements: -** [H17853] [H17856] [H17859] [H17862] [H17863] [H17865] [H17868] */ SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); /* -** CAPI3REF: Write Data Into A BLOB Incrementally {H17870} +** CAPI3REF: Write Data Into A BLOB Incrementally ** -** This function is used to write data into an open [BLOB handle] from a -** caller-supplied buffer. N bytes of data are copied from the buffer Z +** ^This function is used to write data into an open [BLOB handle] from a +** caller-supplied buffer. ^N bytes of data are copied from the buffer Z ** into the open BLOB, starting at offset iOffset. ** -** If the [BLOB handle] passed as the first argument was not opened for +** ^If the [BLOB handle] passed as the first argument was not opened for ** writing (the flags parameter to [sqlite3_blob_open()] was zero), ** this function returns [SQLITE_READONLY]. ** -** This function may only modify the contents of the BLOB; it is +** ^This function may only modify the contents of the BLOB; it is ** not possible to increase the size of a BLOB using this API. -** If offset iOffset is less than N bytes from the end of the BLOB, -** [SQLITE_ERROR] is returned and no data is written. If N is +** ^If offset iOffset is less than N bytes from the end of the BLOB, +** [SQLITE_ERROR] is returned and no data is written. ^If N is ** less than zero [SQLITE_ERROR] is returned and no data is written. ** The size of the BLOB (and hence the maximum value of N+iOffset) ** can be determined using the [sqlite3_blob_bytes()] interface. ** -** An attempt to write to an expired [BLOB handle] fails with an -** error code of [SQLITE_ABORT]. Writes to the BLOB that occurred +** ^An attempt to write to an expired [BLOB handle] fails with an +** error code of [SQLITE_ABORT]. ^Writes to the BLOB that occurred ** before the [BLOB handle] expired are not rolled back by the ** expiration of the handle, though of course those changes might ** have been overwritten by the statement that expired the BLOB handle ** or by other independent statements. ** -** On success, SQLITE_OK is returned. -** Otherwise, an [error code] or an [extended error code] is returned. +** ^(On success, sqlite3_blob_write() returns SQLITE_OK. +** Otherwise, an [error code] or an [extended error code] is returned.)^ ** ** This routine only works on a [BLOB handle] which has been created ** by a prior successful call to [sqlite3_blob_open()] and which has not @@ -4688,15 +5109,11 @@ SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); ** to this routine results in undefined and probably undesirable behavior. ** ** See also: [sqlite3_blob_read()]. -** -** Requirements: -** [H17873] [H17874] [H17875] [H17876] [H17877] [H17879] [H17882] [H17885] -** [H17888] */ SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); /* -** CAPI3REF: Virtual File System Objects {H11200} +** CAPI3REF: Virtual File System Objects ** ** A virtual filesystem (VFS) is an [sqlite3_vfs] object ** that SQLite uses to interact @@ -4705,34 +5122,31 @@ SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOff ** New VFSes can be registered and existing VFSes can be unregistered. ** The following interfaces are provided. ** -** The sqlite3_vfs_find() interface returns a pointer to a VFS given its name. -** Names are case sensitive. -** Names are zero-terminated UTF-8 strings. -** If there is no match, a NULL pointer is returned. -** If zVfsName is NULL then the default VFS is returned. +** ^The sqlite3_vfs_find() interface returns a pointer to a VFS given its name. +** ^Names are case sensitive. +** ^Names are zero-terminated UTF-8 strings. +** ^If there is no match, a NULL pointer is returned. +** ^If zVfsName is NULL then the default VFS is returned. ** -** New VFSes are registered with sqlite3_vfs_register(). -** Each new VFS becomes the default VFS if the makeDflt flag is set. -** The same VFS can be registered multiple times without injury. -** To make an existing VFS into the default VFS, register it again +** ^New VFSes are registered with sqlite3_vfs_register(). +** ^Each new VFS becomes the default VFS if the makeDflt flag is set. +** ^The same VFS can be registered multiple times without injury. +** ^To make an existing VFS into the default VFS, register it again ** with the makeDflt flag set. If two different VFSes with the ** same name are registered, the behavior is undefined. If a ** VFS is registered with a name that is NULL or an empty string, ** then the behavior is undefined. ** -** Unregister a VFS with the sqlite3_vfs_unregister() interface. -** If the default VFS is unregistered, another VFS is chosen as -** the default. The choice for the new VFS is arbitrary. -** -** Requirements: -** [H11203] [H11206] [H11209] [H11212] [H11215] [H11218] +** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. +** ^(If the default VFS is unregistered, another VFS is chosen as +** the default. The choice for the new VFS is arbitrary.)^ */ SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName); SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); /* -** CAPI3REF: Mutexes {H17000} +** CAPI3REF: Mutexes ** ** The SQLite core uses these routines for thread ** synchronization. Though they are intended for internal @@ -4741,7 +5155,7 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); ** ** The SQLite source code contains multiple implementations ** of these mutex routines. An appropriate implementation -** is selected automatically at compile-time. The following +** is selected automatically at compile-time. ^(The following ** implementations are available in the SQLite core: ** **
      @@ -4749,26 +5163,26 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); **
    • SQLITE_MUTEX_PTHREAD **
    • SQLITE_MUTEX_W32 **
    • SQLITE_MUTEX_NOOP -**
    +** )^ ** -** The SQLITE_MUTEX_NOOP implementation is a set of routines +** ^The SQLITE_MUTEX_NOOP implementation is a set of routines ** that does no real locking and is appropriate for use in -** a single-threaded application. The SQLITE_MUTEX_OS2, +** a single-threaded application. ^The SQLITE_MUTEX_OS2, ** SQLITE_MUTEX_PTHREAD, and SQLITE_MUTEX_W32 implementations ** are appropriate for use on OS/2, Unix, and Windows. ** -** If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor +** ^(If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor ** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex ** implementation is included with the library. In this case the ** application must supply a custom mutex implementation using the ** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function ** before calling sqlite3_initialize() or any other public sqlite3_ -** function that calls sqlite3_initialize(). +** function that calls sqlite3_initialize().)^ ** -** {H17011} The sqlite3_mutex_alloc() routine allocates a new -** mutex and returns a pointer to it. {H17012} If it returns NULL -** that means that a mutex could not be allocated. {H17013} SQLite -** will unwind its stack and return an error. {H17014} The argument +** ^The sqlite3_mutex_alloc() routine allocates a new +** mutex and returns a pointer to it. ^If it returns NULL +** that means that a mutex could not be allocated. ^SQLite +** will unwind its stack and return an error. ^(The argument ** to sqlite3_mutex_alloc() is one of these integer constants: ** **
      @@ -4780,64 +5194,66 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); **
    • SQLITE_MUTEX_STATIC_PRNG **
    • SQLITE_MUTEX_STATIC_LRU **
    • SQLITE_MUTEX_STATIC_LRU2 -**
    +** )^ ** -** {H17015} The first two constants cause sqlite3_mutex_alloc() to create -** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE -** is used but not necessarily so when SQLITE_MUTEX_FAST is used. {END} +** ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) +** cause sqlite3_mutex_alloc() to create +** a new mutex. ^The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +** is used but not necessarily so when SQLITE_MUTEX_FAST is used. ** The mutex implementation does not need to make a distinction ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does -** not want to. {H17016} But SQLite will only request a recursive mutex in -** cases where it really needs one. {END} If a faster non-recursive mutex +** not want to. ^SQLite will only request a recursive mutex in +** cases where it really needs one. ^If a faster non-recursive mutex ** implementation is available on the host platform, the mutex subsystem ** might return such a mutex in response to SQLITE_MUTEX_FAST. ** -** {H17017} The other allowed parameters to sqlite3_mutex_alloc() each return -** a pointer to a static preexisting mutex. {END} Six static mutexes are +** ^The other allowed parameters to sqlite3_mutex_alloc() (anything other +** than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return +** a pointer to a static preexisting mutex. ^Six static mutexes are ** used by the current version of SQLite. Future versions of SQLite ** may add additional static mutexes. Static mutexes are for internal ** use by SQLite only. Applications that use SQLite mutexes should ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or ** SQLITE_MUTEX_RECURSIVE. ** -** {H17018} Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() -** returns a different mutex on every call. {H17034} But for the static +** returns a different mutex on every call. ^But for the static ** mutex types, the same mutex is returned on every call that has ** the same type number. ** -** {H17019} The sqlite3_mutex_free() routine deallocates a previously -** allocated dynamic mutex. {H17020} SQLite is careful to deallocate every -** dynamic mutex that it allocates. {A17021} The dynamic mutexes must not be in -** use when they are deallocated. {A17022} Attempting to deallocate a static -** mutex results in undefined behavior. {H17023} SQLite never deallocates -** a static mutex. {END} +** ^The sqlite3_mutex_free() routine deallocates a previously +** allocated dynamic mutex. ^SQLite is careful to deallocate every +** dynamic mutex that it allocates. The dynamic mutexes must not be in +** use when they are deallocated. Attempting to deallocate a static +** mutex results in undefined behavior. ^SQLite never deallocates +** a static mutex. ** -** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt -** to enter a mutex. {H17024} If another thread is already within the mutex, +** ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +** to enter a mutex. ^If another thread is already within the mutex, ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return -** SQLITE_BUSY. {H17025} The sqlite3_mutex_try() interface returns [SQLITE_OK] -** upon successful entry. {H17026} Mutexes created using +** SQLITE_BUSY. ^The sqlite3_mutex_try() interface returns [SQLITE_OK] +** upon successful entry. ^(Mutexes created using ** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread. -** {H17027} In such cases the, +** In such cases the, ** mutex must be exited an equal number of times before another thread -** can enter. {A17028} If the same thread tries to enter any other +** can enter.)^ ^(If the same thread tries to enter any other ** kind of mutex more than once, the behavior is undefined. -** {H17029} SQLite will never exhibit -** such behavior in its own use of mutexes. +** SQLite will never exhibit +** such behavior in its own use of mutexes.)^ ** -** Some systems (for example, Windows 95) do not support the operation +** ^(Some systems (for example, Windows 95) do not support the operation ** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() -** will always return SQLITE_BUSY. {H17030} The SQLite core only ever uses -** sqlite3_mutex_try() as an optimization so this is acceptable behavior. +** will always return SQLITE_BUSY. The SQLite core only ever uses +** sqlite3_mutex_try() as an optimization so this is acceptable behavior.)^ ** -** {H17031} The sqlite3_mutex_leave() routine exits a mutex that was -** previously entered by the same thread. {A17032} The behavior +** ^The sqlite3_mutex_leave() routine exits a mutex that was +** previously entered by the same thread. ^(The behavior ** is undefined if the mutex is not currently entered by the -** calling thread or is not currently allocated. {H17033} SQLite will -** never do either. {END} +** calling thread or is not currently allocated. SQLite will +** never do either.)^ ** -** If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or +** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** @@ -4850,8 +5266,7 @@ SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); /* -** CAPI3REF: Mutex Methods Object {H17120} -** EXPERIMENTAL +** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. @@ -4866,19 +5281,19 @@ SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); ** output variable when querying the system for the current mutex ** implementation, using the [SQLITE_CONFIG_GETMUTEX] option. ** -** The xMutexInit method defined by this structure is invoked as +** ^The xMutexInit method defined by this structure is invoked as ** part of system initialization by the sqlite3_initialize() function. -** {H17001} The xMutexInit routine shall be called by SQLite once for each +** ^The xMutexInit routine is called by SQLite exactly once for each ** effective call to [sqlite3_initialize()]. ** -** The xMutexEnd method defined by this structure is invoked as +** ^The xMutexEnd method defined by this structure is invoked as ** part of system shutdown by the sqlite3_shutdown() function. The ** implementation of this method is expected to release all outstanding ** resources obtained by the mutex methods implementation, especially -** those obtained by the xMutexInit method. {H17003} The xMutexEnd() -** interface shall be invoked once for each call to [sqlite3_shutdown()]. +** those obtained by the xMutexInit method. ^The xMutexEnd() +** interface is invoked exactly once for each call to [sqlite3_shutdown()]. ** -** The remaining seven methods defined by this structure (xMutexAlloc, +** ^(The remaining seven methods defined by this structure (xMutexAlloc, ** xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and ** xMutexNotheld) implement the following interfaces (respectively): ** @@ -4890,7 +5305,7 @@ SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); **
  • [sqlite3_mutex_leave()]
  • **
  • [sqlite3_mutex_held()]
  • **
  • [sqlite3_mutex_notheld()]
  • -** +** )^ ** ** The only difference is that the public sqlite3_XXX functions enumerated ** above silently ignore any invocations that pass a NULL pointer instead @@ -4900,17 +5315,17 @@ SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); ** (i.e. it is acceptable to provide an implementation that segfaults if ** it is passed a NULL pointer). ** -** The xMutexInit() method must be threadsafe. It must be harmless to -** invoke xMutexInit() mutiple times within the same process and without +** The xMutexInit() method must be threadsafe. ^It must be harmless to +** invoke xMutexInit() multiple times within the same process and without ** intervening calls to xMutexEnd(). Second and subsequent calls to ** xMutexInit() must be no-ops. ** -** xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] -** and its associates). Similarly, xMutexAlloc() must not use SQLite memory -** allocation for a static mutex. However xMutexAlloc() may use SQLite +** ^xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] +** and its associates). ^Similarly, xMutexAlloc() must not use SQLite memory +** allocation for a static mutex. ^However xMutexAlloc() may use SQLite ** memory allocation for a fast or recursive mutex. ** -** SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is +** ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is ** called, but only if the prior call to xMutexInit returned SQLITE_OK. ** If xMutexInit fails in any way, it is expected to clean up after itself ** prior to returning. @@ -4929,39 +5344,41 @@ struct sqlite3_mutex_methods { }; /* -** CAPI3REF: Mutex Verification Routines {H17080} +** CAPI3REF: Mutex Verification Routines ** ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines -** are intended for use inside assert() statements. {H17081} The SQLite core +** are intended for use inside assert() statements. ^The SQLite core ** never uses these routines except inside an assert() and applications -** are advised to follow the lead of the core. {H17082} The core only +** are advised to follow the lead of the core. ^The SQLite core only ** provides implementations for these routines when it is compiled -** with the SQLITE_DEBUG flag. {A17087} External mutex implementations +** with the SQLITE_DEBUG flag. ^External mutex implementations ** are only required to provide these routines if SQLITE_DEBUG is ** defined and if NDEBUG is not defined. ** -** {H17083} These routines should return true if the mutex in their argument +** ^These routines should return true if the mutex in their argument ** is held or not held, respectively, by the calling thread. ** -** {X17084} The implementation is not required to provided versions of these +** ^The implementation is not required to provided versions of these ** routines that actually work. If the implementation does not provide working ** versions of these routines, it should at least provide stubs that always ** return true so that one does not get spurious assertion failures. ** -** {H17085} If the argument to sqlite3_mutex_held() is a NULL pointer then -** the routine should return 1. {END} This seems counter-intuitive since +** ^If the argument to sqlite3_mutex_held() is a NULL pointer then +** the routine should return 1. This seems counter-intuitive since ** clearly the mutex cannot be held if it does not exist. But the ** the reason the mutex does not exist is because the build is not ** using mutexes. And we do not want the assert() containing the ** call to sqlite3_mutex_held() to fail, so a non-zero return is -** the appropriate thing to do. {H17086} The sqlite3_mutex_notheld() +** the appropriate thing to do. ^The sqlite3_mutex_notheld() ** interface should also return 1 when given a NULL pointer. */ +#ifndef NDEBUG SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); +#endif /* -** CAPI3REF: Mutex Types {H17001} +** CAPI3REF: Mutex Types ** ** The [sqlite3_mutex_alloc()] interface takes a single argument ** which is one of these integer constants. @@ -4981,48 +5398,50 @@ SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); #define SQLITE_MUTEX_STATIC_LRU2 7 /* lru page list */ /* -** CAPI3REF: Retrieve the mutex for a database connection {H17002} +** CAPI3REF: Retrieve the mutex for a database connection ** -** This interface returns a pointer the [sqlite3_mutex] object that +** ^This interface returns a pointer the [sqlite3_mutex] object that ** serializes access to the [database connection] given in the argument ** when the [threading mode] is Serialized. -** If the [threading mode] is Single-thread or Multi-thread then this +** ^If the [threading mode] is Single-thread or Multi-thread then this ** routine returns a NULL pointer. */ SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*); /* -** CAPI3REF: Low-Level Control Of Database Files {H11300} +** CAPI3REF: Low-Level Control Of Database Files ** -** {H11301} The [sqlite3_file_control()] interface makes a direct call to the +** ^The [sqlite3_file_control()] interface makes a direct call to the ** xFileControl method for the [sqlite3_io_methods] object associated -** with a particular database identified by the second argument. {H11302} The -** name of the database is the name assigned to the database by the -** ATTACH SQL command that opened the -** database. {H11303} To control the main database file, use the name "main" -** or a NULL pointer. {H11304} The third and fourth parameters to this routine +** with a particular database identified by the second argument. ^The +** name of the database "main" for the main database or "temp" for the +** TEMP database, or the name that appears after the AS keyword for +** databases that are added using the [ATTACH] SQL command. +** ^A NULL pointer can be used in place of "main" to refer to the +** main database file. +** ^The third and fourth parameters to this routine ** are passed directly through to the second and third parameters of -** the xFileControl method. {H11305} The return value of the xFileControl +** the xFileControl method. ^The return value of the xFileControl ** method becomes the return value of this routine. ** -** {H11306} If the second parameter (zDbName) does not match the name of any -** open database file, then SQLITE_ERROR is returned. {H11307} This error +** ^If the second parameter (zDbName) does not match the name of any +** open database file, then SQLITE_ERROR is returned. ^This error ** code is not remembered and will not be recalled by [sqlite3_errcode()] -** or [sqlite3_errmsg()]. {A11308} The underlying xFileControl method might -** also return SQLITE_ERROR. {A11309} There is no way to distinguish between +** or [sqlite3_errmsg()]. The underlying xFileControl method might +** also return SQLITE_ERROR. There is no way to distinguish between ** an incorrect zDbName and an SQLITE_ERROR return from the underlying -** xFileControl method. {END} +** xFileControl method. ** ** See also: [SQLITE_FCNTL_LOCKSTATE] */ SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); /* -** CAPI3REF: Testing Interface {H11400} +** CAPI3REF: Testing Interface ** -** The sqlite3_test_control() interface is used to read out internal +** ^The sqlite3_test_control() interface is used to read out internal ** state of SQLite and to inject faults into SQLite for testing -** purposes. The first parameter is an operation code that determines +** purposes. ^The first parameter is an operation code that determines ** the number, meaning, and operation of all subsequent parameters. ** ** This interface is not for use by applications. It exists solely @@ -5037,7 +5456,7 @@ SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void* SQLITE_API int sqlite3_test_control(int op, ...); /* -** CAPI3REF: Testing Interface Operation Codes {H11410} +** CAPI3REF: Testing Interface Operation Codes ** ** These constants are the valid operation code parameters used ** as the first argument to [sqlite3_test_control()]. @@ -5047,6 +5466,7 @@ SQLITE_API int sqlite3_test_control(int op, ...); ** Applications should not use any of these parameters or the ** [sqlite3_test_control()] interface. */ +#define SQLITE_TESTCTRL_FIRST 5 #define SQLITE_TESTCTRL_PRNG_SAVE 5 #define SQLITE_TESTCTRL_PRNG_RESTORE 6 #define SQLITE_TESTCTRL_PRNG_RESET 7 @@ -5057,27 +5477,31 @@ SQLITE_API int sqlite3_test_control(int op, ...); #define SQLITE_TESTCTRL_ASSERT 12 #define SQLITE_TESTCTRL_ALWAYS 13 #define SQLITE_TESTCTRL_RESERVE 14 +#define SQLITE_TESTCTRL_OPTIMIZATIONS 15 +#define SQLITE_TESTCTRL_ISKEYWORD 16 +#define SQLITE_TESTCTRL_PGHDRSZ 17 +#define SQLITE_TESTCTRL_SCRATCHMALLOC 18 +#define SQLITE_TESTCTRL_LAST 18 /* -** CAPI3REF: SQLite Runtime Status {H17200} -** EXPERIMENTAL +** CAPI3REF: SQLite Runtime Status ** -** This interface is used to retrieve runtime status information -** about the preformance of SQLite, and optionally to reset various -** highwater marks. The first argument is an integer code for -** the specific parameter to measure. Recognized integer codes -** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...]. -** The current value of the parameter is returned into *pCurrent. -** The highest recorded value is returned in *pHighwater. If the +** ^This interface is used to retrieve runtime status information +** about the performance of SQLite, and optionally to reset various +** highwater marks. ^The first argument is an integer code for +** the specific parameter to measure. ^(Recognized integer codes +** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...].)^ +** ^The current value of the parameter is returned into *pCurrent. +** ^The highest recorded value is returned in *pHighwater. ^If the ** resetFlag is true, then the highest record value is reset after -** *pHighwater is written. Some parameters do not record the highest +** *pHighwater is written. ^(Some parameters do not record the highest ** value. For those parameters -** nothing is written into *pHighwater and the resetFlag is ignored. -** Other parameters record only the highwater mark and not the current -** value. For these latter parameters nothing is written into *pCurrent. +** nothing is written into *pHighwater and the resetFlag is ignored.)^ +** ^(Other parameters record only the highwater mark and not the current +** value. For these latter parameters nothing is written into *pCurrent.)^ ** -** This routine returns SQLITE_OK on success and a non-zero -** [error code] on failure. +** ^The sqlite3_status() routine returns SQLITE_OK on success and a +** non-zero [error code] on failure. ** ** This routine is threadsafe but is not atomic. This routine can be ** called while other threads are running the same or different SQLite @@ -5088,18 +5512,17 @@ SQLITE_API int sqlite3_test_control(int op, ...); ** ** See also: [sqlite3_db_status()] */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); +SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); /* -** CAPI3REF: Status Parameters {H17250} -** EXPERIMENTAL +** CAPI3REF: Status Parameters ** ** These integer constants designate various run-time status parameters ** that can be returned by [sqlite3_status()]. ** **
    -**
    SQLITE_STATUS_MEMORY_USED
    +** ^(
    SQLITE_STATUS_MEMORY_USED
    **
    This parameter is the current amount of memory checked out ** using [sqlite3_malloc()], either directly or indirectly. The ** figure includes calls made to [sqlite3_malloc()] by the application @@ -5107,63 +5530,66 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pH ** controlled by [SQLITE_CONFIG_SCRATCH] and auxiliary page-cache ** memory controlled by [SQLITE_CONFIG_PAGECACHE] is not included in ** this parameter. The amount returned is the sum of the allocation -** sizes as reported by the xSize method in [sqlite3_mem_methods].
    +** sizes as reported by the xSize method in [sqlite3_mem_methods].)^ ** -**
    SQLITE_STATUS_MALLOC_SIZE
    +** ^(
    SQLITE_STATUS_MALLOC_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their ** internal equivalents). Only the value returned in the ** *pHighwater parameter to [sqlite3_status()] is of interest. -** The value written into the *pCurrent parameter is undefined.
    +** The value written into the *pCurrent parameter is undefined.)^ ** -**
    SQLITE_STATUS_PAGECACHE_USED
    +** ^(
    SQLITE_STATUS_MALLOC_COUNT
    +**
    This parameter records the number of separate memory allocations.
    )^ +** +** ^(
    SQLITE_STATUS_PAGECACHE_USED
    **
    This parameter returns the number of pages used out of the ** [pagecache memory allocator] that was configured using ** [SQLITE_CONFIG_PAGECACHE]. The -** value returned is in pages, not in bytes.
    +** value returned is in pages, not in bytes.)^ ** -**
    SQLITE_STATUS_PAGECACHE_OVERFLOW
    +** ^(
    SQLITE_STATUS_PAGECACHE_OVERFLOW
    **
    This parameter returns the number of bytes of page cache -** allocation which could not be statisfied by the [SQLITE_CONFIG_PAGECACHE] +** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] ** buffer and where forced to overflow to [sqlite3_malloc()]. The ** returned value includes allocations that overflowed because they ** where too large (they were larger than the "sz" parameter to ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because -** no space was left in the page cache.
    +** no space was left in the page cache.)^ ** -**
    SQLITE_STATUS_PAGECACHE_SIZE
    +** ^(
    SQLITE_STATUS_PAGECACHE_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [pagecache memory allocator]. Only the value returned in the ** *pHighwater parameter to [sqlite3_status()] is of interest. -** The value written into the *pCurrent parameter is undefined.
    +** The value written into the *pCurrent parameter is undefined.)^ ** -**
    SQLITE_STATUS_SCRATCH_USED
    +** ^(
    SQLITE_STATUS_SCRATCH_USED
    **
    This parameter returns the number of allocations used out of the ** [scratch memory allocator] configured using ** [SQLITE_CONFIG_SCRATCH]. The value returned is in allocations, not ** in bytes. Since a single thread may only have one scratch allocation ** outstanding at time, this parameter also reports the number of threads -** using scratch memory at the same time.
    +** using scratch memory at the same time.)^ ** -**
    SQLITE_STATUS_SCRATCH_OVERFLOW
    +** ^(
    SQLITE_STATUS_SCRATCH_OVERFLOW
    **
    This parameter returns the number of bytes of scratch memory -** allocation which could not be statisfied by the [SQLITE_CONFIG_SCRATCH] +** allocation which could not be satisfied by the [SQLITE_CONFIG_SCRATCH] ** buffer and where forced to overflow to [sqlite3_malloc()]. The values ** returned include overflows because the requested allocation was too ** larger (that is, because the requested allocation was larger than the ** "sz" parameter to [SQLITE_CONFIG_SCRATCH]) and because no scratch buffer ** slots were available. -**
    +** )^ ** -**
    SQLITE_STATUS_SCRATCH_SIZE
    +** ^(
    SQLITE_STATUS_SCRATCH_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [scratch memory allocator]. Only the value returned in the ** *pHighwater parameter to [sqlite3_status()] is of interest. -** The value written into the *pCurrent parameter is undefined.
    +** The value written into the *pCurrent parameter is undefined.)^ ** -**
    SQLITE_STATUS_PARSER_STACK
    +** ^(
    SQLITE_STATUS_PARSER_STACK
    **
    This parameter records the deepest parser stack. It is only -** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].
    +** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].)^ **
    ** ** New status parameters may be added from time to time. @@ -5177,30 +5603,34 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pH #define SQLITE_STATUS_PARSER_STACK 6 #define SQLITE_STATUS_PAGECACHE_SIZE 7 #define SQLITE_STATUS_SCRATCH_SIZE 8 +#define SQLITE_STATUS_MALLOC_COUNT 9 /* -** CAPI3REF: Database Connection Status {H17500} -** EXPERIMENTAL +** CAPI3REF: Database Connection Status ** -** This interface is used to retrieve runtime status information -** about a single [database connection]. The first argument is the -** database connection object to be interrogated. The second argument -** is the parameter to interrogate. Currently, the only allowed value -** for the second parameter is [SQLITE_DBSTATUS_LOOKASIDE_USED]. -** Additional options will likely appear in future releases of SQLite. +** ^This interface is used to retrieve runtime status information +** about a single [database connection]. ^The first argument is the +** database connection object to be interrogated. ^The second argument +** is an integer constant, taken from the set of +** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros, that +** determines the parameter to interrogate. The set of +** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros is likely +** to grow in future releases of SQLite. ** -** The current value of the requested parameter is written into *pCur -** and the highest instantaneous value is written into *pHiwtr. If +** ^The current value of the requested parameter is written into *pCur +** and the highest instantaneous value is written into *pHiwtr. ^If ** the resetFlg is true, then the highest instantaneous value is ** reset back down to the current value. ** +** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a +** non-zero [error code] on failure. +** ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); +SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); /* -** CAPI3REF: Status Parameters for database connections {H17520} -** EXPERIMENTAL +** CAPI3REF: Status Parameters for database connections ** ** These constants are the available integer "verbs" that can be passed as ** the second argument to the [sqlite3_db_status()] interface. @@ -5212,43 +5642,66 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_status(sqlite3*, int op, int *pCur ** if a discontinued or unsupported verb is invoked. ** **
    -**
    SQLITE_DBSTATUS_LOOKASIDE_USED
    +** ^(
    SQLITE_DBSTATUS_LOOKASIDE_USED
    **
    This parameter returns the number of lookaside memory slots currently -** checked out.
    +** checked out.)^ +** +** ^(
    SQLITE_DBSTATUS_CACHE_USED
    +**
    This parameter returns the approximate number of of bytes of heap +** memory used by all pager caches associated with the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. +** +** ^(
    SQLITE_DBSTATUS_SCHEMA_USED
    +**
    This parameter returns the approximate number of of bytes of heap +** memory used to store the schema for all databases associated +** with the connection - main, temp, and any [ATTACH]-ed databases.)^ +** ^The full amount of memory used by the schemas is reported, even if the +** schema memory is shared with other database connections due to +** [shared cache mode] being enabled. +** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. +** +** ^(
    SQLITE_DBSTATUS_STMT_USED
    +**
    This parameter returns the approximate number of of bytes of heap +** and lookaside memory used by all prepared statements associated with +** the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0. +**
    **
    */ #define SQLITE_DBSTATUS_LOOKASIDE_USED 0 +#define SQLITE_DBSTATUS_CACHE_USED 1 +#define SQLITE_DBSTATUS_SCHEMA_USED 2 +#define SQLITE_DBSTATUS_STMT_USED 3 +#define SQLITE_DBSTATUS_MAX 3 /* Largest defined DBSTATUS */ /* -** CAPI3REF: Prepared Statement Status {H17550} -** EXPERIMENTAL +** CAPI3REF: Prepared Statement Status ** -** Each prepared statement maintains various +** ^(Each prepared statement maintains various ** [SQLITE_STMTSTATUS_SORT | counters] that measure the number -** of times it has performed specific operations. These counters can +** of times it has performed specific operations.)^ These counters can ** be used to monitor the performance characteristics of the prepared ** statements. For example, if the number of table steps greatly exceeds ** the number of table searches or result rows, that would tend to indicate ** that the prepared statement is using a full table scan rather than ** an index. ** -** This interface is used to retrieve and reset counter values from +** ^(This interface is used to retrieve and reset counter values from ** a [prepared statement]. The first argument is the prepared statement ** object to be interrogated. The second argument ** is an integer code for a specific [SQLITE_STMTSTATUS_SORT | counter] -** to be interrogated. -** The current value of the requested counter is returned. -** If the resetFlg is true, then the counter is reset to zero after this +** to be interrogated.)^ +** ^The current value of the requested counter is returned. +** ^If the resetFlg is true, then the counter is reset to zero after this ** interface call returns. ** ** See also: [sqlite3_status()] and [sqlite3_db_status()]. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); +SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); /* -** CAPI3REF: Status Parameters for prepared statements {H17570} -** EXPERIMENTAL +** CAPI3REF: Status Parameters for prepared statements ** ** These preprocessor macros define integer codes that name counter ** values associated with the [sqlite3_stmt_status()] interface. @@ -5256,24 +5709,31 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_stmt_status(sqlite3_stmt*, int op,int ** **
    **
    SQLITE_STMTSTATUS_FULLSCAN_STEP
    -**
    This is the number of times that SQLite has stepped forward in +**
    ^This is the number of times that SQLite has stepped forward in ** a table as part of a full table scan. Large numbers for this counter ** may indicate opportunities for performance improvement through ** careful use of indices.
    ** **
    SQLITE_STMTSTATUS_SORT
    -**
    This is the number of sort operations that have occurred. +**
    ^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to ** improvement performance through careful use of indices.
    ** +**
    SQLITE_STMTSTATUS_AUTOINDEX
    +**
    ^This is the number of rows inserted into transient indices that +** were created automatically in order to help joins run faster. +** A non-zero value in this counter may indicate an opportunity to +** improvement performance by adding permanent indices that do not +** need to be reinitialized each time the statement is run.
    +** **
    */ #define SQLITE_STMTSTATUS_FULLSCAN_STEP 1 #define SQLITE_STMTSTATUS_SORT 2 +#define SQLITE_STMTSTATUS_AUTOINDEX 3 /* ** CAPI3REF: Custom Page Cache Object -** EXPERIMENTAL ** ** The sqlite3_pcache type is opaque. It is implemented by ** the pluggable module. The SQLite core has no knowledge of @@ -5288,84 +5748,96 @@ typedef struct sqlite3_pcache sqlite3_pcache; /* ** CAPI3REF: Application Defined Page Cache. ** KEYWORDS: {page cache} -** EXPERIMENTAL ** -** The [sqlite3_config]([SQLITE_CONFIG_PCACHE], ...) interface can +** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE], ...) interface can ** register an alternative page cache implementation by passing in an -** instance of the sqlite3_pcache_methods structure. The majority of the -** heap memory used by SQLite is used by the page cache to cache data read -** from, or ready to be written to, the database file. By implementing a -** custom page cache using this API, an application can control more -** precisely the amount of memory consumed by SQLite, the way in which +** instance of the sqlite3_pcache_methods structure.)^ +** In many applications, most of the heap memory allocated by +** SQLite is used for the page cache. +** By implementing a +** custom page cache using this API, an application can better control +** the amount of memory consumed by SQLite, the way in which ** that memory is allocated and released, and the policies used to ** determine exactly which parts of a database file are cached and for ** how long. ** -** The contents of the sqlite3_pcache_methods structure are copied to an +** The alternative page cache mechanism is an +** extreme measure that is only needed by the most demanding applications. +** The built-in page cache is recommended for most uses. +** +** ^(The contents of the sqlite3_pcache_methods structure are copied to an ** internal buffer by SQLite within the call to [sqlite3_config]. Hence ** the application may discard the parameter after the call to -** [sqlite3_config()] returns. +** [sqlite3_config()] returns.)^ ** -** The xInit() method is called once for each call to [sqlite3_initialize()] -** (usually only once during the lifetime of the process). It is passed -** a copy of the sqlite3_pcache_methods.pArg value. It can be used to set -** up global structures and mutexes required by the custom page cache -** implementation. +** ^(The xInit() method is called once for each effective +** call to [sqlite3_initialize()])^ +** (usually only once during the lifetime of the process). ^(The xInit() +** method is passed a copy of the sqlite3_pcache_methods.pArg value.)^ +** The intent of the xInit() method is to set up global data structures +** required by the custom page cache implementation. +** ^(If the xInit() method is NULL, then the +** built-in default page cache is used instead of the application defined +** page cache.)^ ** -** The xShutdown() method is called from within [sqlite3_shutdown()], -** if the application invokes this API. It can be used to clean up +** ^The xShutdown() method is called by [sqlite3_shutdown()]. +** It can be used to clean up ** any outstanding resources before process shutdown, if required. +** ^The xShutdown() method may be NULL. ** -** SQLite holds a [SQLITE_MUTEX_RECURSIVE] mutex when it invokes -** the xInit method, so the xInit method need not be threadsafe. The +** ^SQLite automatically serializes calls to the xInit method, +** so the xInit method need not be threadsafe. ^The ** xShutdown method is only called from [sqlite3_shutdown()] so it does ** not need to be threadsafe either. All other methods must be threadsafe ** in multithreaded applications. ** -** SQLite will never invoke xInit() more than once without an intervening +** ^SQLite will never invoke xInit() more than once without an intervening ** call to xShutdown(). ** -** The xCreate() method is used to construct a new cache instance. SQLite -** will typically create one cache instance for each open database file, -** though this is not guaranteed. The +** ^SQLite invokes the xCreate() method to construct a new cache instance. +** SQLite will typically create one cache instance for each open database file, +** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. szPage will not be a power of two. szPage +** be allocated by the cache. ^szPage will not be a power of two. ^szPage ** will the page size of the database file that is to be cached plus an ** increment (here called "R") of about 100 or 200. SQLite will use the ** extra R bytes on each page to store metadata about the underlying ** database page on disk. The value of R depends ** on the SQLite version, the target platform, and how SQLite was compiled. -** R is constant for a particular build of SQLite. The second argument to +** ^R is constant for a particular build of SQLite. ^The second argument to ** xCreate(), bPurgeable, is true if the cache being created will ** be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation ** does not have to do anything special based with the value of bPurgeable; -** it is purely advisory. On a cache where bPurgeable is false, SQLite will +** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. -** In other words, a cache created with bPurgeable set to false will +** ^In other words, calls to xUnpin() on a cache with bPurgeable set to +** false will always have the "discard" flag set to true. +** ^Hence, a cache created with bPurgeable false will ** never contain any unpinned pages. ** -** The xCachesize() method may be called at any time by SQLite to set the +** ^(The xCachesize() method may be called at any time by SQLite to set the ** suggested maximum cache-size (number of pages stored by) the cache ** instance passed as the first argument. This is the value configured using -** the SQLite "[PRAGMA cache_size]" command. As with the bPurgeable parameter, -** the implementation is not required to do anything with this +** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable +** parameter, the implementation is not required to do anything with this ** value; it is advisory only. ** -** The xPagecount() method should return the number of pages currently -** stored in the cache. +** The xPagecount() method must return the number of pages currently +** stored in the cache, both pinned and unpinned. ** -** The xFetch() method is used to fetch a page and return a pointer to it. -** A 'page', in this context, is a buffer of szPage bytes aligned at an -** 8-byte boundary. The page to be fetched is determined by the key. The -** mimimum key value is 1. After it has been retrieved using xFetch, the page +** The xFetch() method locates a page in the cache and returns a pointer to +** the page, or a NULL pointer. +** A "page", in this context, means a buffer of szPage bytes aligned at an +** 8-byte boundary. The page to be fetched is determined by the key. ^The +** mimimum key value is 1. After it has been retrieved using xFetch, the page ** is considered to be "pinned". ** ** If the requested page is already in the page cache, then the page cache ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the -** behavior of the cache implementation is determined by the value of the -** createFlag parameter passed to xFetch, according to the following table: +** behavior of the cache implementation should use the value of the createFlag +** parameter to help it determined what action to take: ** ** **
    createFlag Behaviour when page is not already in cache @@ -5376,29 +5848,28 @@ typedef struct sqlite3_pcache sqlite3_pcache; ** NULL if allocating a new page is effectively impossible. **
    ** -** SQLite will normally invoke xFetch() with a createFlag of 0 or 1. If -** a call to xFetch() with createFlag==1 returns NULL, then SQLite will +** ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1. SQLite +** will only use a createFlag of 2 after a prior call with a createFlag of 1 +** failed.)^ In between the to xFetch() calls, SQLite may ** attempt to unpin one or more cache pages by spilling the content of -** pinned pages to disk and synching the operating system disk cache. After -** attempting to unpin pages, the xFetch() method will be invoked again with -** a createFlag of 2. +** pinned pages to disk and synching the operating system disk cache. ** -** xUnpin() is called by SQLite with a pointer to a currently pinned page -** as its second argument. If the third parameter, discard, is non-zero, -** then the page should be evicted from the cache. In this case SQLite -** assumes that the next time the page is retrieved from the cache using -** the xFetch() method, it will be zeroed. If the discard parameter is -** zero, then the page is considered to be unpinned. The cache implementation +** ^xUnpin() is called by SQLite with a pointer to a currently pinned page +** as its second argument. If the third parameter, discard, is non-zero, +** then the page must be evicted from the cache. +** ^If the discard parameter is +** zero, then the page may be discarded or retained at the discretion of +** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** -** The cache is not required to perform any reference counting. A single +** The cache must not perform any reference counting. A single ** call to xUnpin() unpins the page regardless of the number of prior calls ** to xFetch(). ** ** The xRekey() method is used to change the key value associated with the -** page passed as the second argument from oldKey to newKey. If the cache -** previously contains an entry associated with newKey, it should be -** discarded. Any prior cache entry associated with newKey is guaranteed not +** page passed as the second argument. If the cache +** previously contains an entry associated with newKey, it must be +** discarded. ^Any prior cache entry associated with newKey is guaranteed not ** to be pinned. ** ** When SQLite calls the xTruncate() method, the cache must discard all @@ -5407,8 +5878,8 @@ typedef struct sqlite3_pcache sqlite3_pcache; ** of these pages are pinned, they are implicitly unpinned, meaning that ** they can be safely discarded. ** -** The xDestroy() method is used to delete a cache allocated by xCreate(). -** All resources associated with the specified cache should be freed. After +** ^The xDestroy() method is used to delete a cache allocated by xCreate(). +** All resources associated with the specified cache should be freed. ^After ** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] ** handle invalid, and will not use it with any other sqlite3_pcache_methods ** functions. @@ -5430,10 +5901,9 @@ struct sqlite3_pcache_methods { /* ** CAPI3REF: Online Backup Object -** EXPERIMENTAL ** ** The sqlite3_backup object records state information about an ongoing -** online backup operation. The sqlite3_backup object is created by +** online backup operation. ^The sqlite3_backup object is created by ** a call to [sqlite3_backup_init()] and is destroyed by a call to ** [sqlite3_backup_finish()]. ** @@ -5443,22 +5913,21 @@ typedef struct sqlite3_backup sqlite3_backup; /* ** CAPI3REF: Online Backup API. -** EXPERIMENTAL ** -** This API is used to overwrite the contents of one database with that -** of another. It is useful either for creating backups of databases or +** The backup API copies the content of one database into another. +** It is useful either for creating backups of databases or ** for copying in-memory databases to or from persistent files. ** ** See Also: [Using the SQLite Online Backup API] ** -** Exclusive access is required to the destination database for the -** duration of the operation. However the source database is only -** read-locked while it is actually being read, it is not locked -** continuously for the entire operation. Thus, the backup may be -** performed on a live database without preventing other users from -** writing to the database for an extended period of time. +** ^Exclusive access is required to the destination database for the +** duration of the operation. ^However the source database is only +** read-locked while it is actually being read; it is not locked +** continuously for the entire backup operation. ^Thus, the backup may be +** performed on a live source database without preventing other users from +** reading or writing to the source database while the backup is underway. ** -** To perform a backup operation: +** ^(To perform a backup operation: **
      **
    1. sqlite3_backup_init() is called once to initialize the ** backup, @@ -5466,143 +5935,152 @@ typedef struct sqlite3_backup sqlite3_backup; ** the data between the two databases, and finally **
    2. sqlite3_backup_finish() is called to release all resources ** associated with the backup operation. -**
    +** )^ ** There should be exactly one call to sqlite3_backup_finish() for each ** successful call to sqlite3_backup_init(). ** ** sqlite3_backup_init() ** -** The first two arguments passed to [sqlite3_backup_init()] are the database -** handle associated with the destination database and the database name -** used to attach the destination database to the handle. The database name -** is "main" for the main database, "temp" for the temporary database, or -** the name specified as part of the [ATTACH] statement if the destination is -** an attached database. The third and fourth arguments passed to -** sqlite3_backup_init() identify the [database connection] -** and database name used -** to access the source database. The values passed for the source and -** destination [database connection] parameters must not be the same. +** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the +** [database connection] associated with the destination database +** and the database name, respectively. +** ^The database name is "main" for the main database, "temp" for the +** temporary database, or the name specified after the AS keyword in +** an [ATTACH] statement for an attached database. +** ^The S and M arguments passed to +** sqlite3_backup_init(D,N,S,M) identify the [database connection] +** and database name of the source database, respectively. +** ^The source and destination [database connections] (parameters S and D) +** must be different or else sqlite3_backup_init(D,N,S,M) will file with +** an error. ** -** If an error occurs within sqlite3_backup_init(), then NULL is returned -** and an error code and error message written into the [database connection] -** passed as the first argument. They may be retrieved using the -** [sqlite3_errcode()], [sqlite3_errmsg()], and [sqlite3_errmsg16()] functions. -** Otherwise, if successful, a pointer to an [sqlite3_backup] object is -** returned. This pointer may be used with the sqlite3_backup_step() and +** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is +** returned and an error code and error message are store3d in the +** destination [database connection] D. +** ^The error code and message for the failed call to sqlite3_backup_init() +** can be retrieved using the [sqlite3_errcode()], [sqlite3_errmsg()], and/or +** [sqlite3_errmsg16()] functions. +** ^A successful call to sqlite3_backup_init() returns a pointer to an +** [sqlite3_backup] object. +** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and ** sqlite3_backup_finish() functions to perform the specified backup ** operation. ** ** sqlite3_backup_step() ** -** Function [sqlite3_backup_step()] is used to copy up to nPage pages between -** the source and destination databases, where nPage is the value of the -** second parameter passed to sqlite3_backup_step(). If nPage is a negative -** value, all remaining source pages are copied. If the required pages are -** successfully copied, but there are still more pages to copy before the -** backup is complete, it returns [SQLITE_OK]. If no error occured and there -** are no more pages to copy, then [SQLITE_DONE] is returned. If an error -** occurs, then an SQLite error code is returned. As well as [SQLITE_OK] and +** ^Function sqlite3_backup_step(B,N) will copy up to N pages between +** the source and destination databases specified by [sqlite3_backup] object B. +** ^If N is negative, all remaining source pages are copied. +** ^If sqlite3_backup_step(B,N) successfully copies N pages and there +** are still more pages to be copied, then the function resturns [SQLITE_OK]. +** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages +** from source to destination, then it returns [SQLITE_DONE]. +** ^If an error occurs while running sqlite3_backup_step(B,N), +** then an [error code] is returned. ^As well as [SQLITE_OK] and ** [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY], ** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an ** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code. ** -** As well as the case where the destination database file was opened for -** read-only access, sqlite3_backup_step() may return [SQLITE_READONLY] if -** the destination is an in-memory database with a different page size -** from the source database. +** ^(The sqlite3_backup_step() might return [SQLITE_READONLY] if +**
      +**
    1. the destination database was opened read-only, or +**
    2. the destination database is using write-ahead-log journaling +** and the destination and source page sizes differ, or +**
    3. The destination database is an in-memory database and the +** destination and source page sizes differ. +**
    )^ ** -** If sqlite3_backup_step() cannot obtain a required file-system lock, then +** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then ** the [sqlite3_busy_handler | busy-handler function] -** is invoked (if one is specified). If the +** is invoked (if one is specified). ^If the ** busy-handler returns non-zero before the lock is available, then -** [SQLITE_BUSY] is returned to the caller. In this case the call to -** sqlite3_backup_step() can be retried later. If the source +** [SQLITE_BUSY] is returned to the caller. ^In this case the call to +** sqlite3_backup_step() can be retried later. ^If the source ** [database connection] ** is being used to write to the source database when sqlite3_backup_step() -** is called, then [SQLITE_LOCKED] is returned immediately. Again, in this -** case the call to sqlite3_backup_step() can be retried later on. If +** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this +** case the call to sqlite3_backup_step() can be retried later on. ^(If ** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or ** [SQLITE_READONLY] is returned, then ** there is no point in retrying the call to sqlite3_backup_step(). These -** errors are considered fatal. At this point the application must accept +** errors are considered fatal.)^ The application must accept ** that the backup operation has failed and pass the backup operation handle ** to the sqlite3_backup_finish() to release associated resources. ** -** Following the first call to sqlite3_backup_step(), an exclusive lock is -** obtained on the destination file. It is not released until either +** ^The first call to sqlite3_backup_step() obtains an exclusive lock +** on the destination file. ^The exclusive lock is not released until either ** sqlite3_backup_finish() is called or the backup operation is complete -** and sqlite3_backup_step() returns [SQLITE_DONE]. Additionally, each time -** a call to sqlite3_backup_step() is made a [shared lock] is obtained on -** the source database file. This lock is released before the -** sqlite3_backup_step() call returns. Because the source database is not -** locked between calls to sqlite3_backup_step(), it may be modified mid-way -** through the backup procedure. If the source database is modified by an +** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to +** sqlite3_backup_step() obtains a [shared lock] on the source database that +** lasts for the duration of the sqlite3_backup_step() call. +** ^Because the source database is not locked between calls to +** sqlite3_backup_step(), the source database may be modified mid-way +** through the backup process. ^If the source database is modified by an ** external process or via a database connection other than the one being -** used by the backup operation, then the backup will be transparently -** restarted by the next call to sqlite3_backup_step(). If the source +** used by the backup operation, then the backup will be automatically +** restarted by the next call to sqlite3_backup_step(). ^If the source ** database is modified by the using the same database connection as is used -** by the backup operation, then the backup database is transparently +** by the backup operation, then the backup database is automatically ** updated at the same time. ** ** sqlite3_backup_finish() ** -** Once sqlite3_backup_step() has returned [SQLITE_DONE], or when the -** application wishes to abandon the backup operation, the [sqlite3_backup] -** object should be passed to sqlite3_backup_finish(). This releases all -** resources associated with the backup operation. If sqlite3_backup_step() -** has not yet returned [SQLITE_DONE], then any active write-transaction on the -** destination database is rolled back. The [sqlite3_backup] object is invalid +** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the +** application wishes to abandon the backup operation, the application +** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). +** ^The sqlite3_backup_finish() interfaces releases all +** resources associated with the [sqlite3_backup] object. +** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any +** active write-transaction on the destination database is rolled back. +** The [sqlite3_backup] object is invalid ** and may not be used following a call to sqlite3_backup_finish(). ** -** The value returned by sqlite3_backup_finish is [SQLITE_OK] if no error -** occurred, regardless or whether or not sqlite3_backup_step() was called -** a sufficient number of times to complete the backup operation. Or, if -** an out-of-memory condition or IO error occured during a call to -** sqlite3_backup_step() then [SQLITE_NOMEM] or an -** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] error code -** is returned. In this case the error code and an error message are -** written to the destination [database connection]. +** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no +** sqlite3_backup_step() errors occurred, regardless or whether or not +** sqlite3_backup_step() completed. +** ^If an out-of-memory condition or IO error occurred during any prior +** sqlite3_backup_step() call on the same [sqlite3_backup] object, then +** sqlite3_backup_finish() returns the corresponding [error code]. ** -** A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() is -** not a permanent error and does not affect the return value of +** ^A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() +** is not a permanent error and does not affect the return value of ** sqlite3_backup_finish(). ** ** sqlite3_backup_remaining(), sqlite3_backup_pagecount() ** -** Each call to sqlite3_backup_step() sets two values stored internally -** by an [sqlite3_backup] object. The number of pages still to be backed -** up, which may be queried by sqlite3_backup_remaining(), and the total -** number of pages in the source database file, which may be queried by -** sqlite3_backup_pagecount(). +** ^Each call to sqlite3_backup_step() sets two values inside +** the [sqlite3_backup] object: the number of pages still to be backed +** up and the total number of pages in the source database file. +** The sqlite3_backup_remaining() and sqlite3_backup_pagecount() interfaces +** retrieve these two values, respectively. ** -** The values returned by these functions are only updated by -** sqlite3_backup_step(). If the source database is modified during a backup +** ^The values returned by these functions are only updated by +** sqlite3_backup_step(). ^If the source database is modified during a backup ** operation, then the values are not updated to account for any extra ** pages that need to be updated or the size of the source database file ** changing. ** ** Concurrent Usage of Database Handles ** -** The source [database connection] may be used by the application for other +** ^The source [database connection] may be used by the application for other ** purposes while a backup operation is underway or being initialized. -** If SQLite is compiled and configured to support threadsafe database +** ^If SQLite is compiled and configured to support threadsafe database ** connections, then the source database connection may be used concurrently ** from within other threads. ** -** However, the application must guarantee that the destination database -** connection handle is not passed to any other API (by any thread) after +** However, the application must guarantee that the destination +** [database connection] is not passed to any other API (by any thread) after ** sqlite3_backup_init() is called and before the corresponding call to -** sqlite3_backup_finish(). Unfortunately SQLite does not currently check -** for this, if the application does use the destination [database connection] -** for some other purpose during a backup operation, things may appear to -** work correctly but in fact be subtly malfunctioning. Use of the -** destination database connection while a backup is in progress might -** also cause a mutex deadlock. +** sqlite3_backup_finish(). SQLite does not currently check to see +** if the application incorrectly accesses the destination [database connection] +** and so no error code is reported, but the operations may malfunction +** nevertheless. Use of the destination database connection while a +** backup is in progress might also also cause a mutex deadlock. ** -** Furthermore, if running in [shared cache mode], the application must +** If running in [shared cache mode], the application must ** guarantee that the shared cache used by the destination database ** is not accessed while the backup is running. In practice this means -** that the application must guarantee that the file-system file being +** that the application must guarantee that the disk file being ** backed up to is not accessed by any connection within the process, ** not just the specific connection that was passed to sqlite3_backup_init(). ** @@ -5626,50 +6104,49 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); /* ** CAPI3REF: Unlock Notification -** EXPERIMENTAL ** -** When running in shared-cache mode, a database operation may fail with +** ^When running in shared-cache mode, a database operation may fail with ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or ** individual tables within the shared-cache cannot be obtained. See ** [SQLite Shared-Cache Mode] for a description of shared-cache locking. -** This API may be used to register a callback that SQLite will invoke +** ^This API may be used to register a callback that SQLite will invoke ** when the connection currently holding the required lock relinquishes it. -** This API is only available if the library was compiled with the +** ^This API is only available if the library was compiled with the ** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. ** ** See Also: [Using the SQLite Unlock Notification Feature]. ** -** Shared-cache locks are released when a database connection concludes +** ^Shared-cache locks are released when a database connection concludes ** its current transaction, either by committing it or rolling it back. ** -** When a connection (known as the blocked connection) fails to obtain a +** ^When a connection (known as the blocked connection) fails to obtain a ** shared-cache lock and SQLITE_LOCKED is returned to the caller, the ** identity of the database connection (the blocking connection) that -** has locked the required resource is stored internally. After an +** has locked the required resource is stored internally. ^After an ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. The +** when the blocking connections current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connections transaction. ** -** If sqlite3_unlock_notify() is called in a multi-threaded application, +** ^(If sqlite3_unlock_notify() is called in a multi-threaded application, ** there is a chance that the blocking connection will have already ** concluded its transaction by the time sqlite3_unlock_notify() is invoked. ** If this happens, then the specified callback is invoked immediately, -** from within the call to sqlite3_unlock_notify(). +** from within the call to sqlite3_unlock_notify().)^ ** -** If the blocked connection is attempting to obtain a write-lock on a +** ^If the blocked connection is attempting to obtain a write-lock on a ** shared-cache table, and more than one other connection currently holds ** a read-lock on the same table, then SQLite arbitrarily selects one of ** the other connections to use as the blocking connection. ** -** There may be at most one unlock-notify callback registered by a +** ^(There may be at most one unlock-notify callback registered by a ** blocked connection. If sqlite3_unlock_notify() is called when the ** blocked connection already has a registered unlock-notify callback, -** then the new callback replaces the old. If sqlite3_unlock_notify() is +** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is cancelled. The blocked connections +** unlock-notify callback is canceled. ^The blocked connections ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -5677,7 +6154,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** any sqlite3_xxx API functions from within an unlock-notify callback, a ** crash or deadlock may be the result. ** -** Unless deadlock is detected (see below), sqlite3_unlock_notify() always +** ^Unless deadlock is detected (see below), sqlite3_unlock_notify() always ** returns SQLITE_OK. ** ** Callback Invocation Details @@ -5691,7 +6168,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** When a blocking connections transaction is concluded, there may be ** more than one blocked connection that has registered for an unlock-notify -** callback. If two or more such blocked connections have specified the +** callback. ^If two or more such blocked connections have specified the ** same callback function, then instead of invoking the callback function ** multiple times, it is invoked once with the set of void* context pointers ** specified by the blocked connections bundled together into an array. @@ -5709,16 +6186,16 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** will proceed and the system may remain deadlocked indefinitely. ** ** To avoid this scenario, the sqlite3_unlock_notify() performs deadlock -** detection. If a given call to sqlite3_unlock_notify() would put the +** detection. ^If a given call to sqlite3_unlock_notify() would put the ** system in a deadlocked state, then SQLITE_LOCKED is returned and no ** unlock-notify callback is registered. The system is said to be in ** a deadlocked state if connection A has registered for an unlock-notify ** callback on the conclusion of connection B's transaction, and connection ** B has itself registered for an unlock-notify callback when connection -** A's transaction is concluded. Indirect deadlock is also detected, so +** A's transaction is concluded. ^Indirect deadlock is also detected, so ** the system is also considered to be deadlocked if connection B has ** registered for an unlock-notify callback on the conclusion of connection -** C's transaction, where connection C is waiting on connection A. Any +** C's transaction, where connection C is waiting on connection A. ^Any ** number of levels of indirection are allowed. ** ** The "DROP TABLE" Exception @@ -5734,10 +6211,10 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** or "DROP INDEX" query, an infinite loop might be the result. ** ** One way around this problem is to check the extended error code returned -** by an sqlite3_step() call. If there is a blocking connection, then the +** by an sqlite3_step() call. ^(If there is a blocking connection, then the ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in ** the special "DROP TABLE/INDEX" case, the extended error code is just -** SQLITE_LOCKED. +** SQLITE_LOCKED.)^ */ SQLITE_API int sqlite3_unlock_notify( sqlite3 *pBlocked, /* Waiting connection */ @@ -5748,15 +6225,120 @@ SQLITE_API int sqlite3_unlock_notify( /* ** CAPI3REF: String Comparison -** EXPERIMENTAL ** -** The [sqlite3_strnicmp()] API allows applications and extensions to +** ^The [sqlite3_strnicmp()] API allows applications and extensions to ** compare the contents of two buffers containing UTF-8 strings in a -** case-indendent fashion, using the same definition of case independence +** case-independent fashion, using the same definition of case independence ** that SQLite uses internally when comparing identifiers. */ SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); +/* +** CAPI3REF: Error Logging Interface +** +** ^The [sqlite3_log()] interface writes a message into the error log +** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. +** ^If logging is enabled, the zFormat string and subsequent arguments are +** used with [sqlite3_snprintf()] to generate the final output string. +** +** The sqlite3_log() interface is intended for use by extensions such as +** virtual tables, collating functions, and SQL functions. While there is +** nothing to prevent an application from calling sqlite3_log(), doing so +** is considered bad form. +** +** The zFormat string must not be NULL. +** +** To avoid deadlocks and other threading problems, the sqlite3_log() routine +** will not use dynamically allocated memory. The log message is stored in +** a fixed-length buffer on the stack. If the log message is longer than +** a few hundred characters, it will be truncated to the length of the +** buffer. +*/ +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); + +/* +** CAPI3REF: Write-Ahead Log Commit Hook +** +** ^The [sqlite3_wal_hook()] function is used to register a callback that +** will be invoked each time a database connection commits data to a +** [write-ahead log] (i.e. whenever a transaction is committed in +** [journal_mode | journal_mode=WAL mode]). +** +** ^The callback is invoked by SQLite after the commit has taken place and +** the associated write-lock on the database released, so the implementation +** may read, write or [checkpoint] the database as required. +** +** ^The first parameter passed to the callback function when it is invoked +** is a copy of the third parameter passed to sqlite3_wal_hook() when +** registering the callback. ^The second is a copy of the database handle. +** ^The third parameter is the name of the database that was written to - +** either "main" or the name of an [ATTACH]-ed database. ^The fourth parameter +** is the number of pages currently in the write-ahead log file, +** including those that were just committed. +** +** The callback function should normally return [SQLITE_OK]. ^If an error +** code is returned, that error will propagate back up through the +** SQLite code base to cause the statement that provoked the callback +** to report an error, though the commit will have still occurred. If the +** callback returns [SQLITE_ROW] or [SQLITE_DONE], or if it returns a value +** that does not correspond to any valid SQLite error code, the results +** are undefined. +** +** A single database handle may have at most a single write-ahead log callback +** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any +** previously registered write-ahead log callback. ^Note that the +** [sqlite3_wal_autocheckpoint()] interface and the +** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will +** those overwrite any prior [sqlite3_wal_hook()] settings. +*/ +SQLITE_API void *sqlite3_wal_hook( + sqlite3*, + int(*)(void *,sqlite3*,const char*,int), + void* +); + +/* +** CAPI3REF: Configure an auto-checkpoint +** +** ^The [sqlite3_wal_autocheckpoint(D,N)] is a wrapper around +** [sqlite3_wal_hook()] that causes any database on [database connection] D +** to automatically [checkpoint] +** after committing a transaction if there are N or +** more frames in the [write-ahead log] file. ^Passing zero or +** a negative value as the nFrame parameter disables automatic +** checkpoints entirely. +** +** ^The callback registered by this function replaces any existing callback +** registered using [sqlite3_wal_hook()]. ^Likewise, registering a callback +** using [sqlite3_wal_hook()] disables the automatic checkpoint mechanism +** configured by this function. +** +** ^The [wal_autocheckpoint pragma] can be used to invoke this interface +** from SQL. +** +** ^Every new [database connection] defaults to having the auto-checkpoint +** enabled with a threshold of 1000 pages. The use of this interface +** is only necessary if the default setting is found to be suboptimal +** for a particular application. +*/ +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N); + +/* +** CAPI3REF: Checkpoint a database +** +** ^The [sqlite3_wal_checkpoint(D,X)] interface causes database named X +** on [database connection] D to be [checkpointed]. ^If X is NULL or an +** empty string, then a checkpoint is run on all databases of +** connection D. ^If the database connection D is not in +** [WAL | write-ahead log mode] then this interface is a harmless no-op. +** +** ^The [wal_checkpoint pragma] can be used to invoke this interface +** from SQL. ^The [sqlite3_wal_autocheckpoint()] interface and the +** [wal_autocheckpoint pragma] can be used to cause this interface to be +** run whenever the WAL reaches a certain size threshold. +*/ +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); + /* ** Undo the hack that converts floating point types to integer for ** builds on processors without floating point support. @@ -5770,3 +6352,59 @@ SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); #endif #endif +/* +** 2010 August 30 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +*/ + +#ifndef _SQLITE3RTREE_H_ +#define _SQLITE3RTREE_H_ + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry; + +/* +** Register a geometry callback named zGeom that can be used as part of an +** R-Tree geometry query as follows: +** +** SELECT ... FROM WHERE MATCH $zGeom(... params ...) +*/ +SQLITE_API int sqlite3_rtree_geometry_callback( + sqlite3 *db, + const char *zGeom, + int (*xGeom)(sqlite3_rtree_geometry *, int nCoord, double *aCoord, int *pRes), + void *pContext +); + + +/* +** A pointer to a structure of the following type is passed as the first +** argument to callbacks registered using rtree_geometry_callback(). +*/ +struct sqlite3_rtree_geometry { + void *pContext; /* Copy of pContext passed to s_r_g_c() */ + int nParam; /* Size of array aParam[] */ + double *aParam; /* Parameters passed to SQL geom function */ + void *pUser; /* Callback implementation user data */ + void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */ +}; + + +#ifdef __cplusplus +} /* end of the 'extern "C"' block */ +#endif + +#endif /* ifndef _SQLITE3RTREE_H_ */ + diff --git a/src/core/spatialite/headers/spatialite/sqlite3ext.h b/src/core/spatialite/headers/spatialite/sqlite3ext.h index 885d49767e8..353139f57ec 100644 --- a/src/core/spatialite/headers/spatialite/sqlite3ext.h +++ b/src/core/spatialite/headers/spatialite/sqlite3ext.h @@ -1,3 +1,232 @@ +/* +** alias MACROs to avoid any potential collision +** for linker symbols declared into the sqlite3 code +** internally embedded into SpatiaLite +*/ +#define sqlite3_version SPLite3_version +#define sqlite3_libversion SPLite3_libversion +#define sqlite3_sourceid SPLite3_sourceid +#define sqlite3_libversion_number SPLite3_libversion_number +#define sqlite3_compileoption_used SPLite3_compileoption_used +#define sqlite3_compileoption_get SPLite3_compileoption_get +#define sqlite3_threadsafe SPLite3_threadsafe +#define sqlite3_close SPLite3_close +#define sqlite3_exec SPLite3_exec +#define sqlite3_initialize SPLite3_initialize +#define sqlite3_shutdown SPLite3_shutdown +#define sqlite3_os_init SPLite3_os_init +#define sqlite3_os_end SPLite3_os_end +#define sqlite3_config SPLite3_config +#define sqlite3_db_config SPLite3_db_config +#define sqlite3_extended_result_codes SPLite3_extended_result_codes +#define sqlite3_last_insert_rowid SPLite3_last_insert_rowid +#define sqlite3_changes SPLite3_changes +#define sqlite3_total_changes SPLite3_total_changes +#define sqlite3_interrupt SPLite3_interrupt +#define sqlite3_complete SPLite3_complete +#define sqlite3_complete16 SPLite3_complete16 +#define sqlite3_busy_handler SPLite3_busy_handler +#define sqlite3_busy_timeout SPLite3_busy_timeout +#define sqlite3_get_table SPLite3_get_table +#define sqlite3_free_table SPLite3_free_table +#define sqlite3_mprintf SPLite3_mprintf +#define sqlite3_vmprintf SPLite3_vmprintf +#define sqlite3_snprintf SPLite3_snprintf +#define sqlite3_malloc SPLite3_malloc +#define sqlite3_realloc SPLite3_realloc +#define sqlite3_free SPLite3_free +#define sqlite3_memory_used SPLite3_memory_used +#define sqlite3_memory_highwater SPLite3_memory_highwater +#define sqlite3_randomness SPLite3_randomness +#define sqlite3_set_authorizer SPLite3_set_authorizer +#define sqlite3_trace SPLite3_trace +#define sqlite3_progress_handler SPLite3_progress_handler +#define sqlite3_open SPLite3_open +#define sqlite3_open16 SPLite3_open16 +#define sqlite3_open_v2 SPLite3_open_v2 +#define sqlite3_errcode SPLite3_errcode +#define sqlite3_extended_errcode SPLite3_extended_errcode +#define sqlite3_errmsg SPLite3_errmsg +#define sqlite3_errmsg16 SPLite3_errmsg16 +#define sqlite3_limit SPLite3_limit +#define sqlite3_prepare SPLite3_prepare +#define sqlite3_prepare_v2 SPLite3_prepare_v2 +#define sqlite3_prepare16 SPLite3_prepare16 +#define sqlite3_prepare16_v2 SPLite3_prepare16_v2 +#define sqlite3_sql SPLite3_sql +#define sqlite3_bind_blob SPLite3_bind_blob +#define sqlite3_bind_double SPLite3_bind_double +#define sqlite3_bind_int SPLite3_bind_int +#define sqlite3_bind_int64 SPLite3_bind_int64 +#define sqlite3_bind_null SPLite3_bind_null +#define sqlite3_bind_text SPLite3_bind_text +#define sqlite3_bind_text16 SPLite3_bind_text16 +#define sqlite3_bind_value SPLite3_bind_value +#define sqlite3_bind_zeroblob SPLite3_bind_zeroblob +#define sqlite3_bind_parameter_count SPLite3_bind_parameter_count +#define sqlite3_bind_parameter_name SPLite3_bind_parameter_name +#define sqlite3_bind_parameter_index SPLite3_bind_parameter_index +#define sqlite3_clear_bindings SPLite3_clear_bindings +#define sqlite3_column_count SPLite3_column_count +#define sqlite3_column_name SPLite3_column_name +#define sqlite3_column_name16 SPLite3_column_name16 +#define sqlite3_column_database_name SPLite3_column_database_name +#define sqlite3_column_database_name16 SPLite3_column_database_name16 +#define sqlite3_column_table_name SPLite3_column_table_name +#define sqlite3_column_table_name16 SPLite3_column_table_name16 +#define sqlite3_column_origin_name SPLite3_column_origin_name +#define sqlite3_column_origin_name16 SPLite3_column_origin_name16 +#define sqlite3_column_decltype SPLite3_column_decltype +#define sqlite3_column_decltype16 SPLite3_column_decltype16 +#define sqlite3_step SPLite3_step +#define sqlite3_data_count SPLite3_data_count +#define sqlite3_column_blob SPLite3_column_blob +#define sqlite3_column_bytes SPLite3_column_bytes +#define sqlite3_column_bytes16 SPLite3_column_bytes16 +#define sqlite3_column_double SPLite3_column_double +#define sqlite3_column_int SPLite3_column_int +#define sqlite3_column_int64 SPLite3_column_int64 +#define sqlite3_column_text SPLite3_column_text +#define sqlite3_column_text16 SPLite3_column_text16 +#define sqlite3_column_type SPLite3_column_type +#define sqlite3_column_value SPLite3_column_value +#define sqlite3_finalize SPLite3_finalize +#define sqlite3_reset SPLite3_reset +#define sqlite3_create_function SPLite3_create_function +#define sqlite3_create_function16 SPLite3_create_function16 +#define sqlite3_create_function_v2 SPLite3_create_function_v2 +#define sqlite3_value_blob SPLite3_value_blob +#define sqlite3_value_bytes SPLite3_value_bytes +#define sqlite3_value_bytes16 SPLite3_value_bytes16 +#define sqlite3_value_double SPLite3_value_double +#define sqlite3_value_int SPLite3_value_int +#define sqlite3_value_int64 SPLite3_value_int64 +#define sqlite3_value_text SPLite3_value_text +#define sqlite3_value_text16 SPLite3_value_text16 +#define sqlite3_value_text16le SPLite3_value_text16le +#define sqlite3_value_text16be SPLite3_value_text16be +#define sqlite3_value_type SPLite3_value_type +#define sqlite3_value_numeric_type SPLite3_value_numeric_type +#define sqlite3_aggregate_context SPLite3_aggregate_context +#define sqlite3_user_data SPLite3_user_data +#define sqlite3_context_db_handle SPLite3_context_db_handle +#define sqlite3_get_auxdata SPLite3_get_auxdata +#define sqlite3_set_auxdata SPLite3_set_auxdata +#define sqlite3_result_blob SPLite3_result_blob +#define sqlite3_result_double SPLite3_result_double +#define sqlite3_result_error SPLite3_result_error +#define sqlite3_result_error16 SPLite3_result_error16 +#define sqlite3_result_error_toobig SPLite3_result_error_toobig +#define sqlite3_result_error_nomem SPLite3_result_error_nomem +#define sqlite3_result_error_code SPLite3_result_error_code +#define sqlite3_result_int SPLite3_result_int +#define sqlite3_result_int64 SPLite3_result_int64 +#define sqlite3_result_null SPLite3_result_null +#define sqlite3_result_text SPLite3_result_text +#define sqlite3_result_text16 SPLite3_result_text16 +#define sqlite3_result_text16le SPLite3_result_text16le +#define sqlite3_result_text16be SPLite3_result_text16be +#define sqlite3_result_value SPLite3_result_value +#define sqlite3_result_zeroblob SPLite3_result_zeroblob +#define sqlite3_create_collation SPLite3_create_collation +#define sqlite3_create_collation_v2 SPLite3_create_collation_v2 +#define sqlite3_create_collation16 SPLite3_create_collation16 +#define sqlite3_collation_needed SPLite3_collation_needed +#define sqlite3_collation_needed16 SPLite3_collation_needed16 +#define sqlite3_key SPLite3_key +#define sqlite3_rekey SPLite3_rekey +#define sqlite3_activate_see SPLite3_activate_see +#define sqlite3_activate_cerod SPLite3_activate_cerod +#define sqlite3_sleep SPLite3_sleep +#define sqlite3_temp_directory SPLite3_temp_directory +#define sqlite3_get_autocommit SPLite3_get_autocommit +#define sqlite3_db_handle SPLite3_db_handle +#define sqlite3_next_stmt SPLite3_next_stmt +#define sqlite3_commit_hook SPLite3_commit_hook +#define sqlite3_rollback_hook SPLite3_rollback_hook +#define sqlite3_update_hook SPLite3_update_hook +#define sqlite3_enable_shared_cache SPLite3_enable_shared_cache +#define sqlite3_release_memory SPLite3_release_memory +#define sqlite3_soft_heap_limit64 SPLite3_soft_heap_limit64 +#define sqlite3_table_column_metadata SPLite3_table_column_metadata +#define sqlite3_load_extension SPLite3_load_extension +#define sqlite3_enable_load_extension SPLite3_enable_load_extension +#define sqlite3_auto_extension SPLite3_auto_extension +#define sqlite3_reset_auto_extension SPLite3_reset_auto_extension +#define sqlite3_create_module SPLite3_create_module +#define sqlite3_create_module_v2 SPLite3_create_module_v2 +#define sqlite3_declare_vtab SPLite3_declare_vtab +#define sqlite3_overload_function SPLite3_overload_function +#define sqlite3_blob_open SPLite3_blob_open +#define sqlite3_blob_close SPLite3_blob_close +#define sqlite3_blob_bytes SPLite3_blob_bytes +#define sqlite3_blob_read SPLite3_blob_read +#define sqlite3_blob_write SPLite3_blob_write +#define sqlite3_vfs_find SPLite3_vfs_find +#define sqlite3_vfs_register SPLite3_vfs_register +#define sqlite3_vfs_unregister SPLite3_vfs_unregister +#define sqlite3_mutex_alloc SPLite3_mutex_alloc +#define sqlite3_mutex_free SPLite3_mutex_free +#define sqlite3_mutex_enter SPLite3_mutex_enter +#define sqlite3_mutex_try SPLite3_mutex_try +#define sqlite3_mutex_leave SPLite3_mutex_leave +#define sqlite3_mutex_held SPLite3_mutex_held +#define sqlite3_mutex_notheld SPLite3_mutex_notheld +#define sqlite3_db_mutex SPLite3_db_mutex +#define sqlite3_file_control SPLite3_file_control +#define sqlite3_test_control SPLite3_test_control +#define sqlite3_status SPLite3_status +#define sqlite3_db_status SPLite3_db_status +#define sqlite3_stmt_status SPLite3_stmt_status +#define sqlite3_backup_init SPLite3_backup_init +#define sqlite3_backup_step SPLite3_backup_step +#define sqlite3_backup_finish SPLite3_backup_finish +#define sqlite3_backup_remaining SPLite3_backup_remaining +#define sqlite3_backup_pagecount SPLite3_backup_pagecount +#define sqlite3_unlock_notify SPLite3_unlock_notify +#define sqlite3_strnicmp SPLite3_strnicmp +#define sqlite3_log SPLite3_log +#define sqlite3_wal_hook SPLite3_wal_hook +#define sqlite3_wal_autocheckpoint SPLite3_wal_autocheckpoint +#define sqlite3_wal_checkpoint SPLite3_wal_checkpoint +#define sqlite3_rtree_geometry_callback SPLite3_rtree_geometry_callback +#define sqlite3_memdebug_vfs_oom_test SPLite3_memdebug_vfs_oom_test +#define sqlite3_memory_alarm SPLite3_memory_alarm +#define sqlite3_soft_heap_limit SPLite3_soft_heap_limit +#define sqlite3_io_error_hit SPLite3_io_error_hit +#define sqlite3_io_error_hardhit SPLite3_io_error_hardhit +#define sqlite3_io_error_pending SPLite3_io_error_pending +#define sqlite3_io_error_persist SPLite3_io_error_persist +#define sqlite3_io_error_benign SPLite3_io_error_benign +#define sqlite3_diskfull_pending SPLite3_diskfull_pending +#define sqlite3_diskfull SPLite3_diskfull +#define sqlite3_open_file_count SPLite3_open_file_count +#define sqlite3_sync_count SPLite3_sync_count +#define sqlite3_fullsync_count SPLite3_fullsync_count +#define sqlite3_current_time SPLite3_current_time +#define sqlite3_hostid_num SPLite3_hostid_num +#define sqlite3_os_type SPLite3_os_type +#define sqlite3_win32_mbcs_to_utf8 SPLite3_win32_mbcs_to_utf8 +#define sqlite3_pager_readdb_count SPLite3_pager_readdb_count +#define sqlite3_pager_writedb_count SPLite3_pager_writedb_count +#define sqlite3_pager_writej_count SPLite3_pager_writej_count +#define sqlite3_opentemp_count SPLite3_opentemp_count +#define sqlite3_expired SPLite3_expired +#define sqlite3_aggregate_count SPLite3_aggregate_count +#define sqlite3_transfer_bindings SPLite3_transfer_bindings +#define sqlite3_search_count SPLite3_search_count +#define sqlite3_interrupt_count SPLite3_interrupt_count +#define sqlite3_sort_count SPLite3_sort_count +#define sqlite3_max_blobsize SPLite3_max_blobsize +#define sqlite3_found_count SPLite3_found_count +#define sqlite3_like_count SPLite3_like_count +#define sqlite3_xferopt_count SPLite3_xferopt_count +#define sqlite3_profile SPLite3_profile +#define sqlite3_global_recover SPLite3_global_recover +#define sqlite3_thread_cleanup SPLite3_thread_cleanup +#define sqlite3_fts3_enable_parentheses SPLite3_fts3_enable_parentheses +/* end SpatiaLite/sqlite3 alias macros */ + /* ** 2006 June 7 ** @@ -14,8 +243,6 @@ ** an SQLite instance. Shared libraries that intend to be loaded ** as extensions by SQLite should #include this file instead of ** sqlite3.h. -** -** @(#) $Id: sqlite3ext.h,v 1.25 2008/10/12 00:27:54 shane Exp $ */ #ifndef _SQLITE3EXT_H_ #define _SQLITE3EXT_H_ @@ -197,7 +424,7 @@ struct sqlite3_api_routines { /* ** The following macros redefine the API routines so that they are -** redirected through the global sqlite3_api structure. +** redirected throught the global sqlite3_api structure. ** ** This header file is also used by the loadext.c source file ** (part of the main SQLite library - not an extension) so that diff --git a/src/core/spatialite/spatialite.c b/src/core/spatialite/spatialite.c index 36f9b962f91..237185adf3b 100644 --- a/src/core/spatialite/spatialite.c +++ b/src/core/spatialite/spatialite.c @@ -7,7 +7,7 @@ ** of 5% are more are commonly seen when SQLite is compiled as a single ** translation unit. ** -** This amalgamation was generated on 2009-12-03 13:49:58 +0100. +** This amalgamation was generated on 2010-11-24 12:53:28 +0100. Author: Alessandro (Sandro) Furieri @@ -35,6 +35,8 @@ the Initial Developer. All Rights Reserved. Contributor(s): Klaus Foerster klaus.foerster@svg.cc Luigi Costalli luigi.costalli@gmail.com +The Vanuatu Team - University of Toronto + Supervisor: Greg Wilson gwilson@cs.toronto.ca Alternatively, the contents of this file may be used under the terms of either the GNU General Public License Version 2 or later (the "GPL"), or @@ -50,6 +52,11 @@ the terms of any one of the MPL, the GPL or the LGPL. */ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +#include +#endif + #include #include #include @@ -60,6 +67,8 @@ the terms of any one of the MPL, the GPL or the LGPL. #include #include +#include + #if defined(__MINGW32__) || defined(_WIN32) #define LIBICONV_STATIC #include @@ -95,6 +104,235 @@ extern const char * locale_charset (void); #define atoll _atoi64 #endif /* not WIN32 */ +/* +** alias MACROs to avoid any potential collision +** for linker symbols declared into the sqlite3 code +** internally embedded into SpatiaLite +*/ +#define sqlite3_version SPLite3_version +#define sqlite3_libversion SPLite3_libversion +#define sqlite3_sourceid SPLite3_sourceid +#define sqlite3_libversion_number SPLite3_libversion_number +#define sqlite3_compileoption_used SPLite3_compileoption_used +#define sqlite3_compileoption_get SPLite3_compileoption_get +#define sqlite3_threadsafe SPLite3_threadsafe +#define sqlite3_close SPLite3_close +#define sqlite3_exec SPLite3_exec +#define sqlite3_initialize SPLite3_initialize +#define sqlite3_shutdown SPLite3_shutdown +#define sqlite3_os_init SPLite3_os_init +#define sqlite3_os_end SPLite3_os_end +#define sqlite3_config SPLite3_config +#define sqlite3_db_config SPLite3_db_config +#define sqlite3_extended_result_codes SPLite3_extended_result_codes +#define sqlite3_last_insert_rowid SPLite3_last_insert_rowid +#define sqlite3_changes SPLite3_changes +#define sqlite3_total_changes SPLite3_total_changes +#define sqlite3_interrupt SPLite3_interrupt +#define sqlite3_complete SPLite3_complete +#define sqlite3_complete16 SPLite3_complete16 +#define sqlite3_busy_handler SPLite3_busy_handler +#define sqlite3_busy_timeout SPLite3_busy_timeout +#define sqlite3_get_table SPLite3_get_table +#define sqlite3_free_table SPLite3_free_table +#define sqlite3_mprintf SPLite3_mprintf +#define sqlite3_vmprintf SPLite3_vmprintf +#define sqlite3_snprintf SPLite3_snprintf +#define sqlite3_malloc SPLite3_malloc +#define sqlite3_realloc SPLite3_realloc +#define sqlite3_free SPLite3_free +#define sqlite3_memory_used SPLite3_memory_used +#define sqlite3_memory_highwater SPLite3_memory_highwater +#define sqlite3_randomness SPLite3_randomness +#define sqlite3_set_authorizer SPLite3_set_authorizer +#define sqlite3_trace SPLite3_trace +#define sqlite3_progress_handler SPLite3_progress_handler +#define sqlite3_open SPLite3_open +#define sqlite3_open16 SPLite3_open16 +#define sqlite3_open_v2 SPLite3_open_v2 +#define sqlite3_errcode SPLite3_errcode +#define sqlite3_extended_errcode SPLite3_extended_errcode +#define sqlite3_errmsg SPLite3_errmsg +#define sqlite3_errmsg16 SPLite3_errmsg16 +#define sqlite3_limit SPLite3_limit +#define sqlite3_prepare SPLite3_prepare +#define sqlite3_prepare_v2 SPLite3_prepare_v2 +#define sqlite3_prepare16 SPLite3_prepare16 +#define sqlite3_prepare16_v2 SPLite3_prepare16_v2 +#define sqlite3_sql SPLite3_sql +#define sqlite3_bind_blob SPLite3_bind_blob +#define sqlite3_bind_double SPLite3_bind_double +#define sqlite3_bind_int SPLite3_bind_int +#define sqlite3_bind_int64 SPLite3_bind_int64 +#define sqlite3_bind_null SPLite3_bind_null +#define sqlite3_bind_text SPLite3_bind_text +#define sqlite3_bind_text16 SPLite3_bind_text16 +#define sqlite3_bind_value SPLite3_bind_value +#define sqlite3_bind_zeroblob SPLite3_bind_zeroblob +#define sqlite3_bind_parameter_count SPLite3_bind_parameter_count +#define sqlite3_bind_parameter_name SPLite3_bind_parameter_name +#define sqlite3_bind_parameter_index SPLite3_bind_parameter_index +#define sqlite3_clear_bindings SPLite3_clear_bindings +#define sqlite3_column_count SPLite3_column_count +#define sqlite3_column_name SPLite3_column_name +#define sqlite3_column_name16 SPLite3_column_name16 +#define sqlite3_column_database_name SPLite3_column_database_name +#define sqlite3_column_database_name16 SPLite3_column_database_name16 +#define sqlite3_column_table_name SPLite3_column_table_name +#define sqlite3_column_table_name16 SPLite3_column_table_name16 +#define sqlite3_column_origin_name SPLite3_column_origin_name +#define sqlite3_column_origin_name16 SPLite3_column_origin_name16 +#define sqlite3_column_decltype SPLite3_column_decltype +#define sqlite3_column_decltype16 SPLite3_column_decltype16 +#define sqlite3_step SPLite3_step +#define sqlite3_data_count SPLite3_data_count +#define sqlite3_column_blob SPLite3_column_blob +#define sqlite3_column_bytes SPLite3_column_bytes +#define sqlite3_column_bytes16 SPLite3_column_bytes16 +#define sqlite3_column_double SPLite3_column_double +#define sqlite3_column_int SPLite3_column_int +#define sqlite3_column_int64 SPLite3_column_int64 +#define sqlite3_column_text SPLite3_column_text +#define sqlite3_column_text16 SPLite3_column_text16 +#define sqlite3_column_type SPLite3_column_type +#define sqlite3_column_value SPLite3_column_value +#define sqlite3_finalize SPLite3_finalize +#define sqlite3_reset SPLite3_reset +#define sqlite3_create_function SPLite3_create_function +#define sqlite3_create_function16 SPLite3_create_function16 +#define sqlite3_create_function_v2 SPLite3_create_function_v2 +#define sqlite3_value_blob SPLite3_value_blob +#define sqlite3_value_bytes SPLite3_value_bytes +#define sqlite3_value_bytes16 SPLite3_value_bytes16 +#define sqlite3_value_double SPLite3_value_double +#define sqlite3_value_int SPLite3_value_int +#define sqlite3_value_int64 SPLite3_value_int64 +#define sqlite3_value_text SPLite3_value_text +#define sqlite3_value_text16 SPLite3_value_text16 +#define sqlite3_value_text16le SPLite3_value_text16le +#define sqlite3_value_text16be SPLite3_value_text16be +#define sqlite3_value_type SPLite3_value_type +#define sqlite3_value_numeric_type SPLite3_value_numeric_type +#define sqlite3_aggregate_context SPLite3_aggregate_context +#define sqlite3_user_data SPLite3_user_data +#define sqlite3_context_db_handle SPLite3_context_db_handle +#define sqlite3_get_auxdata SPLite3_get_auxdata +#define sqlite3_set_auxdata SPLite3_set_auxdata +#define sqlite3_result_blob SPLite3_result_blob +#define sqlite3_result_double SPLite3_result_double +#define sqlite3_result_error SPLite3_result_error +#define sqlite3_result_error16 SPLite3_result_error16 +#define sqlite3_result_error_toobig SPLite3_result_error_toobig +#define sqlite3_result_error_nomem SPLite3_result_error_nomem +#define sqlite3_result_error_code SPLite3_result_error_code +#define sqlite3_result_int SPLite3_result_int +#define sqlite3_result_int64 SPLite3_result_int64 +#define sqlite3_result_null SPLite3_result_null +#define sqlite3_result_text SPLite3_result_text +#define sqlite3_result_text16 SPLite3_result_text16 +#define sqlite3_result_text16le SPLite3_result_text16le +#define sqlite3_result_text16be SPLite3_result_text16be +#define sqlite3_result_value SPLite3_result_value +#define sqlite3_result_zeroblob SPLite3_result_zeroblob +#define sqlite3_create_collation SPLite3_create_collation +#define sqlite3_create_collation_v2 SPLite3_create_collation_v2 +#define sqlite3_create_collation16 SPLite3_create_collation16 +#define sqlite3_collation_needed SPLite3_collation_needed +#define sqlite3_collation_needed16 SPLite3_collation_needed16 +#define sqlite3_key SPLite3_key +#define sqlite3_rekey SPLite3_rekey +#define sqlite3_activate_see SPLite3_activate_see +#define sqlite3_activate_cerod SPLite3_activate_cerod +#define sqlite3_sleep SPLite3_sleep +#define sqlite3_temp_directory SPLite3_temp_directory +#define sqlite3_get_autocommit SPLite3_get_autocommit +#define sqlite3_db_handle SPLite3_db_handle +#define sqlite3_next_stmt SPLite3_next_stmt +#define sqlite3_commit_hook SPLite3_commit_hook +#define sqlite3_rollback_hook SPLite3_rollback_hook +#define sqlite3_update_hook SPLite3_update_hook +#define sqlite3_enable_shared_cache SPLite3_enable_shared_cache +#define sqlite3_release_memory SPLite3_release_memory +#define sqlite3_soft_heap_limit64 SPLite3_soft_heap_limit64 +#define sqlite3_table_column_metadata SPLite3_table_column_metadata +#define sqlite3_load_extension SPLite3_load_extension +#define sqlite3_enable_load_extension SPLite3_enable_load_extension +#define sqlite3_auto_extension SPLite3_auto_extension +#define sqlite3_reset_auto_extension SPLite3_reset_auto_extension +#define sqlite3_create_module SPLite3_create_module +#define sqlite3_create_module_v2 SPLite3_create_module_v2 +#define sqlite3_declare_vtab SPLite3_declare_vtab +#define sqlite3_overload_function SPLite3_overload_function +#define sqlite3_blob_open SPLite3_blob_open +#define sqlite3_blob_close SPLite3_blob_close +#define sqlite3_blob_bytes SPLite3_blob_bytes +#define sqlite3_blob_read SPLite3_blob_read +#define sqlite3_blob_write SPLite3_blob_write +#define sqlite3_vfs_find SPLite3_vfs_find +#define sqlite3_vfs_register SPLite3_vfs_register +#define sqlite3_vfs_unregister SPLite3_vfs_unregister +#define sqlite3_mutex_alloc SPLite3_mutex_alloc +#define sqlite3_mutex_free SPLite3_mutex_free +#define sqlite3_mutex_enter SPLite3_mutex_enter +#define sqlite3_mutex_try SPLite3_mutex_try +#define sqlite3_mutex_leave SPLite3_mutex_leave +#define sqlite3_mutex_held SPLite3_mutex_held +#define sqlite3_mutex_notheld SPLite3_mutex_notheld +#define sqlite3_db_mutex SPLite3_db_mutex +#define sqlite3_file_control SPLite3_file_control +#define sqlite3_test_control SPLite3_test_control +#define sqlite3_status SPLite3_status +#define sqlite3_db_status SPLite3_db_status +#define sqlite3_stmt_status SPLite3_stmt_status +#define sqlite3_backup_init SPLite3_backup_init +#define sqlite3_backup_step SPLite3_backup_step +#define sqlite3_backup_finish SPLite3_backup_finish +#define sqlite3_backup_remaining SPLite3_backup_remaining +#define sqlite3_backup_pagecount SPLite3_backup_pagecount +#define sqlite3_unlock_notify SPLite3_unlock_notify +#define sqlite3_strnicmp SPLite3_strnicmp +#define sqlite3_log SPLite3_log +#define sqlite3_wal_hook SPLite3_wal_hook +#define sqlite3_wal_autocheckpoint SPLite3_wal_autocheckpoint +#define sqlite3_wal_checkpoint SPLite3_wal_checkpoint +#define sqlite3_rtree_geometry_callback SPLite3_rtree_geometry_callback +#define sqlite3_memdebug_vfs_oom_test SPLite3_memdebug_vfs_oom_test +#define sqlite3_memory_alarm SPLite3_memory_alarm +#define sqlite3_soft_heap_limit SPLite3_soft_heap_limit +#define sqlite3_io_error_hit SPLite3_io_error_hit +#define sqlite3_io_error_hardhit SPLite3_io_error_hardhit +#define sqlite3_io_error_pending SPLite3_io_error_pending +#define sqlite3_io_error_persist SPLite3_io_error_persist +#define sqlite3_io_error_benign SPLite3_io_error_benign +#define sqlite3_diskfull_pending SPLite3_diskfull_pending +#define sqlite3_diskfull SPLite3_diskfull +#define sqlite3_open_file_count SPLite3_open_file_count +#define sqlite3_sync_count SPLite3_sync_count +#define sqlite3_fullsync_count SPLite3_fullsync_count +#define sqlite3_current_time SPLite3_current_time +#define sqlite3_hostid_num SPLite3_hostid_num +#define sqlite3_os_type SPLite3_os_type +#define sqlite3_win32_mbcs_to_utf8 SPLite3_win32_mbcs_to_utf8 +#define sqlite3_pager_readdb_count SPLite3_pager_readdb_count +#define sqlite3_pager_writedb_count SPLite3_pager_writedb_count +#define sqlite3_pager_writej_count SPLite3_pager_writej_count +#define sqlite3_opentemp_count SPLite3_opentemp_count +#define sqlite3_expired SPLite3_expired +#define sqlite3_aggregate_count SPLite3_aggregate_count +#define sqlite3_transfer_bindings SPLite3_transfer_bindings +#define sqlite3_search_count SPLite3_search_count +#define sqlite3_interrupt_count SPLite3_interrupt_count +#define sqlite3_sort_count SPLite3_sort_count +#define sqlite3_max_blobsize SPLite3_max_blobsize +#define sqlite3_found_count SPLite3_found_count +#define sqlite3_like_count SPLite3_like_count +#define sqlite3_xferopt_count SPLite3_xferopt_count +#define sqlite3_profile SPLite3_profile +#define sqlite3_global_recover SPLite3_global_recover +#define sqlite3_thread_cleanup SPLite3_thread_cleanup +#define sqlite3_fts3_enable_parentheses SPLite3_fts3_enable_parentheses +/* end SpatiaLite/sqlite3 alias macros */ + /**************** Begin file: sqlite3.h **********/ /* @@ -180,55 +418,43 @@ extern "C" { #endif /* -** CAPI3REF: Compile-Time Library Version Numbers {H10010} +** CAPI3REF: Compile-Time Library Version Numbers ** -** The SQLITE_VERSION and SQLITE_VERSION_NUMBER #defines in -** the sqlite3.h file specify the version of SQLite with which -** that header file is associated. -** -** The "version" of SQLite is a string of the form "W.X.Y" or "W.X.Y.Z". -** The W value is major version number and is always 3 in SQLite3. -** The W value only changes when backwards compatibility is -** broken and we intend to never break backwards compatibility. -** The X value is the minor version number and only changes when -** there are major feature enhancements that are forwards compatible -** but not backwards compatible. -** The Y value is the release number and is incremented with -** each release but resets back to 0 whenever X is incremented. -** The Z value only appears on branch releases. -** -** The SQLITE_VERSION_NUMBER is an integer that is computed as -** follows: -** -**
    -** SQLITE_VERSION_NUMBER = W*1000000 + X*1000 + Y
    -** 
    +** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header +** evaluates to a string literal that is the SQLite version in the +** format "X.Y.Z" where X is the major version number (always 3 for +** SQLite3) and Y is the minor version number and Z is the release number.)^ +** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer +** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same +** numbers used in [SQLITE_VERSION].)^ +** The SQLITE_VERSION_NUMBER for any given release of SQLite will also +** be larger than the release from which it is derived. Either Y will +** be held constant and Z will be incremented or else Y will be incremented +** and Z will be reset to zero. ** ** Since version 3.6.18, SQLite source code has been stored in the -** fossil configuration management -** system. The SQLITE_SOURCE_ID -** macro is a string which identifies a particular check-in of SQLite -** within its configuration management system. The string contains the -** date and time of the check-in (UTC) and an SHA1 hash of the entire -** source tree. +** Fossil configuration management +** system. ^The SQLITE_SOURCE_ID macro evaluates to +** a string which identifies a particular check-in of SQLite +** within its configuration management system. ^The SQLITE_SOURCE_ID +** string contains the date and time of the check-in (UTC) and an SHA1 +** hash of the entire source tree. ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. -** -** Requirements: [H10011] [H10014] */ -#define SQLITE_VERSION "3.6.20" -#define SQLITE_VERSION_NUMBER 3006020 -#define SQLITE_SOURCE_ID "2009-11-04 13:30:02 eb7a544fe49d1626bacecfe53ddc03fe082e3243" +#define SQLITE_VERSION "3.7.3" +#define SQLITE_VERSION_NUMBER 3007003 +#define SQLITE_SOURCE_ID "2010-10-08 02:34:02 2677848087c9c090efb17c1893e77d6136a9111d" /* -** CAPI3REF: Run-Time Library Version Numbers {H10020} -** KEYWORDS: sqlite3_version +** CAPI3REF: Run-Time Library Version Numbers +** KEYWORDS: sqlite3_version, sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], -** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] #defines in the header, -** but are associated with the library instead of the header file. Cautious +** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros +** but are associated with the library instead of the header file. ^(Cautious ** programmers might include assert() statements in their application to ** verify that values returned by these interfaces match the macros in ** the header, and thus insure that the application is @@ -237,19 +463,20 @@ extern "C" { **
     ** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
     ** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
    -** assert( strcmp(sqlite3_libversion,SQLITE_VERSION)==0 );
    -** 
    +** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 ); +** )^ ** -** The sqlite3_libversion() function returns the same information as is -** in the sqlite3_version[] string constant. The function is provided -** for use in DLLs since DLL users usually do not have direct access to string -** constants within the DLL. Similarly, the sqlite3_sourceid() function -** returns the same information as is in the [SQLITE_SOURCE_ID] #define of -** the header file. +** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION] +** macro. ^The sqlite3_libversion() function returns a pointer to the +** to the sqlite3_version[] string constant. The sqlite3_libversion() +** function is provided for use in DLLs since DLL users usually do not have +** direct access to string constants within the DLL. ^The +** sqlite3_libversion_number() function returns an integer equal to +** [SQLITE_VERSION_NUMBER]. ^The sqlite3_sourceid() function returns +** a pointer to a string constant whose value is the same as the +** [SQLITE_SOURCE_ID] C preprocessor macro. ** ** See also: [sqlite_version()] and [sqlite_source_id()]. -** -** Requirements: [H10021] [H10022] [H10023] */ SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; SQLITE_API const char *sqlite3_libversion(void); @@ -257,7 +484,38 @@ SQLITE_API const char *sqlite3_sourceid(void); SQLITE_API int sqlite3_libversion_number(void); /* -** CAPI3REF: Test To See If The Library Is Threadsafe {H10100} +** CAPI3REF: Run-Time Library Compilation Options Diagnostics +** +** ^The sqlite3_compileoption_used() function returns 0 or 1 +** indicating whether the specified option was defined at +** compile time. ^The SQLITE_ prefix may be omitted from the +** option name passed to sqlite3_compileoption_used(). +** +** ^The sqlite3_compileoption_get() function allows iterating +** over the list of options that were defined at compile time by +** returning the N-th compile time option string. ^If N is out of range, +** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ +** prefix is omitted from any strings returned by +** sqlite3_compileoption_get(). +** +** ^Support for the diagnostic functions sqlite3_compileoption_used() +** and sqlite3_compileoption_get() may be omitted by specifying the +** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. +** +** See also: SQL functions [sqlite_compileoption_used()] and +** [sqlite_compileoption_get()] and the [compile_options pragma]. +*/ +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS +SQLITE_API int sqlite3_compileoption_used(const char *zOptName); +SQLITE_API const char *sqlite3_compileoption_get(int N); +#endif + +/* +** CAPI3REF: Test To See If The Library Is Threadsafe +** +** ^The sqlite3_threadsafe() function returns zero if and only if +** SQLite was compiled mutexing code omitted due to the +** [SQLITE_THREADSAFE] compile-time option being set to 0. ** ** SQLite can be compiled with or without mutexes. When ** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes @@ -269,7 +527,7 @@ SQLITE_API int sqlite3_libversion_number(void); ** Enabling mutexes incurs a measurable performance penalty. ** So if speed is of utmost importance, it makes sense to disable ** the mutexes. But for maximum safety, mutexes should be enabled. -** The default behavior is for mutexes to be enabled. +** ^The default behavior is for mutexes to be enabled. ** ** This interface can be used by an application to make sure that the ** version of SQLite that it is linking against was compiled with @@ -277,21 +535,21 @@ SQLITE_API int sqlite3_libversion_number(void); ** ** This interface only reports on the compile-time mutex setting ** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with -** SQLITE_THREADSAFE=1 then mutexes are enabled by default but +** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but ** can be fully or partially disabled using a call to [sqlite3_config()] ** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD], -** or [SQLITE_CONFIG_MUTEX]. The return value of this function shows -** only the default compile-time setting, not any run-time changes -** to that setting. +** or [SQLITE_CONFIG_MUTEX]. ^(The return value of the +** sqlite3_threadsafe() function shows only the compile-time setting of +** thread safety, not any run-time changes to that setting made by +** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() +** is unchanged by calls to sqlite3_config().)^ ** ** See the [threading mode] documentation for additional information. -** -** Requirements: [H10101] [H10102] */ SQLITE_API int sqlite3_threadsafe(void); /* -** CAPI3REF: Database Connection Handle {H12000} +** CAPI3REF: Database Connection Handle ** KEYWORDS: {database connection} {database connections} ** ** Each open SQLite database is represented by a pointer to an instance of @@ -306,7 +564,7 @@ SQLITE_API int sqlite3_threadsafe(void); typedef struct sqlite3 sqlite3; /* -** CAPI3REF: 64-Bit Integer Types {H10200} +** CAPI3REF: 64-Bit Integer Types ** KEYWORDS: sqlite_int64 sqlite_uint64 ** ** Because there is no cross-platform way to specify 64-bit integer types @@ -316,7 +574,10 @@ typedef struct sqlite3 sqlite3; ** The sqlite_int64 and sqlite_uint64 types are supported for backwards ** compatibility only. ** -** Requirements: [H10201] [H10202] +** ^The sqlite3_int64 and sqlite_int64 types can store integer values +** between -9223372036854775808 and +9223372036854775807 inclusive. ^The +** sqlite3_uint64 and sqlite_uint64 types can store integer values +** between 0 and +18446744073709551615 inclusive. */ #ifdef SQLITE_INT64_TYPE typedef SQLITE_INT64_TYPE sqlite_int64; @@ -340,24 +601,28 @@ typedef sqlite_uint64 sqlite3_uint64; #endif /* -** CAPI3REF: Closing A Database Connection {H12010} +** CAPI3REF: Closing A Database Connection ** -** This routine is the destructor for the [sqlite3] object. +** ^The sqlite3_close() routine is the destructor for the [sqlite3] object. +** ^Calls to sqlite3_close() return SQLITE_OK if the [sqlite3] object is +** successfully destroyed and all associated resources are deallocated. ** ** Applications must [sqlite3_finalize | finalize] all [prepared statements] ** and [sqlite3_blob_close | close] all [BLOB handles] associated with -** the [sqlite3] object prior to attempting to close the object. +** the [sqlite3] object prior to attempting to close the object. ^If +** sqlite3_close() is called on a [database connection] that still has +** outstanding [prepared statements] or [BLOB handles], then it returns +** SQLITE_BUSY. ** -** If [sqlite3_close()] is invoked while a transaction is open, +** ^If [sqlite3_close()] is invoked while a transaction is open, ** the transaction is automatically rolled back. ** ** The C parameter to [sqlite3_close(C)] must be either a NULL ** pointer or an [sqlite3] object pointer obtained ** from [sqlite3_open()], [sqlite3_open16()], or ** [sqlite3_open_v2()], and not previously closed. -** -** Requirements: -** [H12011] [H12012] [H12013] [H12014] [H12015] [H12019] +** ^Calling sqlite3_close() with a NULL pointer argument is a +** harmless no-op. */ SQLITE_API int sqlite3_close(sqlite3 *); @@ -369,48 +634,65 @@ SQLITE_API int sqlite3_close(sqlite3 *); typedef int (*sqlite3_callback)(void*,int,char**, char**); /* -** CAPI3REF: One-Step Query Execution Interface {H12100} +** CAPI3REF: One-Step Query Execution Interface ** -** The sqlite3_exec() interface is a convenient way of running one or more -** SQL statements without having to write a lot of C code. The UTF-8 encoded -** SQL statements are passed in as the second parameter to sqlite3_exec(). -** The statements are evaluated one by one until either an error or -** an interrupt is encountered, or until they are all done. The 3rd parameter -** is an optional callback that is invoked once for each row of any query -** results produced by the SQL statements. The 5th parameter tells where -** to write any error messages. +** The sqlite3_exec() interface is a convenience wrapper around +** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], +** that allows an application to run multiple statements of SQL +** without having to use a lot of C code. ** -** The error message passed back through the 5th parameter is held -** in memory obtained from [sqlite3_malloc()]. To avoid a memory leak, -** the calling application should call [sqlite3_free()] on any error -** message returned through the 5th parameter when it has finished using -** the error message. +** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, +** semicolon-separate SQL statements passed into its 2nd argument, +** in the context of the [database connection] passed in as its 1st +** argument. ^If the callback function of the 3rd argument to +** sqlite3_exec() is not NULL, then it is invoked for each result row +** coming out of the evaluated SQL statements. ^The 4th argument to +** to sqlite3_exec() is relayed through to the 1st argument of each +** callback invocation. ^If the callback pointer to sqlite3_exec() +** is NULL, then no callback is ever invoked and result rows are +** ignored. ** -** If the SQL statement in the 2nd parameter is NULL or an empty string -** or a string containing only whitespace and comments, then no SQL -** statements are evaluated and the database is not changed. +** ^If an error occurs while evaluating the SQL statements passed into +** sqlite3_exec(), then execution of the current statement stops and +** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec() +** is not NULL then any error message is written into memory obtained +** from [sqlite3_malloc()] and passed back through the 5th parameter. +** To avoid memory leaks, the application should invoke [sqlite3_free()] +** on error message strings returned through the 5th parameter of +** of sqlite3_exec() after the error message string is no longer needed. +** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors +** occur, then sqlite3_exec() sets the pointer in its 5th parameter to +** NULL before returning. ** -** The sqlite3_exec() interface is implemented in terms of -** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()]. -** The sqlite3_exec() routine does nothing to the database that cannot be done -** by [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()]. +** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec() +** routine returns SQLITE_ABORT without invoking the callback again and +** without running any subsequent SQL statements. ** -** The first parameter to [sqlite3_exec()] must be an valid and open -** [database connection]. +** ^The 2nd argument to the sqlite3_exec() callback function is the +** number of columns in the result. ^The 3rd argument to the sqlite3_exec() +** callback is an array of pointers to strings obtained as if from +** [sqlite3_column_text()], one for each column. ^If an element of a +** result row is NULL then the corresponding string pointer for the +** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the +** sqlite3_exec() callback is an array of pointers to strings where each +** entry represents the name of corresponding result column as obtained +** from [sqlite3_column_name()]. ** -** The database connection must not be closed while -** [sqlite3_exec()] is running. +** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer +** to an empty string, or a pointer that contains only whitespace and/or +** SQL comments, then no SQL statements are evaluated and the database +** is not changed. ** -** The calling function should use [sqlite3_free()] to free -** the memory that *errmsg is left pointing at once the error -** message is no longer needed. +** Restrictions: ** -** The SQL statement text in the 2nd parameter to [sqlite3_exec()] -** must remain unchanged while [sqlite3_exec()] is running. -** -** Requirements: -** [H12101] [H12102] [H12104] [H12105] [H12107] [H12110] [H12113] [H12116] -** [H12119] [H12122] [H12125] [H12131] [H12134] [H12137] [H12138] +**
      +**
    • The application must insure that the 1st parameter to sqlite3_exec() +** is a valid and open [database connection]. +**
    • The application must not close [database connection] specified by +** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. +**
    • The application must not modify the SQL statement text passed into +** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. +**
    */ SQLITE_API int sqlite3_exec( sqlite3*, /* An open database */ @@ -421,7 +703,7 @@ SQLITE_API int sqlite3_exec( ); /* -** CAPI3REF: Result Codes {H10210} +** CAPI3REF: Result Codes ** KEYWORDS: SQLITE_OK {error code} {error codes} ** KEYWORDS: {result code} {result codes} ** @@ -448,7 +730,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */ #define SQLITE_FULL 13 /* Insertion failed because database is full */ #define SQLITE_CANTOPEN 14 /* Unable to open the database file */ -#define SQLITE_PROTOCOL 15 /* NOT USED. Database lock protocol error */ +#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ #define SQLITE_EMPTY 16 /* Database is empty */ #define SQLITE_SCHEMA 17 /* The database schema changed */ #define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */ @@ -465,7 +747,7 @@ SQLITE_API int sqlite3_exec( /* end-of-error-codes */ /* -** CAPI3REF: Extended Result Codes {H10220} +** CAPI3REF: Extended Result Codes ** KEYWORDS: {extended error code} {extended error codes} ** KEYWORDS: {extended result code} {extended result codes} ** @@ -504,10 +786,15 @@ SQLITE_API int sqlite3_exec( #define SQLITE_IOERR_LOCK (SQLITE_IOERR | (15<<8)) #define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) #define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) -#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8) ) +#define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8)) +#define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8)) +#define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) +#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) +#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) +#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) /* -** CAPI3REF: Flags For File Open Operations {H10230} +** CAPI3REF: Flags For File Open Operations ** ** These bit values are intended for use in the ** 3rd parameter to the [sqlite3_open_v2()] interface and @@ -519,6 +806,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_DELETEONCLOSE 0x00000008 /* VFS only */ #define SQLITE_OPEN_EXCLUSIVE 0x00000010 /* VFS only */ +#define SQLITE_OPEN_AUTOPROXY 0x00000020 /* VFS only */ #define SQLITE_OPEN_MAIN_DB 0x00000100 /* VFS only */ #define SQLITE_OPEN_TEMP_DB 0x00000200 /* VFS only */ #define SQLITE_OPEN_TRANSIENT_DB 0x00000400 /* VFS only */ @@ -530,11 +818,12 @@ SQLITE_API int sqlite3_exec( #define SQLITE_OPEN_FULLMUTEX 0x00010000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ /* -** CAPI3REF: Device Characteristics {H10240} +** CAPI3REF: Device Characteristics ** -** The xDeviceCapabilities method of the [sqlite3_io_methods] +** The xDeviceCharacteristics method of the [sqlite3_io_methods] ** object returns an integer which is a vector of the these ** bit values expressing I/O characteristics of the mass storage ** device that holds the file that the [sqlite3_io_methods] @@ -551,20 +840,21 @@ SQLITE_API int sqlite3_exec( ** information is written to disk in the same order as calls ** to xWrite(). */ -#define SQLITE_IOCAP_ATOMIC 0x00000001 -#define SQLITE_IOCAP_ATOMIC512 0x00000002 -#define SQLITE_IOCAP_ATOMIC1K 0x00000004 -#define SQLITE_IOCAP_ATOMIC2K 0x00000008 -#define SQLITE_IOCAP_ATOMIC4K 0x00000010 -#define SQLITE_IOCAP_ATOMIC8K 0x00000020 -#define SQLITE_IOCAP_ATOMIC16K 0x00000040 -#define SQLITE_IOCAP_ATOMIC32K 0x00000080 -#define SQLITE_IOCAP_ATOMIC64K 0x00000100 -#define SQLITE_IOCAP_SAFE_APPEND 0x00000200 -#define SQLITE_IOCAP_SEQUENTIAL 0x00000400 +#define SQLITE_IOCAP_ATOMIC 0x00000001 +#define SQLITE_IOCAP_ATOMIC512 0x00000002 +#define SQLITE_IOCAP_ATOMIC1K 0x00000004 +#define SQLITE_IOCAP_ATOMIC2K 0x00000008 +#define SQLITE_IOCAP_ATOMIC4K 0x00000010 +#define SQLITE_IOCAP_ATOMIC8K 0x00000020 +#define SQLITE_IOCAP_ATOMIC16K 0x00000040 +#define SQLITE_IOCAP_ATOMIC32K 0x00000080 +#define SQLITE_IOCAP_ATOMIC64K 0x00000100 +#define SQLITE_IOCAP_SAFE_APPEND 0x00000200 +#define SQLITE_IOCAP_SEQUENTIAL 0x00000400 +#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800 /* -** CAPI3REF: File Locking Levels {H10250} +** CAPI3REF: File Locking Levels ** ** SQLite uses one of these integer values as the second ** argument to calls it makes to the xLock() and xUnlock() methods @@ -577,7 +867,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_LOCK_EXCLUSIVE 4 /* -** CAPI3REF: Synchronization Type Flags {H10260} +** CAPI3REF: Synchronization Type Flags ** ** When SQLite invokes the xSync() method of an ** [sqlite3_io_methods] object it uses a combination of @@ -595,7 +885,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_SYNC_DATAONLY 0x00010 /* -** CAPI3REF: OS Interface Open File Handle {H11110} +** CAPI3REF: OS Interface Open File Handle ** ** An [sqlite3_file] object represents an open file in the ** [sqlite3_vfs | OS interface layer]. Individual OS interface @@ -611,7 +901,7 @@ struct sqlite3_file { }; /* -** CAPI3REF: OS Interface File Virtual Methods Object {H11120} +** CAPI3REF: OS Interface File Virtual Methods Object ** ** Every file opened by the [sqlite3_vfs] xOpen method populates an ** [sqlite3_file] object (or, more commonly, a subclass of the @@ -712,11 +1002,17 @@ struct sqlite3_io_methods { int (*xFileControl)(sqlite3_file*, int op, void *pArg); int (*xSectorSize)(sqlite3_file*); int (*xDeviceCharacteristics)(sqlite3_file*); + /* Methods above are valid for version 1 */ + int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); + int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); + void (*xShmBarrier)(sqlite3_file*); + int (*xShmUnmap)(sqlite3_file*, int deleteFlag); + /* Methods above are valid for version 2 */ /* Additional methods may be added in future releases */ }; /* -** CAPI3REF: Standard File Control Opcodes {H11310} +** CAPI3REF: Standard File Control Opcodes ** ** These integer constants are opcodes for the xFileControl method ** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] @@ -729,14 +1025,31 @@ struct sqlite3_io_methods { ** into an integer that the pArg argument points to. This capability ** is used during testing and only needs to be supported when SQLITE_TEST ** is defined. +** +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. */ #define SQLITE_FCNTL_LOCKSTATE 1 #define SQLITE_GET_LOCKPROXYFILE 2 #define SQLITE_SET_LOCKPROXYFILE 3 #define SQLITE_LAST_ERRNO 4 +#define SQLITE_FCNTL_SIZE_HINT 5 +#define SQLITE_FCNTL_CHUNK_SIZE 6 /* -** CAPI3REF: Mutex Handle {H17110} +** CAPI3REF: Mutex Handle ** ** The mutex module within SQLite defines [sqlite3_mutex] to be an ** abstract type for a mutex object. The SQLite core never looks @@ -748,7 +1061,7 @@ struct sqlite3_io_methods { typedef struct sqlite3_mutex sqlite3_mutex; /* -** CAPI3REF: OS Interface Object {H11140} +** CAPI3REF: OS Interface Object ** ** An instance of the sqlite3_vfs object defines the interface between ** the SQLite core and the underlying operating system. The "vfs" @@ -781,15 +1094,19 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** The zName field holds the name of the VFS module. The name must ** be unique across all VFS modules. ** -** SQLite will guarantee that the zFilename parameter to xOpen +** ^SQLite guarantees that the zFilename parameter to xOpen ** is either a NULL pointer or string obtained -** from xFullPathname(). SQLite further guarantees that +** from xFullPathname() with an optional suffix added. +** ^If a suffix is added to the zFilename parameter, it will +** consist of a single "-" character followed by no more than +** 10 alphanumeric and/or "-" characters. +** ^SQLite further guarantees that ** the string will be valid and unchanged until xClose() is ** called. Because of the previous sentence, ** the [sqlite3_file] can safely store a pointer to the ** filename if it needs to remember the filename for some reason. -** If the zFilename parameter is xOpen is a NULL pointer then xOpen -** must invent its own temporary name for the file. Whenever the +** If the zFilename parameter to xOpen is a NULL pointer then xOpen +** must invent its own temporary name for the file. ^Whenever the ** xFilename parameter is NULL it will also be the case that the ** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. ** @@ -800,7 +1117,7 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** If xOpen() opens a file read-only then it sets *pOutFlags to ** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. ** -** SQLite will also add one of the following flags to the xOpen() +** ^(SQLite will also add one of the following flags to the xOpen() ** call, depending on the object being opened: ** **
      @@ -811,7 +1128,8 @@ typedef struct sqlite3_mutex sqlite3_mutex; **
    • [SQLITE_OPEN_TRANSIENT_DB] **
    • [SQLITE_OPEN_SUBJOURNAL] **
    • [SQLITE_OPEN_MASTER_JOURNAL] -**
    +**
  • [SQLITE_OPEN_WAL] +** )^ ** ** The file I/O implementation can use the object type flags to ** change the way it deals with files. For example, an application @@ -830,10 +1148,11 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** ** ** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be -** deleted when it is closed. The [SQLITE_OPEN_DELETEONCLOSE] -** will be set for TEMP databases, journals and for subjournals. +** deleted when it is closed. ^The [SQLITE_OPEN_DELETEONCLOSE] +** will be set for TEMP databases and their journals, transient +** databases, and subjournals. ** -** The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction +** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction ** with the [SQLITE_OPEN_CREATE] flag, which are both directly ** analogous to the O_EXCL and O_CREAT flags of the POSIX open() ** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the @@ -842,7 +1161,7 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** It is not used to indicate the file should be opened ** for exclusive access. ** -** At least szOsFile bytes of memory are allocated by SQLite +** ^At least szOsFile bytes of memory are allocated by SQLite ** to hold the [sqlite3_file] structure passed as the third ** argument to xOpen. The xOpen method does not have to ** allocate the structure; it should just fill it in. Note that @@ -852,33 +1171,40 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** element will be valid after xOpen returns regardless of the success ** or failure of the xOpen call. ** -** The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] +** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] ** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to ** test whether a file is readable and writable, or [SQLITE_ACCESS_READ] ** to test whether a file is at least readable. The file can be a ** directory. ** -** SQLite will always allocate at least mxPathname+1 bytes for the +** ^SQLite will always allocate at least mxPathname+1 bytes for the ** output buffer xFullPathname. The exact size of the output buffer ** is also passed as a parameter to both methods. If the output buffer ** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is ** handled as a fatal error by SQLite, vfs implementations should endeavor ** to prevent this by setting mxPathname to a sufficiently large value. ** -** The xRandomness(), xSleep(), and xCurrentTime() interfaces -** are not strictly a part of the filesystem, but they are +** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64() +** interfaces are not strictly a part of the filesystem, but they are ** included in the VFS structure for completeness. ** The xRandomness() function attempts to return nBytes bytes ** of good-quality randomness into zOut. The return value is ** the actual number of bytes of randomness obtained. ** The xSleep() method causes the calling thread to sleep for at -** least the number of microseconds given. The xCurrentTime() -** method returns a Julian Day Number for the current date and time. -** +** least the number of microseconds given. ^The xCurrentTime() +** method returns a Julian Day Number for the current date and time as +** a floating point value. +** ^The xCurrentTimeInt64() method returns, as an integer, the Julian +** Day Number multipled by 86400000 (the number of milliseconds in +** a 24-hour day). +** ^SQLite will use the xCurrentTimeInt64() method to get the current +** date and time if that method is available (if iVersion is 2 or +** greater and the function pointer is not NULL) and will fall back +** to xCurrentTime() if xCurrentTimeInt64() is unavailable. */ typedef struct sqlite3_vfs sqlite3_vfs; struct sqlite3_vfs { - int iVersion; /* Structure version number */ + int iVersion; /* Structure version number (currently 2) */ int szOsFile; /* Size of subclassed sqlite3_file */ int mxPathname; /* Maximum file pathname length */ sqlite3_vfs *pNext; /* Next registered VFS */ @@ -897,48 +1223,101 @@ struct sqlite3_vfs { int (*xSleep)(sqlite3_vfs*, int microseconds); int (*xCurrentTime)(sqlite3_vfs*, double*); int (*xGetLastError)(sqlite3_vfs*, int, char *); - /* New fields may be appended in figure versions. The iVersion - ** value will increment whenever this happens. */ + /* + ** The methods above are in version 1 of the sqlite_vfs object + ** definition. Those that follow are added in version 2 or later + */ + int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); + /* + ** The methods above are in versions 1 and 2 of the sqlite_vfs object. + ** New fields may be appended in figure versions. The iVersion + ** value will increment whenever this happens. + */ }; /* -** CAPI3REF: Flags for the xAccess VFS method {H11190} +** CAPI3REF: Flags for the xAccess VFS method ** ** These integer constants can be used as the third parameter to -** the xAccess method of an [sqlite3_vfs] object. {END} They determine +** the xAccess method of an [sqlite3_vfs] object. They determine ** what kind of permissions the xAccess method is looking for. ** With SQLITE_ACCESS_EXISTS, the xAccess method ** simply checks whether the file exists. ** With SQLITE_ACCESS_READWRITE, the xAccess method -** checks whether the file is both readable and writable. +** checks whether the named directory is both readable and writable +** (in other words, if files can be added, removed, and renamed within +** the directory). +** The SQLITE_ACCESS_READWRITE constant is currently used only by the +** [temp_store_directory pragma], though this could change in a future +** release of SQLite. ** With SQLITE_ACCESS_READ, the xAccess method -** checks whether the file is readable. +** checks whether the file is readable. The SQLITE_ACCESS_READ constant is +** currently unused, though it might be used in a future release of +** SQLite. */ #define SQLITE_ACCESS_EXISTS 0 -#define SQLITE_ACCESS_READWRITE 1 -#define SQLITE_ACCESS_READ 2 +#define SQLITE_ACCESS_READWRITE 1 /* Used by PRAGMA temp_store_directory */ +#define SQLITE_ACCESS_READ 2 /* Unused */ /* -** CAPI3REF: Initialize The SQLite Library {H10130} +** CAPI3REF: Flags for the xShmLock VFS method ** -** The sqlite3_initialize() routine initializes the -** SQLite library. The sqlite3_shutdown() routine +** These integer constants define the various locking operations +** allowed by the xShmLock method of [sqlite3_io_methods]. The +** following are the only legal combinations of flags to the +** xShmLock method: +** +**
      +**
    • SQLITE_SHM_LOCK | SQLITE_SHM_SHARED +**
    • SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE +**
    • SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED +**
    • SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE +**
    +** +** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as +** was given no the corresponding lock. +** +** The xShmLock method can transition between unlocked and SHARED or +** between unlocked and EXCLUSIVE. It cannot transition between SHARED +** and EXCLUSIVE. +*/ +#define SQLITE_SHM_UNLOCK 1 +#define SQLITE_SHM_LOCK 2 +#define SQLITE_SHM_SHARED 4 +#define SQLITE_SHM_EXCLUSIVE 8 + +/* +** CAPI3REF: Maximum xShmLock index +** +** The xShmLock method on [sqlite3_io_methods] may use values +** between 0 and this upper bound as its "offset" argument. +** The SQLite core will never attempt to acquire or release a +** lock outside of this range +*/ +#define SQLITE_SHM_NLOCK 8 + + +/* +** CAPI3REF: Initialize The SQLite Library +** +** ^The sqlite3_initialize() routine initializes the +** SQLite library. ^The sqlite3_shutdown() routine ** deallocates any resources that were allocated by sqlite3_initialize(). -** This routines are designed to aid in process initialization and +** These routines are designed to aid in process initialization and ** shutdown on embedded systems. Workstation applications using ** SQLite normally do not need to invoke either of these routines. ** ** A call to sqlite3_initialize() is an "effective" call if it is ** the first time sqlite3_initialize() is invoked during the lifetime of ** the process, or if it is the first time sqlite3_initialize() is invoked -** following a call to sqlite3_shutdown(). Only an effective call +** following a call to sqlite3_shutdown(). ^(Only an effective call ** of sqlite3_initialize() does any initialization. All other calls -** are harmless no-ops. +** are harmless no-ops.)^ ** ** A call to sqlite3_shutdown() is an "effective" call if it is the first -** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only +** call to sqlite3_shutdown() since the last sqlite3_initialize(). ^(Only ** an effective call to sqlite3_shutdown() does any deinitialization. -** All other valid calls to sqlite3_shutdown() are harmless no-ops. +** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^ ** ** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown() ** is not. The sqlite3_shutdown() interface must only be called from a @@ -946,21 +1325,21 @@ struct sqlite3_vfs { ** other SQLite resources must be deallocated prior to invoking ** sqlite3_shutdown(). ** -** Among other things, sqlite3_initialize() will invoke -** sqlite3_os_init(). Similarly, sqlite3_shutdown() +** Among other things, ^sqlite3_initialize() will invoke +** sqlite3_os_init(). Similarly, ^sqlite3_shutdown() ** will invoke sqlite3_os_end(). ** -** The sqlite3_initialize() routine returns [SQLITE_OK] on success. -** If for some reason, sqlite3_initialize() is unable to initialize +** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success. +** ^If for some reason, sqlite3_initialize() is unable to initialize ** the library (perhaps it is unable to allocate a needed resource such ** as a mutex) it returns an [error code] other than [SQLITE_OK]. ** -** The sqlite3_initialize() routine is called internally by many other +** ^The sqlite3_initialize() routine is called internally by many other ** SQLite interfaces so that an application usually does not need to ** invoke sqlite3_initialize() directly. For example, [sqlite3_open()] ** calls sqlite3_initialize() so the SQLite library will be automatically ** initialized when [sqlite3_open()] is called if it has not be initialized -** already. However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] +** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] ** compile-time option, then the automatic calls to sqlite3_initialize() ** are omitted and the application must call sqlite3_initialize() directly ** prior to using any other SQLite interface. For maximum portability, @@ -999,8 +1378,7 @@ SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void); /* -** CAPI3REF: Configuring The SQLite Library {H14100} -** EXPERIMENTAL +** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of @@ -1013,7 +1391,9 @@ SQLITE_API int sqlite3_os_end(void); ** threads while sqlite3_config() is running. Furthermore, sqlite3_config() ** may only be invoked prior to library initialization using ** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()]. -** Note, however, that sqlite3_config() can be called as part of the +** ^If sqlite3_config() is called after [sqlite3_initialize()] and before +** [sqlite3_shutdown()] then it will return SQLITE_MISUSE. +** Note, however, that ^sqlite3_config() can be called as part of the ** implementation of an application-defined [sqlite3_os_init()]. ** ** The first argument to sqlite3_config() is an integer @@ -1022,26 +1402,20 @@ SQLITE_API int sqlite3_os_end(void); ** vary depending on the [SQLITE_CONFIG_SINGLETHREAD | configuration option] ** in the first argument. ** -** When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. -** If the option is unknown or SQLite is unable to set the option +** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. +** ^If the option is unknown or SQLite is unable to set the option ** then this routine returns a non-zero [error code]. -** -** Requirements: -** [H14103] [H14106] [H14120] [H14123] [H14126] [H14129] [H14132] [H14135] -** [H14138] [H14141] [H14144] [H14147] [H14150] [H14153] [H14156] [H14159] -** [H14162] [H14165] [H14168] */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_config(int, ...); +SQLITE_API int sqlite3_config(int, ...); /* -** CAPI3REF: Configure database connections {H14200} -** EXPERIMENTAL +** CAPI3REF: Configure database connections ** ** The sqlite3_db_config() interface is used to make configuration ** changes to a [database connection]. The interface is similar to ** [sqlite3_config()] except that the changes apply to a single ** [database connection] (specified in the first argument). The -** sqlite3_db_config() interface can only be used immediately after +** sqlite3_db_config() interface should only be used immediately after ** the database connection is created using [sqlite3_open()], ** [sqlite3_open16()], or [sqlite3_open_v2()]. ** @@ -1052,14 +1426,13 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_config(int, ...); ** New verbs are likely to be added in future releases of SQLite. ** Additional arguments depend on the verb. ** -** Requirements: -** [H14203] [H14206] [H14209] [H14212] [H14215] +** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if +** the call is considered successful. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_config(sqlite3*, int op, ...); +SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); /* -** CAPI3REF: Memory Allocation Routines {H10155} -** EXPERIMENTAL +** CAPI3REF: Memory Allocation Routines ** ** An instance of this object defines the interface between SQLite ** and low-level memory allocation routines. @@ -1088,7 +1461,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_config(sqlite3*, int op, ...); ** The xRealloc method must work like realloc() from the standard C library ** with the exception that if the second argument to xRealloc is zero, ** xRealloc must be a no-op - it must not perform any allocation or -** deallocation. SQLite guaranteeds that the second argument to +** deallocation. ^SQLite guarantees that the second argument to ** xRealloc is always a value returned by a prior call to xRoundup. ** And so in cases where xRoundup always returns a positive number, ** xRealloc can perform exactly as the standard library realloc() and @@ -1140,8 +1513,7 @@ struct sqlite3_mem_methods { }; /* -** CAPI3REF: Configuration Options {H10160} -** EXPERIMENTAL +** CAPI3REF: Configuration Options ** ** These constants are the available integer configuration options that ** can be passed as the first argument to the [sqlite3_config()] interface. @@ -1155,22 +1527,33 @@ struct sqlite3_mem_methods { ** **
    **
    SQLITE_CONFIG_SINGLETHREAD
    -**
    There are no arguments to this option. This option disables +**
    There are no arguments to this option. ^This option sets the +** [threading mode] to Single-thread. In other words, it disables ** all mutexing and puts SQLite into a mode where it can only be used -** by a single thread.
    +** by a single thread. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to change the [threading mode] from its default +** value of Single-thread and so [sqlite3_config()] will return +** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD +** configuration option. ** **
    SQLITE_CONFIG_MULTITHREAD
    -**
    There are no arguments to this option. This option disables +**
    There are no arguments to this option. ^This option sets the +** [threading mode] to Multi-thread. In other words, it disables ** mutexing on [database connection] and [prepared statement] objects. ** The application is responsible for serializing access to ** [database connections] and [prepared statements]. But other mutexes ** are enabled so that SQLite will be safe to use in a multi-threaded ** environment as long as no two threads attempt to use the same -** [database connection] at the same time. See the [threading mode] -** documentation for additional information.
    +** [database connection] at the same time. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to set the Multi-thread [threading mode] and +** [sqlite3_config()] will return [SQLITE_ERROR] if called with the +** SQLITE_CONFIG_MULTITHREAD configuration option. ** **
    SQLITE_CONFIG_SERIALIZED
    -**
    There are no arguments to this option. This option enables +**
    There are no arguments to this option. ^This option sets the +** [threading mode] to Serialized. In other words, this option enables ** all mutexes including the recursive ** mutexes on [database connection] and [prepared statement] objects. ** In this mode (which is the default when SQLite is compiled with @@ -1178,55 +1561,62 @@ struct sqlite3_mem_methods { ** to [database connections] and [prepared statements] so that the ** application is free to use the same [database connection] or the ** same [prepared statement] in different threads at the same time. -** See the [threading mode] documentation for additional information.
    +** ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to set the Serialized [threading mode] and +** [sqlite3_config()] will return [SQLITE_ERROR] if called with the +** SQLITE_CONFIG_SERIALIZED configuration option. ** **
    SQLITE_CONFIG_MALLOC
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mem_methods] structure. The argument specifies ** alternative low-level memory allocation routines to be used in place of -** the memory allocation routines built into SQLite.
    +** the memory allocation routines built into SQLite.)^ ^SQLite makes +** its own private copy of the content of the [sqlite3_mem_methods] structure +** before the [sqlite3_config()] call returns. ** **
    SQLITE_CONFIG_GETMALLOC
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mem_methods] structure. The [sqlite3_mem_methods] -** structure is filled with the currently defined memory allocation routines. +** structure is filled with the currently defined memory allocation routines.)^ ** This option can be used to overload the default memory allocation ** routines with a wrapper that simulations memory allocation failure or -** tracks memory usage, for example.
    +** tracks memory usage, for example. ** **
    SQLITE_CONFIG_MEMSTATUS
    -**
    This option takes single argument of type int, interpreted as a +**
    ^This option takes single argument of type int, interpreted as a ** boolean, which enables or disables the collection of memory allocation -** statistics. When disabled, the following SQLite interfaces become -** non-operational: +** statistics. ^(When memory allocation statistics are disabled, the +** following SQLite interfaces become non-operational: **
      **
    • [sqlite3_memory_used()] **
    • [sqlite3_memory_highwater()] -**
    • [sqlite3_soft_heap_limit()] +**
    • [sqlite3_soft_heap_limit64()] **
    • [sqlite3_status()] -**
    +** )^ +** ^Memory allocation statistics are enabled by default unless SQLite is +** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory +** allocation statistics are disabled by default. **
    ** **
    SQLITE_CONFIG_SCRATCH
    -**
    This option specifies a static memory buffer that SQLite can use for +**
    ^This option specifies a static memory buffer that SQLite can use for ** scratch memory. There are three arguments: A pointer an 8-byte ** aligned memory buffer from which the scrach allocations will be ** drawn, the size of each scratch allocation (sz), ** and the maximum number of scratch allocations (N). The sz -** argument must be a multiple of 16. The sz parameter should be a few bytes -** larger than the actual scratch space required due to internal overhead. -** The first argument should pointer to an 8-byte aligned buffer +** argument must be a multiple of 16. +** The first argument must be a pointer to an 8-byte aligned buffer ** of at least sz*N bytes of memory. -** SQLite will use no more than one scratch buffer at once per thread, so -** N should be set to the expected maximum number of threads. The sz -** parameter should be 6 times the size of the largest database page size. -** Scratch buffers are used as part of the btree balance operation. If -** The btree balancer needs additional memory beyond what is provided by -** scratch buffers or if no scratch buffer space is specified, then SQLite -** goes to [sqlite3_malloc()] to obtain the memory it needs.
    +** ^SQLite will use no more than two scratch buffers per thread. So +** N should be set to twice the expected maximum number of threads. +** ^SQLite will never require a scratch buffer that is more than 6 +** times the database page size. ^If SQLite needs needs additional +** scratch memory beyond what is provided by this configuration option, then +** [sqlite3_malloc()] will be used to obtain the memory needed. ** **
    SQLITE_CONFIG_PAGECACHE
    -**
    This option specifies a static memory buffer that SQLite can use for +**
    ^This option specifies a static memory buffer that SQLite can use for ** the database page cache with the default page cache implemenation. ** This configuration should not be used if an application-define page ** cache implementation is loaded using the SQLITE_CONFIG_PCACHE option. @@ -1234,28 +1624,27 @@ struct sqlite3_mem_methods { ** memory, the size of each page buffer (sz), and the number of pages (N). ** The sz argument should be the size of the largest database page ** (a power of two between 512 and 32768) plus a little extra for each -** page header. The page header size is 20 to 40 bytes depending on -** the host architecture. It is harmless, apart from the wasted memory, +** page header. ^The page header size is 20 to 40 bytes depending on +** the host architecture. ^It is harmless, apart from the wasted memory, ** to make sz a little too large. The first ** argument should point to an allocation of at least sz*N bytes of memory. -** SQLite will use the memory provided by the first argument to satisfy its -** memory needs for the first N pages that it adds to cache. If additional +** ^SQLite will use the memory provided by the first argument to satisfy its +** memory needs for the first N pages that it adds to cache. ^If additional ** page cache memory is needed beyond what is provided by this option, then ** SQLite goes to [sqlite3_malloc()] for the additional storage space. -** The implementation might use one or more of the N buffers to hold -** memory accounting information. The pointer in the first argument must +** The pointer in the first argument must ** be aligned to an 8-byte boundary or subsequent behavior of SQLite ** will be undefined.
    ** **
    SQLITE_CONFIG_HEAP
    -**
    This option specifies a static memory buffer that SQLite will use +**
    ^This option specifies a static memory buffer that SQLite will use ** for all of its dynamic memory allocation needs beyond those provided ** for by [SQLITE_CONFIG_SCRATCH] and [SQLITE_CONFIG_PAGECACHE]. ** There are three arguments: An 8-byte aligned pointer to the memory, ** the number of bytes in the memory buffer, and the minimum allocation size. -** If the first pointer (the memory pointer) is NULL, then SQLite reverts +** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts ** to using its default memory allocator (the system malloc() implementation), -** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. If the +** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. ^If the ** memory pointer is not NULL and either [SQLITE_ENABLE_MEMSYS3] or ** [SQLITE_ENABLE_MEMSYS5] are defined, then the alternative memory ** allocator is engaged to handle all of SQLites memory allocation needs. @@ -1263,39 +1652,68 @@ struct sqlite3_mem_methods { ** boundary or subsequent behavior of SQLite will be undefined.
    ** **
    SQLITE_CONFIG_MUTEX
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mutex_methods] structure. The argument specifies ** alternative low-level mutex routines to be used in place -** the mutex routines built into SQLite.
    +** the mutex routines built into SQLite.)^ ^SQLite makes a copy of the +** content of the [sqlite3_mutex_methods] structure before the call to +** [sqlite3_config()] returns. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** the entire mutexing subsystem is omitted from the build and hence calls to +** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will +** return [SQLITE_ERROR]. ** **
    SQLITE_CONFIG_GETMUTEX
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mutex_methods] structure. The ** [sqlite3_mutex_methods] -** structure is filled with the currently defined mutex routines. +** structure is filled with the currently defined mutex routines.)^ ** This option can be used to overload the default mutex allocation ** routines with a wrapper used to track mutex usage for performance -** profiling or testing, for example.
    +** profiling or testing, for example. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** the entire mutexing subsystem is omitted from the build and hence calls to +** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will +** return [SQLITE_ERROR]. ** **
    SQLITE_CONFIG_LOOKASIDE
    -**
    This option takes two arguments that determine the default -** memory allocation lookaside optimization. The first argument is the +**
    ^(This option takes two arguments that determine the default +** memory allocation for the lookaside memory allocator on each +** [database connection]. The first argument is the ** size of each lookaside buffer slot and the second is the number of -** slots allocated to each database connection. This option sets the -** default lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] +** slots allocated to each database connection.)^ ^(This option sets the +** default lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] ** verb to [sqlite3_db_config()] can be used to change the lookaside -** configuration on individual connections.
    +** configuration on individual connections.)^ ** **
    SQLITE_CONFIG_PCACHE
    -**
    This option takes a single argument which is a pointer to +**
    ^(This option takes a single argument which is a pointer to ** an [sqlite3_pcache_methods] object. This object specifies the interface -** to a custom page cache implementation. SQLite makes a copy of the +** to a custom page cache implementation.)^ ^SQLite makes a copy of the ** object and uses it for page cache memory allocations.
    ** **
    SQLITE_CONFIG_GETPCACHE
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** [sqlite3_pcache_methods] object. SQLite copies of the current -** page cache implementation into that object.
    +** page cache implementation into that object.)^ +** +**
    SQLITE_CONFIG_LOG
    +**
    ^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a +** function with a call signature of void(*)(void*,int,const char*), +** and a pointer to void. ^If the function pointer is not NULL, it is +** invoked by [sqlite3_log()] to process each logging event. ^If the +** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. +** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is +** passed through as the first parameter to the application-defined logger +** function whenever that function is invoked. ^The second parameter to +** the logger function is a copy of the first parameter to the corresponding +** [sqlite3_log()] call and is intended to be a [result code] or an +** [extended result code]. ^The third parameter passed to the logger is +** log message after formatting via [sqlite3_snprintf()]. +** The SQLite logging interface is not reentrant; the logger function +** supplied by the application must not invoke any SQLite interface. +** In a multi-threaded application, the application-defined logger +** function must be threadsafe.
    ** **
    */ @@ -1314,10 +1732,10 @@ struct sqlite3_mem_methods { #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ #define SQLITE_CONFIG_PCACHE 14 /* sqlite3_pcache_methods* */ #define SQLITE_CONFIG_GETPCACHE 15 /* sqlite3_pcache_methods* */ +#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ /* -** CAPI3REF: Configuration Options {H10170} -** EXPERIMENTAL +** CAPI3REF: Database Connection Configuration Options ** ** These constants are the available integer configuration options that ** can be passed as the second argument to the [sqlite3_db_config()] interface. @@ -1325,24 +1743,32 @@ struct sqlite3_mem_methods { ** New configuration options may be added in future releases of SQLite. ** Existing configuration options might be discontinued. Applications ** should check the return code from [sqlite3_db_config()] to make sure that -** the call worked. The [sqlite3_db_config()] interface will return a +** the call worked. ^The [sqlite3_db_config()] interface will return a ** non-zero [error code] if a discontinued or unsupported configuration option ** is invoked. ** **
    **
    SQLITE_DBCONFIG_LOOKASIDE
    -**
    This option takes three additional arguments that determine the +**
    ^This option takes three additional arguments that determine the ** [lookaside memory allocator] configuration for the [database connection]. -** The first argument (the third parameter to [sqlite3_db_config()] is a +** ^The first argument (the third parameter to [sqlite3_db_config()] is a ** pointer to an memory buffer to use for lookaside memory. -** The first argument may be NULL in which case SQLite will allocate the -** lookaside buffer itself using [sqlite3_malloc()]. The second argument is the -** size of each lookaside buffer slot and the third argument is the number of +** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb +** may be NULL in which case SQLite will allocate the +** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the +** size of each lookaside buffer slot. ^The third argument is the number of ** slots. The size of the buffer in the first argument must be greater than ** or equal to the product of the second and third arguments. The buffer -** must be aligned to an 8-byte boundary. If the second argument is not -** a multiple of 8, it is internally rounded down to the next smaller -** multiple of 8. See also: [SQLITE_CONFIG_LOOKASIDE]
    +** must be aligned to an 8-byte boundary. ^If the second argument to +** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally +** rounded down to the next smaller multiple of 8. ^(The lookaside memory +** configuration for a database connection can only be changed when that +** connection is not currently using lookaside memory, or in other words +** when the "current value" returned by +** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero. +** Any attempt to change the lookaside memory configuration when lookaside +** memory is in use leaves the configuration unchanged and returns +** [SQLITE_BUSY].)^ ** **
    */ @@ -1350,52 +1776,49 @@ struct sqlite3_mem_methods { /* -** CAPI3REF: Enable Or Disable Extended Result Codes {H12200} +** CAPI3REF: Enable Or Disable Extended Result Codes ** -** The sqlite3_extended_result_codes() routine enables or disables the -** [extended result codes] feature of SQLite. The extended result -** codes are disabled by default for historical compatibility considerations. -** -** Requirements: -** [H12201] [H12202] +** ^The sqlite3_extended_result_codes() routine enables or disables the +** [extended result codes] feature of SQLite. ^The extended result +** codes are disabled by default for historical compatibility. */ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); /* -** CAPI3REF: Last Insert Rowid {H12220} +** CAPI3REF: Last Insert Rowid ** -** Each entry in an SQLite table has a unique 64-bit signed -** integer key called the [ROWID | "rowid"]. The rowid is always available +** ^Each entry in an SQLite table has a unique 64-bit signed +** integer key called the [ROWID | "rowid"]. ^The rowid is always available ** as an undeclared column named ROWID, OID, or _ROWID_ as long as those -** names are not also used by explicitly declared columns. If +** names are not also used by explicitly declared columns. ^If ** the table has a column of type [INTEGER PRIMARY KEY] then that column ** is another alias for the rowid. ** -** This routine returns the [rowid] of the most recent +** ^This routine returns the [rowid] of the most recent ** successful [INSERT] into the database from the [database connection] -** in the first argument. If no successful [INSERT]s +** in the first argument. ^If no successful [INSERT]s ** have ever occurred on that database connection, zero is returned. ** -** If an [INSERT] occurs within a trigger, then the [rowid] of the inserted +** ^(If an [INSERT] occurs within a trigger, then the [rowid] of the inserted ** row is returned by this routine as long as the trigger is running. ** But once the trigger terminates, the value returned by this routine -** reverts to the last value inserted before the trigger fired. +** reverts to the last value inserted before the trigger fired.)^ ** -** An [INSERT] that fails due to a constraint violation is not a +** ^An [INSERT] that fails due to a constraint violation is not a ** successful [INSERT] and does not change the value returned by this -** routine. Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, +** routine. ^Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, ** and INSERT OR ABORT make no changes to the return value of this -** routine when their insertion fails. When INSERT OR REPLACE +** routine when their insertion fails. ^(When INSERT OR REPLACE ** encounters a constraint violation, it does not fail. The ** INSERT continues to completion after deleting rows that caused ** the constraint problem so INSERT OR REPLACE will always change -** the return value of this interface. +** the return value of this interface.)^ ** -** For the purposes of this routine, an [INSERT] is considered to +** ^For the purposes of this routine, an [INSERT] is considered to ** be successful even if it is subsequently rolled back. ** -** Requirements: -** [H12221] [H12223] +** This function is accessible to SQL statements via the +** [last_insert_rowid() SQL function]. ** ** If a separate thread performs a new [INSERT] on the same ** database connection while the [sqlite3_last_insert_rowid()] @@ -1407,25 +1830,25 @@ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); /* -** CAPI3REF: Count The Number Of Rows Modified {H12240} +** CAPI3REF: Count The Number Of Rows Modified ** -** This function returns the number of database rows that were changed +** ^This function returns the number of database rows that were changed ** or inserted or deleted by the most recently completed SQL statement ** on the [database connection] specified by the first parameter. -** Only changes that are directly specified by the [INSERT], [UPDATE], +** ^(Only changes that are directly specified by the [INSERT], [UPDATE], ** or [DELETE] statement are counted. Auxiliary changes caused by -** triggers or [foreign key actions] are not counted. Use the +** triggers or [foreign key actions] are not counted.)^ Use the ** [sqlite3_total_changes()] function to find the total number of changes ** including changes caused by triggers and foreign key actions. ** -** Changes to a view that are simulated by an [INSTEAD OF trigger] +** ^Changes to a view that are simulated by an [INSTEAD OF trigger] ** are not counted. Only real table changes are counted. ** -** A "row change" is a change to a single row of a single table +** ^(A "row change" is a change to a single row of a single table ** caused by an INSERT, DELETE, or UPDATE statement. Rows that ** are changed as side effects of [REPLACE] constraint resolution, ** rollback, ABORT processing, [DROP TABLE], or by any other -** mechanisms do not count as direct row changes. +** mechanisms do not count as direct row changes.)^ ** ** A "trigger context" is a scope of execution that begins and ** ends with the script of a [CREATE TRIGGER | trigger]. @@ -1435,27 +1858,24 @@ SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); ** new trigger context is entered for the duration of that one ** trigger. Subtriggers create subcontexts for their duration. ** -** Calling [sqlite3_exec()] or [sqlite3_step()] recursively does +** ^Calling [sqlite3_exec()] or [sqlite3_step()] recursively does ** not create a new trigger context. ** -** This function returns the number of direct row changes in the +** ^This function returns the number of direct row changes in the ** most recent INSERT, UPDATE, or DELETE statement within the same ** trigger context. ** -** Thus, when called from the top level, this function returns the +** ^Thus, when called from the top level, this function returns the ** number of changes in the most recent INSERT, UPDATE, or DELETE -** that also occurred at the top level. Within the body of a trigger, +** that also occurred at the top level. ^(Within the body of a trigger, ** the sqlite3_changes() interface can be called to find the number of ** changes in the most recently completed INSERT, UPDATE, or DELETE ** statement within the body of the same trigger. ** However, the number returned does not include changes -** caused by subtriggers since those have their own context. +** caused by subtriggers since those have their own context.)^ ** -** See also the [sqlite3_total_changes()] interface and the -** [count_changes pragma]. -** -** Requirements: -** [H12241] [H12243] +** See also the [sqlite3_total_changes()] interface, the +** [count_changes pragma], and the [changes() SQL function]. ** ** If a separate thread makes changes on the same database connection ** while [sqlite3_changes()] is running then the value returned @@ -1464,26 +1884,24 @@ SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); SQLITE_API int sqlite3_changes(sqlite3*); /* -** CAPI3REF: Total Number Of Rows Modified {H12260} +** CAPI3REF: Total Number Of Rows Modified ** -** This function returns the number of row changes caused by [INSERT], +** ^This function returns the number of row changes caused by [INSERT], ** [UPDATE] or [DELETE] statements since the [database connection] was opened. -** The count includes all changes from all [CREATE TRIGGER | trigger] -** contexts and changes made by [foreign key actions]. However, +** ^(The count returned by sqlite3_total_changes() includes all changes +** from all [CREATE TRIGGER | trigger] contexts and changes made by +** [foreign key actions]. However, ** the count does not include changes used to implement [REPLACE] constraints, ** do rollbacks or ABORT processing, or [DROP TABLE] processing. The ** count does not include rows of views that fire an [INSTEAD OF trigger], ** though if the INSTEAD OF trigger makes changes of its own, those changes -** are counted. -** The changes are counted as soon as the statement that makes them is -** completed (when the statement handle is passed to [sqlite3_reset()] or -** [sqlite3_finalize()]). +** are counted.)^ +** ^The sqlite3_total_changes() function counts the changes as soon as +** the statement that makes them is completed (when the statement handle +** is passed to [sqlite3_reset()] or [sqlite3_finalize()]). ** -** See also the [sqlite3_changes()] interface and the -** [count_changes pragma]. -** -** Requirements: -** [H12261] [H12263] +** See also the [sqlite3_changes()] interface, the +** [count_changes pragma], and the [total_changes() SQL function]. ** ** If a separate thread makes changes on the same database connection ** while [sqlite3_total_changes()] is running then the value @@ -1492,75 +1910,70 @@ SQLITE_API int sqlite3_changes(sqlite3*); SQLITE_API int sqlite3_total_changes(sqlite3*); /* -** CAPI3REF: Interrupt A Long-Running Query {H12270} +** CAPI3REF: Interrupt A Long-Running Query ** -** This function causes any pending database operation to abort and +** ^This function causes any pending database operation to abort and ** return at its earliest opportunity. This routine is typically ** called in response to a user action such as pressing "Cancel" ** or Ctrl-C where the user wants a long query operation to halt ** immediately. ** -** It is safe to call this routine from a thread different from the +** ^It is safe to call this routine from a thread different from the ** thread that is currently running the database operation. But it ** is not safe to call this routine with a [database connection] that ** is closed or might close before sqlite3_interrupt() returns. ** -** If an SQL operation is very nearly finished at the time when +** ^If an SQL operation is very nearly finished at the time when ** sqlite3_interrupt() is called, then it might not have an opportunity ** to be interrupted and might continue to completion. ** -** An SQL operation that is interrupted will return [SQLITE_INTERRUPT]. -** If the interrupted SQL operation is an INSERT, UPDATE, or DELETE +** ^An SQL operation that is interrupted will return [SQLITE_INTERRUPT]. +** ^If the interrupted SQL operation is an INSERT, UPDATE, or DELETE ** that is inside an explicit transaction, then the entire transaction ** will be rolled back automatically. ** -** The sqlite3_interrupt(D) call is in effect until all currently running -** SQL statements on [database connection] D complete. Any new SQL statements +** ^The sqlite3_interrupt(D) call is in effect until all currently running +** SQL statements on [database connection] D complete. ^Any new SQL statements ** that are started after the sqlite3_interrupt() call and before the ** running statements reaches zero are interrupted as if they had been -** running prior to the sqlite3_interrupt() call. New SQL statements +** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are ** not effected by the sqlite3_interrupt(). -** A call to sqlite3_interrupt(D) that occurs when there are no running +** ^A call to sqlite3_interrupt(D) that occurs when there are no running ** SQL statements is a no-op and has no effect on SQL statements ** that are started after the sqlite3_interrupt() call returns. ** -** Requirements: -** [H12271] [H12272] -** ** If the database connection closes while [sqlite3_interrupt()] ** is running then bad things will likely happen. */ SQLITE_API void sqlite3_interrupt(sqlite3*); /* -** CAPI3REF: Determine If An SQL Statement Is Complete {H10510} +** CAPI3REF: Determine If An SQL Statement Is Complete ** ** These routines are useful during command-line input to determine if the ** currently entered text seems to form a complete SQL statement or ** if additional input is needed before sending the text into -** SQLite for parsing. These routines return 1 if the input string -** appears to be a complete SQL statement. A statement is judged to be +** SQLite for parsing. ^These routines return 1 if the input string +** appears to be a complete SQL statement. ^A statement is judged to be ** complete if it ends with a semicolon token and is not a prefix of a -** well-formed CREATE TRIGGER statement. Semicolons that are embedded within +** well-formed CREATE TRIGGER statement. ^Semicolons that are embedded within ** string literals or quoted identifier names or comments are not ** independent tokens (they are part of the token in which they are -** embedded) and thus do not count as a statement terminator. Whitespace +** embedded) and thus do not count as a statement terminator. ^Whitespace ** and comments that follow the final semicolon are ignored. ** -** These routines return 0 if the statement is incomplete. If a +** ^These routines return 0 if the statement is incomplete. ^If a ** memory allocation fails, then SQLITE_NOMEM is returned. ** -** These routines do not parse the SQL statements thus +** ^These routines do not parse the SQL statements thus ** will not detect syntactically incorrect SQL. ** -** If SQLite has not been initialized using [sqlite3_initialize()] prior +** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked ** automatically by sqlite3_complete16(). If that initialization fails, ** then the return value from sqlite3_complete16() will be non-zero -** regardless of whether or not the input SQL is complete. -** -** Requirements: [H10511] [H10512] +** regardless of whether or not the input SQL is complete.)^ ** ** The input to [sqlite3_complete()] must be a zero-terminated ** UTF-8 string. @@ -1572,27 +1985,27 @@ SQLITE_API int sqlite3_complete(const char *sql); SQLITE_API int sqlite3_complete16(const void *sql); /* -** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors {H12310} +** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors ** -** This routine sets a callback function that might be invoked whenever +** ^This routine sets a callback function that might be invoked whenever ** an attempt is made to open a database table that another thread ** or process has locked. ** -** If the busy callback is NULL, then [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] -** is returned immediately upon encountering the lock. If the busy callback -** is not NULL, then the callback will be invoked with two arguments. +** ^If the busy callback is NULL, then [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] +** is returned immediately upon encountering the lock. ^If the busy callback +** is not NULL, then the callback might be invoked with two arguments. ** -** The first argument to the handler is a copy of the void* pointer which -** is the third argument to sqlite3_busy_handler(). The second argument to -** the handler callback is the number of times that the busy handler has -** been invoked for this locking event. If the +** ^The first argument to the busy handler is a copy of the void* pointer which +** is the third argument to sqlite3_busy_handler(). ^The second argument to +** the busy handler callback is the number of times that the busy handler has +** been invoked for this locking event. ^If the ** busy callback returns 0, then no additional attempts are made to ** access the database and [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] is returned. -** If the callback returns non-zero, then another attempt +** ^If the callback returns non-zero, then another attempt ** is made to open the database for reading and the cycle repeats. ** ** The presence of a busy handler does not guarantee that it will be invoked -** when there is lock contention. If SQLite determines that invoking the busy +** when there is lock contention. ^If SQLite determines that invoking the busy ** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] ** or [SQLITE_IOERR_BLOCKED] instead of invoking the busy handler. ** Consider a scenario where one process is holding a read lock that @@ -1606,65 +2019,62 @@ SQLITE_API int sqlite3_complete16(const void *sql); ** will induce the first process to release its read lock and allow ** the second process to proceed. ** -** The default busy callback is NULL. +** ^The default busy callback is NULL. ** -** The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED] +** ^The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED] ** when SQLite is in the middle of a large transaction where all the ** changes will not fit into the in-memory cache. SQLite will ** already hold a RESERVED lock on the database file, but it needs ** to promote this lock to EXCLUSIVE so that it can spill cache ** pages into the database file without harm to concurrent -** readers. If it is unable to promote the lock, then the in-memory +** readers. ^If it is unable to promote the lock, then the in-memory ** cache will be left in an inconsistent state and so the error ** code is promoted from the relatively benign [SQLITE_BUSY] to -** the more severe [SQLITE_IOERR_BLOCKED]. This error code promotion +** the more severe [SQLITE_IOERR_BLOCKED]. ^This error code promotion ** forces an automatic rollback of the changes. See the ** ** CorruptionFollowingBusyError wiki page for a discussion of why ** this is important. ** -** There can only be a single busy handler defined for each +** ^(There can only be a single busy handler defined for each ** [database connection]. Setting a new busy handler clears any -** previously set handler. Note that calling [sqlite3_busy_timeout()] +** previously set handler.)^ ^Note that calling [sqlite3_busy_timeout()] ** will also set or clear the busy handler. ** ** The busy callback should not take any actions which modify the ** database connection that invoked the busy handler. Any such actions ** result in undefined behavior. ** -** Requirements: -** [H12311] [H12312] [H12314] [H12316] [H12318] -** ** A busy handler must not close the database connection ** or [prepared statement] that invoked the busy handler. */ SQLITE_API int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); /* -** CAPI3REF: Set A Busy Timeout {H12340} +** CAPI3REF: Set A Busy Timeout ** -** This routine sets a [sqlite3_busy_handler | busy handler] that sleeps -** for a specified amount of time when a table is locked. The handler +** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps +** for a specified amount of time when a table is locked. ^The handler ** will sleep multiple times until at least "ms" milliseconds of sleeping -** have accumulated. {H12343} After "ms" milliseconds of sleeping, +** have accumulated. ^After at least "ms" milliseconds of sleeping, ** the handler returns 0 which causes [sqlite3_step()] to return ** [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED]. ** -** Calling this routine with an argument less than or equal to zero +** ^Calling this routine with an argument less than or equal to zero ** turns off all busy handlers. ** -** There can only be a single busy handler for a particular +** ^(There can only be a single busy handler for a particular ** [database connection] any any given moment. If another busy handler ** was defined (using [sqlite3_busy_handler()]) prior to calling -** this routine, that other busy handler is cleared. -** -** Requirements: -** [H12341] [H12343] [H12344] +** this routine, that other busy handler is cleared.)^ */ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); /* -** CAPI3REF: Convenience Routines For Running Queries {H12370} +** CAPI3REF: Convenience Routines For Running Queries +** +** This is a legacy interface that is preserved for backwards compatibility. +** Use of this interface is not recommended. ** ** Definition: A result table is memory data structure created by the ** [sqlite3_get_table()] interface. A result table records the @@ -1686,7 +2096,7 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); ** It is not safe to pass a result table directly to [sqlite3_free()]. ** A result table should be deallocated using [sqlite3_free_table()]. ** -** As an example of the result table format, suppose a query result +** ^(As an example of the result table format, suppose a query result ** is as follows: ** **
    @@ -1710,15 +2120,15 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
     **        azResult[5] = "28";
     **        azResult[6] = "Cindy";
     **        azResult[7] = "21";
    -** 
    +** )^ ** -** The sqlite3_get_table() function evaluates one or more +** ^The sqlite3_get_table() function evaluates one or more ** semicolon-separated SQL statements in the zero-terminated UTF-8 -** string of its 2nd parameter. It returns a result table to the +** string of its 2nd parameter and returns a result table to the ** pointer given in its 3rd parameter. ** -** After the calling function has finished using the result, it should -** pass the pointer to the result table to sqlite3_free_table() in order to +** After the application has finished with the result from sqlite3_get_table(), +** it must pass the result table pointer to sqlite3_free_table() in order to ** release the memory that was malloced. Because of the way the ** [sqlite3_malloc()] happens within sqlite3_get_table(), the calling ** function must not try to call [sqlite3_free()] directly. Only @@ -1729,10 +2139,8 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); ** to any internal data structures of SQLite. It uses only the public ** interface defined here. As a consequence, errors that occur in the ** wrapper layer outside of the internal [sqlite3_exec()] call are not -** reflected in subsequent calls to [sqlite3_errcode()] or [sqlite3_errmsg()]. -** -** Requirements: -** [H12371] [H12373] [H12374] [H12376] [H12379] [H12382] +** reflected in subsequent calls to [sqlite3_errcode()] or +** [sqlite3_errmsg()]. */ SQLITE_API int sqlite3_get_table( sqlite3 *db, /* An open database */ @@ -1745,33 +2153,33 @@ SQLITE_API int sqlite3_get_table( SQLITE_API void sqlite3_free_table(char **result); /* -** CAPI3REF: Formatted String Printing Functions {H17400} +** CAPI3REF: Formatted String Printing Functions ** ** These routines are work-alikes of the "printf()" family of functions ** from the standard C library. ** -** The sqlite3_mprintf() and sqlite3_vmprintf() routines write their +** ^The sqlite3_mprintf() and sqlite3_vmprintf() routines write their ** results into memory obtained from [sqlite3_malloc()]. ** The strings returned by these two routines should be -** released by [sqlite3_free()]. Both routines return a +** released by [sqlite3_free()]. ^Both routines return a ** NULL pointer if [sqlite3_malloc()] is unable to allocate enough ** memory to hold the resulting string. ** -** In sqlite3_snprintf() routine is similar to "snprintf()" from +** ^(In sqlite3_snprintf() routine is similar to "snprintf()" from ** the standard C library. The result is written into the ** buffer supplied as the second parameter whose size is given by ** the first parameter. Note that the order of the -** first two parameters is reversed from snprintf(). This is an +** first two parameters is reversed from snprintf().)^ This is an ** historical accident that cannot be fixed without breaking -** backwards compatibility. Note also that sqlite3_snprintf() +** backwards compatibility. ^(Note also that sqlite3_snprintf() ** returns a pointer to its buffer instead of the number of -** characters actually written into the buffer. We admit that +** characters actually written into the buffer.)^ We admit that ** the number of characters written would be a more useful return ** value but we cannot change the implementation of sqlite3_snprintf() ** now without breaking compatibility. ** -** As long as the buffer size is greater than zero, sqlite3_snprintf() -** guarantees that the buffer is always zero-terminated. The first +** ^As long as the buffer size is greater than zero, sqlite3_snprintf() +** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. @@ -1781,9 +2189,9 @@ SQLITE_API void sqlite3_free_table(char **result); ** All of the usual printf() formatting options apply. In addition, there ** is are "%q", "%Q", and "%z" options. ** -** The %q option works like %s in that it substitutes a null-terminated +** ^(The %q option works like %s in that it substitutes a null-terminated ** string from the argument list. But %q also doubles every '\'' character. -** %q is designed for use inside a string literal. By doubling each '\'' +** %q is designed for use inside a string literal.)^ By doubling each '\'' ** character it escapes that character and allows it to be inserted into ** the string. ** @@ -1818,10 +2226,10 @@ SQLITE_API void sqlite3_free_table(char **result); ** This second example is an SQL syntax error. As a general rule you should ** always use %q instead of %s when inserting text into a string literal. ** -** The %Q option works like %q except it also adds single quotes around +** ^(The %Q option works like %q except it also adds single quotes around ** the outside of the total string. Additionally, if the parameter in the ** argument list is a NULL pointer, %Q substitutes the text "NULL" (without -** single quotes) in place of the %Q option. So, for example, one could say: +** single quotes).)^ So, for example, one could say: ** **
     **  char *zSQL = sqlite3_mprintf("INSERT INTO table VALUES(%Q)", zText);
    @@ -1832,35 +2240,32 @@ SQLITE_API void sqlite3_free_table(char **result);
     ** The code above will render a correct SQL statement in the zSQL
     ** variable even if the zText variable is a NULL pointer.
     **
    -** The "%z" formatting option works exactly like "%s" with the
    +** ^(The "%z" formatting option works like "%s" but with the
     ** addition that after the string has been read and copied into
    -** the result, [sqlite3_free()] is called on the input string. {END}
    -**
    -** Requirements:
    -** [H17403] [H17406] [H17407]
    +** the result, [sqlite3_free()] is called on the input string.)^
     */
     SQLITE_API char *sqlite3_mprintf(const char*,...);
     SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
     SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
     
     /*
    -** CAPI3REF: Memory Allocation Subsystem {H17300} 
    +** CAPI3REF: Memory Allocation Subsystem
     **
    -** The SQLite core  uses these three routines for all of its own
    +** The SQLite core uses these three routines for all of its own
     ** internal memory allocation needs. "Core" in the previous sentence
     ** does not include operating-system specific VFS implementation.  The
     ** Windows VFS uses native malloc() and free() for some operations.
     **
    -** The sqlite3_malloc() routine returns a pointer to a block
    +** ^The sqlite3_malloc() routine returns a pointer to a block
     ** of memory at least N bytes in length, where N is the parameter.
    -** If sqlite3_malloc() is unable to obtain sufficient free
    -** memory, it returns a NULL pointer.  If the parameter N to
    +** ^If sqlite3_malloc() is unable to obtain sufficient free
    +** memory, it returns a NULL pointer.  ^If the parameter N to
     ** sqlite3_malloc() is zero or negative then sqlite3_malloc() returns
     ** a NULL pointer.
     **
    -** Calling sqlite3_free() with a pointer previously returned
    +** ^Calling sqlite3_free() with a pointer previously returned
     ** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
    -** that it might be reused.  The sqlite3_free() routine is
    +** that it might be reused.  ^The sqlite3_free() routine is
     ** a no-op if is called with a NULL pointer.  Passing a NULL pointer
     ** to sqlite3_free() is harmless.  After being freed, memory
     ** should neither be read nor written.  Even reading previously freed
    @@ -1869,34 +2274,27 @@ SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
     ** might result if sqlite3_free() is called with a non-NULL pointer that
     ** was not obtained from sqlite3_malloc() or sqlite3_realloc().
     **
    -** The sqlite3_realloc() interface attempts to resize a
    +** ^(The sqlite3_realloc() interface attempts to resize a
     ** prior memory allocation to be at least N bytes, where N is the
     ** second parameter.  The memory allocation to be resized is the first
    -** parameter.  If the first parameter to sqlite3_realloc()
    +** parameter.)^ ^ If the first parameter to sqlite3_realloc()
     ** is a NULL pointer then its behavior is identical to calling
     ** sqlite3_malloc(N) where N is the second parameter to sqlite3_realloc().
    -** If the second parameter to sqlite3_realloc() is zero or
    +** ^If the second parameter to sqlite3_realloc() is zero or
     ** negative then the behavior is exactly the same as calling
     ** sqlite3_free(P) where P is the first parameter to sqlite3_realloc().
    -** sqlite3_realloc() returns a pointer to a memory allocation
    +** ^sqlite3_realloc() returns a pointer to a memory allocation
     ** of at least N bytes in size or NULL if sufficient memory is unavailable.
    -** If M is the size of the prior allocation, then min(N,M) bytes
    +** ^If M is the size of the prior allocation, then min(N,M) bytes
     ** of the prior allocation are copied into the beginning of buffer returned
     ** by sqlite3_realloc() and the prior allocation is freed.
    -** If sqlite3_realloc() returns NULL, then the prior allocation
    +** ^If sqlite3_realloc() returns NULL, then the prior allocation
     ** is not freed.
     **
    -** The memory returned by sqlite3_malloc() and sqlite3_realloc()
    -** is always aligned to at least an 8 byte boundary. {END}
    -**
    -** The default implementation of the memory allocation subsystem uses
    -** the malloc(), realloc() and free() provided by the standard C library.
    -** {H17382} However, if SQLite is compiled with the
    -** SQLITE_MEMORY_SIZE=NNN C preprocessor macro (where NNN
    -** is an integer), then SQLite create a static array of at least
    -** NNN bytes in size and uses that array for all of its dynamic
    -** memory allocation needs. {END}  Additional memory allocator options
    -** may be added in future releases.
    +** ^The memory returned by sqlite3_malloc() and sqlite3_realloc()
    +** is always aligned to at least an 8 byte boundary, or to a
    +** 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time
    +** option is used.
     **
     ** In SQLite version 3.5.0 and 3.5.1, it was possible to define
     ** the SQLITE_OMIT_MEMORY_ALLOCATION which would cause the built-in
    @@ -1911,10 +2309,6 @@ SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
     ** they are reported back as [SQLITE_CANTOPEN] or
     ** [SQLITE_IOERR] rather than [SQLITE_NOMEM].
     **
    -** Requirements:
    -** [H17303] [H17304] [H17305] [H17306] [H17310] [H17312] [H17315] [H17318]
    -** [H17321] [H17322] [H17323]
    -**
     ** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()]
     ** must be either NULL or else pointers obtained from a prior
     ** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have
    @@ -1929,20 +2323,33 @@ SQLITE_API void *sqlite3_realloc(void*, int);
     SQLITE_API void sqlite3_free(void*);
     
     /*
    -** CAPI3REF: Memory Allocator Statistics {H17370} 
    +** CAPI3REF: Memory Allocator Statistics
     **
     ** SQLite provides these two interfaces for reporting on the status
     ** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()]
     ** routines, which form the built-in memory allocation subsystem.
     **
    -** Requirements:
    -** [H17371] [H17373] [H17374] [H17375]
    +** ^The [sqlite3_memory_used()] routine returns the number of bytes
    +** of memory currently outstanding (malloced but not freed).
    +** ^The [sqlite3_memory_highwater()] routine returns the maximum
    +** value of [sqlite3_memory_used()] since the high-water mark
    +** was last reset.  ^The values returned by [sqlite3_memory_used()] and
    +** [sqlite3_memory_highwater()] include any overhead
    +** added by SQLite in its implementation of [sqlite3_malloc()],
    +** but not overhead added by the any underlying system library
    +** routines that [sqlite3_malloc()] may call.
    +**
    +** ^The memory high-water mark is reset to the current value of
    +** [sqlite3_memory_used()] if and only if the parameter to
    +** [sqlite3_memory_highwater()] is true.  ^The value returned
    +** by [sqlite3_memory_highwater(1)] is the high-water mark
    +** prior to the reset.
     */
     SQLITE_API sqlite3_int64 sqlite3_memory_used(void);
     SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
     
     /*
    -** CAPI3REF: Pseudo-Random Number Generator {H17390} 
    +** CAPI3REF: Pseudo-Random Number Generator
     **
     ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
     ** select random [ROWID | ROWIDs] when inserting new records into a table that
    @@ -1950,60 +2357,57 @@ SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
     ** the build-in random() and randomblob() SQL functions.  This interface allows
     ** applications to access the same PRNG for other purposes.
     **
    -** A call to this routine stores N bytes of randomness into buffer P.
    +** ^A call to this routine stores N bytes of randomness into buffer P.
     **
    -** The first time this routine is invoked (either internally or by
    +** ^The first time this routine is invoked (either internally or by
     ** the application) the PRNG is seeded using randomness obtained
     ** from the xRandomness method of the default [sqlite3_vfs] object.
    -** On all subsequent invocations, the pseudo-randomness is generated
    +** ^On all subsequent invocations, the pseudo-randomness is generated
     ** internally and without recourse to the [sqlite3_vfs] xRandomness
     ** method.
    -**
    -** Requirements:
    -** [H17392]
     */
     SQLITE_API void sqlite3_randomness(int N, void *P);
     
     /*
    -** CAPI3REF: Compile-Time Authorization Callbacks {H12500} 
    +** CAPI3REF: Compile-Time Authorization Callbacks
     **
    -** This routine registers a authorizer callback with a particular
    +** ^This routine registers a authorizer callback with a particular
     ** [database connection], supplied in the first argument.
    -** The authorizer callback is invoked as SQL statements are being compiled
    +** ^The authorizer callback is invoked as SQL statements are being compiled
     ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()],
    -** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()].  At various
    +** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()].  ^At various
     ** points during the compilation process, as logic is being created
     ** to perform various actions, the authorizer callback is invoked to
    -** see if those actions are allowed.  The authorizer callback should
    +** see if those actions are allowed.  ^The authorizer callback should
     ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the
     ** specific action but allow the SQL statement to continue to be
     ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
    -** rejected with an error.  If the authorizer callback returns
    +** rejected with an error.  ^If the authorizer callback returns
     ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY]
     ** then the [sqlite3_prepare_v2()] or equivalent call that triggered
     ** the authorizer will fail with an error message.
     **
     ** When the callback returns [SQLITE_OK], that means the operation
    -** requested is ok.  When the callback returns [SQLITE_DENY], the
    +** requested is ok.  ^When the callback returns [SQLITE_DENY], the
     ** [sqlite3_prepare_v2()] or equivalent call that triggered the
     ** authorizer will fail with an error message explaining that
     ** access is denied. 
     **
    -** The first parameter to the authorizer callback is a copy of the third
    -** parameter to the sqlite3_set_authorizer() interface. The second parameter
    +** ^The first parameter to the authorizer callback is a copy of the third
    +** parameter to the sqlite3_set_authorizer() interface. ^The second parameter
     ** to the callback is an integer [SQLITE_COPY | action code] that specifies
    -** the particular action to be authorized. The third through sixth parameters
    +** the particular action to be authorized. ^The third through sixth parameters
     ** to the callback are zero-terminated strings that contain additional
     ** details about the action to be authorized.
     **
    -** If the action code is [SQLITE_READ]
    +** ^If the action code is [SQLITE_READ]
     ** and the callback returns [SQLITE_IGNORE] then the
     ** [prepared statement] statement is constructed to substitute
     ** a NULL value in place of the table column that would have
     ** been read if [SQLITE_OK] had been returned.  The [SQLITE_IGNORE]
     ** return can be used to deny an untrusted user access to individual
     ** columns of a table.
    -** If the action code is [SQLITE_DELETE] and the callback returns
    +** ^If the action code is [SQLITE_DELETE] and the callback returns
     ** [SQLITE_IGNORE] then the [DELETE] operation proceeds but the
     ** [truncate optimization] is disabled and all rows are deleted individually.
     **
    @@ -2023,9 +2427,9 @@ SQLITE_API void sqlite3_randomness(int N, void *P);
     ** and limiting database size using the [max_page_count] [PRAGMA]
     ** in addition to using an authorizer.
     **
    -** Only a single authorizer can be in place on a database connection
    +** ^(Only a single authorizer can be in place on a database connection
     ** at a time.  Each call to sqlite3_set_authorizer overrides the
    -** previous call.  Disable the authorizer by installing a NULL callback.
    +** previous call.)^  ^Disable the authorizer by installing a NULL callback.
     ** The authorizer is disabled by default.
     **
     ** The authorizer callback must not do anything that will modify
    @@ -2033,20 +2437,16 @@ SQLITE_API void sqlite3_randomness(int N, void *P);
     ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
     ** database connections for the meaning of "modify" in this paragraph.
     **
    -** When [sqlite3_prepare_v2()] is used to prepare a statement, the
    +** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the
     ** statement might be re-prepared during [sqlite3_step()] due to a 
     ** schema change.  Hence, the application should ensure that the
     ** correct authorizer callback remains in place during the [sqlite3_step()].
     **
    -** Note that the authorizer callback is invoked only during
    +** ^Note that the authorizer callback is invoked only during
     ** [sqlite3_prepare()] or its variants.  Authorization is not
     ** performed during statement evaluation in [sqlite3_step()], unless
     ** as stated in the previous paragraph, sqlite3_step() invokes
     ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
    -**
    -** Requirements:
    -** [H12501] [H12502] [H12503] [H12504] [H12505] [H12506] [H12507] [H12510]
    -** [H12511] [H12512] [H12520] [H12521] [H12522]
     */
     SQLITE_API int sqlite3_set_authorizer(
       sqlite3*,
    @@ -2055,7 +2455,7 @@ SQLITE_API int sqlite3_set_authorizer(
     );
     
     /*
    -** CAPI3REF: Authorizer Return Codes {H12590} 
    +** CAPI3REF: Authorizer Return Codes
     **
     ** The [sqlite3_set_authorizer | authorizer callback function] must
     ** return either [SQLITE_OK] or one of these two constants in order
    @@ -2067,7 +2467,7 @@ SQLITE_API int sqlite3_set_authorizer(
     #define SQLITE_IGNORE 2   /* Don't allow access, but don't generate an error */
     
     /*
    -** CAPI3REF: Authorizer Action Codes {H12550} 
    +** CAPI3REF: Authorizer Action Codes
     **
     ** The [sqlite3_set_authorizer()] interface registers a callback function
     ** that is invoked to authorize certain SQL statement actions.  The
    @@ -2078,15 +2478,12 @@ SQLITE_API int sqlite3_set_authorizer(
     ** These action code values signify what kind of operation is to be
     ** authorized.  The 3rd and 4th parameters to the authorization
     ** callback function will be parameters or NULL depending on which of these
    -** codes is used as the second parameter.  The 5th parameter to the
    +** codes is used as the second parameter.  ^(The 5th parameter to the
     ** authorizer callback is the name of the database ("main", "temp",
    -** etc.) if applicable.  The 6th parameter to the authorizer callback
    +** etc.) if applicable.)^  ^The 6th parameter to the authorizer callback
     ** is the name of the inner-most trigger or view that is responsible for
     ** the access attempt or NULL if this access attempt is directly from
     ** top-level SQL code.
    -**
    -** Requirements:
    -** [H12551] [H12552] [H12553] [H12554]
     */
     /******************************************* 3rd ************ 4th ***********/
     #define SQLITE_CREATE_INDEX          1   /* Index Name      Table Name      */
    @@ -2124,72 +2521,83 @@ SQLITE_API int sqlite3_set_authorizer(
     #define SQLITE_COPY                  0   /* No longer used */
     
     /*
    -** CAPI3REF: Tracing And Profiling Functions {H12280} 
    -** EXPERIMENTAL
    +** CAPI3REF: Tracing And Profiling Functions
     **
     ** These routines register callback functions that can be used for
     ** tracing and profiling the execution of SQL statements.
     **
    -** The callback function registered by sqlite3_trace() is invoked at
    +** ^The callback function registered by sqlite3_trace() is invoked at
     ** various times when an SQL statement is being run by [sqlite3_step()].
    -** The callback returns a UTF-8 rendering of the SQL statement text
    -** as the statement first begins executing.  Additional callbacks occur
    +** ^The sqlite3_trace() callback is invoked with a UTF-8 rendering of the
    +** SQL statement text as the statement first begins executing.
    +** ^(Additional sqlite3_trace() callbacks might occur
     ** as each triggered subprogram is entered.  The callbacks for triggers
    -** contain a UTF-8 SQL comment that identifies the trigger.
    +** contain a UTF-8 SQL comment that identifies the trigger.)^
     **
    -** The callback function registered by sqlite3_profile() is invoked
    -** as each SQL statement finishes.  The profile callback contains
    +** ^The callback function registered by sqlite3_profile() is invoked
    +** as each SQL statement finishes.  ^The profile callback contains
     ** the original statement text and an estimate of wall-clock time
    -** of how long that statement took to run.
    -**
    -** Requirements:
    -** [H12281] [H12282] [H12283] [H12284] [H12285] [H12287] [H12288] [H12289]
    -** [H12290]
    +** of how long that statement took to run.  ^The profile callback
    +** time is in units of nanoseconds, however the current implementation
    +** is only capable of millisecond resolution so the six least significant
    +** digits in the time are meaningless.  Future versions of SQLite
    +** might provide greater resolution on the profiler callback.  The
    +** sqlite3_profile() function is considered experimental and is
    +** subject to change in future versions of SQLite.
     */
    -SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
    +SQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
     SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
        void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
     
     /*
    -** CAPI3REF: Query Progress Callbacks {H12910} 
    +** CAPI3REF: Query Progress Callbacks
     **
    -** This routine configures a callback function - the
    -** progress callback - that is invoked periodically during long
    -** running calls to [sqlite3_exec()], [sqlite3_step()] and
    -** [sqlite3_get_table()].  An example use for this
    +** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback
    +** function X to be invoked periodically during long running calls to
    +** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for
    +** database connection D.  An example use for this
     ** interface is to keep a GUI updated during a large query.
     **
    -** If the progress callback returns non-zero, the operation is
    +** ^The parameter P is passed through as the only parameter to the 
    +** callback function X.  ^The parameter N is the number of 
    +** [virtual machine instructions] that are evaluated between successive
    +** invocations of the callback X.
    +**
    +** ^Only a single progress handler may be defined at one time per
    +** [database connection]; setting a new progress handler cancels the
    +** old one.  ^Setting parameter X to NULL disables the progress handler.
    +** ^The progress handler is also disabled by setting N to a value less
    +** than 1.
    +**
    +** ^If the progress callback returns non-zero, the operation is
     ** interrupted.  This feature can be used to implement a
     ** "Cancel" button on a GUI progress dialog box.
     **
    -** The progress handler must not do anything that will modify
    +** The progress handler callback must not do anything that will modify
     ** the database connection that invoked the progress handler.
     ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
     ** database connections for the meaning of "modify" in this paragraph.
     **
    -** Requirements:
    -** [H12911] [H12912] [H12913] [H12914] [H12915] [H12916] [H12917] [H12918]
    -**
     */
     SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
     
     /*
    -** CAPI3REF: Opening A New Database Connection {H12700} 
    +** CAPI3REF: Opening A New Database Connection
     **
    -** These routines open an SQLite database file whose name is given by the
    -** filename argument. The filename argument is interpreted as UTF-8 for
    +** ^These routines open an SQLite database file whose name is given by the
    +** filename argument. ^The filename argument is interpreted as UTF-8 for
     ** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte
    -** order for sqlite3_open16(). A [database connection] handle is usually
    +** order for sqlite3_open16(). ^(A [database connection] handle is usually
     ** returned in *ppDb, even if an error occurs.  The only exception is that
     ** if SQLite is unable to allocate memory to hold the [sqlite3] object,
     ** a NULL will be written into *ppDb instead of a pointer to the [sqlite3]
    -** object. If the database is opened (and/or created) successfully, then
    -** [SQLITE_OK] is returned.  Otherwise an [error code] is returned.  The
    +** object.)^ ^(If the database is opened (and/or created) successfully, then
    +** [SQLITE_OK] is returned.  Otherwise an [error code] is returned.)^ ^The
     ** [sqlite3_errmsg()] or [sqlite3_errmsg16()] routines can be used to obtain
    -** an English language description of the error.
    +** an English language description of the error following a failure of any
    +** of the sqlite3_open() routines.
     **
    -** The default encoding for the database will be UTF-8 if
    +** ^The default encoding for the database will be UTF-8 if
     ** sqlite3_open() or sqlite3_open_v2() is called and
     ** UTF-16 in the native byte order if sqlite3_open16() is used.
     **
    @@ -2199,60 +2607,61 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
     **
     ** The sqlite3_open_v2() interface works like sqlite3_open()
     ** except that it accepts two additional parameters for additional control
    -** over the new database connection.  The flags parameter can take one of
    +** over the new database connection.  ^(The flags parameter to
    +** sqlite3_open_v2() can take one of
     ** the following three values, optionally combined with the 
     ** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE],
    -** and/or [SQLITE_OPEN_PRIVATECACHE] flags:
    +** and/or [SQLITE_OPEN_PRIVATECACHE] flags:)^
     **
     ** 
    -**
    [SQLITE_OPEN_READONLY]
    +** ^(
    [SQLITE_OPEN_READONLY]
    **
    The database is opened in read-only mode. If the database does not -** already exist, an error is returned.
    +** already exist, an error is returned.)^ ** -**
    [SQLITE_OPEN_READWRITE]
    +** ^(
    [SQLITE_OPEN_READWRITE]
    **
    The database is opened for reading and writing if possible, or reading ** only if the file is write protected by the operating system. In either -** case the database must already exist, otherwise an error is returned.
    +** case the database must already exist, otherwise an error is returned.)^ ** -**
    [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]
    +** ^(
    [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]
    **
    The database is opened for reading and writing, and is creates it if ** it does not already exist. This is the behavior that is always used for -** sqlite3_open() and sqlite3_open16().
    +** sqlite3_open() and sqlite3_open16().)^ **
    ** ** If the 3rd parameter to sqlite3_open_v2() is not one of the ** combinations shown above or one of the combinations shown above combined ** with the [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], -** [SQLITE_OPEN_SHAREDCACHE] and/or [SQLITE_OPEN_SHAREDCACHE] flags, +** [SQLITE_OPEN_SHAREDCACHE] and/or [SQLITE_OPEN_PRIVATECACHE] flags, ** then the behavior is undefined. ** -** If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection +** ^If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection ** opens in the multi-thread [threading mode] as long as the single-thread -** mode has not been set at compile-time or start-time. If the +** mode has not been set at compile-time or start-time. ^If the ** [SQLITE_OPEN_FULLMUTEX] flag is set then the database connection opens ** in the serialized [threading mode] unless single-thread was ** previously selected at compile-time or start-time. -** The [SQLITE_OPEN_SHAREDCACHE] flag causes the database connection to be +** ^The [SQLITE_OPEN_SHAREDCACHE] flag causes the database connection to be ** eligible to use [shared cache mode], regardless of whether or not shared -** cache is enabled using [sqlite3_enable_shared_cache()]. The +** cache is enabled using [sqlite3_enable_shared_cache()]. ^The ** [SQLITE_OPEN_PRIVATECACHE] flag causes the database connection to not ** participate in [shared cache mode] even if it is enabled. ** -** If the filename is ":memory:", then a private, temporary in-memory database -** is created for the connection. This in-memory database will vanish when +** ^If the filename is ":memory:", then a private, temporary in-memory database +** is created for the connection. ^This in-memory database will vanish when ** the database connection is closed. Future versions of SQLite might ** make use of additional special filenames that begin with the ":" character. ** It is recommended that when a database filename actually does begin with ** a ":" character you should prefix the filename with a pathname such as ** "./" to avoid ambiguity. ** -** If the filename is an empty string, then a private, temporary -** on-disk database will be created. This private database will be +** ^If the filename is an empty string, then a private, temporary +** on-disk database will be created. ^This private database will be ** automatically deleted as soon as the database connection is closed. ** -** The fourth parameter to sqlite3_open_v2() is the name of the +** ^The fourth parameter to sqlite3_open_v2() is the name of the ** [sqlite3_vfs] object that defines the operating system interface that -** the new database connection should use. If the fourth parameter is +** the new database connection should use. ^If the fourth parameter is ** a NULL pointer then the default [sqlite3_vfs] object is used. ** ** Note to Windows users: The encoding used for the filename argument @@ -2260,10 +2669,6 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** codepage is currently defined. Filenames containing international ** characters must be converted to UTF-8 prior to passing them into ** sqlite3_open() or sqlite3_open_v2(). -** -** Requirements: -** [H12701] [H12702] [H12703] [H12704] [H12706] [H12707] [H12709] [H12711] -** [H12712] [H12713] [H12714] [H12717] [H12719] [H12721] [H12723] */ SQLITE_API int sqlite3_open( const char *filename, /* Database filename (UTF-8) */ @@ -2281,23 +2686,23 @@ SQLITE_API int sqlite3_open_v2( ); /* -** CAPI3REF: Error Codes And Messages {H12800} +** CAPI3REF: Error Codes And Messages ** -** The sqlite3_errcode() interface returns the numeric [result code] or +** ^The sqlite3_errcode() interface returns the numeric [result code] or ** [extended result code] for the most recent failed sqlite3_* API call ** associated with a [database connection]. If a prior API call failed ** but the most recent API call succeeded, the return value from -** sqlite3_errcode() is undefined. The sqlite3_extended_errcode() +** sqlite3_errcode() is undefined. ^The sqlite3_extended_errcode() ** interface is the same except that it always returns the ** [extended result code] even when extended result codes are ** disabled. ** -** The sqlite3_errmsg() and sqlite3_errmsg16() return English-language +** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language ** text that describes the error, as either UTF-8 or UTF-16 respectively. -** Memory to hold the error message string is managed internally. +** ^(Memory to hold the error message string is managed internally. ** The application does not need to worry about freeing the result. ** However, the error string might be overwritten or deallocated by -** subsequent calls to other SQLite interface functions. +** subsequent calls to other SQLite interface functions.)^ ** ** When the serialized [threading mode] is in use, it might be the ** case that a second error occurs on a separate thread in between @@ -2312,9 +2717,6 @@ SQLITE_API int sqlite3_open_v2( ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. -** -** Requirements: -** [H12801] [H12802] [H12803] [H12807] [H12808] [H12809] */ SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); @@ -2322,7 +2724,7 @@ SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); /* -** CAPI3REF: SQL Statement Object {H13000} +** CAPI3REF: SQL Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement. @@ -2348,25 +2750,30 @@ SQLITE_API const void *sqlite3_errmsg16(sqlite3*); typedef struct sqlite3_stmt sqlite3_stmt; /* -** CAPI3REF: Run-time Limits {H12760} +** CAPI3REF: Run-time Limits ** -** This interface allows the size of various constructs to be limited +** ^(This interface allows the size of various constructs to be limited ** on a connection by connection basis. The first parameter is the ** [database connection] whose limit is to be set or queried. The ** second parameter is one of the [limit categories] that define a ** class of constructs to be size limited. The third parameter is the -** new limit for that construct. The function returns the old limit. +** new limit for that construct.)^ ** -** If the new limit is a negative number, the limit is unchanged. -** For the limit category of SQLITE_LIMIT_XYZ there is a +** ^If the new limit is a negative number, the limit is unchanged. +** ^(For each limit category SQLITE_LIMIT_NAME there is a ** [limits | hard upper bound] -** set by a compile-time C preprocessor macro named -** [limits | SQLITE_MAX_XYZ]. -** (The "_LIMIT_" in the name is changed to "_MAX_".) -** Attempts to increase a limit above its hard upper bound are -** silently truncated to the hard upper limit. +** set at compile-time by a C preprocessor macro called +** [limits | SQLITE_MAX_NAME]. +** (The "_LIMIT_" in the name is changed to "_MAX_".))^ +** ^Attempts to increase a limit above its hard upper bound are +** silently truncated to the hard upper bound. ** -** Run time limits are intended for use in applications that manage +** ^Regardless of whether or not the limit was changed, the +** [sqlite3_limit()] interface returns the prior value of the limit. +** ^Hence, to find the current value of a limit without changing it, +** simply invoke this interface with the third parameter set to -1. +** +** Run-time limits are intended for use in applications that manage ** both their own internal database and also databases that are controlled ** by untrusted external sources. An example application might be a ** web browser that has its own databases for storing history and @@ -2380,14 +2787,11 @@ typedef struct sqlite3_stmt sqlite3_stmt; ** [max_page_count] [PRAGMA]. ** ** New run-time limit categories may be added in future releases. -** -** Requirements: -** [H12762] [H12766] [H12769] */ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); /* -** CAPI3REF: Run-Time Limit Categories {H12790} +** CAPI3REF: Run-Time Limit Categories ** KEYWORDS: {limit category} {*limit categories} ** ** These constants define various performance limits @@ -2396,43 +2800,44 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); ** Additional information is available at [limits | Limits in SQLite]. ** **
    -**
    SQLITE_LIMIT_LENGTH
    -**
    The maximum size of any string or BLOB or table row.
    +** ^(
    SQLITE_LIMIT_LENGTH
    +**
    The maximum size of any string or BLOB or table row, in bytes.
    )^ ** -**
    SQLITE_LIMIT_SQL_LENGTH
    -**
    The maximum length of an SQL statement.
    +** ^(
    SQLITE_LIMIT_SQL_LENGTH
    +**
    The maximum length of an SQL statement, in bytes.
    )^ ** -**
    SQLITE_LIMIT_COLUMN
    +** ^(
    SQLITE_LIMIT_COLUMN
    **
    The maximum number of columns in a table definition or in the ** result set of a [SELECT] or the maximum number of columns in an index -** or in an ORDER BY or GROUP BY clause.
    +** or in an ORDER BY or GROUP BY clause.)^ ** -**
    SQLITE_LIMIT_EXPR_DEPTH
    -**
    The maximum depth of the parse tree on any expression.
    +** ^(
    SQLITE_LIMIT_EXPR_DEPTH
    +**
    The maximum depth of the parse tree on any expression.
    )^ ** -**
    SQLITE_LIMIT_COMPOUND_SELECT
    -**
    The maximum number of terms in a compound SELECT statement.
    +** ^(
    SQLITE_LIMIT_COMPOUND_SELECT
    +**
    The maximum number of terms in a compound SELECT statement.
    )^ ** -**
    SQLITE_LIMIT_VDBE_OP
    +** ^(
    SQLITE_LIMIT_VDBE_OP
    **
    The maximum number of instructions in a virtual machine program -** used to implement an SQL statement.
    +** used to implement an SQL statement. This limit is not currently +** enforced, though that might be added in some future release of +** SQLite.)^ ** -**
    SQLITE_LIMIT_FUNCTION_ARG
    -**
    The maximum number of arguments on a function.
    +** ^(
    SQLITE_LIMIT_FUNCTION_ARG
    +**
    The maximum number of arguments on a function.
    )^ ** -**
    SQLITE_LIMIT_ATTACHED
    -**
    The maximum number of [ATTACH | attached databases].
    +** ^(
    SQLITE_LIMIT_ATTACHED
    +**
    The maximum number of [ATTACH | attached databases].)^
    ** -**
    SQLITE_LIMIT_LIKE_PATTERN_LENGTH
    +** ^(
    SQLITE_LIMIT_LIKE_PATTERN_LENGTH
    **
    The maximum length of the pattern argument to the [LIKE] or -** [GLOB] operators.
    +** [GLOB] operators.)^ ** -**
    SQLITE_LIMIT_VARIABLE_NUMBER
    -**
    The maximum number of variables in an SQL statement that can -** be bound.
    +** ^(
    SQLITE_LIMIT_VARIABLE_NUMBER
    +**
    The maximum index number of any [parameter] in an SQL statement.)^ ** -**
    SQLITE_LIMIT_TRIGGER_DEPTH
    -**
    The maximum depth of recursion for triggers.
    +** ^(
    SQLITE_LIMIT_TRIGGER_DEPTH
    +**
    The maximum depth of recursion for triggers.
    )^ **
    */ #define SQLITE_LIMIT_LENGTH 0 @@ -2448,7 +2853,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); #define SQLITE_LIMIT_TRIGGER_DEPTH 10 /* -** CAPI3REF: Compiling An SQL Statement {H13010} +** CAPI3REF: Compiling An SQL Statement ** KEYWORDS: {SQL statement compiler} ** ** To execute an SQL query, it must first be compiled into a byte-code @@ -2463,9 +2868,9 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); ** interfaces use UTF-8, and sqlite3_prepare16() and sqlite3_prepare16_v2() ** use UTF-16. ** -** If the nByte argument is less than zero, then zSql is read up to the -** first zero terminator. If nByte is non-negative, then it is the maximum -** number of bytes read from zSql. When nByte is non-negative, the +** ^If the nByte argument is less than zero, then zSql is read up to the +** first zero terminator. ^If nByte is non-negative, then it is the maximum +** number of bytes read from zSql. ^When nByte is non-negative, the ** zSql string ends at either the first '\000' or '\u0000' character or ** the nByte-th byte, whichever comes first. If the caller knows ** that the supplied string is nul-terminated, then there is a small @@ -2473,62 +2878,59 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); ** is equal to the number of bytes in the input string including ** the nul-terminator bytes. ** -** If pzTail is not NULL then *pzTail is made to point to the first byte +** ^If pzTail is not NULL then *pzTail is made to point to the first byte ** past the end of the first SQL statement in zSql. These routines only ** compile the first statement in zSql, so *pzTail is left pointing to ** what remains uncompiled. ** -** *ppStmt is left pointing to a compiled [prepared statement] that can be -** executed using [sqlite3_step()]. If there is an error, *ppStmt is set -** to NULL. If the input text contains no SQL (if the input is an empty +** ^*ppStmt is left pointing to a compiled [prepared statement] that can be +** executed using [sqlite3_step()]. ^If there is an error, *ppStmt is set +** to NULL. ^If the input text contains no SQL (if the input is an empty ** string or a comment) then *ppStmt is set to NULL. ** The calling procedure is responsible for deleting the compiled ** SQL statement using [sqlite3_finalize()] after it has finished with it. ** ppStmt may not be NULL. ** -** On success, [SQLITE_OK] is returned, otherwise an [error code] is returned. +** ^On success, the sqlite3_prepare() family of routines return [SQLITE_OK]; +** otherwise an [error code] is returned. ** ** The sqlite3_prepare_v2() and sqlite3_prepare16_v2() interfaces are ** recommended for all new programs. The two older interfaces are retained ** for backwards compatibility, but their use is discouraged. -** In the "v2" interfaces, the prepared statement +** ^In the "v2" interfaces, the prepared statement ** that is returned (the [sqlite3_stmt] object) contains a copy of the ** original SQL text. This causes the [sqlite3_step()] interface to -** behave a differently in three ways: +** behave differently in three ways: ** **
      **
    1. -** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it +** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it ** always used to do, [sqlite3_step()] will automatically recompile the SQL -** statement and try to run it again. If the schema has changed in -** a way that makes the statement no longer valid, [sqlite3_step()] will still -** return [SQLITE_SCHEMA]. But unlike the legacy behavior, [SQLITE_SCHEMA] is -** now a fatal error. Calling [sqlite3_prepare_v2()] again will not make the -** error go away. Note: use [sqlite3_errmsg()] to find the text -** of the parsing error that results in an [SQLITE_SCHEMA] return. +** statement and try to run it again. **
    2. ** **
    3. -** When an error occurs, [sqlite3_step()] will return one of the detailed -** [error codes] or [extended error codes]. The legacy behavior was that +** ^When an error occurs, [sqlite3_step()] will return one of the detailed +** [error codes] or [extended error codes]. ^The legacy behavior was that ** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code -** and you would have to make a second call to [sqlite3_reset()] in order -** to find the underlying cause of the problem. With the "v2" prepare +** and the application would have to make a second call to [sqlite3_reset()] +** in order to find the underlying cause of the problem. With the "v2" prepare ** interfaces, the underlying reason for the error is returned immediately. **
    4. ** **
    5. -** ^If the value of a [parameter | host parameter] in the WHERE clause might -** change the query plan for a statement, then the statement may be -** automatically recompiled (as if there had been a schema change) on the first -** [sqlite3_step()] call following any change to the -** [sqlite3_bind_text | bindings] of the [parameter]. +** ^If the specific value bound to [parameter | host parameter] in the +** WHERE clause might influence the choice of query plan for a statement, +** then the statement will be automatically recompiled, as if there had been +** a schema change, on the first [sqlite3_step()] call following any change +** to the [sqlite3_bind_text | bindings] of that [parameter]. +** ^The specific value of WHERE-clause [parameter] might influence the +** choice of query plan if the parameter is the left-hand side of a [LIKE] +** or [GLOB] operator or if the parameter is compared to an indexed column +** and the [SQLITE_ENABLE_STAT2] compile-time option is enabled. +** the **
    6. **
    -** -** Requirements: -** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021] -** */ SQLITE_API int sqlite3_prepare( sqlite3 *db, /* Database handle */ @@ -2560,24 +2962,21 @@ SQLITE_API int sqlite3_prepare16_v2( ); /* -** CAPI3REF: Retrieving Statement SQL {H13100} +** CAPI3REF: Retrieving Statement SQL ** -** This interface can be used to retrieve a saved copy of the original +** ^This interface can be used to retrieve a saved copy of the original ** SQL text used to create a [prepared statement] if that statement was ** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()]. -** -** Requirements: -** [H13101] [H13102] [H13103] */ SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); /* -** CAPI3REF: Dynamically Typed Value Object {H15000} +** CAPI3REF: Dynamically Typed Value Object ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} ** ** SQLite uses the sqlite3_value object to represent all values ** that can be stored in a database table. SQLite uses dynamic typing -** for the values it stores. Values stored in sqlite3_value objects +** for the values it stores. ^Values stored in sqlite3_value objects ** can be integers, floating point values, strings, BLOBs, or NULL. ** ** An sqlite3_value object may be either "protected" or "unprotected". @@ -2596,12 +2995,12 @@ SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); ** then there is no distinction between protected and unprotected ** sqlite3_value objects and they can be used interchangeably. However, ** for maximum code portability it is recommended that applications -** still make the distinction between between protected and unprotected +** still make the distinction between protected and unprotected ** sqlite3_value objects even when not strictly required. ** -** The sqlite3_value objects that are passed as parameters into the +** ^The sqlite3_value objects that are passed as parameters into the ** implementation of [application-defined SQL functions] are protected. -** The sqlite3_value object returned by +** ^The sqlite3_value object returned by ** [sqlite3_column_value()] is unprotected. ** Unprotected sqlite3_value objects may only be used with ** [sqlite3_result_value()] and [sqlite3_bind_value()]. @@ -2611,10 +3010,10 @@ SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); typedef struct Mem sqlite3_value; /* -** CAPI3REF: SQL Function Context Object {H16001} +** CAPI3REF: SQL Function Context Object ** ** The context in which an SQL function executes is stored in an -** sqlite3_context object. A pointer to an sqlite3_context object +** sqlite3_context object. ^A pointer to an sqlite3_context object ** is always first parameter to [application-defined SQL functions]. ** The application-defined SQL function implementation will pass this ** pointer through into calls to [sqlite3_result_int | sqlite3_result()], @@ -2625,11 +3024,11 @@ typedef struct Mem sqlite3_value; typedef struct sqlite3_context sqlite3_context; /* -** CAPI3REF: Binding Values To Prepared Statements {H13500} +** CAPI3REF: Binding Values To Prepared Statements ** KEYWORDS: {host parameter} {host parameters} {host parameter name} ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} ** -** In the SQL strings input to [sqlite3_prepare_v2()] and its variants, +** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants, ** literals may be replaced by a [parameter] that matches one of following ** templates: ** @@ -2642,72 +3041,66 @@ typedef struct sqlite3_context sqlite3_context; ** ** ** In the templates above, NNN represents an integer literal, -** and VVV represents an alphanumeric identifer. The values of these +** and VVV represents an alphanumeric identifier.)^ ^The values of these ** parameters (also called "host parameter names" or "SQL parameters") ** can be set using the sqlite3_bind_*() routines defined here. ** -** The first argument to the sqlite3_bind_*() routines is always +** ^The first argument to the sqlite3_bind_*() routines is always ** a pointer to the [sqlite3_stmt] object returned from ** [sqlite3_prepare_v2()] or its variants. ** -** The second argument is the index of the SQL parameter to be set. -** The leftmost SQL parameter has an index of 1. When the same named +** ^The second argument is the index of the SQL parameter to be set. +** ^The leftmost SQL parameter has an index of 1. ^When the same named ** SQL parameter is used more than once, second and subsequent ** occurrences have the same index as the first occurrence. -** The index for named parameters can be looked up using the -** [sqlite3_bind_parameter_index()] API if desired. The index +** ^The index for named parameters can be looked up using the +** [sqlite3_bind_parameter_index()] API if desired. ^The index ** for "?NNN" parameters is the value of NNN. -** The NNN value must be between 1 and the [sqlite3_limit()] +** ^The NNN value must be between 1 and the [sqlite3_limit()] ** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999). ** -** The third argument is the value to bind to the parameter. +** ^The third argument is the value to bind to the parameter. ** -** In those routines that have a fourth argument, its value is the +** ^(In those routines that have a fourth argument, its value is the ** number of bytes in the parameter. To be clear: the value is the -** number of bytes in the value, not the number of characters. -** If the fourth parameter is negative, the length of the string is +** number of bytes in the value, not the number of characters.)^ +** ^If the fourth parameter is negative, the length of the string is ** the number of bytes up to the first zero terminator. ** -** The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and +** ^The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and ** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or -** string after SQLite has finished with it. If the fifth argument is +** string after SQLite has finished with it. ^If the fifth argument is ** the special value [SQLITE_STATIC], then SQLite assumes that the ** information is in static, unmanaged space and does not need to be freed. -** If the fifth argument has the value [SQLITE_TRANSIENT], then +** ^If the fifth argument has the value [SQLITE_TRANSIENT], then ** SQLite makes its own private copy of the data immediately, before ** the sqlite3_bind_*() routine returns. ** -** The sqlite3_bind_zeroblob() routine binds a BLOB of length N that -** is filled with zeroes. A zeroblob uses a fixed amount of memory +** ^The sqlite3_bind_zeroblob() routine binds a BLOB of length N that +** is filled with zeroes. ^A zeroblob uses a fixed amount of memory ** (just an integer to hold its size) while it is being processed. ** Zeroblobs are intended to serve as placeholders for BLOBs whose ** content is later written using ** [sqlite3_blob_open | incremental BLOB I/O] routines. -** A negative value for the zeroblob results in a zero-length BLOB. +** ^A negative value for the zeroblob results in a zero-length BLOB. ** -** The sqlite3_bind_*() routines must be called after -** [sqlite3_prepare_v2()] (and its variants) or [sqlite3_reset()] and -** before [sqlite3_step()]. -** Bindings are not cleared by the [sqlite3_reset()] routine. -** Unbound parameters are interpreted as NULL. +** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer +** for the [prepared statement] or with a prepared statement for which +** [sqlite3_step()] has been called more recently than [sqlite3_reset()], +** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_() +** routine is passed a [prepared statement] that has been finalized, the +** result is undefined and probably harmful. ** -** These routines return [SQLITE_OK] on success or an error code if -** anything goes wrong. [SQLITE_RANGE] is returned if the parameter -** index is out of range. [SQLITE_NOMEM] is returned if malloc() fails. -** [SQLITE_MISUSE] might be returned if these routines are called on a -** virtual machine that is the wrong state or which has already been finalized. -** Detection of misuse is unreliable. Applications should not depend -** on SQLITE_MISUSE returns. SQLITE_MISUSE is intended to indicate a -** a logic error in the application. Future versions of SQLite might -** panic rather than return SQLITE_MISUSE. +** ^Bindings are not cleared by the [sqlite3_reset()] routine. +** ^Unbound parameters are interpreted as NULL. +** +** ^The sqlite3_bind_* routines return [SQLITE_OK] on success or an +** [error code] if anything goes wrong. +** ^[SQLITE_RANGE] is returned if the parameter +** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. ** ** See also: [sqlite3_bind_parameter_count()], ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13506] [H13509] [H13512] [H13515] [H13518] [H13521] [H13524] [H13527] -** [H13530] [H13533] [H13536] [H13539] [H13542] [H13545] [H13548] [H13551] -** */ SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double); @@ -2720,45 +3113,42 @@ SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); /* -** CAPI3REF: Number Of SQL Parameters {H13600} +** CAPI3REF: Number Of SQL Parameters ** -** This routine can be used to find the number of [SQL parameters] +** ^This routine can be used to find the number of [SQL parameters] ** in a [prepared statement]. SQL parameters are tokens of the ** form "?", "?NNN", ":AAA", "$AAA", or "@AAA" that serve as ** placeholders for values that are [sqlite3_bind_blob | bound] ** to the parameters at a later time. ** -** This routine actually returns the index of the largest (rightmost) +** ^(This routine actually returns the index of the largest (rightmost) ** parameter. For all forms except ?NNN, this will correspond to the -** number of unique parameters. If parameters of the ?NNN are used, -** there may be gaps in the list. +** number of unique parameters. If parameters of the ?NNN form are used, +** there may be gaps in the list.)^ ** ** See also: [sqlite3_bind_blob|sqlite3_bind()], ** [sqlite3_bind_parameter_name()], and ** [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13601] */ SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*); /* -** CAPI3REF: Name Of A Host Parameter {H13620} +** CAPI3REF: Name Of A Host Parameter ** -** This routine returns a pointer to the name of the n-th -** [SQL parameter] in a [prepared statement]. -** SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA" +** ^The sqlite3_bind_parameter_name(P,N) interface returns +** the name of the N-th [SQL parameter] in the [prepared statement] P. +** ^(SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA" ** have a name which is the string "?NNN" or ":AAA" or "@AAA" or "$AAA" ** respectively. ** In other words, the initial ":" or "$" or "@" or "?" -** is included as part of the name. -** Parameters of the form "?" without a following integer have no name -** and are also referred to as "anonymous parameters". +** is included as part of the name.)^ +** ^Parameters of the form "?" without a following integer have no name +** and are referred to as "nameless" or "anonymous parameters". ** -** The first host parameter has an index of 1, not 0. +** ^The first host parameter has an index of 1, not 0. ** -** If the value n is out of range or if the n-th parameter is -** nameless, then NULL is returned. The returned string is +** ^If the value N is out of range or if the N-th parameter is +** nameless, then NULL is returned. ^The returned string is ** always in UTF-8 encoding even if the named parameter was ** originally specified as UTF-16 in [sqlite3_prepare16()] or ** [sqlite3_prepare16_v2()]. @@ -2766,125 +3156,110 @@ SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*); ** See also: [sqlite3_bind_blob|sqlite3_bind()], ** [sqlite3_bind_parameter_count()], and ** [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13621] */ SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int); /* -** CAPI3REF: Index Of A Parameter With A Given Name {H13640} +** CAPI3REF: Index Of A Parameter With A Given Name ** -** Return the index of an SQL parameter given its name. The +** ^Return the index of an SQL parameter given its name. ^The ** index value returned is suitable for use as the second -** parameter to [sqlite3_bind_blob|sqlite3_bind()]. A zero -** is returned if no matching parameter is found. The parameter +** parameter to [sqlite3_bind_blob|sqlite3_bind()]. ^A zero +** is returned if no matching parameter is found. ^The parameter ** name must be given in UTF-8 even if the original statement ** was prepared from UTF-16 text using [sqlite3_prepare16_v2()]. ** ** See also: [sqlite3_bind_blob|sqlite3_bind()], ** [sqlite3_bind_parameter_count()], and ** [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13641] */ SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); /* -** CAPI3REF: Reset All Bindings On A Prepared Statement {H13660} +** CAPI3REF: Reset All Bindings On A Prepared Statement ** -** Contrary to the intuition of many, [sqlite3_reset()] does not reset +** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset ** the [sqlite3_bind_blob | bindings] on a [prepared statement]. -** Use this routine to reset all host parameters to NULL. -** -** Requirements: -** [H13661] +** ^Use this routine to reset all host parameters to NULL. */ SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*); /* -** CAPI3REF: Number Of Columns In A Result Set {H13710} +** CAPI3REF: Number Of Columns In A Result Set ** -** Return the number of columns in the result set returned by the -** [prepared statement]. This routine returns 0 if pStmt is an SQL +** ^Return the number of columns in the result set returned by the +** [prepared statement]. ^This routine returns 0 if pStmt is an SQL ** statement that does not return data (for example an [UPDATE]). ** -** Requirements: -** [H13711] +** See also: [sqlite3_data_count()] */ SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt); /* -** CAPI3REF: Column Names In A Result Set {H13720} +** CAPI3REF: Column Names In A Result Set ** -** These routines return the name assigned to a particular column -** in the result set of a [SELECT] statement. The sqlite3_column_name() +** ^These routines return the name assigned to a particular column +** in the result set of a [SELECT] statement. ^The sqlite3_column_name() ** interface returns a pointer to a zero-terminated UTF-8 string ** and sqlite3_column_name16() returns a pointer to a zero-terminated -** UTF-16 string. The first parameter is the [prepared statement] -** that implements the [SELECT] statement. The second parameter is the -** column number. The leftmost column is number 0. +** UTF-16 string. ^The first parameter is the [prepared statement] +** that implements the [SELECT] statement. ^The second parameter is the +** column number. ^The leftmost column is number 0. ** -** The returned string pointer is valid until either the [prepared statement] +** ^The returned string pointer is valid until either the [prepared statement] ** is destroyed by [sqlite3_finalize()] or until the next call to ** sqlite3_column_name() or sqlite3_column_name16() on the same column. ** -** If sqlite3_malloc() fails during the processing of either routine +** ^If sqlite3_malloc() fails during the processing of either routine ** (for example during a conversion from UTF-8 to UTF-16) then a ** NULL pointer is returned. ** -** The name of a result column is the value of the "AS" clause for +** ^The name of a result column is the value of the "AS" clause for ** that column, if there is an AS clause. If there is no AS clause ** then the name of the column is unspecified and may change from ** one release of SQLite to the next. -** -** Requirements: -** [H13721] [H13723] [H13724] [H13725] [H13726] [H13727] */ SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N); SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N); /* -** CAPI3REF: Source Of Data In A Query Result {H13740} +** CAPI3REF: Source Of Data In A Query Result ** -** These routines provide a means to determine what column of what -** table in which database a result of a [SELECT] statement comes from. -** The name of the database or table or column can be returned as -** either a UTF-8 or UTF-16 string. The _database_ routines return +** ^These routines provide a means to determine the database, table, and +** table column that is the origin of a particular result column in +** [SELECT] statement. +** ^The name of the database or table or column can be returned as +** either a UTF-8 or UTF-16 string. ^The _database_ routines return ** the database name, the _table_ routines return the table name, and ** the origin_ routines return the column name. -** The returned string is valid until the [prepared statement] is destroyed +** ^The returned string is valid until the [prepared statement] is destroyed ** using [sqlite3_finalize()] or until the same information is requested ** again in a different encoding. ** -** The names returned are the original un-aliased names of the +** ^The names returned are the original un-aliased names of the ** database, table, and column. ** -** The first argument to the following calls is a [prepared statement]. -** These functions return information about the Nth column returned by +** ^The first argument to these interfaces is a [prepared statement]. +** ^These functions return information about the Nth result column returned by ** the statement, where N is the second function argument. +** ^The left-most column is column 0 for these routines. ** -** If the Nth column returned by the statement is an expression or +** ^If the Nth column returned by the statement is an expression or ** subquery and is not a column value, then all of these functions return -** NULL. These routine might also return NULL if a memory allocation error -** occurs. Otherwise, they return the name of the attached database, table -** and column that query result column was extracted from. +** NULL. ^These routine might also return NULL if a memory allocation error +** occurs. ^Otherwise, they return the name of the attached database, table, +** or column that query result column was extracted from. ** -** As with all other SQLite APIs, those postfixed with "16" return -** UTF-16 encoded strings, the other functions return UTF-8. {END} +** ^As with all other SQLite APIs, those whose names end with "16" return +** UTF-16 encoded strings and the other functions return UTF-8. ** -** These APIs are only available if the library was compiled with the -** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined. +** ^These APIs are only available if the library was compiled with the +** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** -** {A13751} ** If two or more threads call one or more of these routines against the same ** prepared statement and column at the same time then the results are ** undefined. ** -** Requirements: -** [H13741] [H13742] [H13743] [H13744] [H13745] [H13746] [H13748] -** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column @@ -2898,17 +3273,17 @@ SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); /* -** CAPI3REF: Declared Datatype Of A Query Result {H13760} +** CAPI3REF: Declared Datatype Of A Query Result ** -** The first parameter is a [prepared statement]. +** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table -** column is returned. If the Nth column of the result set is an +** column is returned.)^ ^If the Nth column of the result set is an ** expression or subquery, then a NULL pointer is returned. -** The returned string is always UTF-8 encoded. {END} +** ^The returned string is always UTF-8 encoded. ** -** For example, given the database schema: +** ^(For example, given the database schema: ** ** CREATE TABLE t1(c1 VARIANT); ** @@ -2917,23 +3292,20 @@ SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); ** SELECT c1 + 1, c1 FROM t1; ** ** this routine would return the string "VARIANT" for the second result -** column (i==1), and a NULL pointer for the first result column (i==0). +** column (i==1), and a NULL pointer for the first result column (i==0).)^ ** -** SQLite uses dynamic run-time typing. So just because a column +** ^SQLite uses dynamic run-time typing. ^So just because a column ** is declared to contain a particular type does not mean that the ** data stored in that column is of the declared type. SQLite is -** strongly typed, but the typing is dynamic not static. Type +** strongly typed, but the typing is dynamic not static. ^Type ** is associated with individual values, not with the containers ** used to hold those values. -** -** Requirements: -** [H13761] [H13762] [H13763] */ SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); /* -** CAPI3REF: Evaluate An SQL Statement {H13200} +** CAPI3REF: Evaluate An SQL Statement ** ** After a [prepared statement] has been prepared using either ** [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] or one of the legacy @@ -2947,35 +3319,35 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** new "v2" interface is recommended for new applications but the legacy ** interface will continue to be supported. ** -** In the legacy interface, the return value will be either [SQLITE_BUSY], +** ^In the legacy interface, the return value will be either [SQLITE_BUSY], ** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. -** With the "v2" interface, any of the other [result codes] or +** ^With the "v2" interface, any of the other [result codes] or ** [extended result codes] might be returned as well. ** -** [SQLITE_BUSY] means that the database engine was unable to acquire the -** database locks it needs to do its job. If the statement is a [COMMIT] +** ^[SQLITE_BUSY] means that the database engine was unable to acquire the +** database locks it needs to do its job. ^If the statement is a [COMMIT] ** or occurs outside of an explicit transaction, then you can retry the ** statement. If the statement is not a [COMMIT] and occurs within a ** explicit transaction then you should rollback the transaction before ** continuing. ** -** [SQLITE_DONE] means that the statement has finished executing +** ^[SQLITE_DONE] means that the statement has finished executing ** successfully. sqlite3_step() should not be called again on this virtual ** machine without first calling [sqlite3_reset()] to reset the virtual ** machine back to its initial state. ** -** If the SQL statement being executed returns any data, then [SQLITE_ROW] +** ^If the SQL statement being executed returns any data, then [SQLITE_ROW] ** is returned each time a new row of data is ready for processing by the ** caller. The values may be accessed using the [column access functions]. ** sqlite3_step() is called again to retrieve the next row of data. ** -** [SQLITE_ERROR] means that a run-time error (such as a constraint +** ^[SQLITE_ERROR] means that a run-time error (such as a constraint ** violation) has occurred. sqlite3_step() should not be called again on ** the VM. More information may be found by calling [sqlite3_errmsg()]. -** With the legacy interface, a more specific error code (for example, +** ^With the legacy interface, a more specific error code (for example, ** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) ** can be obtained by calling [sqlite3_reset()] on the -** [prepared statement]. In the "v2" interface, +** [prepared statement]. ^In the "v2" interface, ** the more specific error code is returned directly by sqlite3_step(). ** ** [SQLITE_MISUSE] means that the this routine was called inappropriately. @@ -2985,6 +3357,14 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** be the case that the same database connection is being used by two or ** more threads at the same moment in time. ** +** For all versions of SQLite up to and including 3.6.23.1, it was required +** after sqlite3_step() returned anything other than [SQLITE_ROW] that +** [sqlite3_reset()] be called before any subsequent invocation of +** sqlite3_step(). Failure to invoke [sqlite3_reset()] in this way would +** result in an [SQLITE_MISUSE] return from sqlite3_step(). But after +** version 3.6.23.1, sqlite3_step() began calling [sqlite3_reset()] +** automatically in this circumstance rather than returning [SQLITE_MISUSE]. +** ** Goofy Interface Alert: In the legacy interface, the sqlite3_step() ** API always returns a generic error code, [SQLITE_ERROR], following any ** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call @@ -2996,27 +3376,28 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, ** then the more specific [error codes] are returned directly ** by sqlite3_step(). The use of the "v2" interface is recommended. -** -** Requirements: -** [H13202] [H15304] [H15306] [H15308] [H15310] */ SQLITE_API int sqlite3_step(sqlite3_stmt*); /* -** CAPI3REF: Number of columns in a result set {H13770} +** CAPI3REF: Number of columns in a result set ** -** Returns the number of values in the current row of the result set. +** ^The sqlite3_data_count(P) interface returns the number of columns in the +** current row of the result set of [prepared statement] P. +** ^If prepared statement P does not have results ready to return +** (via calls to the [sqlite3_column_int | sqlite3_column_*()] of +** interfaces) then sqlite3_data_count(P) returns 0. +** ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer. ** -** Requirements: -** [H13771] [H13772] +** See also: [sqlite3_column_count()] */ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); /* -** CAPI3REF: Fundamental Datatypes {H10265} +** CAPI3REF: Fundamental Datatypes ** KEYWORDS: SQLITE_TEXT ** -** {H10266} Every value in SQLite has one of five fundamental datatypes: +** ^(Every value in SQLite has one of five fundamental datatypes: ** **
      **
    • 64-bit signed integer @@ -3024,7 +3405,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); **
    • string **
    • BLOB **
    • NULL -**
    {END} +** )^ ** ** These constants are codes for each of those types. ** @@ -3045,18 +3426,18 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); #define SQLITE3_TEXT 3 /* -** CAPI3REF: Result Values From A Query {H13800} +** CAPI3REF: Result Values From A Query ** KEYWORDS: {column access functions} ** -** These routines form the "result set query" interface. +** These routines form the "result set" interface. ** -** These routines return information about a single column of the current -** result row of a query. In every case the first argument is a pointer +** ^These routines return information about a single column of the current +** result row of a query. ^In every case the first argument is a pointer ** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*] ** that was returned from [sqlite3_prepare_v2()] or one of its variants) ** and the second argument is the index of the column for which information -** should be returned. The leftmost column of the result set has the index 0. -** The number of columns in the result can be determined using +** should be returned. ^The leftmost column of the result set has the index 0. +** ^The number of columns in the result can be determined using ** [sqlite3_column_count()]. ** ** If the SQL statement does not currently point to a valid row, or if the @@ -3071,9 +3452,9 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** are called from a different thread while any of these routines ** are pending, then the results are undefined. ** -** The sqlite3_column_type() routine returns the +** ^The sqlite3_column_type() routine returns the ** [SQLITE_INTEGER | datatype code] for the initial data type -** of the result column. The returned value is one of [SQLITE_INTEGER], +** of the result column. ^The returned value is one of [SQLITE_INTEGER], ** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL]. The value ** returned by sqlite3_column_type() is only meaningful if no type ** conversions have occurred as described below. After a type conversion, @@ -3081,27 +3462,35 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** versions of SQLite may change the behavior of sqlite3_column_type() ** following a type conversion. ** -** If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() +** ^If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() ** routine returns the number of bytes in that BLOB or string. -** If the result is a UTF-16 string, then sqlite3_column_bytes() converts +** ^If the result is a UTF-16 string, then sqlite3_column_bytes() converts ** the string to UTF-8 and then returns the number of bytes. -** If the result is a numeric value then sqlite3_column_bytes() uses +** ^If the result is a numeric value then sqlite3_column_bytes() uses ** [sqlite3_snprintf()] to convert that value to a UTF-8 string and returns ** the number of bytes in that string. -** The value returned does not include the zero terminator at the end -** of the string. For clarity: the value returned is the number of +** ^If the result is NULL, then sqlite3_column_bytes() returns zero. +** +** ^If the result is a BLOB or UTF-16 string then the sqlite3_column_bytes16() +** routine returns the number of bytes in that BLOB or string. +** ^If the result is a UTF-8 string, then sqlite3_column_bytes16() converts +** the string to UTF-16 and then returns the number of bytes. +** ^If the result is a numeric value then sqlite3_column_bytes16() uses +** [sqlite3_snprintf()] to convert that value to a UTF-16 string and returns +** the number of bytes in that string. +** ^If the result is NULL, then sqlite3_column_bytes16() returns zero. +** +** ^The values returned by [sqlite3_column_bytes()] and +** [sqlite3_column_bytes16()] do not include the zero terminators at the end +** of the string. ^For clarity: the values returned by +** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of ** bytes in the string, not the number of characters. ** -** Strings returned by sqlite3_column_text() and sqlite3_column_text16(), -** even empty strings, are always zero terminated. The return -** value from sqlite3_column_blob() for a zero-length BLOB is an arbitrary -** pointer, possibly even a NULL pointer. +** ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(), +** even empty strings, are always zero terminated. ^The return +** value from sqlite3_column_blob() for a zero-length BLOB is a NULL pointer. ** -** The sqlite3_column_bytes16() routine is similar to sqlite3_column_bytes() -** but leaves the result in UTF-16 in native byte order instead of UTF-8. -** The zero terminator is not included in this count. -** -** The object returned by [sqlite3_column_value()] is an +** ^The object returned by [sqlite3_column_value()] is an ** [unprotected sqlite3_value] object. An unprotected sqlite3_value object ** may only be used with [sqlite3_bind_value()] and [sqlite3_result_value()]. ** If the [unprotected sqlite3_value] object returned by @@ -3109,10 +3498,10 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** to routines like [sqlite3_value_int()], [sqlite3_value_text()], ** or [sqlite3_value_bytes()], then the behavior is undefined. ** -** These routines attempt to convert the value where appropriate. For +** These routines attempt to convert the value where appropriate. ^For ** example, if the internal representation is FLOAT and a text result ** is requested, [sqlite3_snprintf()] is used internally to perform the -** conversion automatically. The following table details the conversions +** conversion automatically. ^(The following table details the conversions ** that are applied: ** **
    @@ -3136,7 +3525,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** BLOB FLOAT Convert to TEXT then use atof() ** BLOB TEXT Add a zero terminator if needed ** -**
    +**
    )^ ** ** The table above makes reference to standard C library functions atoi() ** and atof(). SQLite does not really use these functions. It has its @@ -3162,9 +3551,9 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** to UTF-8.
  • ** ** -** Conversions between UTF-16be and UTF-16le are always done in place and do +** ^Conversions between UTF-16be and UTF-16le are always done in place and do ** not invalidate a prior pointer, though of course the content of the buffer -** that the prior pointer points to will have been modified. Other kinds +** that the prior pointer references will have been modified. Other kinds ** of conversion are done in place when it is possible, but sometimes they ** are not possible and in those cases prior pointers are invalidated. ** @@ -3185,22 +3574,18 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16() ** with calls to sqlite3_column_bytes(). ** -** The pointers returned are valid until a type conversion occurs as +** ^The pointers returned are valid until a type conversion occurs as ** described above, or until [sqlite3_step()] or [sqlite3_reset()] or -** [sqlite3_finalize()] is called. The memory space used to hold strings +** [sqlite3_finalize()] is called. ^The memory space used to hold strings ** and BLOBs is freed automatically. Do not pass the pointers returned ** [sqlite3_column_blob()], [sqlite3_column_text()], etc. into ** [sqlite3_free()]. ** -** If a memory allocation error occurs during the evaluation of any +** ^(If a memory allocation error occurs during the evaluation of any ** of these routines, a default value is returned. The default value ** is either the integer 0, the floating point number 0.0, or a NULL ** pointer. Subsequent calls to [sqlite3_errcode()] will return -** [SQLITE_NOMEM]. -** -** Requirements: -** [H13803] [H13806] [H13809] [H13812] [H13815] [H13818] [H13821] [H13824] -** [H13827] [H13830] +** [SQLITE_NOMEM].)^ */ SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol); SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol); @@ -3214,135 +3599,142 @@ SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol); SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol); /* -** CAPI3REF: Destroy A Prepared Statement Object {H13300} +** CAPI3REF: Destroy A Prepared Statement Object ** -** The sqlite3_finalize() function is called to delete a [prepared statement]. -** If the statement was executed successfully or not executed at all, then -** SQLITE_OK is returned. If execution of the statement failed then an -** [error code] or [extended error code] is returned. +** ^The sqlite3_finalize() function is called to delete a [prepared statement]. +** ^If the most recent evaluation of the statement encountered no errors or +** or if the statement is never been evaluated, then sqlite3_finalize() returns +** SQLITE_OK. ^If the most recent evaluation of statement S failed, then +** sqlite3_finalize(S) returns the appropriate [error code] or +** [extended error code]. ** -** This routine can be called at any point during the execution of the -** [prepared statement]. If the virtual machine has not -** completed execution when this routine is called, that is like -** encountering an error or an [sqlite3_interrupt | interrupt]. -** Incomplete updates may be rolled back and transactions canceled, -** depending on the circumstances, and the -** [error code] returned will be [SQLITE_ABORT]. +** ^The sqlite3_finalize(S) routine can be called at any point during +** the life cycle of [prepared statement] S: +** before statement S is ever evaluated, after +** one or more calls to [sqlite3_reset()], or after any call +** to [sqlite3_step()] regardless of whether or not the statement has +** completed execution. ** -** Requirements: -** [H11302] [H11304] +** ^Invoking sqlite3_finalize() on a NULL pointer is a harmless no-op. +** +** The application must finalize every [prepared statement] in order to avoid +** resource leaks. It is a grievous error for the application to try to use +** a prepared statement after it has been finalized. Any use of a prepared +** statement after it has been finalized can result in undefined and +** undesirable behavior such as segfaults and heap corruption. */ SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt); /* -** CAPI3REF: Reset A Prepared Statement Object {H13330} +** CAPI3REF: Reset A Prepared Statement Object ** ** The sqlite3_reset() function is called to reset a [prepared statement] ** object back to its initial state, ready to be re-executed. -** Any SQL statement variables that had values bound to them using +** ^Any SQL statement variables that had values bound to them using ** the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values. ** Use [sqlite3_clear_bindings()] to reset the bindings. ** -** {H11332} The [sqlite3_reset(S)] interface resets the [prepared statement] S -** back to the beginning of its program. +** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S +** back to the beginning of its program. ** -** {H11334} If the most recent call to [sqlite3_step(S)] for the -** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], -** or if [sqlite3_step(S)] has never before been called on S, -** then [sqlite3_reset(S)] returns [SQLITE_OK]. +** ^If the most recent call to [sqlite3_step(S)] for the +** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], +** or if [sqlite3_step(S)] has never before been called on S, +** then [sqlite3_reset(S)] returns [SQLITE_OK]. ** -** {H11336} If the most recent call to [sqlite3_step(S)] for the -** [prepared statement] S indicated an error, then -** [sqlite3_reset(S)] returns an appropriate [error code]. +** ^If the most recent call to [sqlite3_step(S)] for the +** [prepared statement] S indicated an error, then +** [sqlite3_reset(S)] returns an appropriate [error code]. ** -** {H11338} The [sqlite3_reset(S)] interface does not change the values -** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. +** ^The [sqlite3_reset(S)] interface does not change the values +** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. */ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); /* -** CAPI3REF: Create Or Redefine SQL Functions {H16100} +** CAPI3REF: Create Or Redefine SQL Functions ** KEYWORDS: {function creation routines} ** KEYWORDS: {application-defined SQL function} ** KEYWORDS: {application-defined SQL functions} ** -** These two functions (collectively known as "function creation routines") +** ^These functions (collectively known as "function creation routines") ** are used to add SQL functions or aggregates or to redefine the behavior -** of existing SQL functions or aggregates. The only difference between the -** two is that the second parameter, the name of the (scalar) function or -** aggregate, is encoded in UTF-8 for sqlite3_create_function() and UTF-16 -** for sqlite3_create_function16(). +** of existing SQL functions or aggregates. The only differences between +** these routines are the text encoding expected for +** the the second parameter (the name of the function being created) +** and the presence or absence of a destructor callback for +** the application data pointer. ** -** The first parameter is the [database connection] to which the SQL -** function is to be added. If a single program uses more than one database -** connection internally, then SQL functions must be added individually to -** each database connection. +** ^The first parameter is the [database connection] to which the SQL +** function is to be added. ^If an application uses more than one database +** connection then application-defined SQL functions must be added +** to each database connection separately. ** -** The second parameter is the name of the SQL function to be created or -** redefined. The length of the name is limited to 255 bytes, exclusive of -** the zero-terminator. Note that the name length limit is in bytes, not -** characters. Any attempt to create a function with a longer name -** will result in [SQLITE_ERROR] being returned. +** ^The second parameter is the name of the SQL function to be created or +** redefined. ^The length of the name is limited to 255 bytes in a UTF-8 +** representation, exclusive of the zero-terminator. ^Note that the name +** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. +** ^Any attempt to create a function with a longer name +** will result in [SQLITE_MISUSE] being returned. ** -** The third parameter (nArg) +** ^The third parameter (nArg) ** is the number of arguments that the SQL function or -** aggregate takes. If this parameter is -1, then the SQL function or +** aggregate takes. ^If this parameter is -1, then the SQL function or ** aggregate may take any number of arguments between 0 and the limit ** set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]). If the third ** parameter is less than -1 or greater than 127 then the behavior is ** undefined. ** -** The fourth parameter, eTextRep, specifies what +** ^The fourth parameter, eTextRep, specifies what ** [SQLITE_UTF8 | text encoding] this SQL function prefers for -** its parameters. Any SQL function implementation should be able to work -** work with UTF-8, UTF-16le, or UTF-16be. But some implementations may be -** more efficient with one encoding than another. An application may +** its parameters. Every SQL function implementation must be able to work +** with UTF-8, UTF-16le, or UTF-16be. But some implementations may be +** more efficient with one encoding than another. ^An application may ** invoke sqlite3_create_function() or sqlite3_create_function16() multiple ** times with the same function but with different values of eTextRep. -** When multiple implementations of the same function are available, SQLite +** ^When multiple implementations of the same function are available, SQLite ** will pick the one that involves the least amount of data conversion. ** If there is only a single implementation which does not care what text ** encoding is used, then the fourth argument should be [SQLITE_ANY]. ** -** The fifth parameter is an arbitrary pointer. The implementation of the -** function can gain access to this pointer using [sqlite3_user_data()]. +** ^(The fifth parameter is an arbitrary pointer. The implementation of the +** function can gain access to this pointer using [sqlite3_user_data()].)^ ** -** The seventh, eighth and ninth parameters, xFunc, xStep and xFinal, are +** ^The seventh, eighth and ninth parameters, xFunc, xStep and xFinal, are ** pointers to C-language functions that implement the SQL function or -** aggregate. A scalar SQL function requires an implementation of the xFunc -** callback only, NULL pointers should be passed as the xStep and xFinal -** parameters. An aggregate SQL function requires an implementation of xStep -** and xFinal and NULL should be passed for xFunc. To delete an existing -** SQL function or aggregate, pass NULL for all three function callbacks. +** aggregate. ^A scalar SQL function requires an implementation of the xFunc +** callback only; NULL pointers must be passed as the xStep and xFinal +** parameters. ^An aggregate SQL function requires an implementation of xStep +** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing +** SQL function or aggregate, pass NULL poiners for all three function +** callbacks. ** -** It is permitted to register multiple implementations of the same +** ^If the tenth parameter to sqlite3_create_function_v2() is not NULL, +** then it is invoked when the function is deleted, either by being +** overloaded or when the database connection closes. +** ^When the destructure callback of the tenth parameter is invoked, it +** is passed a single argument which is a copy of the pointer which was +** the fifth parameter to sqlite3_create_function_v2(). +** +** ^It is permitted to register multiple implementations of the same ** functions with the same name but with either differing numbers of -** arguments or differing preferred text encodings. SQLite will use +** arguments or differing preferred text encodings. ^SQLite will use ** the implementation that most closely matches the way in which the -** SQL function is used. A function implementation with a non-negative +** SQL function is used. ^A function implementation with a non-negative ** nArg parameter is a better match than a function implementation with -** a negative nArg. A function where the preferred text encoding +** a negative nArg. ^A function where the preferred text encoding ** matches the database encoding is a better ** match than a function where the encoding is different. -** A function where the encoding difference is between UTF16le and UTF16be +** ^A function where the encoding difference is between UTF16le and UTF16be ** is a closer match than a function where the encoding difference is ** between UTF8 and UTF16. ** -** Built-in functions may be overloaded by new application-defined functions. -** The first application-defined function with a given name overrides all -** built-in functions in the same [database connection] with the same name. -** Subsequent application-defined functions of the same name only override -** prior application-defined functions that are an exact match for the -** number of parameters and preferred encoding. +** ^Built-in functions may be overloaded by new application-defined functions. ** -** An application-defined function is permitted to call other +** ^An application-defined function is permitted to call other ** SQLite interfaces. However, such calls must not ** close the database connection nor finalize or reset the prepared ** statement in which the function is running. -** -** Requirements: -** [H16103] [H16106] [H16109] [H16112] [H16118] [H16121] [H16127] -** [H16130] [H16133] [H16136] [H16139] [H16142] */ SQLITE_API int sqlite3_create_function( sqlite3 *db, @@ -3364,9 +3756,20 @@ SQLITE_API int sqlite3_create_function16( void (*xStep)(sqlite3_context*,int,sqlite3_value**), void (*xFinal)(sqlite3_context*) ); +SQLITE_API int sqlite3_create_function_v2( + sqlite3 *db, + const char *zFunctionName, + int nArg, + int eTextRep, + void *pApp, + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*), + void(*xDestroy)(void*) +); /* -** CAPI3REF: Text Encodings {H10267} +** CAPI3REF: Text Encodings ** ** These constant define integer codes that represent the various ** text encodings supported by SQLite. @@ -3398,7 +3801,7 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 #endif /* -** CAPI3REF: Obtaining SQL Function Parameter Values {H15100} +** CAPI3REF: Obtaining SQL Function Parameter Values ** ** The C-language implementation of SQL functions and aggregates uses ** this set of interface routines to access the parameter values on @@ -3416,22 +3819,22 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 ** Any attempt to use these routines on an [unprotected sqlite3_value] ** object results in undefined behavior. ** -** These routines work just like the corresponding [column access functions] +** ^These routines work just like the corresponding [column access functions] ** except that these routines take a single [protected sqlite3_value] object ** pointer instead of a [sqlite3_stmt*] pointer and an integer column number. ** -** The sqlite3_value_text16() interface extracts a UTF-16 string -** in the native byte-order of the host machine. The +** ^The sqlite3_value_text16() interface extracts a UTF-16 string +** in the native byte-order of the host machine. ^The ** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces ** extract UTF-16 strings as big-endian and little-endian respectively. ** -** The sqlite3_value_numeric_type() interface attempts to apply +** ^(The sqlite3_value_numeric_type() interface attempts to apply ** numeric affinity to the value. This means that an attempt is ** made to convert the value to an integer or floating point. If ** such a conversion is possible without loss of information (in other ** words, if the value is a string that looks like a number) ** then the conversion is performed. Otherwise no conversion occurs. -** The [SQLITE_INTEGER | datatype] after conversion is returned. +** The [SQLITE_INTEGER | datatype] after conversion is returned.)^ ** ** Please pay particular attention to the fact that the pointer returned ** from [sqlite3_value_blob()], [sqlite3_value_text()], or @@ -3441,10 +3844,6 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 ** ** These routines must be called from the same thread as ** the SQL function that supplied the [sqlite3_value*] parameters. -** -** Requirements: -** [H15103] [H15106] [H15109] [H15112] [H15115] [H15118] [H15121] [H15124] -** [H15127] [H15130] [H15133] [H15136] */ SQLITE_API const void *sqlite3_value_blob(sqlite3_value*); SQLITE_API int sqlite3_value_bytes(sqlite3_value*); @@ -3460,66 +3859,73 @@ SQLITE_API int sqlite3_value_type(sqlite3_value*); SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*); /* -** CAPI3REF: Obtain Aggregate Function Context {H16210} +** CAPI3REF: Obtain Aggregate Function Context ** -** The implementation of aggregate SQL functions use this routine to allocate -** a structure for storing their state. +** Implementations of aggregate SQL functions use this +** routine to allocate memory for storing their state. ** -** The first time the sqlite3_aggregate_context() routine is called for a -** particular aggregate, SQLite allocates nBytes of memory, zeroes out that -** memory, and returns a pointer to it. On second and subsequent calls to -** sqlite3_aggregate_context() for the same aggregate function index, -** the same buffer is returned. The implementation of the aggregate can use -** the returned buffer to accumulate data. +** ^The first time the sqlite3_aggregate_context(C,N) routine is called +** for a particular aggregate function, SQLite +** allocates N of memory, zeroes out that memory, and returns a pointer +** to the new memory. ^On second and subsequent calls to +** sqlite3_aggregate_context() for the same aggregate function instance, +** the same buffer is returned. Sqlite3_aggregate_context() is normally +** called once for each invocation of the xStep callback and then one +** last time when the xFinal callback is invoked. ^(When no rows match +** an aggregate query, the xStep() callback of the aggregate function +** implementation is never called and xFinal() is called exactly once. +** In those cases, sqlite3_aggregate_context() might be called for the +** first time from within xFinal().)^ ** -** SQLite automatically frees the allocated buffer when the aggregate -** query concludes. +** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer if N is +** less than or equal to zero or if a memory allocate error occurs. ** -** The first parameter should be a copy of the +** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is +** determined by the N parameter on first successful call. Changing the +** value of N in subsequent call to sqlite3_aggregate_context() within +** the same aggregate function instance will not resize the memory +** allocation.)^ +** +** ^SQLite automatically frees the memory allocated by +** sqlite3_aggregate_context() when the aggregate query concludes. +** +** The first parameter must be a copy of the ** [sqlite3_context | SQL function context] that is the first parameter -** to the callback routine that implements the aggregate function. +** to the xStep or xFinal callback routine that implements the aggregate +** function. ** ** This routine must be called from the same thread in which ** the aggregate SQL function is running. -** -** Requirements: -** [H16211] [H16213] [H16215] [H16217] */ SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes); /* -** CAPI3REF: User Data For Functions {H16240} +** CAPI3REF: User Data For Functions ** -** The sqlite3_user_data() interface returns a copy of +** ^The sqlite3_user_data() interface returns a copy of ** the pointer that was the pUserData parameter (the 5th parameter) ** of the [sqlite3_create_function()] ** and [sqlite3_create_function16()] routines that originally -** registered the application defined function. {END} -** -** This routine must be called from the same thread in which -** the application-defined function is running. -** -** Requirements: -** [H16243] -*/ -SQLITE_API void *sqlite3_user_data(sqlite3_context*); - -/* -** CAPI3REF: Database Connection For Functions {H16250} -** -** The sqlite3_context_db_handle() interface returns a copy of -** the pointer to the [database connection] (the 1st parameter) -** of the [sqlite3_create_function()] -** and [sqlite3_create_function16()] routines that originally ** registered the application defined function. ** -** Requirements: -** [H16253] +** This routine must be called from the same thread in which +** the application-defined function is running. +*/ +SQLITE_API void *sqlite3_user_data(sqlite3_context*); + +/* +** CAPI3REF: Database Connection For Functions +** +** ^The sqlite3_context_db_handle() interface returns a copy of +** the pointer to the [database connection] (the 1st parameter) +** of the [sqlite3_create_function()] +** and [sqlite3_create_function16()] routines that originally +** registered the application defined function. */ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); /* -** CAPI3REF: Function Auxiliary Data {H16270} +** CAPI3REF: Function Auxiliary Data ** ** The following two functions may be used by scalar SQL functions to ** associate metadata with argument values. If the same value is passed to @@ -3532,48 +3938,45 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** invocations of the same function so that the original pattern string ** does not need to be recompiled on each invocation. ** -** The sqlite3_get_auxdata() interface returns a pointer to the metadata +** ^The sqlite3_get_auxdata() interface returns a pointer to the metadata ** associated by the sqlite3_set_auxdata() function with the Nth argument -** value to the application-defined function. If no metadata has been ever +** value to the application-defined function. ^If no metadata has been ever ** been set for the Nth argument of the function, or if the corresponding ** function parameter has changed since the meta-data was set, ** then sqlite3_get_auxdata() returns a NULL pointer. ** -** The sqlite3_set_auxdata() interface saves the metadata +** ^The sqlite3_set_auxdata() interface saves the metadata ** pointed to by its 3rd parameter as the metadata for the N-th ** argument of the application-defined function. Subsequent ** calls to sqlite3_get_auxdata() might return this data, if it has ** not been destroyed. -** If it is not NULL, SQLite will invoke the destructor +** ^If it is not NULL, SQLite will invoke the destructor ** function given by the 4th parameter to sqlite3_set_auxdata() on ** the metadata when the corresponding function parameter changes ** or when the SQL statement completes, whichever comes first. ** ** SQLite is free to call the destructor and drop metadata on any -** parameter of any function at any time. The only guarantee is that +** parameter of any function at any time. ^The only guarantee is that ** the destructor will be called before the metadata is dropped. ** -** In practice, metadata is preserved between function calls for +** ^(In practice, metadata is preserved between function calls for ** expressions that are constant at compile time. This includes literal -** values and SQL variables. +** values and [parameters].)^ ** ** These routines must be called from the same thread in which ** the SQL function is running. -** -** Requirements: -** [H16272] [H16274] [H16276] [H16277] [H16278] [H16279] */ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); /* -** CAPI3REF: Constants Defining Special Destructor Behavior {H10280} +** CAPI3REF: Constants Defining Special Destructor Behavior ** ** These are special values for the destructor that is passed in as the -** final argument to routines like [sqlite3_result_blob()]. If the destructor +** final argument to routines like [sqlite3_result_blob()]. ^If the destructor ** argument is SQLITE_STATIC, it means that the content pointer is constant -** and will never change. It does not need to be destroyed. The +** and will never change. It does not need to be destroyed. ^The ** SQLITE_TRANSIENT value means that the content will likely change in ** the near future and that SQLite should make its own private copy of ** the content before returning. @@ -3586,7 +3989,7 @@ typedef void (*sqlite3_destructor_type)(void*); #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) /* -** CAPI3REF: Setting The Result Of An SQL Function {H16400} +** CAPI3REF: Setting The Result Of An SQL Function ** ** These routines are used by the xFunc or xFinal callbacks that ** implement SQL functions and aggregates. See @@ -3597,103 +4000,98 @@ typedef void (*sqlite3_destructor_type)(void*); ** functions used to bind values to host parameters in prepared statements. ** Refer to the [SQL parameter] documentation for additional information. ** -** The sqlite3_result_blob() interface sets the result from +** ^The sqlite3_result_blob() interface sets the result from ** an application-defined function to be the BLOB whose content is pointed ** to by the second parameter and which is N bytes long where N is the ** third parameter. ** -** The sqlite3_result_zeroblob() interfaces set the result of +** ^The sqlite3_result_zeroblob() interfaces set the result of ** the application-defined function to be a BLOB containing all zero ** bytes and N bytes in size, where N is the value of the 2nd parameter. ** -** The sqlite3_result_double() interface sets the result from +** ^The sqlite3_result_double() interface sets the result from ** an application-defined function to be a floating point value specified ** by its 2nd argument. ** -** The sqlite3_result_error() and sqlite3_result_error16() functions +** ^The sqlite3_result_error() and sqlite3_result_error16() functions ** cause the implemented SQL function to throw an exception. -** SQLite uses the string pointed to by the +** ^SQLite uses the string pointed to by the ** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16() -** as the text of an error message. SQLite interprets the error -** message string from sqlite3_result_error() as UTF-8. SQLite +** as the text of an error message. ^SQLite interprets the error +** message string from sqlite3_result_error() as UTF-8. ^SQLite ** interprets the string from sqlite3_result_error16() as UTF-16 in native -** byte order. If the third parameter to sqlite3_result_error() +** byte order. ^If the third parameter to sqlite3_result_error() ** or sqlite3_result_error16() is negative then SQLite takes as the error ** message all text up through the first zero character. -** If the third parameter to sqlite3_result_error() or +** ^If the third parameter to sqlite3_result_error() or ** sqlite3_result_error16() is non-negative then SQLite takes that many ** bytes (not characters) from the 2nd parameter as the error message. -** The sqlite3_result_error() and sqlite3_result_error16() +** ^The sqlite3_result_error() and sqlite3_result_error16() ** routines make a private copy of the error message text before ** they return. Hence, the calling function can deallocate or ** modify the text after they return without harm. -** The sqlite3_result_error_code() function changes the error code -** returned by SQLite as a result of an error in a function. By default, -** the error code is SQLITE_ERROR. A subsequent call to sqlite3_result_error() +** ^The sqlite3_result_error_code() function changes the error code +** returned by SQLite as a result of an error in a function. ^By default, +** the error code is SQLITE_ERROR. ^A subsequent call to sqlite3_result_error() ** or sqlite3_result_error16() resets the error code to SQLITE_ERROR. ** -** The sqlite3_result_toobig() interface causes SQLite to throw an error -** indicating that a string or BLOB is to long to represent. +** ^The sqlite3_result_toobig() interface causes SQLite to throw an error +** indicating that a string or BLOB is too long to represent. ** -** The sqlite3_result_nomem() interface causes SQLite to throw an error +** ^The sqlite3_result_nomem() interface causes SQLite to throw an error ** indicating that a memory allocation failed. ** -** The sqlite3_result_int() interface sets the return value +** ^The sqlite3_result_int() interface sets the return value ** of the application-defined function to be the 32-bit signed integer ** value given in the 2nd argument. -** The sqlite3_result_int64() interface sets the return value +** ^The sqlite3_result_int64() interface sets the return value ** of the application-defined function to be the 64-bit signed integer ** value given in the 2nd argument. ** -** The sqlite3_result_null() interface sets the return value +** ^The sqlite3_result_null() interface sets the return value ** of the application-defined function to be NULL. ** -** The sqlite3_result_text(), sqlite3_result_text16(), +** ^The sqlite3_result_text(), sqlite3_result_text16(), ** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces ** set the return value of the application-defined function to be ** a text string which is represented as UTF-8, UTF-16 native byte order, ** UTF-16 little endian, or UTF-16 big endian, respectively. -** SQLite takes the text result from the application from +** ^SQLite takes the text result from the application from ** the 2nd parameter of the sqlite3_result_text* interfaces. -** If the 3rd parameter to the sqlite3_result_text* interfaces +** ^If the 3rd parameter to the sqlite3_result_text* interfaces ** is negative, then SQLite takes result text from the 2nd parameter ** through the first zero character. -** If the 3rd parameter to the sqlite3_result_text* interfaces +** ^If the 3rd parameter to the sqlite3_result_text* interfaces ** is non-negative, then as many bytes (not characters) of the text ** pointed to by the 2nd parameter are taken as the application-defined ** function result. -** If the 4th parameter to the sqlite3_result_text* interfaces +** ^If the 4th parameter to the sqlite3_result_text* interfaces ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that ** function as the destructor on the text or BLOB result when it has ** finished using that result. -** If the 4th parameter to the sqlite3_result_text* interfaces or to +** ^If the 4th parameter to the sqlite3_result_text* interfaces or to ** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite ** assumes that the text or BLOB result is in constant space and does not ** copy the content of the parameter nor call a destructor on the content ** when it has finished using that result. -** If the 4th parameter to the sqlite3_result_text* interfaces +** ^If the 4th parameter to the sqlite3_result_text* interfaces ** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT ** then SQLite makes a copy of the result into space obtained from ** from [sqlite3_malloc()] before it returns. ** -** The sqlite3_result_value() interface sets the result of +** ^The sqlite3_result_value() interface sets the result of ** the application-defined function to be a copy the -** [unprotected sqlite3_value] object specified by the 2nd parameter. The +** [unprotected sqlite3_value] object specified by the 2nd parameter. ^The ** sqlite3_result_value() interface makes a copy of the [sqlite3_value] ** so that the [sqlite3_value] specified in the parameter may change or ** be deallocated after sqlite3_result_value() returns without harm. -** A [protected sqlite3_value] object may always be used where an +** ^A [protected sqlite3_value] object may always be used where an ** [unprotected sqlite3_value] object is required, so either ** kind of [sqlite3_value] object can be used with this interface. ** ** If these routines are called from within the different thread ** than the one containing the application-defined function that received ** the [sqlite3_context] pointer, the results are undefined. -** -** Requirements: -** [H16403] [H16406] [H16409] [H16412] [H16415] [H16418] [H16421] [H16424] -** [H16427] [H16430] [H16433] [H16436] [H16439] [H16442] [H16445] [H16448] -** [H16451] [H16454] [H16457] [H16460] [H16463] */ SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); SQLITE_API void sqlite3_result_double(sqlite3_context*, double); @@ -3713,67 +4111,87 @@ SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*); SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n); /* -** CAPI3REF: Define New Collating Sequences {H16600} +** CAPI3REF: Define New Collating Sequences ** -** These functions are used to add new collation sequences to the -** [database connection] specified as the first argument. +** ^These functions add, remove, or modify a [collation] associated +** with the [database connection] specified as the first argument. ** -** The name of the new collation sequence is specified as a UTF-8 string +** ^The name of the collation is a UTF-8 string ** for sqlite3_create_collation() and sqlite3_create_collation_v2() -** and a UTF-16 string for sqlite3_create_collation16(). In all cases -** the name is passed as the second function argument. +** and a UTF-16 string in native byte order for sqlite3_create_collation16(). +** ^Collation names that compare equal according to [sqlite3_strnicmp()] are +** considered to be the same name. ** -** The third argument may be one of the constants [SQLITE_UTF8], -** [SQLITE_UTF16LE], or [SQLITE_UTF16BE], indicating that the user-supplied -** routine expects to be passed pointers to strings encoded using UTF-8, -** UTF-16 little-endian, or UTF-16 big-endian, respectively. The -** third argument might also be [SQLITE_UTF16] to indicate that the routine -** expects pointers to be UTF-16 strings in the native byte order, or the -** argument can be [SQLITE_UTF16_ALIGNED] if the -** the routine expects pointers to 16-bit word aligned strings -** of UTF-16 in the native byte order. +** ^(The third argument (eTextRep) must be one of the constants: +**
      +**
    • [SQLITE_UTF8], +**
    • [SQLITE_UTF16LE], +**
    • [SQLITE_UTF16BE], +**
    • [SQLITE_UTF16], or +**
    • [SQLITE_UTF16_ALIGNED]. +**
    )^ +** ^The eTextRep argument determines the encoding of strings passed +** to the collating function callback, xCallback. +** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep +** force strings to be UTF16 with native byte order. +** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin +** on an even byte address. ** -** A pointer to the user supplied routine must be passed as the fifth -** argument. If it is NULL, this is the same as deleting the collation -** sequence (so that SQLite cannot call it anymore). -** Each time the application supplied function is invoked, it is passed -** as its first parameter a copy of the void* passed as the fourth argument -** to sqlite3_create_collation() or sqlite3_create_collation16(). +** ^The fourth argument, pArg, is a application data pointer that is passed +** through as the first argument to the collating function callback. ** -** The remaining arguments to the application-supplied routine are two strings, -** each represented by a (length, data) pair and encoded in the encoding -** that was passed as the third argument when the collation sequence was -** registered. {END} The application defined collation routine should -** return negative, zero or positive if the first string is less than, -** equal to, or greater than the second string. i.e. (STRING1 - STRING2). +** ^The fifth argument, xCallback, is a pointer to the collating function. +** ^Multiple collating functions can be registered using the same name but +** with different eTextRep parameters and SQLite will use whichever +** function requires the least amount of data transformation. +** ^If the xCallback argument is NULL then the collating function is +** deleted. ^When all collating functions having the same name are deleted, +** that collation is no longer usable. ** -** The sqlite3_create_collation_v2() works like sqlite3_create_collation() -** except that it takes an extra argument which is a destructor for -** the collation. The destructor is called when the collation is -** destroyed and is passed a copy of the fourth parameter void* pointer -** of the sqlite3_create_collation_v2(). -** Collations are destroyed when they are overridden by later calls to the -** collation creation functions or when the [database connection] is closed -** using [sqlite3_close()]. +** ^The collating function callback is invoked with a copy of the pArg +** application data pointer and with two strings in the encoding specified +** by the eTextRep argument. The collating function must return an +** integer that is negative, zero, or positive +** if the first string is less than, equal to, or greater than the second, +** respectively. A collating function must alway return the same answer +** given the same inputs. If two or more collating functions are registered +** to the same collation name (using different eTextRep values) then all +** must give an equivalent answer when invoked with equivalent strings. +** The collating function must obey the following properties for all +** strings A, B, and C: +** +**
      +**
    1. If A==B then B==A. +**
    2. If A==B and B==C then A==C. +**
    3. If A<B THEN B>A. +**
    4. If A<B and B<C then A<C. +**
    +** +** If a collating function fails any of the above constraints and that +** collating function is registered and used, then the behavior of SQLite +** is undefined. +** +** ^The sqlite3_create_collation_v2() works like sqlite3_create_collation() +** with the addition that the xDestroy callback is invoked on pArg when +** the collating function is deleted. +** ^Collating functions are deleted when they are overridden by later +** calls to the collation creation functions or when the +** [database connection] is closed using [sqlite3_close()]. ** ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. -** -** Requirements: -** [H16603] [H16604] [H16606] [H16609] [H16612] [H16615] [H16618] [H16621] -** [H16624] [H16627] [H16630] */ SQLITE_API int sqlite3_create_collation( sqlite3*, const char *zName, int eTextRep, - void*, + void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); SQLITE_API int sqlite3_create_collation_v2( sqlite3*, const char *zName, int eTextRep, - void*, + void *pArg, int(*xCompare)(void*,int,const void*,int,const void*), void(*xDestroy)(void*) ); @@ -3781,38 +4199,35 @@ SQLITE_API int sqlite3_create_collation16( sqlite3*, const void *zName, int eTextRep, - void*, + void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); /* -** CAPI3REF: Collation Needed Callbacks {H16700} +** CAPI3REF: Collation Needed Callbacks ** -** To avoid having to register all collation sequences before a database +** ^To avoid having to register all collation sequences before a database ** can be used, a single callback function may be registered with the -** [database connection] to be called whenever an undefined collation +** [database connection] to be invoked whenever an undefined collation ** sequence is required. ** -** If the function is registered using the sqlite3_collation_needed() API, +** ^If the function is registered using the sqlite3_collation_needed() API, ** then it is passed the names of undefined collation sequences as strings -** encoded in UTF-8. {H16703} If sqlite3_collation_needed16() is used, +** encoded in UTF-8. ^If sqlite3_collation_needed16() is used, ** the names are passed as UTF-16 in machine native byte order. -** A call to either function replaces any existing callback. +** ^A call to either function replaces the existing collation-needed callback. ** -** When the callback is invoked, the first argument passed is a copy +** ^(When the callback is invoked, the first argument passed is a copy ** of the second argument to sqlite3_collation_needed() or ** sqlite3_collation_needed16(). The second argument is the database ** connection. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE], ** or [SQLITE_UTF16LE], indicating the most desirable form of the collation ** sequence function required. The fourth parameter is the name of the -** required collation sequence. +** required collation sequence.)^ ** ** The callback function should register the desired collation using ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or ** [sqlite3_create_collation_v2()]. -** -** Requirements: -** [H16702] [H16704] [H16706] */ SQLITE_API int sqlite3_collation_needed( sqlite3*, @@ -3825,6 +4240,7 @@ SQLITE_API int sqlite3_collation_needed16( void(*)(void*,sqlite3*,int eTextRep,const void*) ); +#ifdef SQLITE_HAS_CODEC /* ** Specify the key for an encrypted database. This routine should be ** called right after sqlite3_open(). @@ -3851,7 +4267,26 @@ SQLITE_API int sqlite3_rekey( ); /* -** CAPI3REF: Suspend Execution For A Short Time {H10530} +** Specify the activation key for a SEE database. Unless +** activated, none of the SEE routines will work. +*/ +SQLITE_API void sqlite3_activate_see( + const char *zPassPhrase /* Activation phrase */ +); +#endif + +#ifdef SQLITE_ENABLE_CEROD +/* +** Specify the activation key for a CEROD database. Unless +** activated, none of the CEROD routines will work. +*/ +SQLITE_API void sqlite3_activate_cerod( + const char *zPassPhrase /* Activation phrase */ +); +#endif + +/* +** CAPI3REF: Suspend Execution For A Short Time ** ** The sqlite3_sleep() function causes the current thread to suspend execution ** for at least a number of milliseconds specified in its parameter. @@ -3861,19 +4296,21 @@ SQLITE_API int sqlite3_rekey( ** the nearest second. The number of milliseconds of sleep actually ** requested from the operating system is returned. ** -** SQLite implements this interface by calling the xSleep() -** method of the default [sqlite3_vfs] object. -** -** Requirements: [H10533] [H10536] +** ^SQLite implements this interface by calling the xSleep() +** method of the default [sqlite3_vfs] object. If the xSleep() method +** of the default VFS is not implemented correctly, or not implemented at +** all, then the behavior of sqlite3_sleep() may deviate from the description +** in the previous paragraphs. */ SQLITE_API int sqlite3_sleep(int); /* -** CAPI3REF: Name Of The Folder Holding Temporary Files {H10310} +** CAPI3REF: Name Of The Folder Holding Temporary Files ** -** If this global variable is made to point to a string which is +** ^(If this global variable is made to point to a string which is ** the name of a folder (a.k.a. directory), then all temporary files -** created by SQLite will be placed in that directory. If this variable +** created by SQLite when using a built-in [sqlite3_vfs | VFS] +** will be placed in that directory.)^ ^If this variable ** is a NULL pointer, then SQLite performs a search for an appropriate ** temporary file directory. ** @@ -3886,8 +4323,8 @@ SQLITE_API int sqlite3_sleep(int); ** routines have been called and that this variable remain unchanged ** thereafter. ** -** The [temp_store_directory pragma] may modify this variable and cause -** it to point to memory obtained from [sqlite3_malloc]. Furthermore, +** ^The [temp_store_directory pragma] may modify this variable and cause +** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, ** the [temp_store_directory pragma] always assumes that any string ** that this variable points to is held in memory obtained from ** [sqlite3_malloc] and the pragma may attempt to free that memory @@ -3899,14 +4336,14 @@ SQLITE_API int sqlite3_sleep(int); SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; /* -** CAPI3REF: Test For Auto-Commit Mode {H12930} +** CAPI3REF: Test For Auto-Commit Mode ** KEYWORDS: {autocommit mode} ** -** The sqlite3_get_autocommit() interface returns non-zero or +** ^The sqlite3_get_autocommit() interface returns non-zero or ** zero if the given database connection is or is not in autocommit mode, -** respectively. Autocommit mode is on by default. -** Autocommit mode is disabled by a [BEGIN] statement. -** Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK]. +** respectively. ^Autocommit mode is on by default. +** ^Autocommit mode is disabled by a [BEGIN] statement. +** ^Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK]. ** ** If certain kinds of errors occur on a statement within a multi-statement ** transaction (errors including [SQLITE_FULL], [SQLITE_IOERR], @@ -3918,58 +4355,55 @@ SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; ** If another thread changes the autocommit status of the database ** connection while this routine is running, then the return value ** is undefined. -** -** Requirements: [H12931] [H12932] [H12933] [H12934] */ SQLITE_API int sqlite3_get_autocommit(sqlite3*); /* -** CAPI3REF: Find The Database Handle Of A Prepared Statement {H13120} +** CAPI3REF: Find The Database Handle Of A Prepared Statement ** -** The sqlite3_db_handle interface returns the [database connection] handle -** to which a [prepared statement] belongs. The [database connection] -** returned by sqlite3_db_handle is the same [database connection] that was the first argument +** ^The sqlite3_db_handle interface returns the [database connection] handle +** to which a [prepared statement] belongs. ^The [database connection] +** returned by sqlite3_db_handle is the same [database connection] +** that was the first argument ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to ** create the statement in the first place. -** -** Requirements: [H13123] */ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); /* -** CAPI3REF: Find the next prepared statement {H13140} +** CAPI3REF: Find the next prepared statement ** -** This interface returns a pointer to the next [prepared statement] after -** pStmt associated with the [database connection] pDb. If pStmt is NULL +** ^This interface returns a pointer to the next [prepared statement] after +** pStmt associated with the [database connection] pDb. ^If pStmt is NULL ** then this interface returns a pointer to the first prepared statement -** associated with the database connection pDb. If no prepared statement +** associated with the database connection pDb. ^If no prepared statement ** satisfies the conditions of this routine, it returns NULL. ** ** The [database connection] pointer D in a call to ** [sqlite3_next_stmt(D,S)] must refer to an open database ** connection and in particular must not be a NULL pointer. -** -** Requirements: [H13143] [H13146] [H13149] [H13152] */ SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); /* -** CAPI3REF: Commit And Rollback Notification Callbacks {H12950} +** CAPI3REF: Commit And Rollback Notification Callbacks ** -** The sqlite3_commit_hook() interface registers a callback +** ^The sqlite3_commit_hook() interface registers a callback ** function to be invoked whenever a transaction is [COMMIT | committed]. -** Any callback set by a previous call to sqlite3_commit_hook() +** ^Any callback set by a previous call to sqlite3_commit_hook() ** for the same database connection is overridden. -** The sqlite3_rollback_hook() interface registers a callback +** ^The sqlite3_rollback_hook() interface registers a callback ** function to be invoked whenever a transaction is [ROLLBACK | rolled back]. -** Any callback set by a previous call to sqlite3_commit_hook() +** ^Any callback set by a previous call to sqlite3_rollback_hook() ** for the same database connection is overridden. -** The pArg argument is passed through to the callback. -** If the callback on a commit hook function returns non-zero, +** ^The pArg argument is passed through to the callback. +** ^If the callback on a commit hook function returns non-zero, ** then the commit is converted into a rollback. ** -** If another function was previously registered, its -** pArg value is returned. Otherwise NULL is returned. +** ^The sqlite3_commit_hook(D,C,P) and sqlite3_rollback_hook(D,C,P) functions +** return the P argument from the previous call of the same function +** on the same [database connection] D, or NULL for +** the first call for each function on D. ** ** The callback implementation must not do anything that will modify ** the database connection that invoked the callback. Any actions @@ -3979,59 +4413,52 @@ SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their ** database connections for the meaning of "modify" in this paragraph. ** -** Registering a NULL function disables the callback. +** ^Registering a NULL function disables the callback. ** -** When the commit hook callback routine returns zero, the [COMMIT] -** operation is allowed to continue normally. If the commit hook +** ^When the commit hook callback routine returns zero, the [COMMIT] +** operation is allowed to continue normally. ^If the commit hook ** returns non-zero, then the [COMMIT] is converted into a [ROLLBACK]. -** The rollback hook is invoked on a rollback that results from a commit +** ^The rollback hook is invoked on a rollback that results from a commit ** hook returning non-zero, just as it would be with any other rollback. ** -** For the purposes of this API, a transaction is said to have been +** ^For the purposes of this API, a transaction is said to have been ** rolled back if an explicit "ROLLBACK" statement is executed, or ** an error or constraint causes an implicit rollback to occur. -** The rollback callback is not invoked if a transaction is +** ^The rollback callback is not invoked if a transaction is ** automatically rolled back because the database connection is closed. -** The rollback callback is not invoked if a transaction is -** rolled back because a commit callback returned non-zero. -** Check on this ** ** See also the [sqlite3_update_hook()] interface. -** -** Requirements: -** [H12951] [H12952] [H12953] [H12954] [H12955] -** [H12961] [H12962] [H12963] [H12964] */ SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); /* -** CAPI3REF: Data Change Notification Callbacks {H12970} +** CAPI3REF: Data Change Notification Callbacks ** -** The sqlite3_update_hook() interface registers a callback function +** ^The sqlite3_update_hook() interface registers a callback function ** with the [database connection] identified by the first argument ** to be invoked whenever a row is updated, inserted or deleted. -** Any callback set by a previous call to this function +** ^Any callback set by a previous call to this function ** for the same database connection is overridden. ** -** The second argument is a pointer to the function to invoke when a +** ^The second argument is a pointer to the function to invoke when a ** row is updated, inserted or deleted. -** The first argument to the callback is a copy of the third argument +** ^The first argument to the callback is a copy of the third argument ** to sqlite3_update_hook(). -** The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], +** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], ** or [SQLITE_UPDATE], depending on the operation that caused the callback ** to be invoked. -** The third and fourth arguments to the callback contain pointers to the +** ^The third and fourth arguments to the callback contain pointers to the ** database and table name containing the affected row. -** The final callback parameter is the [rowid] of the row. -** In the case of an update, this is the [rowid] after the update takes place. +** ^The final callback parameter is the [rowid] of the row. +** ^In the case of an update, this is the [rowid] after the update takes place. ** -** The update hook is not invoked when internal system tables are -** modified (i.e. sqlite_master and sqlite_sequence). +** ^(The update hook is not invoked when internal system tables are +** modified (i.e. sqlite_master and sqlite_sequence).)^ ** -** In the current implementation, the update hook +** ^In the current implementation, the update hook ** is not invoked when duplication rows are deleted because of an -** [ON CONFLICT | ON CONFLICT REPLACE] clause. Nor is the update hook +** [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook ** invoked when rows are deleted using the [truncate optimization]. ** The exceptions defined in this paragraph might change in a future ** release of SQLite. @@ -4043,14 +4470,13 @@ SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their ** database connections for the meaning of "modify" in this paragraph. ** -** If another function was previously registered, its pArg value -** is returned. Otherwise NULL is returned. +** ^The sqlite3_update_hook(D,C,P) function +** returns the P argument from the previous call +** on the same [database connection] D, or NULL for +** the first call on D. ** ** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()] ** interfaces. -** -** Requirements: -** [H12971] [H12973] [H12975] [H12977] [H12979] [H12981] [H12983] [H12986] */ SQLITE_API void *sqlite3_update_hook( sqlite3*, @@ -4059,112 +4485,134 @@ SQLITE_API void *sqlite3_update_hook( ); /* -** CAPI3REF: Enable Or Disable Shared Pager Cache {H10330} +** CAPI3REF: Enable Or Disable Shared Pager Cache ** KEYWORDS: {shared cache} ** -** This routine enables or disables the sharing of the database cache +** ^(This routine enables or disables the sharing of the database cache ** and schema data structures between [database connection | connections] ** to the same database. Sharing is enabled if the argument is true -** and disabled if the argument is false. +** and disabled if the argument is false.)^ ** -** Cache sharing is enabled and disabled for an entire process. +** ^Cache sharing is enabled and disabled for an entire process. ** This is a change as of SQLite version 3.5.0. In prior versions of SQLite, ** sharing was enabled or disabled for each thread separately. ** -** The cache sharing mode set by this interface effects all subsequent +** ^(The cache sharing mode set by this interface effects all subsequent ** calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()]. ** Existing database connections continue use the sharing mode -** that was in effect at the time they were opened. +** that was in effect at the time they were opened.)^ ** -** Virtual tables cannot be used with a shared cache. When shared -** cache is enabled, the [sqlite3_create_module()] API used to register -** virtual tables will always return an error. +** ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled +** successfully. An [error code] is returned otherwise.)^ ** -** This routine returns [SQLITE_OK] if shared cache was enabled or disabled -** successfully. An [error code] is returned otherwise. -** -** Shared cache is disabled by default. But this might change in +** ^Shared cache is disabled by default. But this might change in ** future releases of SQLite. Applications that care about shared ** cache setting should set it explicitly. ** ** See Also: [SQLite Shared-Cache Mode] -** -** Requirements: [H10331] [H10336] [H10337] [H10339] */ SQLITE_API int sqlite3_enable_shared_cache(int); /* -** CAPI3REF: Attempt To Free Heap Memory {H17340} +** CAPI3REF: Attempt To Free Heap Memory ** -** The sqlite3_release_memory() interface attempts to free N bytes +** ^The sqlite3_release_memory() interface attempts to free N bytes ** of heap memory by deallocating non-essential memory allocations -** held by the database library. {END} Memory used to cache database +** held by the database library. Memory used to cache database ** pages to improve performance is an example of non-essential memory. -** sqlite3_release_memory() returns the number of bytes actually freed, +** ^sqlite3_release_memory() returns the number of bytes actually freed, ** which might be more or less than the amount requested. -** -** Requirements: [H17341] [H17342] +** ^The sqlite3_release_memory() routine is a no-op returning zero +** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. */ SQLITE_API int sqlite3_release_memory(int); /* -** CAPI3REF: Impose A Limit On Heap Size {H17350} +** CAPI3REF: Impose A Limit On Heap Size ** -** The sqlite3_soft_heap_limit() interface places a "soft" limit -** on the amount of heap memory that may be allocated by SQLite. -** If an internal allocation is requested that would exceed the -** soft heap limit, [sqlite3_release_memory()] is invoked one or -** more times to free up some space before the allocation is performed. +** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the +** soft limit on the amount of heap memory that may be allocated by SQLite. +** ^SQLite strives to keep heap memory utilization below the soft heap +** limit by reducing the number of pages held in the page cache +** as heap memory usages approaches the limit. +** ^The soft heap limit is "soft" because even though SQLite strives to stay +** below the limit, it will exceed the limit rather than generate +** an [SQLITE_NOMEM] error. In other words, the soft heap limit +** is advisory only. ** -** The limit is called "soft", because if [sqlite3_release_memory()] -** cannot free sufficient memory to prevent the limit from being exceeded, -** the memory is allocated anyway and the current operation proceeds. +** ^The return value from sqlite3_soft_heap_limit64() is the size of +** the soft heap limit prior to the call. ^If the argument N is negative +** then no change is made to the soft heap limit. Hence, the current +** size of the soft heap limit can be determined by invoking +** sqlite3_soft_heap_limit64() with a negative argument. ** -** A negative or zero value for N means that there is no soft heap limit and -** [sqlite3_release_memory()] will only be called when memory is exhausted. -** The default value for the soft heap limit is zero. +** ^If the argument N is zero then the soft heap limit is disabled. ** -** SQLite makes a best effort to honor the soft heap limit. -** But if the soft heap limit cannot be honored, execution will -** continue without error or notification. This is why the limit is -** called a "soft" limit. It is advisory only. +** ^(The soft heap limit is not enforced in the current implementation +** if one or more of following conditions are true: ** -** Prior to SQLite version 3.5.0, this routine only constrained the memory -** allocated by a single thread - the same thread in which this routine -** runs. Beginning with SQLite version 3.5.0, the soft heap limit is -** applied to all threads. The value specified for the soft heap limit -** is an upper bound on the total memory allocation for all threads. In -** version 3.5.0 there is no mechanism for limiting the heap usage for -** individual threads. +**
      +**
    • The soft heap limit is set to zero. +**
    • Memory accounting is disabled using a combination of the +** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and +** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. +**
    • An alternative page cache implementation is specifed using +** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...). +**
    • The page cache allocates from its own memory pool supplied +** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than +** from the heap. +**
    )^ ** -** Requirements: -** [H16351] [H16352] [H16353] [H16354] [H16355] [H16358] +** Beginning with SQLite version 3.7.3, the soft heap limit is enforced +** regardless of whether or not the [SQLITE_ENABLE_MEMORY_MANAGEMENT] +** compile-time option is invoked. With [SQLITE_ENABLE_MEMORY_MANAGEMENT], +** the soft heap limit is enforced on every memory allocation. Without +** [SQLITE_ENABLE_MEMORY_MANAGEMENT], the soft heap limit is only enforced +** when memory is allocated by the page cache. Testing suggests that because +** the page cache is the predominate memory user in SQLite, most +** applications will achieve adequate soft heap limit enforcement without +** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. +** +** The circumstances under which SQLite will enforce the soft heap limit may +** changes in future releases of SQLite. */ -SQLITE_API void sqlite3_soft_heap_limit(int); +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); /* -** CAPI3REF: Extract Metadata About A Column Of A Table {H12850} +** CAPI3REF: Deprecated Soft Heap Limit Interface +** DEPRECATED ** -** This routine returns metadata about a specific column of a specific +** This is a deprecated version of the [sqlite3_soft_heap_limit64()] +** interface. This routine is provided for historical compatibility +** only. All new applications should use the +** [sqlite3_soft_heap_limit64()] interface rather than this one. +*/ +SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); + + +/* +** CAPI3REF: Extract Metadata About A Column Of A Table +** +** ^This routine returns metadata about a specific column of a specific ** database table accessible using the [database connection] handle ** passed as the first function argument. ** -** The column is identified by the second, third and fourth parameters to -** this function. The second parameter is either the name of the database -** (i.e. "main", "temp" or an attached database) containing the specified -** table or NULL. If it is NULL, then all attached databases are searched +** ^The column is identified by the second, third and fourth parameters to +** this function. ^The second parameter is either the name of the database +** (i.e. "main", "temp", or an attached database) containing the specified +** table or NULL. ^If it is NULL, then all attached databases are searched ** for the table using the same algorithm used by the database engine to ** resolve unqualified table references. ** -** The third and fourth parameters to this function are the table and column +** ^The third and fourth parameters to this function are the table and column ** name of the desired column, respectively. Neither of these parameters ** may be NULL. ** -** Metadata is returned by writing to the memory locations passed as the 5th -** and subsequent parameters to this function. Any of these arguments may be +** ^Metadata is returned by writing to the memory locations passed as the 5th +** and subsequent parameters to this function. ^Any of these arguments may be ** NULL, in which case the corresponding element of metadata is omitted. ** -**
    +** ^(
    ** **
    Parameter Output
    Type
    Description ** @@ -4174,17 +4622,17 @@ SQLITE_API void sqlite3_soft_heap_limit(int); **
    8th int True if column is part of the PRIMARY KEY **
    9th int True if column is [AUTOINCREMENT] **
    -**
    +**
    )^ ** -** The memory pointed to by the character pointers returned for the +** ^The memory pointed to by the character pointers returned for the ** declaration type and collation sequence is valid only until the next ** call to any SQLite API function. ** -** If the specified table is actually a view, an [error code] is returned. +** ^If the specified table is actually a view, an [error code] is returned. ** -** If the specified column is "rowid", "oid" or "_rowid_" and an +** ^If the specified column is "rowid", "oid" or "_rowid_" and an ** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output -** parameters are set for the explicitly declared column. If there is no +** parameters are set for the explicitly declared column. ^(If there is no ** explicitly declared [INTEGER PRIMARY KEY] column, then the output ** parameters are set as follows: ** @@ -4194,14 +4642,14 @@ SQLITE_API void sqlite3_soft_heap_limit(int); ** not null: 0 ** primary key: 1 ** auto increment: 0 -** +** )^ ** -** This function may load one or more schemas from database files. If an +** ^(This function may load one or more schemas from database files. If an ** error occurs during this process, or if the requested table or column ** cannot be found, an [error code] is returned and an error message left -** in the [database connection] (to be retrieved using sqlite3_errmsg()). +** in the [database connection] (to be retrieved using sqlite3_errmsg()).)^ ** -** This API is only available if the library was compiled with the +** ^This API is only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined. */ SQLITE_API int sqlite3_table_column_metadata( @@ -4217,30 +4665,29 @@ SQLITE_API int sqlite3_table_column_metadata( ); /* -** CAPI3REF: Load An Extension {H12600} +** CAPI3REF: Load An Extension ** -** This interface loads an SQLite extension library from the named file. +** ^This interface loads an SQLite extension library from the named file. ** -** {H12601} The sqlite3_load_extension() interface attempts to load an -** SQLite extension library contained in the file zFile. +** ^The sqlite3_load_extension() interface attempts to load an +** SQLite extension library contained in the file zFile. ** -** {H12602} The entry point is zProc. +** ^The entry point is zProc. +** ^zProc may be 0, in which case the name of the entry point +** defaults to "sqlite3_extension_init". +** ^The sqlite3_load_extension() interface returns +** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. +** ^If an error occurs and pzErrMsg is not 0, then the +** [sqlite3_load_extension()] interface shall attempt to +** fill *pzErrMsg with error message text stored in memory +** obtained from [sqlite3_malloc()]. The calling function +** should free this memory by calling [sqlite3_free()]. ** -** {H12603} zProc may be 0, in which case the name of the entry point -** defaults to "sqlite3_extension_init". +** ^Extension loading must be enabled using +** [sqlite3_enable_load_extension()] prior to calling this API, +** otherwise an error will be returned. ** -** {H12604} The sqlite3_load_extension() interface shall return -** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. -** -** {H12605} If an error occurs and pzErrMsg is not 0, then the -** [sqlite3_load_extension()] interface shall attempt to -** fill *pzErrMsg with error message text stored in memory -** obtained from [sqlite3_malloc()]. {END} The calling function -** should free this memory by calling [sqlite3_free()]. -** -** {H12606} Extension loading must be enabled using -** [sqlite3_enable_load_extension()] prior to calling this API, -** otherwise an error will be returned. +** See also the [load_extension() SQL function]. */ SQLITE_API int sqlite3_load_extension( sqlite3 *db, /* Load the extension into this database connection */ @@ -4250,67 +4697,66 @@ SQLITE_API int sqlite3_load_extension( ); /* -** CAPI3REF: Enable Or Disable Extension Loading {H12620} +** CAPI3REF: Enable Or Disable Extension Loading ** -** So as not to open security holes in older applications that are +** ^So as not to open security holes in older applications that are ** unprepared to deal with extension loading, and as a means of disabling ** extension loading while evaluating user-entered SQL, the following API ** is provided to turn the [sqlite3_load_extension()] mechanism on and off. ** -** Extension loading is off by default. See ticket #1863. -** -** {H12621} Call the sqlite3_enable_load_extension() routine with onoff==1 -** to turn extension loading on and call it with onoff==0 to turn -** it back off again. -** -** {H12622} Extension loading is off by default. +** ^Extension loading is off by default. See ticket #1863. +** ^Call the sqlite3_enable_load_extension() routine with onoff==1 +** to turn extension loading on and call it with onoff==0 to turn +** it back off again. */ SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff); /* -** CAPI3REF: Automatically Load An Extensions {H12640} +** CAPI3REF: Automatically Load Statically Linked Extensions ** -** This API can be invoked at program startup in order to register -** one or more statically linked extensions that will be available -** to all new [database connections]. {END} +** ^This interface causes the xEntryPoint() function to be invoked for +** each new [database connection] that is created. The idea here is that +** xEntryPoint() is the entry point for a statically linked SQLite extension +** that is to be automatically loaded into all new database connections. ** -** This routine stores a pointer to the extension in an array that is -** obtained from [sqlite3_malloc()]. If you run a memory leak checker -** on your program and it reports a leak because of this array, invoke -** [sqlite3_reset_auto_extension()] prior to shutdown to free the memory. +** ^(Even though the function prototype shows that xEntryPoint() takes +** no arguments and returns void, SQLite invokes xEntryPoint() with three +** arguments and expects and integer result as if the signature of the +** entry point where as follows: ** -** {H12641} This function registers an extension entry point that is -** automatically invoked whenever a new [database connection] -** is opened using [sqlite3_open()], [sqlite3_open16()], -** or [sqlite3_open_v2()]. +**
    +**    int xEntryPoint(
    +**      sqlite3 *db,
    +**      const char **pzErrMsg,
    +**      const struct sqlite3_api_routines *pThunk
    +**    );
    +** 
    )^ ** -** {H12642} Duplicate extensions are detected so calling this routine -** multiple times with the same extension is harmless. +** If the xEntryPoint routine encounters an error, it should make *pzErrMsg +** point to an appropriate error message (obtained from [sqlite3_mprintf()]) +** and return an appropriate [error code]. ^SQLite ensures that *pzErrMsg +** is NULL before calling the xEntryPoint(). ^SQLite will invoke +** [sqlite3_free()] on *pzErrMsg after xEntryPoint() returns. ^If any +** xEntryPoint() returns an error, the [sqlite3_open()], [sqlite3_open16()], +** or [sqlite3_open_v2()] call that provoked the xEntryPoint() will fail. ** -** {H12643} This routine stores a pointer to the extension in an array -** that is obtained from [sqlite3_malloc()]. +** ^Calling sqlite3_auto_extension(X) with an entry point X that is already +** on the list of automatic extensions is a harmless no-op. ^No entry point +** will be called more than once for each database connection that is opened. ** -** {H12644} Automatic extensions apply across all threads. +** See also: [sqlite3_reset_auto_extension()]. */ SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void)); /* -** CAPI3REF: Reset Automatic Extension Loading {H12660} +** CAPI3REF: Reset Automatic Extension Loading ** -** This function disables all previously registered automatic -** extensions. {END} It undoes the effect of all prior -** [sqlite3_auto_extension()] calls. -** -** {H12661} This function disables all previously registered -** automatic extensions. -** -** {H12662} This function disables automatic extensions in all threads. +** ^This interface disables all automatic extensions previously +** registered using [sqlite3_auto_extension()]. */ SQLITE_API void sqlite3_reset_auto_extension(void); /* -****** EXPERIMENTAL - subject to change without notice ************** -** ** The interface to the virtual-table mechanism is currently considered ** to be experimental. The interface might change in incompatible ways. ** If this is a problem for you, do not use the interface at this time. @@ -4328,18 +4774,17 @@ typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor; typedef struct sqlite3_module sqlite3_module; /* -** CAPI3REF: Virtual Table Object {H18000} +** CAPI3REF: Virtual Table Object ** KEYWORDS: sqlite3_module {virtual table module} -** EXPERIMENTAL ** ** This structure, sometimes called a a "virtual table module", ** defines the implementation of a [virtual tables]. ** This structure consists mostly of methods for the module. ** -** A virtual table module is created by filling in a persistent +** ^A virtual table module is created by filling in a persistent ** instance of this structure and passing a pointer to that instance ** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** The registration remains valid until it is replaced by a different +** ^The registration remains valid until it is replaced by a different ** module or until the [database connection] closes. The content ** of this structure must not change while it is registered with ** any database connection. @@ -4375,52 +4820,54 @@ struct sqlite3_module { }; /* -** CAPI3REF: Virtual Table Indexing Information {H18100} +** CAPI3REF: Virtual Table Indexing Information ** KEYWORDS: sqlite3_index_info -** EXPERIMENTAL ** -** The sqlite3_index_info structure and its substructures is used to +** The sqlite3_index_info structure and its substructures is used as part +** of the [virtual table] interface to ** pass information into and receive the reply from the [xBestIndex] ** method of a [virtual table module]. The fields under **Inputs** are the ** inputs to xBestIndex and are read-only. xBestIndex inserts its ** results into the **Outputs** fields. ** -** The aConstraint[] array records WHERE clause constraints of the form: +** ^(The aConstraint[] array records WHERE clause constraints of the form: ** -**
    column OP expr
    +**
    column OP expr
    ** -** where OP is =, <, <=, >, or >=. The particular operator is -** stored in aConstraint[].op. The index of the column is stored in -** aConstraint[].iColumn. aConstraint[].usable is TRUE if the +** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is +** stored in aConstraint[].op using one of the +** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ +** ^(The index of the column is stored in +** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the ** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot. +** is usable) and false if it cannot.)^ ** -** The optimizer automatically inverts terms of the form "expr OP column" +** ^The optimizer automatically inverts terms of the form "expr OP column" ** and makes other simplifications to the WHERE clause in an attempt to ** get as many WHERE clause terms into the form shown above as possible. -** The aConstraint[] array only reports WHERE clause terms in the correct -** form that refer to the particular virtual table being queried. +** ^The aConstraint[] array only reports WHERE clause terms that are +** relevant to the particular virtual table being queried. ** -** Information about the ORDER BY clause is stored in aOrderBy[]. -** Each term of aOrderBy records a column of the ORDER BY clause. +** ^Information about the ORDER BY clause is stored in aOrderBy[]. +** ^Each term of aOrderBy records a column of the ORDER BY clause. ** ** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. If argvIndex>0 then +** about what parameters to pass to xFilter. ^If argvIndex>0 then ** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. If aConstraintUsage[].omit +** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit ** is true, then the constraint is assumed to be fully handled by the -** virtual table and is not checked again by SQLite. +** virtual table and is not checked again by SQLite.)^ ** -** The idxNum and idxPtr values are recorded and passed into the +** ^The idxNum and idxPtr values are recorded and passed into the ** [xFilter] method. -** [sqlite3_free()] is used to free idxPtr if and only iff +** ^[sqlite3_free()] is used to free idxPtr if and only if ** needToFreeIdxPtr is true. ** -** The orderByConsumed means that output from [xFilter]/[xNext] will occur in +** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in ** the correct order to satisfy the ORDER BY clause so that no separate ** sorting step is required. ** -** The estimatedCost value is an estimate of the cost of doing the +** ^The estimatedCost value is an estimate of the cost of doing the ** particular lookup. A full scan of a table with N entries should have ** a cost of N. A binary search of a table of N entries should have a ** cost of approximately log(N). @@ -4450,6 +4897,15 @@ struct sqlite3_index_info { int orderByConsumed; /* True if output is already ordered */ double estimatedCost; /* Estimated cost of using this index */ }; + +/* +** CAPI3REF: Virtual Table Constraint Operator Codes +** +** These macros defined the allowed values for the +** [sqlite3_index_info].aConstraint[].op field. Each value represents +** an operator that is part of a constraint term in the wHERE clause of +** a query that uses a [virtual table]. +*/ #define SQLITE_INDEX_CONSTRAINT_EQ 2 #define SQLITE_INDEX_CONSTRAINT_GT 4 #define SQLITE_INDEX_CONSTRAINT_LE 8 @@ -4458,43 +4914,35 @@ struct sqlite3_index_info { #define SQLITE_INDEX_CONSTRAINT_MATCH 64 /* -** CAPI3REF: Register A Virtual Table Implementation {H18200} -** EXPERIMENTAL +** CAPI3REF: Register A Virtual Table Implementation ** -** This routine is used to register a new [virtual table module] name. -** Module names must be registered before -** creating a new [virtual table] using the module, or before using a +** ^These routines are used to register a new [virtual table module] name. +** ^Module names must be registered before +** creating a new [virtual table] using the module and before using a ** preexisting [virtual table] for the module. ** -** The module name is registered on the [database connection] specified -** by the first parameter. The name of the module is given by the -** second parameter. The third parameter is a pointer to -** the implementation of the [virtual table module]. The fourth +** ^The module name is registered on the [database connection] specified +** by the first parameter. ^The name of the module is given by the +** second parameter. ^The third parameter is a pointer to +** the implementation of the [virtual table module]. ^The fourth ** parameter is an arbitrary client data pointer that is passed through ** into the [xCreate] and [xConnect] methods of the virtual table module ** when a new virtual table is be being created or reinitialized. ** -** This interface has exactly the same effect as calling -** [sqlite3_create_module_v2()] with a NULL client data destructor. +** ^The sqlite3_create_module_v2() interface has a fifth parameter which +** is a pointer to a destructor for the pClientData. ^SQLite will +** invoke the destructor function (if it is not NULL) when SQLite +** no longer needs the pClientData pointer. ^The sqlite3_create_module() +** interface is equivalent to sqlite3_create_module_v2() with a NULL +** destructor. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_create_module( +SQLITE_API int sqlite3_create_module( sqlite3 *db, /* SQLite connection to register module with */ const char *zName, /* Name of the module */ const sqlite3_module *p, /* Methods for the module */ void *pClientData /* Client data for xCreate/xConnect */ ); - -/* -** CAPI3REF: Register A Virtual Table Implementation {H18210} -** EXPERIMENTAL -** -** This routine is identical to the [sqlite3_create_module()] method, -** except that it has an extra parameter to specify -** a destructor function for the client data pointer. SQLite will -** invoke the destructor function (if it is not NULL) when SQLite -** no longer needs the pClientData pointer. -*/ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_create_module_v2( +SQLITE_API int sqlite3_create_module_v2( sqlite3 *db, /* SQLite connection to register module with */ const char *zName, /* Name of the module */ const sqlite3_module *p, /* Methods for the module */ @@ -4503,21 +4951,20 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_create_module_v2( ); /* -** CAPI3REF: Virtual Table Instance Object {H18010} +** CAPI3REF: Virtual Table Instance Object ** KEYWORDS: sqlite3_vtab -** EXPERIMENTAL ** ** Every [virtual table module] implementation uses a subclass -** of the following structure to describe a particular instance +** of this object to describe a particular instance ** of the [virtual table]. Each subclass will ** be tailored to the specific needs of the module implementation. ** The purpose of this superclass is to define certain fields that are ** common to all module implementations. ** -** Virtual tables methods can set an error message by assigning a +** ^Virtual tables methods can set an error message by assigning a ** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should ** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. After the error message +** prior to assigning a new string to zErrMsg. ^After the error message ** is delivered up to the client application, the string will be automatically ** freed by sqlite3_free() and the zErrMsg field will be zeroed. */ @@ -4529,16 +4976,15 @@ struct sqlite3_vtab { }; /* -** CAPI3REF: Virtual Table Cursor Object {H18020} +** CAPI3REF: Virtual Table Cursor Object ** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** EXPERIMENTAL ** ** Every [virtual table module] implementation uses a subclass of the ** following structure to describe cursors that point into the ** [virtual table] and are used ** to loop through the virtual table. Cursors are created using the ** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cussors are used +** by the [sqlite3_module.xClose | xClose] method. Cursors are used ** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods ** of the module. Each module implementation will define ** the content of a cursor structure to suit its own needs. @@ -4552,34 +4998,32 @@ struct sqlite3_vtab_cursor { }; /* -** CAPI3REF: Declare The Schema Of A Virtual Table {H18280} -** EXPERIMENTAL +** CAPI3REF: Declare The Schema Of A Virtual Table ** -** The [xCreate] and [xConnect] methods of a +** ^The [xCreate] and [xConnect] methods of a ** [virtual table module] call this interface ** to declare the format (the names and datatypes of the columns) of ** the virtual tables they implement. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_declare_vtab(sqlite3*, const char *zSQL); +SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL); /* -** CAPI3REF: Overload A Function For A Virtual Table {H18300} -** EXPERIMENTAL +** CAPI3REF: Overload A Function For A Virtual Table ** -** Virtual tables can provide alternative implementations of functions +** ^(Virtual tables can provide alternative implementations of functions ** using the [xFindFunction] method of the [virtual table module]. ** But global versions of those functions -** must exist in order to be overloaded. +** must exist in order to be overloaded.)^ ** -** This API makes sure a global version of a function with a particular +** ^(This API makes sure a global version of a function with a particular ** name and number of parameters exists. If no such function exists -** before this API is called, a new function is created. The implementation +** before this API is called, a new function is created.)^ ^The implementation ** of the new function always causes an exception to be thrown. So ** the new function is not good for anything by itself. Its only ** purpose is to be a placeholder function that can be overloaded ** by a [virtual table]. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); +SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); /* ** The interface to the virtual-table mechanism defined above (back up @@ -4589,82 +5033,77 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_overload_function(sqlite3*, const cha ** ** When the virtual-table mechanism stabilizes, we will declare the ** interface fixed, support it indefinitely, and remove this comment. -** -****** EXPERIMENTAL - subject to change without notice ************** */ /* -** CAPI3REF: A Handle To An Open BLOB {H17800} +** CAPI3REF: A Handle To An Open BLOB ** KEYWORDS: {BLOB handle} {BLOB handles} ** ** An instance of this object represents an open BLOB on which ** [sqlite3_blob_open | incremental BLOB I/O] can be performed. -** Objects of this type are created by [sqlite3_blob_open()] +** ^Objects of this type are created by [sqlite3_blob_open()] ** and destroyed by [sqlite3_blob_close()]. -** The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces +** ^The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces ** can be used to read or write small subsections of the BLOB. -** The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes. +** ^The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes. */ typedef struct sqlite3_blob sqlite3_blob; /* -** CAPI3REF: Open A BLOB For Incremental I/O {H17810} +** CAPI3REF: Open A BLOB For Incremental I/O ** -** This interfaces opens a [BLOB handle | handle] to the BLOB located +** ^(This interfaces opens a [BLOB handle | handle] to the BLOB located ** in row iRow, column zColumn, table zTable in database zDb; ** in other words, the same BLOB that would be selected by: ** **
     **     SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
    -** 
    {END} +** )^ ** -** If the flags parameter is non-zero, then the BLOB is opened for read -** and write access. If it is zero, the BLOB is opened for read access. -** It is not possible to open a column that is part of an index or primary +** ^If the flags parameter is non-zero, then the BLOB is opened for read +** and write access. ^If it is zero, the BLOB is opened for read access. +** ^It is not possible to open a column that is part of an index or primary ** key for writing. ^If [foreign key constraints] are enabled, it is ** not possible to open a column that is part of a [child key] for writing. ** -** Note that the database name is not the filename that contains +** ^Note that the database name is not the filename that contains ** the database but rather the symbolic name of the database that -** is assigned when the database is connected using [ATTACH]. -** For the main database file, the database name is "main". -** For TEMP tables, the database name is "temp". +** appears after the AS keyword when the database is connected using [ATTACH]. +** ^For the main database file, the database name is "main". +** ^For TEMP tables, the database name is "temp". ** -** On success, [SQLITE_OK] is returned and the new [BLOB handle] is written +** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is written ** to *ppBlob. Otherwise an [error code] is returned and *ppBlob is set -** to be a null pointer. -** This function sets the [database connection] error code and message +** to be a null pointer.)^ +** ^This function sets the [database connection] error code and message ** accessible via [sqlite3_errcode()] and [sqlite3_errmsg()] and related -** functions. Note that the *ppBlob variable is always initialized in a +** functions. ^Note that the *ppBlob variable is always initialized in a ** way that makes it safe to invoke [sqlite3_blob_close()] on *ppBlob ** regardless of the success or failure of this routine. ** -** If the row that a BLOB handle points to is modified by an +** ^(If the row that a BLOB handle points to is modified by an ** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects ** then the BLOB handle is marked as "expired". ** This is true if any column of the row is changed, even a column -** other than the one the BLOB handle is open on. -** Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for +** other than the one the BLOB handle is open on.)^ +** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for ** a expired BLOB handle fail with an return code of [SQLITE_ABORT]. -** Changes written into a BLOB prior to the BLOB expiring are not -** rollback by the expiration of the BLOB. Such changes will eventually -** commit if the transaction continues to completion. +** ^(Changes written into a BLOB prior to the BLOB expiring are not +** rolled back by the expiration of the BLOB. Such changes will eventually +** commit if the transaction continues to completion.)^ ** -** Use the [sqlite3_blob_bytes()] interface to determine the size of -** the opened blob. The size of a blob may not be changed by this +** ^Use the [sqlite3_blob_bytes()] interface to determine the size of +** the opened blob. ^The size of a blob may not be changed by this ** interface. Use the [UPDATE] SQL command to change the size of a ** blob. ** -** The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces +** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces ** and the built-in [zeroblob] SQL function can be used, if desired, ** to create an empty, zero-filled blob in which to read or write using ** this interface. ** ** To avoid a resource leak, every open [BLOB handle] should eventually ** be released by a call to [sqlite3_blob_close()]. -** -** Requirements: -** [H17813] [H17814] [H17816] [H17819] [H17821] [H17824] */ SQLITE_API int sqlite3_blob_open( sqlite3*, @@ -4677,37 +5116,34 @@ SQLITE_API int sqlite3_blob_open( ); /* -** CAPI3REF: Close A BLOB Handle {H17830} +** CAPI3REF: Close A BLOB Handle ** -** Closes an open [BLOB handle]. +** ^Closes an open [BLOB handle]. ** -** Closing a BLOB shall cause the current transaction to commit +** ^Closing a BLOB shall cause the current transaction to commit ** if there are no other BLOBs, no pending prepared statements, and the ** database connection is in [autocommit mode]. -** If any writes were made to the BLOB, they might be held in cache +** ^If any writes were made to the BLOB, they might be held in cache ** until the close operation if they will fit. ** -** Closing the BLOB often forces the changes +** ^(Closing the BLOB often forces the changes ** out to disk and so if any I/O errors occur, they will likely occur ** at the time when the BLOB is closed. Any errors that occur during -** closing are reported as a non-zero return value. +** closing are reported as a non-zero return value.)^ ** -** The BLOB is closed unconditionally. Even if this routine returns -** an error code, the BLOB is still closed. +** ^(The BLOB is closed unconditionally. Even if this routine returns +** an error code, the BLOB is still closed.)^ ** -** Calling this routine with a null pointer (which as would be returned -** by failed call to [sqlite3_blob_open()]) is a harmless no-op. -** -** Requirements: -** [H17833] [H17836] [H17839] +** ^Calling this routine with a null pointer (such as would be returned +** by a failed call to [sqlite3_blob_open()]) is a harmless no-op. */ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); /* -** CAPI3REF: Return The Size Of An Open BLOB {H17840} +** CAPI3REF: Return The Size Of An Open BLOB ** -** Returns the size in bytes of the BLOB accessible via the -** successfully opened [BLOB handle] in its only argument. The +** ^Returns the size in bytes of the BLOB accessible via the +** successfully opened [BLOB handle] in its only argument. ^The ** incremental blob I/O routines can only read or overwriting existing ** blob content; they cannot change the size of a blob. ** @@ -4715,30 +5151,27 @@ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); ** by a prior successful call to [sqlite3_blob_open()] and which has not ** been closed by [sqlite3_blob_close()]. Passing any other pointer in ** to this routine results in undefined and probably undesirable behavior. -** -** Requirements: -** [H17843] */ SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *); /* -** CAPI3REF: Read Data From A BLOB Incrementally {H17850} +** CAPI3REF: Read Data From A BLOB Incrementally ** -** This function is used to read data from an open [BLOB handle] into a +** ^(This function is used to read data from an open [BLOB handle] into a ** caller-supplied buffer. N bytes of data are copied into buffer Z -** from the open BLOB, starting at offset iOffset. +** from the open BLOB, starting at offset iOffset.)^ ** -** If offset iOffset is less than N bytes from the end of the BLOB, -** [SQLITE_ERROR] is returned and no data is read. If N or iOffset is +** ^If offset iOffset is less than N bytes from the end of the BLOB, +** [SQLITE_ERROR] is returned and no data is read. ^If N or iOffset is ** less than zero, [SQLITE_ERROR] is returned and no data is read. -** The size of the blob (and hence the maximum value of N+iOffset) +** ^The size of the blob (and hence the maximum value of N+iOffset) ** can be determined using the [sqlite3_blob_bytes()] interface. ** -** An attempt to read from an expired [BLOB handle] fails with an +** ^An attempt to read from an expired [BLOB handle] fails with an ** error code of [SQLITE_ABORT]. ** -** On success, SQLITE_OK is returned. -** Otherwise, an [error code] or an [extended error code] is returned. +** ^(On success, sqlite3_blob_read() returns SQLITE_OK. +** Otherwise, an [error code] or an [extended error code] is returned.)^ ** ** This routine only works on a [BLOB handle] which has been created ** by a prior successful call to [sqlite3_blob_open()] and which has not @@ -4746,40 +5179,37 @@ SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *); ** to this routine results in undefined and probably undesirable behavior. ** ** See also: [sqlite3_blob_write()]. -** -** Requirements: -** [H17853] [H17856] [H17859] [H17862] [H17863] [H17865] [H17868] */ SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); /* -** CAPI3REF: Write Data Into A BLOB Incrementally {H17870} +** CAPI3REF: Write Data Into A BLOB Incrementally ** -** This function is used to write data into an open [BLOB handle] from a -** caller-supplied buffer. N bytes of data are copied from the buffer Z +** ^This function is used to write data into an open [BLOB handle] from a +** caller-supplied buffer. ^N bytes of data are copied from the buffer Z ** into the open BLOB, starting at offset iOffset. ** -** If the [BLOB handle] passed as the first argument was not opened for +** ^If the [BLOB handle] passed as the first argument was not opened for ** writing (the flags parameter to [sqlite3_blob_open()] was zero), ** this function returns [SQLITE_READONLY]. ** -** This function may only modify the contents of the BLOB; it is +** ^This function may only modify the contents of the BLOB; it is ** not possible to increase the size of a BLOB using this API. -** If offset iOffset is less than N bytes from the end of the BLOB, -** [SQLITE_ERROR] is returned and no data is written. If N is +** ^If offset iOffset is less than N bytes from the end of the BLOB, +** [SQLITE_ERROR] is returned and no data is written. ^If N is ** less than zero [SQLITE_ERROR] is returned and no data is written. ** The size of the BLOB (and hence the maximum value of N+iOffset) ** can be determined using the [sqlite3_blob_bytes()] interface. ** -** An attempt to write to an expired [BLOB handle] fails with an -** error code of [SQLITE_ABORT]. Writes to the BLOB that occurred +** ^An attempt to write to an expired [BLOB handle] fails with an +** error code of [SQLITE_ABORT]. ^Writes to the BLOB that occurred ** before the [BLOB handle] expired are not rolled back by the ** expiration of the handle, though of course those changes might ** have been overwritten by the statement that expired the BLOB handle ** or by other independent statements. ** -** On success, SQLITE_OK is returned. -** Otherwise, an [error code] or an [extended error code] is returned. +** ^(On success, sqlite3_blob_write() returns SQLITE_OK. +** Otherwise, an [error code] or an [extended error code] is returned.)^ ** ** This routine only works on a [BLOB handle] which has been created ** by a prior successful call to [sqlite3_blob_open()] and which has not @@ -4787,15 +5217,11 @@ SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); ** to this routine results in undefined and probably undesirable behavior. ** ** See also: [sqlite3_blob_read()]. -** -** Requirements: -** [H17873] [H17874] [H17875] [H17876] [H17877] [H17879] [H17882] [H17885] -** [H17888] */ SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); /* -** CAPI3REF: Virtual File System Objects {H11200} +** CAPI3REF: Virtual File System Objects ** ** A virtual filesystem (VFS) is an [sqlite3_vfs] object ** that SQLite uses to interact @@ -4804,34 +5230,31 @@ SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOff ** New VFSes can be registered and existing VFSes can be unregistered. ** The following interfaces are provided. ** -** The sqlite3_vfs_find() interface returns a pointer to a VFS given its name. -** Names are case sensitive. -** Names are zero-terminated UTF-8 strings. -** If there is no match, a NULL pointer is returned. -** If zVfsName is NULL then the default VFS is returned. +** ^The sqlite3_vfs_find() interface returns a pointer to a VFS given its name. +** ^Names are case sensitive. +** ^Names are zero-terminated UTF-8 strings. +** ^If there is no match, a NULL pointer is returned. +** ^If zVfsName is NULL then the default VFS is returned. ** -** New VFSes are registered with sqlite3_vfs_register(). -** Each new VFS becomes the default VFS if the makeDflt flag is set. -** The same VFS can be registered multiple times without injury. -** To make an existing VFS into the default VFS, register it again +** ^New VFSes are registered with sqlite3_vfs_register(). +** ^Each new VFS becomes the default VFS if the makeDflt flag is set. +** ^The same VFS can be registered multiple times without injury. +** ^To make an existing VFS into the default VFS, register it again ** with the makeDflt flag set. If two different VFSes with the ** same name are registered, the behavior is undefined. If a ** VFS is registered with a name that is NULL or an empty string, ** then the behavior is undefined. ** -** Unregister a VFS with the sqlite3_vfs_unregister() interface. -** If the default VFS is unregistered, another VFS is chosen as -** the default. The choice for the new VFS is arbitrary. -** -** Requirements: -** [H11203] [H11206] [H11209] [H11212] [H11215] [H11218] +** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. +** ^(If the default VFS is unregistered, another VFS is chosen as +** the default. The choice for the new VFS is arbitrary.)^ */ SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName); SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); /* -** CAPI3REF: Mutexes {H17000} +** CAPI3REF: Mutexes ** ** The SQLite core uses these routines for thread ** synchronization. Though they are intended for internal @@ -4840,7 +5263,7 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); ** ** The SQLite source code contains multiple implementations ** of these mutex routines. An appropriate implementation -** is selected automatically at compile-time. The following +** is selected automatically at compile-time. ^(The following ** implementations are available in the SQLite core: ** **
      @@ -4848,26 +5271,26 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); **
    • SQLITE_MUTEX_PTHREAD **
    • SQLITE_MUTEX_W32 **
    • SQLITE_MUTEX_NOOP -**
    +** )^ ** -** The SQLITE_MUTEX_NOOP implementation is a set of routines +** ^The SQLITE_MUTEX_NOOP implementation is a set of routines ** that does no real locking and is appropriate for use in -** a single-threaded application. The SQLITE_MUTEX_OS2, +** a single-threaded application. ^The SQLITE_MUTEX_OS2, ** SQLITE_MUTEX_PTHREAD, and SQLITE_MUTEX_W32 implementations ** are appropriate for use on OS/2, Unix, and Windows. ** -** If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor +** ^(If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor ** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex ** implementation is included with the library. In this case the ** application must supply a custom mutex implementation using the ** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function ** before calling sqlite3_initialize() or any other public sqlite3_ -** function that calls sqlite3_initialize(). +** function that calls sqlite3_initialize().)^ ** -** {H17011} The sqlite3_mutex_alloc() routine allocates a new -** mutex and returns a pointer to it. {H17012} If it returns NULL -** that means that a mutex could not be allocated. {H17013} SQLite -** will unwind its stack and return an error. {H17014} The argument +** ^The sqlite3_mutex_alloc() routine allocates a new +** mutex and returns a pointer to it. ^If it returns NULL +** that means that a mutex could not be allocated. ^SQLite +** will unwind its stack and return an error. ^(The argument ** to sqlite3_mutex_alloc() is one of these integer constants: ** **
      @@ -4879,64 +5302,66 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); **
    • SQLITE_MUTEX_STATIC_PRNG **
    • SQLITE_MUTEX_STATIC_LRU **
    • SQLITE_MUTEX_STATIC_LRU2 -**
    +** )^ ** -** {H17015} The first two constants cause sqlite3_mutex_alloc() to create -** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE -** is used but not necessarily so when SQLITE_MUTEX_FAST is used. {END} +** ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) +** cause sqlite3_mutex_alloc() to create +** a new mutex. ^The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +** is used but not necessarily so when SQLITE_MUTEX_FAST is used. ** The mutex implementation does not need to make a distinction ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does -** not want to. {H17016} But SQLite will only request a recursive mutex in -** cases where it really needs one. {END} If a faster non-recursive mutex +** not want to. ^SQLite will only request a recursive mutex in +** cases where it really needs one. ^If a faster non-recursive mutex ** implementation is available on the host platform, the mutex subsystem ** might return such a mutex in response to SQLITE_MUTEX_FAST. ** -** {H17017} The other allowed parameters to sqlite3_mutex_alloc() each return -** a pointer to a static preexisting mutex. {END} Six static mutexes are +** ^The other allowed parameters to sqlite3_mutex_alloc() (anything other +** than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return +** a pointer to a static preexisting mutex. ^Six static mutexes are ** used by the current version of SQLite. Future versions of SQLite ** may add additional static mutexes. Static mutexes are for internal ** use by SQLite only. Applications that use SQLite mutexes should ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or ** SQLITE_MUTEX_RECURSIVE. ** -** {H17018} Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() -** returns a different mutex on every call. {H17034} But for the static +** returns a different mutex on every call. ^But for the static ** mutex types, the same mutex is returned on every call that has ** the same type number. ** -** {H17019} The sqlite3_mutex_free() routine deallocates a previously -** allocated dynamic mutex. {H17020} SQLite is careful to deallocate every -** dynamic mutex that it allocates. {A17021} The dynamic mutexes must not be in -** use when they are deallocated. {A17022} Attempting to deallocate a static -** mutex results in undefined behavior. {H17023} SQLite never deallocates -** a static mutex. {END} +** ^The sqlite3_mutex_free() routine deallocates a previously +** allocated dynamic mutex. ^SQLite is careful to deallocate every +** dynamic mutex that it allocates. The dynamic mutexes must not be in +** use when they are deallocated. Attempting to deallocate a static +** mutex results in undefined behavior. ^SQLite never deallocates +** a static mutex. ** -** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt -** to enter a mutex. {H17024} If another thread is already within the mutex, +** ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +** to enter a mutex. ^If another thread is already within the mutex, ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return -** SQLITE_BUSY. {H17025} The sqlite3_mutex_try() interface returns [SQLITE_OK] -** upon successful entry. {H17026} Mutexes created using +** SQLITE_BUSY. ^The sqlite3_mutex_try() interface returns [SQLITE_OK] +** upon successful entry. ^(Mutexes created using ** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread. -** {H17027} In such cases the, +** In such cases the, ** mutex must be exited an equal number of times before another thread -** can enter. {A17028} If the same thread tries to enter any other +** can enter.)^ ^(If the same thread tries to enter any other ** kind of mutex more than once, the behavior is undefined. -** {H17029} SQLite will never exhibit -** such behavior in its own use of mutexes. +** SQLite will never exhibit +** such behavior in its own use of mutexes.)^ ** -** Some systems (for example, Windows 95) do not support the operation +** ^(Some systems (for example, Windows 95) do not support the operation ** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() -** will always return SQLITE_BUSY. {H17030} The SQLite core only ever uses -** sqlite3_mutex_try() as an optimization so this is acceptable behavior. +** will always return SQLITE_BUSY. The SQLite core only ever uses +** sqlite3_mutex_try() as an optimization so this is acceptable behavior.)^ ** -** {H17031} The sqlite3_mutex_leave() routine exits a mutex that was -** previously entered by the same thread. {A17032} The behavior +** ^The sqlite3_mutex_leave() routine exits a mutex that was +** previously entered by the same thread. ^(The behavior ** is undefined if the mutex is not currently entered by the -** calling thread or is not currently allocated. {H17033} SQLite will -** never do either. {END} +** calling thread or is not currently allocated. SQLite will +** never do either.)^ ** -** If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or +** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** @@ -4949,8 +5374,7 @@ SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); /* -** CAPI3REF: Mutex Methods Object {H17120} -** EXPERIMENTAL +** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. @@ -4965,19 +5389,19 @@ SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); ** output variable when querying the system for the current mutex ** implementation, using the [SQLITE_CONFIG_GETMUTEX] option. ** -** The xMutexInit method defined by this structure is invoked as +** ^The xMutexInit method defined by this structure is invoked as ** part of system initialization by the sqlite3_initialize() function. -** {H17001} The xMutexInit routine shall be called by SQLite once for each +** ^The xMutexInit routine is called by SQLite exactly once for each ** effective call to [sqlite3_initialize()]. ** -** The xMutexEnd method defined by this structure is invoked as +** ^The xMutexEnd method defined by this structure is invoked as ** part of system shutdown by the sqlite3_shutdown() function. The ** implementation of this method is expected to release all outstanding ** resources obtained by the mutex methods implementation, especially -** those obtained by the xMutexInit method. {H17003} The xMutexEnd() -** interface shall be invoked once for each call to [sqlite3_shutdown()]. +** those obtained by the xMutexInit method. ^The xMutexEnd() +** interface is invoked exactly once for each call to [sqlite3_shutdown()]. ** -** The remaining seven methods defined by this structure (xMutexAlloc, +** ^(The remaining seven methods defined by this structure (xMutexAlloc, ** xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and ** xMutexNotheld) implement the following interfaces (respectively): ** @@ -4989,7 +5413,7 @@ SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); **
  • [sqlite3_mutex_leave()]
  • **
  • [sqlite3_mutex_held()]
  • **
  • [sqlite3_mutex_notheld()]
  • -** +** )^ ** ** The only difference is that the public sqlite3_XXX functions enumerated ** above silently ignore any invocations that pass a NULL pointer instead @@ -4999,17 +5423,17 @@ SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); ** (i.e. it is acceptable to provide an implementation that segfaults if ** it is passed a NULL pointer). ** -** The xMutexInit() method must be threadsafe. It must be harmless to -** invoke xMutexInit() mutiple times within the same process and without +** The xMutexInit() method must be threadsafe. ^It must be harmless to +** invoke xMutexInit() multiple times within the same process and without ** intervening calls to xMutexEnd(). Second and subsequent calls to ** xMutexInit() must be no-ops. ** -** xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] -** and its associates). Similarly, xMutexAlloc() must not use SQLite memory -** allocation for a static mutex. However xMutexAlloc() may use SQLite +** ^xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] +** and its associates). ^Similarly, xMutexAlloc() must not use SQLite memory +** allocation for a static mutex. ^However xMutexAlloc() may use SQLite ** memory allocation for a fast or recursive mutex. ** -** SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is +** ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is ** called, but only if the prior call to xMutexInit returned SQLITE_OK. ** If xMutexInit fails in any way, it is expected to clean up after itself ** prior to returning. @@ -5028,39 +5452,41 @@ struct sqlite3_mutex_methods { }; /* -** CAPI3REF: Mutex Verification Routines {H17080} +** CAPI3REF: Mutex Verification Routines ** ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines -** are intended for use inside assert() statements. {H17081} The SQLite core +** are intended for use inside assert() statements. ^The SQLite core ** never uses these routines except inside an assert() and applications -** are advised to follow the lead of the core. {H17082} The core only +** are advised to follow the lead of the core. ^The SQLite core only ** provides implementations for these routines when it is compiled -** with the SQLITE_DEBUG flag. {A17087} External mutex implementations +** with the SQLITE_DEBUG flag. ^External mutex implementations ** are only required to provide these routines if SQLITE_DEBUG is ** defined and if NDEBUG is not defined. ** -** {H17083} These routines should return true if the mutex in their argument +** ^These routines should return true if the mutex in their argument ** is held or not held, respectively, by the calling thread. ** -** {X17084} The implementation is not required to provided versions of these +** ^The implementation is not required to provided versions of these ** routines that actually work. If the implementation does not provide working ** versions of these routines, it should at least provide stubs that always ** return true so that one does not get spurious assertion failures. ** -** {H17085} If the argument to sqlite3_mutex_held() is a NULL pointer then -** the routine should return 1. {END} This seems counter-intuitive since +** ^If the argument to sqlite3_mutex_held() is a NULL pointer then +** the routine should return 1. This seems counter-intuitive since ** clearly the mutex cannot be held if it does not exist. But the ** the reason the mutex does not exist is because the build is not ** using mutexes. And we do not want the assert() containing the ** call to sqlite3_mutex_held() to fail, so a non-zero return is -** the appropriate thing to do. {H17086} The sqlite3_mutex_notheld() +** the appropriate thing to do. ^The sqlite3_mutex_notheld() ** interface should also return 1 when given a NULL pointer. */ +#ifndef NDEBUG SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); +#endif /* -** CAPI3REF: Mutex Types {H17001} +** CAPI3REF: Mutex Types ** ** The [sqlite3_mutex_alloc()] interface takes a single argument ** which is one of these integer constants. @@ -5080,48 +5506,50 @@ SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); #define SQLITE_MUTEX_STATIC_LRU2 7 /* lru page list */ /* -** CAPI3REF: Retrieve the mutex for a database connection {H17002} +** CAPI3REF: Retrieve the mutex for a database connection ** -** This interface returns a pointer the [sqlite3_mutex] object that +** ^This interface returns a pointer the [sqlite3_mutex] object that ** serializes access to the [database connection] given in the argument ** when the [threading mode] is Serialized. -** If the [threading mode] is Single-thread or Multi-thread then this +** ^If the [threading mode] is Single-thread or Multi-thread then this ** routine returns a NULL pointer. */ SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*); /* -** CAPI3REF: Low-Level Control Of Database Files {H11300} +** CAPI3REF: Low-Level Control Of Database Files ** -** {H11301} The [sqlite3_file_control()] interface makes a direct call to the +** ^The [sqlite3_file_control()] interface makes a direct call to the ** xFileControl method for the [sqlite3_io_methods] object associated -** with a particular database identified by the second argument. {H11302} The -** name of the database is the name assigned to the database by the -** ATTACH SQL command that opened the -** database. {H11303} To control the main database file, use the name "main" -** or a NULL pointer. {H11304} The third and fourth parameters to this routine +** with a particular database identified by the second argument. ^The +** name of the database "main" for the main database or "temp" for the +** TEMP database, or the name that appears after the AS keyword for +** databases that are added using the [ATTACH] SQL command. +** ^A NULL pointer can be used in place of "main" to refer to the +** main database file. +** ^The third and fourth parameters to this routine ** are passed directly through to the second and third parameters of -** the xFileControl method. {H11305} The return value of the xFileControl +** the xFileControl method. ^The return value of the xFileControl ** method becomes the return value of this routine. ** -** {H11306} If the second parameter (zDbName) does not match the name of any -** open database file, then SQLITE_ERROR is returned. {H11307} This error +** ^If the second parameter (zDbName) does not match the name of any +** open database file, then SQLITE_ERROR is returned. ^This error ** code is not remembered and will not be recalled by [sqlite3_errcode()] -** or [sqlite3_errmsg()]. {A11308} The underlying xFileControl method might -** also return SQLITE_ERROR. {A11309} There is no way to distinguish between +** or [sqlite3_errmsg()]. The underlying xFileControl method might +** also return SQLITE_ERROR. There is no way to distinguish between ** an incorrect zDbName and an SQLITE_ERROR return from the underlying -** xFileControl method. {END} +** xFileControl method. ** ** See also: [SQLITE_FCNTL_LOCKSTATE] */ SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); /* -** CAPI3REF: Testing Interface {H11400} +** CAPI3REF: Testing Interface ** -** The sqlite3_test_control() interface is used to read out internal +** ^The sqlite3_test_control() interface is used to read out internal ** state of SQLite and to inject faults into SQLite for testing -** purposes. The first parameter is an operation code that determines +** purposes. ^The first parameter is an operation code that determines ** the number, meaning, and operation of all subsequent parameters. ** ** This interface is not for use by applications. It exists solely @@ -5136,7 +5564,7 @@ SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void* SQLITE_API int sqlite3_test_control(int op, ...); /* -** CAPI3REF: Testing Interface Operation Codes {H11410} +** CAPI3REF: Testing Interface Operation Codes ** ** These constants are the valid operation code parameters used ** as the first argument to [sqlite3_test_control()]. @@ -5146,6 +5574,7 @@ SQLITE_API int sqlite3_test_control(int op, ...); ** Applications should not use any of these parameters or the ** [sqlite3_test_control()] interface. */ +#define SQLITE_TESTCTRL_FIRST 5 #define SQLITE_TESTCTRL_PRNG_SAVE 5 #define SQLITE_TESTCTRL_PRNG_RESTORE 6 #define SQLITE_TESTCTRL_PRNG_RESET 7 @@ -5156,27 +5585,31 @@ SQLITE_API int sqlite3_test_control(int op, ...); #define SQLITE_TESTCTRL_ASSERT 12 #define SQLITE_TESTCTRL_ALWAYS 13 #define SQLITE_TESTCTRL_RESERVE 14 +#define SQLITE_TESTCTRL_OPTIMIZATIONS 15 +#define SQLITE_TESTCTRL_ISKEYWORD 16 +#define SQLITE_TESTCTRL_PGHDRSZ 17 +#define SQLITE_TESTCTRL_SCRATCHMALLOC 18 +#define SQLITE_TESTCTRL_LAST 18 /* -** CAPI3REF: SQLite Runtime Status {H17200} -** EXPERIMENTAL +** CAPI3REF: SQLite Runtime Status ** -** This interface is used to retrieve runtime status information -** about the preformance of SQLite, and optionally to reset various -** highwater marks. The first argument is an integer code for -** the specific parameter to measure. Recognized integer codes -** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...]. -** The current value of the parameter is returned into *pCurrent. -** The highest recorded value is returned in *pHighwater. If the +** ^This interface is used to retrieve runtime status information +** about the performance of SQLite, and optionally to reset various +** highwater marks. ^The first argument is an integer code for +** the specific parameter to measure. ^(Recognized integer codes +** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...].)^ +** ^The current value of the parameter is returned into *pCurrent. +** ^The highest recorded value is returned in *pHighwater. ^If the ** resetFlag is true, then the highest record value is reset after -** *pHighwater is written. Some parameters do not record the highest +** *pHighwater is written. ^(Some parameters do not record the highest ** value. For those parameters -** nothing is written into *pHighwater and the resetFlag is ignored. -** Other parameters record only the highwater mark and not the current -** value. For these latter parameters nothing is written into *pCurrent. +** nothing is written into *pHighwater and the resetFlag is ignored.)^ +** ^(Other parameters record only the highwater mark and not the current +** value. For these latter parameters nothing is written into *pCurrent.)^ ** -** This routine returns SQLITE_OK on success and a non-zero -** [error code] on failure. +** ^The sqlite3_status() routine returns SQLITE_OK on success and a +** non-zero [error code] on failure. ** ** This routine is threadsafe but is not atomic. This routine can be ** called while other threads are running the same or different SQLite @@ -5187,18 +5620,17 @@ SQLITE_API int sqlite3_test_control(int op, ...); ** ** See also: [sqlite3_db_status()] */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); +SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); /* -** CAPI3REF: Status Parameters {H17250} -** EXPERIMENTAL +** CAPI3REF: Status Parameters ** ** These integer constants designate various run-time status parameters ** that can be returned by [sqlite3_status()]. ** **
    -**
    SQLITE_STATUS_MEMORY_USED
    +** ^(
    SQLITE_STATUS_MEMORY_USED
    **
    This parameter is the current amount of memory checked out ** using [sqlite3_malloc()], either directly or indirectly. The ** figure includes calls made to [sqlite3_malloc()] by the application @@ -5206,63 +5638,66 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pH ** controlled by [SQLITE_CONFIG_SCRATCH] and auxiliary page-cache ** memory controlled by [SQLITE_CONFIG_PAGECACHE] is not included in ** this parameter. The amount returned is the sum of the allocation -** sizes as reported by the xSize method in [sqlite3_mem_methods].
    +** sizes as reported by the xSize method in [sqlite3_mem_methods].)^ ** -**
    SQLITE_STATUS_MALLOC_SIZE
    +** ^(
    SQLITE_STATUS_MALLOC_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their ** internal equivalents). Only the value returned in the ** *pHighwater parameter to [sqlite3_status()] is of interest. -** The value written into the *pCurrent parameter is undefined.
    +** The value written into the *pCurrent parameter is undefined.)^ ** -**
    SQLITE_STATUS_PAGECACHE_USED
    +** ^(
    SQLITE_STATUS_MALLOC_COUNT
    +**
    This parameter records the number of separate memory allocations.
    )^ +** +** ^(
    SQLITE_STATUS_PAGECACHE_USED
    **
    This parameter returns the number of pages used out of the ** [pagecache memory allocator] that was configured using ** [SQLITE_CONFIG_PAGECACHE]. The -** value returned is in pages, not in bytes.
    +** value returned is in pages, not in bytes.)^ ** -**
    SQLITE_STATUS_PAGECACHE_OVERFLOW
    +** ^(
    SQLITE_STATUS_PAGECACHE_OVERFLOW
    **
    This parameter returns the number of bytes of page cache -** allocation which could not be statisfied by the [SQLITE_CONFIG_PAGECACHE] +** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] ** buffer and where forced to overflow to [sqlite3_malloc()]. The ** returned value includes allocations that overflowed because they ** where too large (they were larger than the "sz" parameter to ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because -** no space was left in the page cache.
    +** no space was left in the page cache.)^ ** -**
    SQLITE_STATUS_PAGECACHE_SIZE
    +** ^(
    SQLITE_STATUS_PAGECACHE_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [pagecache memory allocator]. Only the value returned in the ** *pHighwater parameter to [sqlite3_status()] is of interest. -** The value written into the *pCurrent parameter is undefined.
    +** The value written into the *pCurrent parameter is undefined.)^ ** -**
    SQLITE_STATUS_SCRATCH_USED
    +** ^(
    SQLITE_STATUS_SCRATCH_USED
    **
    This parameter returns the number of allocations used out of the ** [scratch memory allocator] configured using ** [SQLITE_CONFIG_SCRATCH]. The value returned is in allocations, not ** in bytes. Since a single thread may only have one scratch allocation ** outstanding at time, this parameter also reports the number of threads -** using scratch memory at the same time.
    +** using scratch memory at the same time.)^ ** -**
    SQLITE_STATUS_SCRATCH_OVERFLOW
    +** ^(
    SQLITE_STATUS_SCRATCH_OVERFLOW
    **
    This parameter returns the number of bytes of scratch memory -** allocation which could not be statisfied by the [SQLITE_CONFIG_SCRATCH] +** allocation which could not be satisfied by the [SQLITE_CONFIG_SCRATCH] ** buffer and where forced to overflow to [sqlite3_malloc()]. The values ** returned include overflows because the requested allocation was too ** larger (that is, because the requested allocation was larger than the ** "sz" parameter to [SQLITE_CONFIG_SCRATCH]) and because no scratch buffer ** slots were available. -**
    +** )^ ** -**
    SQLITE_STATUS_SCRATCH_SIZE
    +** ^(
    SQLITE_STATUS_SCRATCH_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [scratch memory allocator]. Only the value returned in the ** *pHighwater parameter to [sqlite3_status()] is of interest. -** The value written into the *pCurrent parameter is undefined.
    +** The value written into the *pCurrent parameter is undefined.)^ ** -**
    SQLITE_STATUS_PARSER_STACK
    +** ^(
    SQLITE_STATUS_PARSER_STACK
    **
    This parameter records the deepest parser stack. It is only -** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].
    +** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].)^ **
    ** ** New status parameters may be added from time to time. @@ -5276,30 +5711,34 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pH #define SQLITE_STATUS_PARSER_STACK 6 #define SQLITE_STATUS_PAGECACHE_SIZE 7 #define SQLITE_STATUS_SCRATCH_SIZE 8 +#define SQLITE_STATUS_MALLOC_COUNT 9 /* -** CAPI3REF: Database Connection Status {H17500} -** EXPERIMENTAL +** CAPI3REF: Database Connection Status ** -** This interface is used to retrieve runtime status information -** about a single [database connection]. The first argument is the -** database connection object to be interrogated. The second argument -** is the parameter to interrogate. Currently, the only allowed value -** for the second parameter is [SQLITE_DBSTATUS_LOOKASIDE_USED]. -** Additional options will likely appear in future releases of SQLite. +** ^This interface is used to retrieve runtime status information +** about a single [database connection]. ^The first argument is the +** database connection object to be interrogated. ^The second argument +** is an integer constant, taken from the set of +** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros, that +** determines the parameter to interrogate. The set of +** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros is likely +** to grow in future releases of SQLite. ** -** The current value of the requested parameter is written into *pCur -** and the highest instantaneous value is written into *pHiwtr. If +** ^The current value of the requested parameter is written into *pCur +** and the highest instantaneous value is written into *pHiwtr. ^If ** the resetFlg is true, then the highest instantaneous value is ** reset back down to the current value. ** +** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a +** non-zero [error code] on failure. +** ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); +SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); /* -** CAPI3REF: Status Parameters for database connections {H17520} -** EXPERIMENTAL +** CAPI3REF: Status Parameters for database connections ** ** These constants are the available integer "verbs" that can be passed as ** the second argument to the [sqlite3_db_status()] interface. @@ -5311,43 +5750,66 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_status(sqlite3*, int op, int *pCur ** if a discontinued or unsupported verb is invoked. ** **
    -**
    SQLITE_DBSTATUS_LOOKASIDE_USED
    +** ^(
    SQLITE_DBSTATUS_LOOKASIDE_USED
    **
    This parameter returns the number of lookaside memory slots currently -** checked out.
    +** checked out.)^ +** +** ^(
    SQLITE_DBSTATUS_CACHE_USED
    +**
    This parameter returns the approximate number of of bytes of heap +** memory used by all pager caches associated with the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. +** +** ^(
    SQLITE_DBSTATUS_SCHEMA_USED
    +**
    This parameter returns the approximate number of of bytes of heap +** memory used to store the schema for all databases associated +** with the connection - main, temp, and any [ATTACH]-ed databases.)^ +** ^The full amount of memory used by the schemas is reported, even if the +** schema memory is shared with other database connections due to +** [shared cache mode] being enabled. +** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. +** +** ^(
    SQLITE_DBSTATUS_STMT_USED
    +**
    This parameter returns the approximate number of of bytes of heap +** and lookaside memory used by all prepared statements associated with +** the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0. +**
    **
    */ #define SQLITE_DBSTATUS_LOOKASIDE_USED 0 +#define SQLITE_DBSTATUS_CACHE_USED 1 +#define SQLITE_DBSTATUS_SCHEMA_USED 2 +#define SQLITE_DBSTATUS_STMT_USED 3 +#define SQLITE_DBSTATUS_MAX 3 /* Largest defined DBSTATUS */ /* -** CAPI3REF: Prepared Statement Status {H17550} -** EXPERIMENTAL +** CAPI3REF: Prepared Statement Status ** -** Each prepared statement maintains various +** ^(Each prepared statement maintains various ** [SQLITE_STMTSTATUS_SORT | counters] that measure the number -** of times it has performed specific operations. These counters can +** of times it has performed specific operations.)^ These counters can ** be used to monitor the performance characteristics of the prepared ** statements. For example, if the number of table steps greatly exceeds ** the number of table searches or result rows, that would tend to indicate ** that the prepared statement is using a full table scan rather than ** an index. ** -** This interface is used to retrieve and reset counter values from +** ^(This interface is used to retrieve and reset counter values from ** a [prepared statement]. The first argument is the prepared statement ** object to be interrogated. The second argument ** is an integer code for a specific [SQLITE_STMTSTATUS_SORT | counter] -** to be interrogated. -** The current value of the requested counter is returned. -** If the resetFlg is true, then the counter is reset to zero after this +** to be interrogated.)^ +** ^The current value of the requested counter is returned. +** ^If the resetFlg is true, then the counter is reset to zero after this ** interface call returns. ** ** See also: [sqlite3_status()] and [sqlite3_db_status()]. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); +SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); /* -** CAPI3REF: Status Parameters for prepared statements {H17570} -** EXPERIMENTAL +** CAPI3REF: Status Parameters for prepared statements ** ** These preprocessor macros define integer codes that name counter ** values associated with the [sqlite3_stmt_status()] interface. @@ -5355,24 +5817,31 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_stmt_status(sqlite3_stmt*, int op,int ** **
    **
    SQLITE_STMTSTATUS_FULLSCAN_STEP
    -**
    This is the number of times that SQLite has stepped forward in +**
    ^This is the number of times that SQLite has stepped forward in ** a table as part of a full table scan. Large numbers for this counter ** may indicate opportunities for performance improvement through ** careful use of indices.
    ** **
    SQLITE_STMTSTATUS_SORT
    -**
    This is the number of sort operations that have occurred. +**
    ^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to ** improvement performance through careful use of indices.
    ** +**
    SQLITE_STMTSTATUS_AUTOINDEX
    +**
    ^This is the number of rows inserted into transient indices that +** were created automatically in order to help joins run faster. +** A non-zero value in this counter may indicate an opportunity to +** improvement performance by adding permanent indices that do not +** need to be reinitialized each time the statement is run.
    +** **
    */ #define SQLITE_STMTSTATUS_FULLSCAN_STEP 1 #define SQLITE_STMTSTATUS_SORT 2 +#define SQLITE_STMTSTATUS_AUTOINDEX 3 /* ** CAPI3REF: Custom Page Cache Object -** EXPERIMENTAL ** ** The sqlite3_pcache type is opaque. It is implemented by ** the pluggable module. The SQLite core has no knowledge of @@ -5387,84 +5856,96 @@ typedef struct sqlite3_pcache sqlite3_pcache; /* ** CAPI3REF: Application Defined Page Cache. ** KEYWORDS: {page cache} -** EXPERIMENTAL ** -** The [sqlite3_config]([SQLITE_CONFIG_PCACHE], ...) interface can +** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE], ...) interface can ** register an alternative page cache implementation by passing in an -** instance of the sqlite3_pcache_methods structure. The majority of the -** heap memory used by SQLite is used by the page cache to cache data read -** from, or ready to be written to, the database file. By implementing a -** custom page cache using this API, an application can control more -** precisely the amount of memory consumed by SQLite, the way in which +** instance of the sqlite3_pcache_methods structure.)^ +** In many applications, most of the heap memory allocated by +** SQLite is used for the page cache. +** By implementing a +** custom page cache using this API, an application can better control +** the amount of memory consumed by SQLite, the way in which ** that memory is allocated and released, and the policies used to ** determine exactly which parts of a database file are cached and for ** how long. ** -** The contents of the sqlite3_pcache_methods structure are copied to an +** The alternative page cache mechanism is an +** extreme measure that is only needed by the most demanding applications. +** The built-in page cache is recommended for most uses. +** +** ^(The contents of the sqlite3_pcache_methods structure are copied to an ** internal buffer by SQLite within the call to [sqlite3_config]. Hence ** the application may discard the parameter after the call to -** [sqlite3_config()] returns. +** [sqlite3_config()] returns.)^ ** -** The xInit() method is called once for each call to [sqlite3_initialize()] -** (usually only once during the lifetime of the process). It is passed -** a copy of the sqlite3_pcache_methods.pArg value. It can be used to set -** up global structures and mutexes required by the custom page cache -** implementation. +** ^(The xInit() method is called once for each effective +** call to [sqlite3_initialize()])^ +** (usually only once during the lifetime of the process). ^(The xInit() +** method is passed a copy of the sqlite3_pcache_methods.pArg value.)^ +** The intent of the xInit() method is to set up global data structures +** required by the custom page cache implementation. +** ^(If the xInit() method is NULL, then the +** built-in default page cache is used instead of the application defined +** page cache.)^ ** -** The xShutdown() method is called from within [sqlite3_shutdown()], -** if the application invokes this API. It can be used to clean up +** ^The xShutdown() method is called by [sqlite3_shutdown()]. +** It can be used to clean up ** any outstanding resources before process shutdown, if required. +** ^The xShutdown() method may be NULL. ** -** SQLite holds a [SQLITE_MUTEX_RECURSIVE] mutex when it invokes -** the xInit method, so the xInit method need not be threadsafe. The +** ^SQLite automatically serializes calls to the xInit method, +** so the xInit method need not be threadsafe. ^The ** xShutdown method is only called from [sqlite3_shutdown()] so it does ** not need to be threadsafe either. All other methods must be threadsafe ** in multithreaded applications. ** -** SQLite will never invoke xInit() more than once without an intervening +** ^SQLite will never invoke xInit() more than once without an intervening ** call to xShutdown(). ** -** The xCreate() method is used to construct a new cache instance. SQLite -** will typically create one cache instance for each open database file, -** though this is not guaranteed. The +** ^SQLite invokes the xCreate() method to construct a new cache instance. +** SQLite will typically create one cache instance for each open database file, +** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. szPage will not be a power of two. szPage +** be allocated by the cache. ^szPage will not be a power of two. ^szPage ** will the page size of the database file that is to be cached plus an ** increment (here called "R") of about 100 or 200. SQLite will use the ** extra R bytes on each page to store metadata about the underlying ** database page on disk. The value of R depends ** on the SQLite version, the target platform, and how SQLite was compiled. -** R is constant for a particular build of SQLite. The second argument to +** ^R is constant for a particular build of SQLite. ^The second argument to ** xCreate(), bPurgeable, is true if the cache being created will ** be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation ** does not have to do anything special based with the value of bPurgeable; -** it is purely advisory. On a cache where bPurgeable is false, SQLite will +** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. -** In other words, a cache created with bPurgeable set to false will +** ^In other words, calls to xUnpin() on a cache with bPurgeable set to +** false will always have the "discard" flag set to true. +** ^Hence, a cache created with bPurgeable false will ** never contain any unpinned pages. ** -** The xCachesize() method may be called at any time by SQLite to set the +** ^(The xCachesize() method may be called at any time by SQLite to set the ** suggested maximum cache-size (number of pages stored by) the cache ** instance passed as the first argument. This is the value configured using -** the SQLite "[PRAGMA cache_size]" command. As with the bPurgeable parameter, -** the implementation is not required to do anything with this +** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable +** parameter, the implementation is not required to do anything with this ** value; it is advisory only. ** -** The xPagecount() method should return the number of pages currently -** stored in the cache. +** The xPagecount() method must return the number of pages currently +** stored in the cache, both pinned and unpinned. ** -** The xFetch() method is used to fetch a page and return a pointer to it. -** A 'page', in this context, is a buffer of szPage bytes aligned at an -** 8-byte boundary. The page to be fetched is determined by the key. The -** mimimum key value is 1. After it has been retrieved using xFetch, the page +** The xFetch() method locates a page in the cache and returns a pointer to +** the page, or a NULL pointer. +** A "page", in this context, means a buffer of szPage bytes aligned at an +** 8-byte boundary. The page to be fetched is determined by the key. ^The +** mimimum key value is 1. After it has been retrieved using xFetch, the page ** is considered to be "pinned". ** ** If the requested page is already in the page cache, then the page cache ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the -** behavior of the cache implementation is determined by the value of the -** createFlag parameter passed to xFetch, according to the following table: +** behavior of the cache implementation should use the value of the createFlag +** parameter to help it determined what action to take: ** ** **
    createFlag Behaviour when page is not already in cache @@ -5475,29 +5956,28 @@ typedef struct sqlite3_pcache sqlite3_pcache; ** NULL if allocating a new page is effectively impossible. **
    ** -** SQLite will normally invoke xFetch() with a createFlag of 0 or 1. If -** a call to xFetch() with createFlag==1 returns NULL, then SQLite will +** ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1. SQLite +** will only use a createFlag of 2 after a prior call with a createFlag of 1 +** failed.)^ In between the to xFetch() calls, SQLite may ** attempt to unpin one or more cache pages by spilling the content of -** pinned pages to disk and synching the operating system disk cache. After -** attempting to unpin pages, the xFetch() method will be invoked again with -** a createFlag of 2. +** pinned pages to disk and synching the operating system disk cache. ** -** xUnpin() is called by SQLite with a pointer to a currently pinned page -** as its second argument. If the third parameter, discard, is non-zero, -** then the page should be evicted from the cache. In this case SQLite -** assumes that the next time the page is retrieved from the cache using -** the xFetch() method, it will be zeroed. If the discard parameter is -** zero, then the page is considered to be unpinned. The cache implementation +** ^xUnpin() is called by SQLite with a pointer to a currently pinned page +** as its second argument. If the third parameter, discard, is non-zero, +** then the page must be evicted from the cache. +** ^If the discard parameter is +** zero, then the page may be discarded or retained at the discretion of +** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** -** The cache is not required to perform any reference counting. A single +** The cache must not perform any reference counting. A single ** call to xUnpin() unpins the page regardless of the number of prior calls ** to xFetch(). ** ** The xRekey() method is used to change the key value associated with the -** page passed as the second argument from oldKey to newKey. If the cache -** previously contains an entry associated with newKey, it should be -** discarded. Any prior cache entry associated with newKey is guaranteed not +** page passed as the second argument. If the cache +** previously contains an entry associated with newKey, it must be +** discarded. ^Any prior cache entry associated with newKey is guaranteed not ** to be pinned. ** ** When SQLite calls the xTruncate() method, the cache must discard all @@ -5506,8 +5986,8 @@ typedef struct sqlite3_pcache sqlite3_pcache; ** of these pages are pinned, they are implicitly unpinned, meaning that ** they can be safely discarded. ** -** The xDestroy() method is used to delete a cache allocated by xCreate(). -** All resources associated with the specified cache should be freed. After +** ^The xDestroy() method is used to delete a cache allocated by xCreate(). +** All resources associated with the specified cache should be freed. ^After ** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] ** handle invalid, and will not use it with any other sqlite3_pcache_methods ** functions. @@ -5529,10 +6009,9 @@ struct sqlite3_pcache_methods { /* ** CAPI3REF: Online Backup Object -** EXPERIMENTAL ** ** The sqlite3_backup object records state information about an ongoing -** online backup operation. The sqlite3_backup object is created by +** online backup operation. ^The sqlite3_backup object is created by ** a call to [sqlite3_backup_init()] and is destroyed by a call to ** [sqlite3_backup_finish()]. ** @@ -5542,22 +6021,21 @@ typedef struct sqlite3_backup sqlite3_backup; /* ** CAPI3REF: Online Backup API. -** EXPERIMENTAL ** -** This API is used to overwrite the contents of one database with that -** of another. It is useful either for creating backups of databases or +** The backup API copies the content of one database into another. +** It is useful either for creating backups of databases or ** for copying in-memory databases to or from persistent files. ** ** See Also: [Using the SQLite Online Backup API] ** -** Exclusive access is required to the destination database for the -** duration of the operation. However the source database is only -** read-locked while it is actually being read, it is not locked -** continuously for the entire operation. Thus, the backup may be -** performed on a live database without preventing other users from -** writing to the database for an extended period of time. +** ^Exclusive access is required to the destination database for the +** duration of the operation. ^However the source database is only +** read-locked while it is actually being read; it is not locked +** continuously for the entire backup operation. ^Thus, the backup may be +** performed on a live source database without preventing other users from +** reading or writing to the source database while the backup is underway. ** -** To perform a backup operation: +** ^(To perform a backup operation: **
      **
    1. sqlite3_backup_init() is called once to initialize the ** backup, @@ -5565,143 +6043,152 @@ typedef struct sqlite3_backup sqlite3_backup; ** the data between the two databases, and finally **
    2. sqlite3_backup_finish() is called to release all resources ** associated with the backup operation. -**
    +** )^ ** There should be exactly one call to sqlite3_backup_finish() for each ** successful call to sqlite3_backup_init(). ** ** sqlite3_backup_init() ** -** The first two arguments passed to [sqlite3_backup_init()] are the database -** handle associated with the destination database and the database name -** used to attach the destination database to the handle. The database name -** is "main" for the main database, "temp" for the temporary database, or -** the name specified as part of the [ATTACH] statement if the destination is -** an attached database. The third and fourth arguments passed to -** sqlite3_backup_init() identify the [database connection] -** and database name used -** to access the source database. The values passed for the source and -** destination [database connection] parameters must not be the same. +** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the +** [database connection] associated with the destination database +** and the database name, respectively. +** ^The database name is "main" for the main database, "temp" for the +** temporary database, or the name specified after the AS keyword in +** an [ATTACH] statement for an attached database. +** ^The S and M arguments passed to +** sqlite3_backup_init(D,N,S,M) identify the [database connection] +** and database name of the source database, respectively. +** ^The source and destination [database connections] (parameters S and D) +** must be different or else sqlite3_backup_init(D,N,S,M) will file with +** an error. ** -** If an error occurs within sqlite3_backup_init(), then NULL is returned -** and an error code and error message written into the [database connection] -** passed as the first argument. They may be retrieved using the -** [sqlite3_errcode()], [sqlite3_errmsg()], and [sqlite3_errmsg16()] functions. -** Otherwise, if successful, a pointer to an [sqlite3_backup] object is -** returned. This pointer may be used with the sqlite3_backup_step() and +** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is +** returned and an error code and error message are store3d in the +** destination [database connection] D. +** ^The error code and message for the failed call to sqlite3_backup_init() +** can be retrieved using the [sqlite3_errcode()], [sqlite3_errmsg()], and/or +** [sqlite3_errmsg16()] functions. +** ^A successful call to sqlite3_backup_init() returns a pointer to an +** [sqlite3_backup] object. +** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and ** sqlite3_backup_finish() functions to perform the specified backup ** operation. ** ** sqlite3_backup_step() ** -** Function [sqlite3_backup_step()] is used to copy up to nPage pages between -** the source and destination databases, where nPage is the value of the -** second parameter passed to sqlite3_backup_step(). If nPage is a negative -** value, all remaining source pages are copied. If the required pages are -** successfully copied, but there are still more pages to copy before the -** backup is complete, it returns [SQLITE_OK]. If no error occured and there -** are no more pages to copy, then [SQLITE_DONE] is returned. If an error -** occurs, then an SQLite error code is returned. As well as [SQLITE_OK] and +** ^Function sqlite3_backup_step(B,N) will copy up to N pages between +** the source and destination databases specified by [sqlite3_backup] object B. +** ^If N is negative, all remaining source pages are copied. +** ^If sqlite3_backup_step(B,N) successfully copies N pages and there +** are still more pages to be copied, then the function resturns [SQLITE_OK]. +** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages +** from source to destination, then it returns [SQLITE_DONE]. +** ^If an error occurs while running sqlite3_backup_step(B,N), +** then an [error code] is returned. ^As well as [SQLITE_OK] and ** [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY], ** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an ** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code. ** -** As well as the case where the destination database file was opened for -** read-only access, sqlite3_backup_step() may return [SQLITE_READONLY] if -** the destination is an in-memory database with a different page size -** from the source database. +** ^(The sqlite3_backup_step() might return [SQLITE_READONLY] if +**
      +**
    1. the destination database was opened read-only, or +**
    2. the destination database is using write-ahead-log journaling +** and the destination and source page sizes differ, or +**
    3. The destination database is an in-memory database and the +** destination and source page sizes differ. +**
    )^ ** -** If sqlite3_backup_step() cannot obtain a required file-system lock, then +** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then ** the [sqlite3_busy_handler | busy-handler function] -** is invoked (if one is specified). If the +** is invoked (if one is specified). ^If the ** busy-handler returns non-zero before the lock is available, then -** [SQLITE_BUSY] is returned to the caller. In this case the call to -** sqlite3_backup_step() can be retried later. If the source +** [SQLITE_BUSY] is returned to the caller. ^In this case the call to +** sqlite3_backup_step() can be retried later. ^If the source ** [database connection] ** is being used to write to the source database when sqlite3_backup_step() -** is called, then [SQLITE_LOCKED] is returned immediately. Again, in this -** case the call to sqlite3_backup_step() can be retried later on. If +** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this +** case the call to sqlite3_backup_step() can be retried later on. ^(If ** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or ** [SQLITE_READONLY] is returned, then ** there is no point in retrying the call to sqlite3_backup_step(). These -** errors are considered fatal. At this point the application must accept +** errors are considered fatal.)^ The application must accept ** that the backup operation has failed and pass the backup operation handle ** to the sqlite3_backup_finish() to release associated resources. ** -** Following the first call to sqlite3_backup_step(), an exclusive lock is -** obtained on the destination file. It is not released until either +** ^The first call to sqlite3_backup_step() obtains an exclusive lock +** on the destination file. ^The exclusive lock is not released until either ** sqlite3_backup_finish() is called or the backup operation is complete -** and sqlite3_backup_step() returns [SQLITE_DONE]. Additionally, each time -** a call to sqlite3_backup_step() is made a [shared lock] is obtained on -** the source database file. This lock is released before the -** sqlite3_backup_step() call returns. Because the source database is not -** locked between calls to sqlite3_backup_step(), it may be modified mid-way -** through the backup procedure. If the source database is modified by an +** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to +** sqlite3_backup_step() obtains a [shared lock] on the source database that +** lasts for the duration of the sqlite3_backup_step() call. +** ^Because the source database is not locked between calls to +** sqlite3_backup_step(), the source database may be modified mid-way +** through the backup process. ^If the source database is modified by an ** external process or via a database connection other than the one being -** used by the backup operation, then the backup will be transparently -** restarted by the next call to sqlite3_backup_step(). If the source +** used by the backup operation, then the backup will be automatically +** restarted by the next call to sqlite3_backup_step(). ^If the source ** database is modified by the using the same database connection as is used -** by the backup operation, then the backup database is transparently +** by the backup operation, then the backup database is automatically ** updated at the same time. ** ** sqlite3_backup_finish() ** -** Once sqlite3_backup_step() has returned [SQLITE_DONE], or when the -** application wishes to abandon the backup operation, the [sqlite3_backup] -** object should be passed to sqlite3_backup_finish(). This releases all -** resources associated with the backup operation. If sqlite3_backup_step() -** has not yet returned [SQLITE_DONE], then any active write-transaction on the -** destination database is rolled back. The [sqlite3_backup] object is invalid +** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the +** application wishes to abandon the backup operation, the application +** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). +** ^The sqlite3_backup_finish() interfaces releases all +** resources associated with the [sqlite3_backup] object. +** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any +** active write-transaction on the destination database is rolled back. +** The [sqlite3_backup] object is invalid ** and may not be used following a call to sqlite3_backup_finish(). ** -** The value returned by sqlite3_backup_finish is [SQLITE_OK] if no error -** occurred, regardless or whether or not sqlite3_backup_step() was called -** a sufficient number of times to complete the backup operation. Or, if -** an out-of-memory condition or IO error occured during a call to -** sqlite3_backup_step() then [SQLITE_NOMEM] or an -** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] error code -** is returned. In this case the error code and an error message are -** written to the destination [database connection]. +** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no +** sqlite3_backup_step() errors occurred, regardless or whether or not +** sqlite3_backup_step() completed. +** ^If an out-of-memory condition or IO error occurred during any prior +** sqlite3_backup_step() call on the same [sqlite3_backup] object, then +** sqlite3_backup_finish() returns the corresponding [error code]. ** -** A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() is -** not a permanent error and does not affect the return value of +** ^A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() +** is not a permanent error and does not affect the return value of ** sqlite3_backup_finish(). ** ** sqlite3_backup_remaining(), sqlite3_backup_pagecount() ** -** Each call to sqlite3_backup_step() sets two values stored internally -** by an [sqlite3_backup] object. The number of pages still to be backed -** up, which may be queried by sqlite3_backup_remaining(), and the total -** number of pages in the source database file, which may be queried by -** sqlite3_backup_pagecount(). +** ^Each call to sqlite3_backup_step() sets two values inside +** the [sqlite3_backup] object: the number of pages still to be backed +** up and the total number of pages in the source database file. +** The sqlite3_backup_remaining() and sqlite3_backup_pagecount() interfaces +** retrieve these two values, respectively. ** -** The values returned by these functions are only updated by -** sqlite3_backup_step(). If the source database is modified during a backup +** ^The values returned by these functions are only updated by +** sqlite3_backup_step(). ^If the source database is modified during a backup ** operation, then the values are not updated to account for any extra ** pages that need to be updated or the size of the source database file ** changing. ** ** Concurrent Usage of Database Handles ** -** The source [database connection] may be used by the application for other +** ^The source [database connection] may be used by the application for other ** purposes while a backup operation is underway or being initialized. -** If SQLite is compiled and configured to support threadsafe database +** ^If SQLite is compiled and configured to support threadsafe database ** connections, then the source database connection may be used concurrently ** from within other threads. ** -** However, the application must guarantee that the destination database -** connection handle is not passed to any other API (by any thread) after +** However, the application must guarantee that the destination +** [database connection] is not passed to any other API (by any thread) after ** sqlite3_backup_init() is called and before the corresponding call to -** sqlite3_backup_finish(). Unfortunately SQLite does not currently check -** for this, if the application does use the destination [database connection] -** for some other purpose during a backup operation, things may appear to -** work correctly but in fact be subtly malfunctioning. Use of the -** destination database connection while a backup is in progress might -** also cause a mutex deadlock. +** sqlite3_backup_finish(). SQLite does not currently check to see +** if the application incorrectly accesses the destination [database connection] +** and so no error code is reported, but the operations may malfunction +** nevertheless. Use of the destination database connection while a +** backup is in progress might also also cause a mutex deadlock. ** -** Furthermore, if running in [shared cache mode], the application must +** If running in [shared cache mode], the application must ** guarantee that the shared cache used by the destination database ** is not accessed while the backup is running. In practice this means -** that the application must guarantee that the file-system file being +** that the application must guarantee that the disk file being ** backed up to is not accessed by any connection within the process, ** not just the specific connection that was passed to sqlite3_backup_init(). ** @@ -5725,50 +6212,49 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); /* ** CAPI3REF: Unlock Notification -** EXPERIMENTAL ** -** When running in shared-cache mode, a database operation may fail with +** ^When running in shared-cache mode, a database operation may fail with ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or ** individual tables within the shared-cache cannot be obtained. See ** [SQLite Shared-Cache Mode] for a description of shared-cache locking. -** This API may be used to register a callback that SQLite will invoke +** ^This API may be used to register a callback that SQLite will invoke ** when the connection currently holding the required lock relinquishes it. -** This API is only available if the library was compiled with the +** ^This API is only available if the library was compiled with the ** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. ** ** See Also: [Using the SQLite Unlock Notification Feature]. ** -** Shared-cache locks are released when a database connection concludes +** ^Shared-cache locks are released when a database connection concludes ** its current transaction, either by committing it or rolling it back. ** -** When a connection (known as the blocked connection) fails to obtain a +** ^When a connection (known as the blocked connection) fails to obtain a ** shared-cache lock and SQLITE_LOCKED is returned to the caller, the ** identity of the database connection (the blocking connection) that -** has locked the required resource is stored internally. After an +** has locked the required resource is stored internally. ^After an ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. The +** when the blocking connections current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connections transaction. ** -** If sqlite3_unlock_notify() is called in a multi-threaded application, +** ^(If sqlite3_unlock_notify() is called in a multi-threaded application, ** there is a chance that the blocking connection will have already ** concluded its transaction by the time sqlite3_unlock_notify() is invoked. ** If this happens, then the specified callback is invoked immediately, -** from within the call to sqlite3_unlock_notify(). +** from within the call to sqlite3_unlock_notify().)^ ** -** If the blocked connection is attempting to obtain a write-lock on a +** ^If the blocked connection is attempting to obtain a write-lock on a ** shared-cache table, and more than one other connection currently holds ** a read-lock on the same table, then SQLite arbitrarily selects one of ** the other connections to use as the blocking connection. ** -** There may be at most one unlock-notify callback registered by a +** ^(There may be at most one unlock-notify callback registered by a ** blocked connection. If sqlite3_unlock_notify() is called when the ** blocked connection already has a registered unlock-notify callback, -** then the new callback replaces the old. If sqlite3_unlock_notify() is +** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is cancelled. The blocked connections +** unlock-notify callback is canceled. ^The blocked connections ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -5776,7 +6262,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** any sqlite3_xxx API functions from within an unlock-notify callback, a ** crash or deadlock may be the result. ** -** Unless deadlock is detected (see below), sqlite3_unlock_notify() always +** ^Unless deadlock is detected (see below), sqlite3_unlock_notify() always ** returns SQLITE_OK. ** ** Callback Invocation Details @@ -5790,7 +6276,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** When a blocking connections transaction is concluded, there may be ** more than one blocked connection that has registered for an unlock-notify -** callback. If two or more such blocked connections have specified the +** callback. ^If two or more such blocked connections have specified the ** same callback function, then instead of invoking the callback function ** multiple times, it is invoked once with the set of void* context pointers ** specified by the blocked connections bundled together into an array. @@ -5808,16 +6294,16 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** will proceed and the system may remain deadlocked indefinitely. ** ** To avoid this scenario, the sqlite3_unlock_notify() performs deadlock -** detection. If a given call to sqlite3_unlock_notify() would put the +** detection. ^If a given call to sqlite3_unlock_notify() would put the ** system in a deadlocked state, then SQLITE_LOCKED is returned and no ** unlock-notify callback is registered. The system is said to be in ** a deadlocked state if connection A has registered for an unlock-notify ** callback on the conclusion of connection B's transaction, and connection ** B has itself registered for an unlock-notify callback when connection -** A's transaction is concluded. Indirect deadlock is also detected, so +** A's transaction is concluded. ^Indirect deadlock is also detected, so ** the system is also considered to be deadlocked if connection B has ** registered for an unlock-notify callback on the conclusion of connection -** C's transaction, where connection C is waiting on connection A. Any +** C's transaction, where connection C is waiting on connection A. ^Any ** number of levels of indirection are allowed. ** ** The "DROP TABLE" Exception @@ -5833,10 +6319,10 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** or "DROP INDEX" query, an infinite loop might be the result. ** ** One way around this problem is to check the extended error code returned -** by an sqlite3_step() call. If there is a blocking connection, then the +** by an sqlite3_step() call. ^(If there is a blocking connection, then the ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in ** the special "DROP TABLE/INDEX" case, the extended error code is just -** SQLITE_LOCKED. +** SQLITE_LOCKED.)^ */ SQLITE_API int sqlite3_unlock_notify( sqlite3 *pBlocked, /* Waiting connection */ @@ -5847,15 +6333,120 @@ SQLITE_API int sqlite3_unlock_notify( /* ** CAPI3REF: String Comparison -** EXPERIMENTAL ** -** The [sqlite3_strnicmp()] API allows applications and extensions to +** ^The [sqlite3_strnicmp()] API allows applications and extensions to ** compare the contents of two buffers containing UTF-8 strings in a -** case-indendent fashion, using the same definition of case independence +** case-independent fashion, using the same definition of case independence ** that SQLite uses internally when comparing identifiers. */ SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); +/* +** CAPI3REF: Error Logging Interface +** +** ^The [sqlite3_log()] interface writes a message into the error log +** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. +** ^If logging is enabled, the zFormat string and subsequent arguments are +** used with [sqlite3_snprintf()] to generate the final output string. +** +** The sqlite3_log() interface is intended for use by extensions such as +** virtual tables, collating functions, and SQL functions. While there is +** nothing to prevent an application from calling sqlite3_log(), doing so +** is considered bad form. +** +** The zFormat string must not be NULL. +** +** To avoid deadlocks and other threading problems, the sqlite3_log() routine +** will not use dynamically allocated memory. The log message is stored in +** a fixed-length buffer on the stack. If the log message is longer than +** a few hundred characters, it will be truncated to the length of the +** buffer. +*/ +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); + +/* +** CAPI3REF: Write-Ahead Log Commit Hook +** +** ^The [sqlite3_wal_hook()] function is used to register a callback that +** will be invoked each time a database connection commits data to a +** [write-ahead log] (i.e. whenever a transaction is committed in +** [journal_mode | journal_mode=WAL mode]). +** +** ^The callback is invoked by SQLite after the commit has taken place and +** the associated write-lock on the database released, so the implementation +** may read, write or [checkpoint] the database as required. +** +** ^The first parameter passed to the callback function when it is invoked +** is a copy of the third parameter passed to sqlite3_wal_hook() when +** registering the callback. ^The second is a copy of the database handle. +** ^The third parameter is the name of the database that was written to - +** either "main" or the name of an [ATTACH]-ed database. ^The fourth parameter +** is the number of pages currently in the write-ahead log file, +** including those that were just committed. +** +** The callback function should normally return [SQLITE_OK]. ^If an error +** code is returned, that error will propagate back up through the +** SQLite code base to cause the statement that provoked the callback +** to report an error, though the commit will have still occurred. If the +** callback returns [SQLITE_ROW] or [SQLITE_DONE], or if it returns a value +** that does not correspond to any valid SQLite error code, the results +** are undefined. +** +** A single database handle may have at most a single write-ahead log callback +** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any +** previously registered write-ahead log callback. ^Note that the +** [sqlite3_wal_autocheckpoint()] interface and the +** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will +** those overwrite any prior [sqlite3_wal_hook()] settings. +*/ +SQLITE_API void *sqlite3_wal_hook( + sqlite3*, + int(*)(void *,sqlite3*,const char*,int), + void* +); + +/* +** CAPI3REF: Configure an auto-checkpoint +** +** ^The [sqlite3_wal_autocheckpoint(D,N)] is a wrapper around +** [sqlite3_wal_hook()] that causes any database on [database connection] D +** to automatically [checkpoint] +** after committing a transaction if there are N or +** more frames in the [write-ahead log] file. ^Passing zero or +** a negative value as the nFrame parameter disables automatic +** checkpoints entirely. +** +** ^The callback registered by this function replaces any existing callback +** registered using [sqlite3_wal_hook()]. ^Likewise, registering a callback +** using [sqlite3_wal_hook()] disables the automatic checkpoint mechanism +** configured by this function. +** +** ^The [wal_autocheckpoint pragma] can be used to invoke this interface +** from SQL. +** +** ^Every new [database connection] defaults to having the auto-checkpoint +** enabled with a threshold of 1000 pages. The use of this interface +** is only necessary if the default setting is found to be suboptimal +** for a particular application. +*/ +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N); + +/* +** CAPI3REF: Checkpoint a database +** +** ^The [sqlite3_wal_checkpoint(D,X)] interface causes database named X +** on [database connection] D to be [checkpointed]. ^If X is NULL or an +** empty string, then a checkpoint is run on all databases of +** connection D. ^If the database connection D is not in +** [WAL | write-ahead log mode] then this interface is a harmless no-op. +** +** ^The [wal_checkpoint pragma] can be used to invoke this interface +** from SQL. ^The [sqlite3_wal_autocheckpoint()] interface and the +** [wal_autocheckpoint pragma] can be used to cause this interface to be +** run whenever the WAL reaches a certain size threshold. +*/ +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); + /* ** Undo the hack that converts floating point types to integer for ** builds on processors without floating point support. @@ -5869,10 +6460,83 @@ SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); #endif #endif +/* +** 2010 August 30 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +*/ + +#ifndef _SQLITE3RTREE_H_ +#define _SQLITE3RTREE_H_ + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry; + +/* +** Register a geometry callback named zGeom that can be used as part of an +** R-Tree geometry query as follows: +** +** SELECT ... FROM WHERE MATCH $zGeom(... params ...) +*/ +SQLITE_API int sqlite3_rtree_geometry_callback( + sqlite3 *db, + const char *zGeom, + int (*xGeom)(sqlite3_rtree_geometry *, int nCoord, double *aCoord, int *pRes), + void *pContext +); + + +/* +** A pointer to a structure of the following type is passed as the first +** argument to callbacks registered using rtree_geometry_callback(). +*/ +struct sqlite3_rtree_geometry { + void *pContext; /* Copy of pContext passed to s_r_g_c() */ + int nParam; /* Size of array aParam[] */ + double *aParam; /* Parameters passed to SQL geom function */ + void *pUser; /* Callback implementation user data */ + void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */ +}; + + +#ifdef __cplusplus +} /* end of the 'extern "C"' block */ +#endif + +#endif /* ifndef _SQLITE3RTREE_H_ */ + /**************** End file: sqlite3.h **********/ /**************** Begin file: sqlite3ext.h **********/ +/* +** 2006 June 7 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** This header file defines the SQLite interface for use by +** shared libraries that want to be imported as extensions into +** an SQLite instance. Shared libraries that intend to be loaded +** as extensions by SQLite should #include this file instead of +** sqlite3.h. +*/ #ifndef _SQLITE3EXT_H_ #define _SQLITE3EXT_H_ /* #include "sqlite3.h" */ @@ -6053,7 +6717,7 @@ struct sqlite3_api_routines { /* ** The following macros redefine the API routines so that they are -** redirected through the global sqlite3_api structure. +** redirected throught the global sqlite3_api structure. ** ** This header file is also used by the loadext.c source file ** (part of the main SQLite library - not an extension) so that @@ -6063,171 +6727,171 @@ struct sqlite3_api_routines { ** SQLITE_CORE macros is undefined. */ #ifndef SQLITE_CORE -#define sqlite3_aggregate_context sqlite3_api->aggregate_context +#define SPLite3_aggregate_context sqlite3_api->aggregate_context #ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_aggregate_count sqlite3_api->aggregate_count +#define SPLite3_aggregate_count sqlite3_api->aggregate_count #endif -#define sqlite3_bind_blob sqlite3_api->bind_blob -#define sqlite3_bind_double sqlite3_api->bind_double -#define sqlite3_bind_int sqlite3_api->bind_int -#define sqlite3_bind_int64 sqlite3_api->bind_int64 -#define sqlite3_bind_null sqlite3_api->bind_null -#define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count -#define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index -#define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name -#define sqlite3_bind_text sqlite3_api->bind_text -#define sqlite3_bind_text16 sqlite3_api->bind_text16 -#define sqlite3_bind_value sqlite3_api->bind_value -#define sqlite3_busy_handler sqlite3_api->busy_handler -#define sqlite3_busy_timeout sqlite3_api->busy_timeout -#define sqlite3_changes sqlite3_api->changes -#define sqlite3_close sqlite3_api->close -#define sqlite3_collation_needed sqlite3_api->collation_needed -#define sqlite3_collation_needed16 sqlite3_api->collation_needed16 -#define sqlite3_column_blob sqlite3_api->column_blob -#define sqlite3_column_bytes sqlite3_api->column_bytes -#define sqlite3_column_bytes16 sqlite3_api->column_bytes16 -#define sqlite3_column_count sqlite3_api->column_count -#define sqlite3_column_database_name sqlite3_api->column_database_name -#define sqlite3_column_database_name16 sqlite3_api->column_database_name16 -#define sqlite3_column_decltype sqlite3_api->column_decltype -#define sqlite3_column_decltype16 sqlite3_api->column_decltype16 -#define sqlite3_column_double sqlite3_api->column_double -#define sqlite3_column_int sqlite3_api->column_int -#define sqlite3_column_int64 sqlite3_api->column_int64 -#define sqlite3_column_name sqlite3_api->column_name -#define sqlite3_column_name16 sqlite3_api->column_name16 -#define sqlite3_column_origin_name sqlite3_api->column_origin_name -#define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16 -#define sqlite3_column_table_name sqlite3_api->column_table_name -#define sqlite3_column_table_name16 sqlite3_api->column_table_name16 -#define sqlite3_column_text sqlite3_api->column_text -#define sqlite3_column_text16 sqlite3_api->column_text16 -#define sqlite3_column_type sqlite3_api->column_type -#define sqlite3_column_value sqlite3_api->column_value -#define sqlite3_commit_hook sqlite3_api->commit_hook -#define sqlite3_complete sqlite3_api->complete -#define sqlite3_complete16 sqlite3_api->complete16 -#define sqlite3_create_collation sqlite3_api->create_collation -#define sqlite3_create_collation16 sqlite3_api->create_collation16 -#define sqlite3_create_function sqlite3_api->create_function -#define sqlite3_create_function16 sqlite3_api->create_function16 -#define sqlite3_create_module sqlite3_api->create_module -#define sqlite3_create_module_v2 sqlite3_api->create_module_v2 -#define sqlite3_data_count sqlite3_api->data_count -#define sqlite3_db_handle sqlite3_api->db_handle -#define sqlite3_declare_vtab sqlite3_api->declare_vtab -#define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache -#define sqlite3_errcode sqlite3_api->errcode -#define sqlite3_errmsg sqlite3_api->errmsg -#define sqlite3_errmsg16 sqlite3_api->errmsg16 -#define sqlite3_exec sqlite3_api->exec +#define SPLite3_bind_blob sqlite3_api->bind_blob +#define SPLite3_bind_double sqlite3_api->bind_double +#define SPLite3_bind_int sqlite3_api->bind_int +#define SPLite3_bind_int64 sqlite3_api->bind_int64 +#define SPLite3_bind_null sqlite3_api->bind_null +#define SPLite3_bind_parameter_count sqlite3_api->bind_parameter_count +#define SPLite3_bind_parameter_index sqlite3_api->bind_parameter_index +#define SPLite3_bind_parameter_name sqlite3_api->bind_parameter_name +#define SPLite3_bind_text sqlite3_api->bind_text +#define SPLite3_bind_text16 sqlite3_api->bind_text16 +#define SPLite3_bind_value sqlite3_api->bind_value +#define SPLite3_busy_handler sqlite3_api->busy_handler +#define SPLite3_busy_timeout sqlite3_api->busy_timeout +#define SPLite3_changes sqlite3_api->changes +#define SPLite3_close sqlite3_api->close +#define SPLite3_collation_needed sqlite3_api->collation_needed +#define SPLite3_collation_needed16 sqlite3_api->collation_needed16 +#define SPLite3_column_blob sqlite3_api->column_blob +#define SPLite3_column_bytes sqlite3_api->column_bytes +#define SPLite3_column_bytes16 sqlite3_api->column_bytes16 +#define SPLite3_column_count sqlite3_api->column_count +#define SPLite3_column_database_name sqlite3_api->column_database_name +#define SPLite3_column_database_name16 sqlite3_api->column_database_name16 +#define SPLite3_column_decltype sqlite3_api->column_decltype +#define SPLite3_column_decltype16 sqlite3_api->column_decltype16 +#define SPLite3_column_double sqlite3_api->column_double +#define SPLite3_column_int sqlite3_api->column_int +#define SPLite3_column_int64 sqlite3_api->column_int64 +#define SPLite3_column_name sqlite3_api->column_name +#define SPLite3_column_name16 sqlite3_api->column_name16 +#define SPLite3_column_origin_name sqlite3_api->column_origin_name +#define SPLite3_column_origin_name16 sqlite3_api->column_origin_name16 +#define SPLite3_column_table_name sqlite3_api->column_table_name +#define SPLite3_column_table_name16 sqlite3_api->column_table_name16 +#define SPLite3_column_text sqlite3_api->column_text +#define SPLite3_column_text16 sqlite3_api->column_text16 +#define SPLite3_column_type sqlite3_api->column_type +#define SPLite3_column_value sqlite3_api->column_value +#define SPLite3_commit_hook sqlite3_api->commit_hook +#define SPLite3_complete sqlite3_api->complete +#define SPLite3_complete16 sqlite3_api->complete16 +#define SPLite3_create_collation sqlite3_api->create_collation +#define SPLite3_create_collation16 sqlite3_api->create_collation16 +#define SPLite3_create_function sqlite3_api->create_function +#define SPLite3_create_function16 sqlite3_api->create_function16 +#define SPLite3_create_module sqlite3_api->create_module +#define SPLite3_create_module_v2 sqlite3_api->create_module_v2 +#define SPLite3_data_count sqlite3_api->data_count +#define SPLite3_db_handle sqlite3_api->db_handle +#define SPLite3_declare_vtab sqlite3_api->declare_vtab +#define SPLite3_enable_shared_cache sqlite3_api->enable_shared_cache +#define SPLite3_errcode sqlite3_api->errcode +#define SPLite3_errmsg sqlite3_api->errmsg +#define SPLite3_errmsg16 sqlite3_api->errmsg16 +#define SPLite3_exec sqlite3_api->exec #ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_expired sqlite3_api->expired +#define SPLite3_expired sqlite3_api->expired #endif -#define sqlite3_finalize sqlite3_api->finalize -#define sqlite3_free sqlite3_api->free -#define sqlite3_free_table sqlite3_api->free_table -#define sqlite3_get_autocommit sqlite3_api->get_autocommit -#define sqlite3_get_auxdata sqlite3_api->get_auxdata -#define sqlite3_get_table sqlite3_api->get_table +#define SPLite3_finalize sqlite3_api->finalize +#define SPLite3_free sqlite3_api->free +#define SPLite3_free_table sqlite3_api->free_table +#define SPLite3_get_autocommit sqlite3_api->get_autocommit +#define SPLite3_get_auxdata sqlite3_api->get_auxdata +#define SPLite3_get_table sqlite3_api->get_table #ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_global_recover sqlite3_api->global_recover +#define SPLite3_global_recover sqlite3_api->global_recover #endif -#define sqlite3_interrupt sqlite3_api->interruptx -#define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid -#define sqlite3_libversion sqlite3_api->libversion -#define sqlite3_libversion_number sqlite3_api->libversion_number -#define sqlite3_malloc sqlite3_api->malloc -#define sqlite3_mprintf sqlite3_api->mprintf -#define sqlite3_open sqlite3_api->open -#define sqlite3_open16 sqlite3_api->open16 -#define sqlite3_prepare sqlite3_api->prepare -#define sqlite3_prepare16 sqlite3_api->prepare16 -#define sqlite3_prepare_v2 sqlite3_api->prepare_v2 -#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2 -#define sqlite3_profile sqlite3_api->profile -#define sqlite3_progress_handler sqlite3_api->progress_handler -#define sqlite3_realloc sqlite3_api->realloc -#define sqlite3_reset sqlite3_api->reset -#define sqlite3_result_blob sqlite3_api->result_blob -#define sqlite3_result_double sqlite3_api->result_double -#define sqlite3_result_error sqlite3_api->result_error -#define sqlite3_result_error16 sqlite3_api->result_error16 -#define sqlite3_result_int sqlite3_api->result_int -#define sqlite3_result_int64 sqlite3_api->result_int64 -#define sqlite3_result_null sqlite3_api->result_null -#define sqlite3_result_text sqlite3_api->result_text -#define sqlite3_result_text16 sqlite3_api->result_text16 -#define sqlite3_result_text16be sqlite3_api->result_text16be -#define sqlite3_result_text16le sqlite3_api->result_text16le -#define sqlite3_result_value sqlite3_api->result_value -#define sqlite3_rollback_hook sqlite3_api->rollback_hook -#define sqlite3_set_authorizer sqlite3_api->set_authorizer -#define sqlite3_set_auxdata sqlite3_api->set_auxdata -#define sqlite3_snprintf sqlite3_api->snprintf -#define sqlite3_step sqlite3_api->step -#define sqlite3_table_column_metadata sqlite3_api->table_column_metadata -#define sqlite3_thread_cleanup sqlite3_api->thread_cleanup -#define sqlite3_total_changes sqlite3_api->total_changes -#define sqlite3_trace sqlite3_api->trace +#define SPLite3_interrupt sqlite3_api->interruptx +#define SPLite3_last_insert_rowid sqlite3_api->last_insert_rowid +#define SPLite3_libversion sqlite3_api->libversion +#define SPLite3_libversion_number sqlite3_api->libversion_number +#define SPLite3_malloc sqlite3_api->malloc +#define SPLite3_mprintf sqlite3_api->mprintf +#define SPLite3_open sqlite3_api->open +#define SPLite3_open16 sqlite3_api->open16 +#define SPLite3_prepare sqlite3_api->prepare +#define SPLite3_prepare16 sqlite3_api->prepare16 +#define SPLite3_prepare_v2 sqlite3_api->prepare_v2 +#define SPLite3_prepare16_v2 sqlite3_api->prepare16_v2 +#define SPLite3_profile sqlite3_api->profile +#define SPLite3_progress_handler sqlite3_api->progress_handler +#define SPLite3_realloc sqlite3_api->realloc +#define SPLite3_reset sqlite3_api->reset +#define SPLite3_result_blob sqlite3_api->result_blob +#define SPLite3_result_double sqlite3_api->result_double +#define SPLite3_result_error sqlite3_api->result_error +#define SPLite3_result_error16 sqlite3_api->result_error16 +#define SPLite3_result_int sqlite3_api->result_int +#define SPLite3_result_int64 sqlite3_api->result_int64 +#define SPLite3_result_null sqlite3_api->result_null +#define SPLite3_result_text sqlite3_api->result_text +#define SPLite3_result_text16 sqlite3_api->result_text16 +#define SPLite3_result_text16be sqlite3_api->result_text16be +#define SPLite3_result_text16le sqlite3_api->result_text16le +#define SPLite3_result_value sqlite3_api->result_value +#define SPLite3_rollback_hook sqlite3_api->rollback_hook +#define SPLite3_set_authorizer sqlite3_api->set_authorizer +#define SPLite3_set_auxdata sqlite3_api->set_auxdata +#define SPLite3_snprintf sqlite3_api->snprintf +#define SPLite3_step sqlite3_api->step +#define SPLite3_table_column_metadata sqlite3_api->table_column_metadata +#define SPLite3_thread_cleanup sqlite3_api->thread_cleanup +#define SPLite3_total_changes sqlite3_api->total_changes +#define SPLite3_trace sqlite3_api->trace #ifndef SQLITE_OMIT_DEPRECATED -#define sqlite3_transfer_bindings sqlite3_api->transfer_bindings +#define SPLite3_transfer_bindings sqlite3_api->transfer_bindings #endif -#define sqlite3_update_hook sqlite3_api->update_hook -#define sqlite3_user_data sqlite3_api->user_data -#define sqlite3_value_blob sqlite3_api->value_blob -#define sqlite3_value_bytes sqlite3_api->value_bytes -#define sqlite3_value_bytes16 sqlite3_api->value_bytes16 -#define sqlite3_value_double sqlite3_api->value_double -#define sqlite3_value_int sqlite3_api->value_int -#define sqlite3_value_int64 sqlite3_api->value_int64 -#define sqlite3_value_numeric_type sqlite3_api->value_numeric_type -#define sqlite3_value_text sqlite3_api->value_text -#define sqlite3_value_text16 sqlite3_api->value_text16 -#define sqlite3_value_text16be sqlite3_api->value_text16be -#define sqlite3_value_text16le sqlite3_api->value_text16le -#define sqlite3_value_type sqlite3_api->value_type -#define sqlite3_vmprintf sqlite3_api->vmprintf -#define sqlite3_overload_function sqlite3_api->overload_function -#define sqlite3_prepare_v2 sqlite3_api->prepare_v2 -#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2 -#define sqlite3_clear_bindings sqlite3_api->clear_bindings -#define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob -#define sqlite3_blob_bytes sqlite3_api->blob_bytes -#define sqlite3_blob_close sqlite3_api->blob_close -#define sqlite3_blob_open sqlite3_api->blob_open -#define sqlite3_blob_read sqlite3_api->blob_read -#define sqlite3_blob_write sqlite3_api->blob_write -#define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2 -#define sqlite3_file_control sqlite3_api->file_control -#define sqlite3_memory_highwater sqlite3_api->memory_highwater -#define sqlite3_memory_used sqlite3_api->memory_used -#define sqlite3_mutex_alloc sqlite3_api->mutex_alloc -#define sqlite3_mutex_enter sqlite3_api->mutex_enter -#define sqlite3_mutex_free sqlite3_api->mutex_free -#define sqlite3_mutex_leave sqlite3_api->mutex_leave -#define sqlite3_mutex_try sqlite3_api->mutex_try -#define sqlite3_open_v2 sqlite3_api->open_v2 -#define sqlite3_release_memory sqlite3_api->release_memory -#define sqlite3_result_error_nomem sqlite3_api->result_error_nomem -#define sqlite3_result_error_toobig sqlite3_api->result_error_toobig -#define sqlite3_sleep sqlite3_api->sleep -#define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit -#define sqlite3_vfs_find sqlite3_api->vfs_find -#define sqlite3_vfs_register sqlite3_api->vfs_register -#define sqlite3_vfs_unregister sqlite3_api->vfs_unregister -#define sqlite3_threadsafe sqlite3_api->xthreadsafe -#define sqlite3_result_zeroblob sqlite3_api->result_zeroblob -#define sqlite3_result_error_code sqlite3_api->result_error_code -#define sqlite3_test_control sqlite3_api->test_control -#define sqlite3_randomness sqlite3_api->randomness -#define sqlite3_context_db_handle sqlite3_api->context_db_handle -#define sqlite3_extended_result_codes sqlite3_api->extended_result_codes -#define sqlite3_limit sqlite3_api->limit -#define sqlite3_next_stmt sqlite3_api->next_stmt -#define sqlite3_sql sqlite3_api->sql -#define sqlite3_status sqlite3_api->status +#define SPLite3_update_hook sqlite3_api->update_hook +#define SPLite3_user_data sqlite3_api->user_data +#define SPLite3_value_blob sqlite3_api->value_blob +#define SPLite3_value_bytes sqlite3_api->value_bytes +#define SPLite3_value_bytes16 sqlite3_api->value_bytes16 +#define SPLite3_value_double sqlite3_api->value_double +#define SPLite3_value_int sqlite3_api->value_int +#define SPLite3_value_int64 sqlite3_api->value_int64 +#define SPLite3_value_numeric_type sqlite3_api->value_numeric_type +#define SPLite3_value_text sqlite3_api->value_text +#define SPLite3_value_text16 sqlite3_api->value_text16 +#define SPLite3_value_text16be sqlite3_api->value_text16be +#define SPLite3_value_text16le sqlite3_api->value_text16le +#define SPLite3_value_type sqlite3_api->value_type +#define SPLite3_vmprintf sqlite3_api->vmprintf +#define SPLite3_overload_function sqlite3_api->overload_function +#define SPLite3_prepare_v2 sqlite3_api->prepare_v2 +#define SPLite3_prepare16_v2 sqlite3_api->prepare16_v2 +#define SPLite3_clear_bindings sqlite3_api->clear_bindings +#define SPLite3_bind_zeroblob sqlite3_api->bind_zeroblob +#define SPLite3_blob_bytes sqlite3_api->blob_bytes +#define SPLite3_blob_close sqlite3_api->blob_close +#define SPLite3_blob_open sqlite3_api->blob_open +#define SPLite3_blob_read sqlite3_api->blob_read +#define SPLite3_blob_write sqlite3_api->blob_write +#define SPLite3_create_collation_v2 sqlite3_api->create_collation_v2 +#define SPLite3_file_control sqlite3_api->file_control +#define SPLite3_memory_highwater sqlite3_api->memory_highwater +#define SPLite3_memory_used sqlite3_api->memory_used +#define SPLite3_mutex_alloc sqlite3_api->mutex_alloc +#define SPLite3_mutex_enter sqlite3_api->mutex_enter +#define SPLite3_mutex_free sqlite3_api->mutex_free +#define SPLite3_mutex_leave sqlite3_api->mutex_leave +#define SPLite3_mutex_try sqlite3_api->mutex_try +#define SPLite3_open_v2 sqlite3_api->open_v2 +#define SPLite3_release_memory sqlite3_api->release_memory +#define SPLite3_result_error_nomem sqlite3_api->result_error_nomem +#define SPLite3_result_error_toobig sqlite3_api->result_error_toobig +#define SPLite3_sleep sqlite3_api->sleep +#define SPLite3_soft_heap_limit sqlite3_api->soft_heap_limit +#define SPLite3_vfs_find sqlite3_api->vfs_find +#define SPLite3_vfs_register sqlite3_api->vfs_register +#define SPLite3_vfs_unregister sqlite3_api->vfs_unregister +#define SPLite3_threadsafe sqlite3_api->xthreadsafe +#define SPLite3_result_zeroblob sqlite3_api->result_zeroblob +#define SPLite3_result_error_code sqlite3_api->result_error_code +#define SPLite3_test_control sqlite3_api->test_control +#define SPLite3_randomness sqlite3_api->randomness +#define SPLite3_context_db_handle sqlite3_api->context_db_handle +#define SPLite3_extended_result_codes sqlite3_api->extended_result_codes +#define SPLite3_limit sqlite3_api->limit +#define SPLite3_next_stmt sqlite3_api->next_stmt +#define SPLite3_sql sqlite3_api->sql +#define SPLite3_status sqlite3_api->status #endif /* SQLITE_CORE */ #define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0; @@ -6254,7 +6918,6 @@ extern "C" #endif SPATIALITE_DECLARE const char *spatialite_version (void); - SPATIALITE_DECLARE const char *virtualtext_version (void); SPATIALITE_DECLARE void spatialite_init (int verbose); SPATIALITE_DECLARE int dump_shapefile (sqlite3 * sqlite, char *table, char *column, char *charset, @@ -6262,10 +6925,16 @@ extern "C" int verbose, int *rows); SPATIALITE_DECLARE int load_shapefile (sqlite3 * sqlite, char *shp_path, char *table, char *charset, int srid, - char *column, int verbose, + char *column, int coerce2d, + int compressed, int verbose, int *rows); + SPATIALITE_DECLARE int load_dbf (sqlite3 * sqlite, char *shp_path, + char *table, char *charset, int verbose, + int *rows); SPATIALITE_DECLARE double math_round (double value); SPATIALITE_DECLARE sqlite3_int64 math_llabs (sqlite3_int64 value); + SPATIALITE_DECLARE void spatial_ref_sys_init (sqlite3 * sqlite, + int verbose); #ifdef __cplusplus } @@ -6292,7 +6961,6 @@ extern "C" #endif SPATIALITE_DECLARE const char *spatialite_version (void); - SPATIALITE_DECLARE const char *virtualtext_version (void); SPATIALITE_DECLARE void spatialite_init (int verbose); SPATIALITE_DECLARE int dump_shapefile (sqlite3 * sqlite, char *table, char *column, char *charset, @@ -6300,10 +6968,16 @@ extern "C" int verbose, int *rows); SPATIALITE_DECLARE int load_shapefile (sqlite3 * sqlite, char *shp_path, char *table, char *charset, int srid, - char *column, int verbose, + char *column, int coerce2d, + int compressed, int verbose, int *rows); + SPATIALITE_DECLARE int load_dbf (sqlite3 * sqlite, char *shp_path, + char *table, char *charset, int verbose, + int *rows); SPATIALITE_DECLARE double math_round (double value); SPATIALITE_DECLARE sqlite3_int64 math_llabs (sqlite3_int64 value); + SPATIALITE_DECLARE void spatial_ref_sys_init (sqlite3 * sqlite, + int verbose); #ifdef __cplusplus } @@ -6331,11 +7005,9 @@ extern "C" /* function prototipes */ - GAIAAUX_DECLARE const char *gaiaGetLocaleCharset (); + GAIAAUX_DECLARE const char *gaiaGetLocaleCharset (void); GAIAAUX_DECLARE int gaiaConvertCharset (char **buf, const char *fromCs, const char *toCs); - GAIAAUX_DECLARE int gaiaToUTF8 (char **buf, const char *fromCs, - const char *toCs); GAIAAUX_DECLARE void *gaiaCreateUTF8Converter (const char *fromCS); GAIAAUX_DECLARE void gaiaFreeUTF8Converter (void *cvtCS); GAIAAUX_DECLARE char *gaiaConvertToUTF8 (void *cvtCS, const char *buf, @@ -6380,7 +7052,6 @@ extern "C" #define GAIA_PDF_BLOB 7 #define GAIA_GEOMETRY_BLOB 8 #define GAIA_TIFF_BLOB 9 -#define GAIA_WAVELET_BLOB 10 /* constants used for EXIF value types */ #define GAIA_EXIF_NONE 0 @@ -6643,6 +7314,7 @@ extern "C" /* constants used for VirtualNetwork */ #define GAIA_NET_START 0x67 #define GAIA_NET64_START 0x68 +#define GAIA_NET64_A_STAR_START 0x69 #define GAIA_NET_END 0x87 #define GAIA_NET_HEADER 0xc0 #define GAIA_NET_CODE 0xa6 @@ -6654,6 +7326,7 @@ extern "C" #define GAIA_NET_TO 0xa2 #define GAIA_NET_GEOM 0xa3 #define GAIA_NET_NAME 0xa4 +#define GAIA_NET_A_STAR_COEFF 0xa5 #define GAIA_NET_BLOCK 0xed /* constants used for Coordinate Dimensions */ @@ -6831,6 +7504,7 @@ extern "C" double MaxY; /* MBR - BBOX */ int DimensionModel; /* (x,y), (x,y,z), (x,y,m) or (x,y,z,m) */ int DeclaredType; /* the declared TYPE for this Geometry */ + struct gaiaGeomCollStruct *Next; /* Vanuatu - used for linked list */ } gaiaGeomColl; typedef gaiaGeomColl *gaiaGeomCollPtr; @@ -6859,7 +7533,7 @@ extern "C" char *Name; /* field name */ unsigned char Type; /* field type */ int Offset; /* buffer offset [this field begins at *buffer+offset* and extends for *length* bytes */ - unsigned char Length; /* field total length [in bytes] */ + unsigned char Length; /* field total lenght [in bytes] */ unsigned char Decimals; /* decimal positions */ gaiaValuePtr Value; /* the current multitype value for this attribute */ struct gaiaDbfFieldStruct *Next; /* pointer to next element in linked list */ @@ -6876,12 +7550,30 @@ extern "C" } gaiaDbfList; typedef gaiaDbfList *gaiaDbfListPtr; + typedef struct gaiaDbfStruct + { +/* DBF TYPE */ + int endian_arch; + int Valid; /* 1 = ready to process */ + char *Path; /* the DBF path */ + FILE *flDbf; /* the DBF file handle */ + gaiaDbfListPtr Dbf; /* the DBF attributes list */ + unsigned char *BufDbf; /* the DBF I/O buffer */ + int DbfHdsz; /* the DBF header length */ + int DbfReclen; /* the DBF record length */ + int DbfSize; /* current DBF size */ + int DbfRecno; /* current DBF record number */ + void *IconvObj; /* opaque reference to ICONV converter */ + char *LastError; /* last error message */ + } gaiaDbf; + typedef gaiaDbf *gaiaDbfPtr; + typedef struct gaiaShapefileStruct { /* SHAPEFILE TYPE */ int endian_arch; int Valid; /* 1 = ready to process */ - int ReadOnly; /* read or wite mode */ + int ReadOnly; /* read or write mode */ char *Path; /* the shapefile abstract path [no suffixes] */ FILE *flShx; /* the SHX file handle */ FILE *flShp; /* the SHP file handle */ @@ -6908,6 +7600,95 @@ extern "C" } gaiaShapefile; typedef gaiaShapefile *gaiaShapefilePtr; + typedef struct gaiaOutBufferStruct + { +/* a struct handling a dynamically growing output buffer */ + char *Buffer; + int WriteOffset; + int BufferSize; + int Error; + } gaiaOutBuffer; + typedef gaiaOutBuffer *gaiaOutBufferPtr; + +#ifndef OMIT_ICONV /* ICONV enabled: supporting text reader */ + +#define VRTTXT_FIELDS_MAX 65535 +#define VRTTXT_BLOCK_MAX 65535 + +#define VRTTXT_TEXT 1 +#define VRTTXT_INTEGER 2 +#define VRTTXT_DOUBLE 3 +#define VRTTXT_NULL 4 + + struct vrttxt_line + { +/* a struct representing a full LINE (aka Record) */ + off_t offset; + int len; + int field_offsets[VRTTXT_FIELDS_MAX]; + int num_fields; + int error; + }; + + struct vrttxt_row + { +/* a struct storing Row offsets */ + int line_no; + off_t offset; + int len; + int num_fields; + }; + + struct vrttxt_row_block + { +/* +/ for efficiency sake, individuale Row offsets +/ are grouped in reasonably sized blocks +*/ + struct vrttxt_row rows[VRTTXT_BLOCK_MAX]; + int num_rows; + int min_line_no; + int max_line_no; + struct vrttxt_row_block *next; + }; + + struct vrttxt_column_header + { +/* a struct representing a Column (aka Field) header */ + char *name; + int type; + }; + + typedef struct vrttxt_reader + { +/* the main TXT-Reader struct */ + struct vrttxt_column_header columns[VRTTXT_FIELDS_MAX]; + FILE *text_file; + void *toUtf8; /* the UTF-8 ICONV converter */ + char field_separator; + char text_separator; + char decimal_separator; + int first_line_titles; + int error; + struct vrttxt_row_block *first; + struct vrttxt_row_block *last; + struct vrttxt_row **rows; + int num_rows; + int line_no; + int max_fields; + int current_buf_sz; + int current_buf_off; + char *line_buffer; + char *field_buffer; + int field_offsets[VRTTXT_FIELDS_MAX]; + int field_lens[VRTTXT_FIELDS_MAX]; + int max_current_field; + int current_line_ready; + } gaiaTextReader; + typedef gaiaTextReader *gaiaTextReaderPtr; + +#endif /* end ICONV (text reader) */ + /* function prototipes */ GAIAGEO_DECLARE int gaiaEndianArch (void); @@ -7093,13 +7874,6 @@ extern "C" unsigned int size); GAIAGEO_DECLARE void gaiaToWkb (gaiaGeomCollPtr geom, unsigned char **result, int *size); - GAIAGEO_DECLARE int gaiaFromWkbNoCheck (const unsigned char *in, - unsigned int szin, - unsigned char **out, int *szout, - int srid); - GAIAGEO_DECLARE int gaiaToWkbNoCheck (const unsigned char *in, - unsigned int szin, - unsigned char **out, int *szout); GAIAGEO_DECLARE char *gaiaToHexWkb (gaiaGeomCollPtr geom); GAIAGEO_DECLARE void gaiaFreeValue (gaiaValuePtr p); GAIAGEO_DECLARE void gaiaSetNullValue (gaiaDbfFieldPtr field); @@ -7144,11 +7918,28 @@ extern "C" GAIAGEO_DECLARE int gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity); GAIAGEO_DECLARE void gaiaFlushShpHeaders (gaiaShapefilePtr shp); + GAIAGEO_DECLARE gaiaDbfPtr gaiaAllocDbf (void); + GAIAGEO_DECLARE void gaiaFreeDbf (gaiaDbfPtr dbf); + GAIAGEO_DECLARE void gaiaOpenDbfRead (gaiaDbfPtr dbf, + const char *path, + const char *charFrom, + const char *charTo); + GAIAGEO_DECLARE int gaiaReadDbfEntity (gaiaDbfPtr shp, int current_row, + int *deleted); GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseWkt (const unsigned char *dirty_buffer, short type); - GAIAGEO_DECLARE void gaiaOutWkt (gaiaGeomCollPtr geom, char **result); - GAIAGEO_DECLARE void gaiaOutSvg (gaiaGeomCollPtr geom, char **result, - int relative, int precision); + GAIAGEO_DECLARE void gaiaOutWkt (gaiaOutBufferPtr out_buf, + gaiaGeomCollPtr geom); + GAIAGEO_DECLARE void gaiaOutSvg (gaiaOutBufferPtr out_buf, + gaiaGeomCollPtr geom, int relative, + int precision); + GAIAGEO_DECLARE void gaiaOutBareKml (gaiaOutBufferPtr out_buf, + gaiaGeomCollPtr geom, int precision); + GAIAGEO_DECLARE void gaiaOutFullKml (gaiaOutBufferPtr out_buf, + const char *name, const char *desc, + gaiaGeomCollPtr geom, int precision); + GAIAGEO_DECLARE void gaiaOutGml (gaiaOutBufferPtr out_buf, int version, + int precision, gaiaGeomCollPtr geom); GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromFgf (const unsigned char *blob, unsigned int size); GAIAGEO_DECLARE void gaiaToFgf (gaiaGeomCollPtr geom, @@ -7237,6 +8028,21 @@ extern "C" double *coords, int vert); GAIAGEO_DECLARE int gaiaConvertLength (double value, int unit_from, int unit_to, double *cvt); + GAIAGEO_DECLARE int gaiaLineGetPoint (gaiaLinestringPtr ln, int v, + double *x, double *y, double *z, + double *m); + GAIAGEO_DECLARE int gaiaLineSetPoint (gaiaLinestringPtr ln, int v, double x, + double y, double z, double m); + GAIAGEO_DECLARE int gaiaRingGetPoint (gaiaRingPtr rng, int v, double *x, + double *y, double *z, double *m); + GAIAGEO_DECLARE int gaiaRingSetPoint (gaiaRingPtr rng, int v, double x, + double y, double z, double m); + GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSanitize (gaiaGeomCollPtr org); + GAIAGEO_DECLARE int gaiaIsToxic (gaiaGeomCollPtr org); + GAIAGEO_DECLARE void gaiaOutBufferInitialize (gaiaOutBufferPtr buf); + GAIAGEO_DECLARE void gaiaOutBufferReset (gaiaOutBufferPtr buf); + GAIAGEO_DECLARE void gaiaAppendToOutBuffer (gaiaOutBufferPtr buf, + const char *text); #ifndef OMIT_PROJ /* including PROJ.4 */ @@ -7250,6 +8056,12 @@ extern "C" #ifndef OMIT_GEOS /* including GEOS */ + GAIAGEO_DECLARE void gaiaResetGeosMsg (void); + GAIAGEO_DECLARE const char *gaiaGetGeosErrorMsg (void); + GAIAGEO_DECLARE const char *gaiaGetGeosWarningMsg (void); + GAIAGEO_DECLARE void gaiaSetGeosErrorMsg (const char *msg); + GAIAGEO_DECLARE void gaiaSetGeosWarningMsg (const char *msg); + GAIAGEO_DECLARE int gaiaGeomCollEquals (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2); GAIAGEO_DECLARE int gaiaGeomCollDisjoint (gaiaGeomCollPtr geom1, @@ -7317,6 +8129,25 @@ extern "C" #endif /* end including GEOS */ +#ifndef OMIT_ICONV /* ICONV enabled: supporting text reader */ + GAIAGEO_DECLARE gaiaTextReaderPtr gaiaTextReaderAlloc (const char *path, + char field_separator, + char text_separator, + char + decimal_separator, + int + first_line_titles, + const char + *encoding); + GAIAGEO_DECLARE void gaiaTextReaderDestroy (gaiaTextReaderPtr reader); + GAIAGEO_DECLARE int gaiaTextReaderParse (gaiaTextReaderPtr reader); + GAIAGEO_DECLARE int gaiaTextReaderGetRow (gaiaTextReaderPtr reader, + int row_num); + GAIAGEO_DECLARE int gaiaTextReaderFetchField (gaiaTextReaderPtr reader, + int field_num, int *type, + const char **value); +#endif /* end ICONV (text reader) */ + #ifdef __cplusplus } #endif @@ -7328,6 +8159,7 @@ extern "C" /**************** Begin file: spatialite.h **********/ int virtualshape_extension_init (sqlite3 * db); +int virtualdbf_extension_init (sqlite3 * db); int virtualtext_extension_init (sqlite3 * db); int virtualnetwork_extension_init (sqlite3 * db); int virtualfdo_extension_init (sqlite3 * db); @@ -7337,13 +8169,27 @@ int mbrcache_extension_init (sqlite3 * db); /**************** Begin file: gg_sqlaux.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif /* not WIN32 */ + GAIAGEO_DECLARE int gaiaIllegalSqlName (const char *name) { @@ -7427,6 +8273,7 @@ gaiaIsReservedSqliteName (const char *name) "LEFT", "LIKE", "LIMIT", + "MATCH", "NATURAL", "NOT", "NOTNULL", @@ -7438,6 +8285,7 @@ gaiaIsReservedSqliteName (const char *name) "PRAGMA", "PRIMARY", "REFERENCES", + "REPLACE", "RIGHT", "ROLLBACK", "SELECT", @@ -7860,16 +8708,29 @@ gaiaCleanSqlString (char *value) /**************** Begin file: gg_utf8.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ /* #include */ +#if OMIT_ICONV == 0 /* ICONV is absolutely required */ + #if defined(__MINGW32__) || defined(_WIN32) #define LIBICONV_STATIC /* #include */ #define LIBCHARSET_STATIC +#ifdef _MSC_VER +/* isn't supported on OSGeo4W */ +/* applying a tricky workaround to fix this issue */ +extern const char * locale_charset (void); +#else /* sane Windows - not OSGeo4W */ /* #include */ +#endif /* end localcharset */ #else /* not MINGW32 - WIN32 */ #ifdef __APPLE__ /* #include */ @@ -7981,22 +8842,40 @@ gaiaConvertToUTF8 (void *cvtCS, const char *buf, int buflen, int *err) utf8buf[maxlen - utf8len] = '\0'; return utf8buf; } + +#endif /* ICONV enabled/disabled */ + /**************** End file: gg_utf8.c **********/ /**************** Begin file: gaia_exif.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ /* #include */ /* #include */ +/* #include */ +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif /* not WIN32 */ + static void exifTagName (char gps, unsigned short tag_id, char *str, int len) { @@ -9161,9 +10040,10 @@ exifExpandIFD (gaiaExifTagListPtr list, const unsigned char *blob, unsigned int offset; unsigned short items; unsigned short i; - gaiaExifTagPtr tag = list->First; + gaiaExifTagPtr tag; if (!list) return; + tag = list->First; while (tag) { if (tag->TagId == 34665) @@ -9194,9 +10074,10 @@ exifExpandGPS (gaiaExifTagListPtr list, const unsigned char *blob, unsigned int offset; unsigned short items; unsigned short i; - gaiaExifTagPtr tag = list->First; + gaiaExifTagPtr tag; if (!list) return; + tag = list->First; while (tag) { if (tag->TagId == 34853) @@ -10291,36 +11172,6 @@ gaiaExifTagGetHumanReadable (const gaiaExifTagPtr tag, char *str, int len, *ok = 0; } -static int -check_wavelet (const unsigned char *blob, int blob_size) -{ -/* testing WAVELET */ - int len; - char to_check[64]; - int ok_header = 0; - int ok_footer = 0; -/* checking the header */ - strcpy (to_check, "StartWaveletsImage$$"); - len = strlen (to_check); - if (blob_size > len) - { - if (memcmp ((char *) blob, to_check, len + 1) == 0) - ok_header = 1; - } -/* checking the footer */ - strcpy (to_check, "$$EndWaveletsImage"); - len = strlen (to_check); - if (blob_size > len) - { - if (memcmp - ((char *) blob + (blob_size - (len + 1)), to_check, len + 1) == 0) - ok_footer = 1; - } - if (ok_header && ok_footer) - return 1; - return 0; -} - GAIAEXIF_DECLARE int gaiaGuessBlobType (const unsigned char *blob, int size) { @@ -10378,8 +11229,6 @@ gaiaGuessBlobType (const unsigned char *blob, int size) tiff_signature_big[3] = 0x2a; if (size < 1 || !blob) return GAIA_HEX_BLOB; - if (check_wavelet (blob, size)) - return GAIA_WAVELET_BLOB; if (size > 4) { if (memcmp (blob, tiff_signature_big, 4) == 0) @@ -10679,12 +11528,22 @@ gaiaGetGpsLatLong (const unsigned char *blob, int size, char *latlong, /**************** Begin file: gg_advanced.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ /* #include */ +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ GAIAGEO_DECLARE double @@ -11265,7 +12124,7 @@ appendRingLine (gaiaDynamicLinePtr dyn, gaiaLinestringPtr line, int reverse) { gaiaGetPointXYM (line->Coords, i, &x, &y, &m); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_Z_M) { gaiaGetPointXYZM (line->Coords, i, &x, &y, &z, &m); } @@ -11289,7 +12148,7 @@ appendRingLine (gaiaDynamicLinePtr dyn, gaiaLinestringPtr line, int reverse) { gaiaGetPointXYM (line->Coords, i, &x, &y, &m); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_Z_M) { gaiaGetPointXYZM (line->Coords, i, &x, &y, &z, &m); } @@ -11324,7 +12183,7 @@ prependRingLine (gaiaDynamicLinePtr dyn, gaiaLinestringPtr line, int reverse) { gaiaGetPointXYM (line->Coords, i, &x, &y, &m); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_Z_M) { gaiaGetPointXYZM (line->Coords, i, &x, &y, &z, &m); } @@ -11348,7 +12207,7 @@ prependRingLine (gaiaDynamicLinePtr dyn, gaiaLinestringPtr line, int reverse) { gaiaGetPointXYM (line->Coords, i, &x, &y, &m); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_Z_M) { gaiaGetPointXYZM (line->Coords, i, &x, &y, &z, &m); } @@ -11431,7 +12290,7 @@ gaiaBuildRings (gaiaGeomCollPtr line_geom) gaiaGetPointXYM (pre->Line->Coords, 0, &x0, &y0, &m); } - else if (pre->Line->DimensionModel == GAIA_XY_Z) + else if (pre->Line->DimensionModel == GAIA_XY_Z_M) { gaiaGetPointXYZM (pre->Line->Coords, 0, &x0, &y0, &z, &m); @@ -11452,7 +12311,7 @@ gaiaBuildRings (gaiaGeomCollPtr line_geom) pre->Line->Points - 1, &xn, &yn, &m); } - else if (pre->Line->DimensionModel == GAIA_XY_Z) + else if (pre->Line->DimensionModel == GAIA_XY_Z_M) { gaiaGetPointXYZM (pre->Line->Coords, pre->Line->Points - 1, &xn, &yn, @@ -11568,10 +12427,20 @@ gaiaBuildRings (gaiaGeomCollPtr line_geom) /**************** Begin file: gg_endian.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ GAIAGEO_DECLARE int @@ -12168,13 +13037,23 @@ gaiaExportI64 (unsigned char *p, sqlite3_int64 value, int little_endian, /**************** Begin file: gg_geometries.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ /* #include */ /* #include */ +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ GAIAGEO_DECLARE gaiaPointPtr @@ -12321,6 +13200,84 @@ gaiaFreeLinestring (gaiaLinestringPtr ptr) } } +GAIAGEO_DECLARE int +gaiaLineGetPoint (gaiaLinestringPtr ln, int v, double *x, double *y, double *z, + double *m) +{ +/* SAFE - getting coords for a vertex in LINESTRING */ + double vx; + double vy; + double vz; + double vm; + *x = 0.0; + *y = 0.0; + *z = 0.0; + *m = 0.0; + if (!ln) + return 0; + if (v < 0 || v >= ln->Points) + return 0; + switch (ln->DimensionModel) + { + case GAIA_XY: + gaiaGetPoint (ln->Coords, v, &vx, &vy); + *x = vx; + *y = vy; + break; + case GAIA_XY_Z: + gaiaGetPointXYZ (ln->Coords, v, &vx, &vy, &vz); + *x = vx; + *y = vy; + *z = vz; + break; + case GAIA_XY_M: + gaiaGetPointXYM (ln->Coords, v, &vx, &vy, &vm); + *x = vx; + *y = vy; + *m = vm; + break; + case GAIA_XY_Z_M: + gaiaGetPointXYZM (ln->Coords, v, &vx, &vy, &vz, &vm); + *x = vx; + *y = vy; + *z = vz; + *m = vm; + break; + default: + return 0; + }; + return 1; +} + +GAIAGEO_DECLARE int +gaiaLineSetPoint (gaiaLinestringPtr ln, int v, double x, double y, double z, + double m) +{ +/* SAFE - setting coords for a vertex in RING */ + if (!ln) + return 0; + if (v < 0 || v >= ln->Points) + return 0; + switch (ln->DimensionModel) + { + case GAIA_XY: + gaiaSetPoint (ln->Coords, v, x, y); + break; + case GAIA_XY_Z: + gaiaSetPointXYZ (ln->Coords, v, x, y, z); + break; + case GAIA_XY_M: + gaiaSetPointXYM (ln->Coords, v, x, y, m); + break; + case GAIA_XY_Z_M: + gaiaSetPointXYZM (ln->Coords, v, x, y, z, m); + break; + default: + return 0; + }; + return 1; +} + GAIAGEO_DECLARE void gaiaCopyLinestringCoords (gaiaLinestringPtr dst, gaiaLinestringPtr src) { @@ -12481,6 +13438,84 @@ gaiaFreeRing (gaiaRingPtr ptr) } } +GAIAGEO_DECLARE int +gaiaRingGetPoint (gaiaRingPtr rng, int v, double *x, double *y, double *z, + double *m) +{ +/* SAFE - getting coords for a vertex in RING */ + double vx; + double vy; + double vz; + double vm; + *x = 0.0; + *y = 0.0; + *z = 0.0; + *m = 0.0; + if (!rng) + return 0; + if (v < 0 || v >= rng->Points) + return 0; + switch (rng->DimensionModel) + { + case GAIA_XY: + gaiaGetPoint (rng->Coords, v, &vx, &vy); + *x = vx; + *y = vy; + break; + case GAIA_XY_Z: + gaiaGetPointXYZ (rng->Coords, v, &vx, &vy, &vz); + *x = vx; + *y = vy; + *z = vz; + break; + case GAIA_XY_M: + gaiaGetPointXYM (rng->Coords, v, &vx, &vy, &vm); + *x = vx; + *y = vy; + *m = vm; + break; + case GAIA_XY_Z_M: + gaiaGetPointXYZM (rng->Coords, v, &vx, &vy, &vz, &vm); + *x = vx; + *y = vy; + *z = vz; + *m = vm; + break; + default: + return 0; + }; + return 1; +} + +GAIAGEO_DECLARE int +gaiaRingSetPoint (gaiaRingPtr rng, int v, double x, double y, double z, + double m) +{ +/* SAFE - getting coords for a vertex in RING */ + if (!rng) + return 0; + if (v < 0 || v >= rng->Points) + return 0; + switch (rng->DimensionModel) + { + case GAIA_XY: + gaiaSetPoint (rng->Coords, v, x, y); + break; + case GAIA_XY_Z: + gaiaSetPointXYZ (rng->Coords, v, x, y, z); + break; + case GAIA_XY_M: + gaiaSetPointXYM (rng->Coords, v, x, y, m); + break; + case GAIA_XY_Z_M: + gaiaSetPointXYZM (rng->Coords, v, x, y, z, m); + break; + default: + return 0; + }; + return 1; +} + GAIAGEO_DECLARE void gaiaCopyRingCoords (gaiaRingPtr dst, gaiaRingPtr src) { @@ -12548,7 +13583,7 @@ gaiaCloneRing (gaiaRingPtr ring) if (ring->DimensionModel == GAIA_XY_Z) new_ring = gaiaAllocRingXYZ (ring->Points); else if (ring->DimensionModel == GAIA_XY_M) - new_ring = gaiaAllocRing (ring->Points); + new_ring = gaiaAllocRingXYM (ring->Points); else if (ring->DimensionModel == GAIA_XY_Z_M) new_ring = gaiaAllocRingXYZM (ring->Points); else @@ -12727,7 +13762,7 @@ gaiaCreatePolygon (gaiaRingPtr ring) if (ring->DimensionModel == GAIA_XY_Z) p->Exterior = gaiaAllocRingXYZ (ring->Points); else if (ring->DimensionModel == GAIA_XY_M) - p->Exterior = gaiaAllocRing (ring->Points); + p->Exterior = gaiaAllocRingXYM (ring->Points); else if (ring->DimensionModel == GAIA_XY_Z_M) p->Exterior = gaiaAllocRingXYZM (ring->Points); else @@ -12792,8 +13827,17 @@ gaiaCloneGeomColl (gaiaGeomCollPtr geom) while (point) { /* copying POINTs */ - gaiaAddPointToGeomCollXYZM (new_geom, point->X, point->Y, point->Z, - point->M); + if (geom->DimensionModel == GAIA_XY_Z) + gaiaAddPointToGeomCollXYZ (new_geom, point->X, point->Y, + point->Z); + else if (geom->DimensionModel == GAIA_XY_M) + gaiaAddPointToGeomCollXYM (new_geom, point->X, point->Y, + point->M); + else if (geom->DimensionModel == GAIA_XY_Z_M) + gaiaAddPointToGeomCollXYZM (new_geom, point->X, point->Y, + point->Z, point->M); + else + gaiaAddPointToGeomColl (new_geom, point->X, point->Y); point = point->Next; } line = geom->FirstLinestring; @@ -13072,6 +14116,7 @@ gaiaAllocGeomColl () p->MaxY = -DBL_MAX; p->DimensionModel = GAIA_XY; p->DeclaredType = GAIA_UNKNOWN; + p->Next = NULL; return p; } @@ -13095,6 +14140,7 @@ gaiaAllocGeomCollXYZ () p->MaxY = -DBL_MAX; p->DimensionModel = GAIA_XY_Z; p->DeclaredType = GAIA_UNKNOWN; + p->Next = NULL; return p; } @@ -13118,6 +14164,7 @@ gaiaAllocGeomCollXYM () p->MaxY = -DBL_MAX; p->DimensionModel = GAIA_XY_M; p->DeclaredType = GAIA_UNKNOWN; + p->Next = NULL; return p; } @@ -13141,6 +14188,7 @@ gaiaAllocGeomCollXYZM () p->MaxY = -DBL_MAX; p->DimensionModel = GAIA_XY_Z_M; p->DeclaredType = GAIA_UNKNOWN; + p->Next = NULL; return p; } @@ -13977,6 +15025,7 @@ gaiaZRangeLinestring (gaiaLinestringPtr line, double *min, double *max) for (iv = 0; iv < line->Points; iv++) { z = 0.0; + m = 0.0; if (line->DimensionModel == GAIA_XY_Z) { gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); @@ -14014,6 +15063,7 @@ gaiaZRangeRing (gaiaRingPtr rng, double *min, double *max) for (iv = 0; iv < rng->Points; iv++) { z = 0.0; + m = 0.0; if (rng->DimensionModel == GAIA_XY_Z) { gaiaGetPointXYZ (rng->Coords, iv, &x, &y, &z); @@ -14488,12 +15538,54 @@ gaiaGeometryAliasType (gaiaGeomCollPtr geom) } if (n_points == 0 && n_linestrings == 0 && n_polygons == 0) return GAIA_UNKNOWN; - if (n_points > 0 && n_linestrings == 0 && n_polygons == 0) - return GAIA_MULTIPOINT; - if (n_points == 0 && n_linestrings > 0 && n_polygons == 0) - return GAIA_MULTILINESTRING; - if (n_points == 0 && n_linestrings == 0 && n_polygons > 0) - return GAIA_MULTIPOLYGON; + if (n_points == 1 && n_linestrings == 0 && n_polygons == 0) + { + if (geom->DeclaredType == GAIA_MULTIPOINT) + return GAIA_MULTIPOINT; + else if (geom->DeclaredType == GAIA_GEOMETRYCOLLECTION) + return GAIA_GEOMETRYCOLLECTION; + else + return GAIA_POINT; + } + if (n_points >= 1 && n_linestrings == 0 && n_polygons == 0) + { + if (geom->DeclaredType == GAIA_GEOMETRYCOLLECTION) + return GAIA_GEOMETRYCOLLECTION; + else + return GAIA_MULTIPOINT; + } + if (n_points == 0 && n_linestrings == 1 && n_polygons == 0) + { + if (geom->DeclaredType == GAIA_MULTILINESTRING) + return GAIA_MULTILINESTRING; + else if (geom->DeclaredType == GAIA_GEOMETRYCOLLECTION) + return GAIA_GEOMETRYCOLLECTION; + else + return GAIA_LINESTRING; + } + if (n_points == 0 && n_linestrings >= 1 && n_polygons == 0) + { + if (geom->DeclaredType == GAIA_GEOMETRYCOLLECTION) + return GAIA_GEOMETRYCOLLECTION; + else + return GAIA_MULTILINESTRING; + } + if (n_points == 0 && n_linestrings == 0 && n_polygons == 1) + { + if (geom->DeclaredType == GAIA_MULTIPOLYGON) + return GAIA_MULTIPOLYGON; + else if (geom->DeclaredType == GAIA_GEOMETRYCOLLECTION) + return GAIA_GEOMETRYCOLLECTION; + else + return GAIA_POLYGON; + } + if (n_points == 0 && n_linestrings == 0 && n_polygons >= 1) + { + if (geom->DeclaredType == GAIA_GEOMETRYCOLLECTION) + return GAIA_GEOMETRYCOLLECTION; + else + return GAIA_MULTIPOLYGON; + } return GAIA_GEOMETRYCOLLECTION; } @@ -15044,21 +16136,690 @@ gaiaGetMbrMaxY (const unsigned char *blob, unsigned int size, double *maxy) *maxy = gaiaImport64 (blob + 30, little_endian, endian_arch); return 1; } + +GAIAGEO_DECLARE gaiaGeomCollPtr +gaiaSanitize (gaiaGeomCollPtr geom) +{ +/* +/ sanitizes a GEOMETRYCOLLECTION: +/ - repeated vertices are omitted +/ - ring closure is enforced anyway +*/ + int iv; + int ib; + double x = 0.0; + double y = 0.0; + double z = 0.0; + double m = 0.0; + double first_x; + double first_y; + double first_z; + double first_m; + double last_x = 0.0; + double last_y = 0.0; + double last_z = 0.0; + double last_m = 0.0; + int points; + gaiaPointPtr point; + gaiaLinestringPtr line; + gaiaLinestringPtr new_line; + gaiaPolygonPtr polyg; + gaiaPolygonPtr new_polyg; + gaiaGeomCollPtr new_geom; + gaiaRingPtr i_ring; + gaiaRingPtr o_ring; + if (!geom) + return NULL; + if (geom->DimensionModel == GAIA_XY_Z) + new_geom = gaiaAllocGeomCollXYZ (); + else if (geom->DimensionModel == GAIA_XY_M) + new_geom = gaiaAllocGeomCollXYM (); + else if (geom->DimensionModel == GAIA_XY_Z_M) + new_geom = gaiaAllocGeomCollXYZM (); + else + new_geom = gaiaAllocGeomColl (); + new_geom->Srid = geom->Srid; + new_geom->DeclaredType = geom->DeclaredType; + point = geom->FirstPoint; + while (point) + { + /* copying POINTs */ + gaiaAddPointToGeomCollXYZM (new_geom, point->X, point->Y, point->Z, + point->M); + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + /* sanitizing LINESTRINGs */ + points = 0; + for (iv = 0; iv < line->Points; iv++) + { + /* PASS I - checking points */ + z = 0.0; + m = 0.0; + if (line->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); + } + else if (line->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); + } + else if (line->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (line->Coords, iv, &x, &y); + } + if (iv > 0) + { + if (last_x == x && last_y == y && last_z == z) + ; + else + points++; + } + else + points++; + last_x = x; + last_y = y; + last_z = z; + last_m = m; + } + if (points < 2) + { + /* illegal LINESTRING - copying the original one */ + new_line = gaiaAddLinestringToGeomColl (new_geom, line->Points); + gaiaCopyLinestringCoords (new_line, line); + } + else + { + /* valid LINESTRING - sanitizing */ + new_line = gaiaAddLinestringToGeomColl (new_geom, points); + points = 0; + for (iv = 0; iv < line->Points; iv++) + { + /* PASS II - inserting points */ + z = 0.0; + m = 0.0; + if (line->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); + } + else if (line->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); + } + else if (line->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (line->Coords, iv, &x, &y); + } + if (iv > 0) + { + if (last_x == x && last_y == y && last_z == z) + ; + else + { + if (new_line->DimensionModel == GAIA_XY_Z) + { + gaiaSetPointXYZ (new_line->Coords, + points, x, y, z); + } + else if (new_line->DimensionModel == + GAIA_XY_M) + { + gaiaSetPointXYM (new_line->Coords, + points, x, y, m); + } + else if (new_line->DimensionModel == + GAIA_XY_Z_M) + { + gaiaSetPointXYZM (new_line->Coords, + points, x, y, z, m); + } + else + { + gaiaSetPoint (new_line->Coords, points, + x, y); + } + points++; + } + } + else + { + if (new_line->DimensionModel == GAIA_XY_Z) + { + gaiaSetPointXYZ (new_line->Coords, points, x, + y, z); + } + else if (new_line->DimensionModel == GAIA_XY_M) + { + gaiaSetPointXYM (new_line->Coords, points, x, + y, m); + } + else if (new_line->DimensionModel == GAIA_XY_Z_M) + { + gaiaSetPointXYZM (new_line->Coords, points, x, + y, z, m); + } + else + { + gaiaSetPoint (new_line->Coords, points, x, y); + } + points++; + } + last_x = x; + last_y = y; + last_z = z; + last_m = m; + } + } + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + /* copying POLYGONs */ + i_ring = polyg->Exterior; + /* sanitizing EXTERIOR RING */ + points = 0; + for (iv = 0; iv < i_ring->Points; iv++) + { + /* PASS I - checking points */ + z = 0.0; + m = 0.0; + if (i_ring->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (i_ring->Coords, iv, &x, &y, &z); + } + else if (i_ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (i_ring->Coords, iv, &x, &y, &m); + } + else if (i_ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (i_ring->Coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (i_ring->Coords, iv, &x, &y); + } + if (iv > 0) + { + if (last_x == x && last_y == y && last_z == z) + ; + else + points++; + } + else + { + first_x = x; + first_y = y; + first_z = z; + first_m = m; + points++; + } + last_x = x; + last_y = y; + last_z = z; + last_m = m; + } + if (last_x == x && last_y == y && last_z == z) + ; + else + { + /* forcing RING closure */ + points++; + } + if (points < 4) + { + /* illegal RING - copying the original one */ + new_polyg = + gaiaAddPolygonToGeomColl (new_geom, i_ring->Points, + polyg->NumInteriors); + o_ring = new_polyg->Exterior; + gaiaCopyRingCoords (o_ring, i_ring); + } + else + { + /* valid RING - sanitizing */ + new_polyg = + gaiaAddPolygonToGeomColl (new_geom, points, + polyg->NumInteriors); + o_ring = new_polyg->Exterior; + points = 0; + for (iv = 0; iv < i_ring->Points; iv++) + { + /* PASS II - inserting points */ + z = 0.0; + m = 0.0; + if (i_ring->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (i_ring->Coords, iv, &x, &y, &z); + } + else if (i_ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (i_ring->Coords, iv, &x, &y, &m); + } + else if (i_ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (i_ring->Coords, iv, &x, &y, &z, + &m); + } + else + { + gaiaGetPoint (i_ring->Coords, iv, &x, &y); + } + if (iv > 0) + { + if (last_x == x && last_y == y && last_z == z) + ; + else + { + if (o_ring->DimensionModel == GAIA_XY_Z) + { + gaiaSetPointXYZ (o_ring->Coords, points, + x, y, z); + } + else if (o_ring->DimensionModel == GAIA_XY_M) + { + gaiaSetPointXYM (o_ring->Coords, points, + x, y, m); + } + else if (o_ring->DimensionModel == + GAIA_XY_Z_M) + { + gaiaSetPointXYZM (o_ring->Coords, + points, x, y, z, m); + } + else + { + gaiaSetPoint (o_ring->Coords, points, x, + y); + } + points++; + } + } + else + { + if (o_ring->DimensionModel == GAIA_XY_Z) + { + gaiaSetPointXYZ (o_ring->Coords, points, x, + y, z); + } + else if (o_ring->DimensionModel == GAIA_XY_M) + { + gaiaSetPointXYM (o_ring->Coords, points, x, + y, m); + } + else if (o_ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaSetPointXYZM (o_ring->Coords, points, x, + y, z, m); + } + else + { + gaiaSetPoint (o_ring->Coords, points, x, y); + } + points++; + } + last_x = x; + last_y = y; + last_z = z; + last_m = m; + } + } + /* PASS III - forcing RING closure */ + z = 0.0; + m = 0.0; + if (i_ring->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (i_ring->Coords, 0, &x, &y, &z); + } + else if (i_ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (i_ring->Coords, 0, &x, &y, &m); + } + else if (i_ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (i_ring->Coords, 0, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (i_ring->Coords, 0, &x, &y); + } + points = o_ring->Points - 1; + if (o_ring->DimensionModel == GAIA_XY_Z) + { + gaiaSetPointXYZ (o_ring->Coords, points, x, y, z); + } + else if (o_ring->DimensionModel == GAIA_XY_M) + { + gaiaSetPointXYM (o_ring->Coords, points, x, y, m); + } + else if (o_ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaSetPointXYZM (o_ring->Coords, points, x, y, z, m); + } + else + { + gaiaSetPoint (o_ring->Coords, points, x, y); + } + for (ib = 0; ib < new_polyg->NumInteriors; ib++) + { + /* copying each INTERIOR RING [if any] */ + i_ring = polyg->Interiors + ib; + /* sanitizing an INTERIOR RING */ + points = 0; + for (iv = 0; iv < i_ring->Points; iv++) + { + /* PASS I - checking points */ + z = 0.0; + m = 0.0; + if (i_ring->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (i_ring->Coords, iv, &x, &y, &z); + } + else if (i_ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (i_ring->Coords, iv, &x, &y, &m); + } + else if (i_ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (i_ring->Coords, iv, &x, &y, &z, + &m); + } + else + { + gaiaGetPoint (i_ring->Coords, iv, &x, &y); + } + if (iv > 0) + { + if (last_x == x && last_y == y && last_z == z) + ; + else + points++; + } + else + { + first_x = x; + first_y = y; + first_z = z; + first_m = m; + points++; + } + last_x = x; + last_y = y; + last_z = z; + last_m = m; + } + if (last_x == x && last_y == y && last_z == z) + ; + else + { + /* forcing RING closure */ + points++; + } + if (points < 4) + { + /* illegal RING - copying the original one */ + o_ring = + gaiaAddInteriorRing (new_polyg, ib, i_ring->Points); + gaiaCopyRingCoords (o_ring, i_ring); + } + else + { + /* valid RING - sanitizing */ + o_ring = gaiaAddInteriorRing (new_polyg, ib, points); + points = 0; + for (iv = 0; iv < i_ring->Points; iv++) + { + /* PASS II - inserting points */ + z = 0.0; + m = 0.0; + if (i_ring->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (i_ring->Coords, iv, &x, &y, + &z); + } + else if (i_ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (i_ring->Coords, iv, &x, &y, + &m); + } + else if (i_ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (i_ring->Coords, iv, &x, &y, + &z, &m); + } + else + { + gaiaGetPoint (i_ring->Coords, iv, &x, &y); + } + if (iv > 0) + { + if (last_x == x && last_y == y && last_z == z) + ; + else + { + if (o_ring->DimensionModel == GAIA_XY_Z) + { + gaiaSetPointXYZ (o_ring->Coords, + points, x, y, z); + } + else if (o_ring->DimensionModel == + GAIA_XY_M) + { + gaiaSetPointXYM (o_ring->Coords, + points, x, y, m); + } + else if (o_ring->DimensionModel == + GAIA_XY_Z_M) + { + gaiaSetPointXYZM (o_ring->Coords, + points, x, y, z, + m); + } + else + { + gaiaSetPoint (o_ring->Coords, + points, x, y); + } + points++; + } + } + else + { + if (o_ring->DimensionModel == GAIA_XY_Z) + { + gaiaSetPointXYZ (o_ring->Coords, points, + x, y, z); + } + else if (o_ring->DimensionModel == GAIA_XY_M) + { + gaiaSetPointXYM (o_ring->Coords, points, + x, y, m); + } + else if (o_ring->DimensionModel == + GAIA_XY_Z_M) + { + gaiaSetPointXYZM (o_ring->Coords, + points, x, y, z, m); + } + else + { + gaiaSetPoint (o_ring->Coords, points, x, + y); + } + points++; + } + last_x = x; + last_y = y; + last_z = z; + last_m = m; + } + /* PASS III - forcing RING closure */ + z = 0.0; + m = 0.0; + if (i_ring->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (i_ring->Coords, 0, &x, &y, &z); + } + else if (i_ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (i_ring->Coords, 0, &x, &y, &m); + } + else if (i_ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (i_ring->Coords, 0, &x, &y, &z, + &m); + } + else + { + gaiaGetPoint (i_ring->Coords, 0, &x, &y); + } + points = o_ring->Points - 1; + if (o_ring->DimensionModel == GAIA_XY_Z) + { + gaiaSetPointXYZ (o_ring->Coords, points, x, y, z); + } + else if (o_ring->DimensionModel == GAIA_XY_M) + { + gaiaSetPointXYM (o_ring->Coords, points, x, y, m); + } + else if (o_ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaSetPointXYZM (o_ring->Coords, points, x, y, z, + m); + } + else + { + gaiaSetPoint (o_ring->Coords, points, x, y); + } + } + } + polyg = polyg->Next; + } + return new_geom; +} + +GAIAGEO_DECLARE int +gaiaIsToxic (gaiaGeomCollPtr geom) +{ +/* +/ identifying toxic geometries +/ i.e. geoms making GEOS to crash !!! +*/ + int ib; + gaiaPointPtr point; + gaiaLinestringPtr line; + gaiaPolygonPtr polyg; + gaiaRingPtr ring; + if (!geom) + return 0; + point = geom->FirstPoint; + while (point) + { + /* checking POINTs */ + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + /* checking LINESTRINGs */ + if (line->Points < 2) + return 1; + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + /* checking POLYGONs */ + ring = polyg->Exterior; + if (ring->Points < 4) + return 1; + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + if (ring->Points < 4) + return 1; + } + polyg = polyg->Next; + } + return 0; +} /**************** End file: gg_geometries.c **********/ /**************** Begin file: gg_relations.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ +/* #include */ #ifndef OMIT_GEOS /* including GEOS */ /* #include */ #endif +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ +/* GLOBAL variables */ +char gaia_geos_error_msg[2048]; +char gaia_geos_warning_msg[2048]; + +GAIAGEO_DECLARE void +gaiaResetGeosMsg () +{ +/* resets the GEOS error and warning messages */ + *gaia_geos_error_msg = '\0'; + *gaia_geos_warning_msg = '\0'; +} + +GAIAGEO_DECLARE const char * +gaiaGetGeosErrorMsg () +{ +/* return the latest GEOS error message */ + return gaia_geos_error_msg; +} + +GAIAGEO_DECLARE const char * +gaiaGetGeosWarningMsg () +{ +/* return the latest GEOS error message */ + return gaia_geos_warning_msg; +} + +GAIAGEO_DECLARE void +gaiaSetGeosErrorMsg (const char *msg) +{ +/* return the latest GEOS error message */ + strcpy (gaia_geos_error_msg, msg); +} + +GAIAGEO_DECLARE void +gaiaSetGeosWarningMsg (const char *msg) +{ +/* return the latest GEOS error message */ + strcpy (gaia_geos_warning_msg, msg); +} + static int check_point (double *coords, int points, double x, double y) { @@ -15384,10 +17145,10 @@ gaiaGeometryIntersection (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2) geo = gaiaFromGeos_XYZM (g3); else geo = gaiaFromGeos_XY (g3); + GEOSGeom_destroy (g3); if (geo == NULL) return NULL; geo->Srid = geom1->Srid; - GEOSGeom_destroy (g3); return geo; } @@ -15414,21 +17175,19 @@ gaiaGeometryUnion (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2) geo = gaiaFromGeos_XYZM (g3); else geo = gaiaFromGeos_XY (g3); + GEOSGeom_destroy (g3); if (geo == NULL) return NULL; geo->Srid = geom1->Srid; - if (geo-> - DeclaredType == GAIA_POINT && geom1->DeclaredType == GAIA_MULTIPOINT) + if (geo->DeclaredType == GAIA_POINT && + geom1->DeclaredType == GAIA_MULTIPOINT) geo->DeclaredType = GAIA_MULTIPOINT; - if (geo-> - DeclaredType - == GAIA_LINESTRING && geom1->DeclaredType == GAIA_MULTILINESTRING) + if (geo->DeclaredType == GAIA_LINESTRING && + geom1->DeclaredType == GAIA_MULTILINESTRING) geo->DeclaredType = GAIA_MULTILINESTRING; - if (geo-> - DeclaredType - == GAIA_POLYGON && geom1->DeclaredType == GAIA_MULTIPOLYGON) + if (geo->DeclaredType == GAIA_POLYGON && + geom1->DeclaredType == GAIA_MULTIPOLYGON) geo->DeclaredType = GAIA_MULTIPOLYGON; - GEOSGeom_destroy (g3); return geo; } @@ -15457,10 +17216,10 @@ gaiaGeometryDifference (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2) geo = gaiaFromGeos_XYZM (g3); else geo = gaiaFromGeos_XY (g3); + GEOSGeom_destroy (g3); if (geo == NULL) return NULL; geo->Srid = geom1->Srid; - GEOSGeom_destroy (g3); return geo; } @@ -15489,10 +17248,10 @@ gaiaGeometrySymDifference (gaiaGeomCollPtr geom1, gaiaGeomCollPtr geom2) geo = gaiaFromGeos_XYZM (g3); else geo = gaiaFromGeos_XY (g3); + GEOSGeom_destroy (g3); if (geo == NULL) return NULL; geo->Srid = geom1->Srid; - GEOSGeom_destroy (g3); return geo; } @@ -15518,10 +17277,10 @@ gaiaBoundary (gaiaGeomCollPtr geom) geo = gaiaFromGeos_XYZM (g2); else geo = gaiaFromGeos_XY (g2); + GEOSGeom_destroy (g2); if (geo == NULL) return NULL; geo->Srid = geom->Srid; - GEOSGeom_destroy (g2); return geo; } @@ -15547,6 +17306,7 @@ gaiaGeomCollCentroid (gaiaGeomCollPtr geom, double *x, double *y) geo = gaiaFromGeos_XYZM (g2); else geo = gaiaFromGeos_XY (g2); + GEOSGeom_destroy (g2); if (geo == NULL) return 0; if (geo->FirstPoint) @@ -15582,6 +17342,7 @@ gaiaGetPointOnSurface (gaiaGeomCollPtr geom, double *x, double *y) geo = gaiaFromGeos_XYZM (g2); else geo = gaiaFromGeos_XY (g2); + GEOSGeom_destroy (g2); if (geo == NULL) return 0; if (geo->FirstPoint) @@ -15687,8 +17448,11 @@ gaiaIsValid (gaiaGeomCollPtr geom) /* checks if this GEOMETRYCOLLECTION is a valid one */ int ret; GEOSGeometry *g; + gaiaResetGeosMsg (); if (!geom) return -1; + if (gaiaIsToxic (geom)) + return 0; g = gaiaToGeos (geom); ret = GEOSisValid (g); GEOSGeom_destroy (g); @@ -15719,6 +17483,7 @@ gaiaGeomCollSimplify (gaiaGeomCollPtr geom, double tolerance) geo = gaiaFromGeos_XYZM (g2); else geo = gaiaFromGeos_XY (g2); + GEOSGeom_destroy (g2); if (geo == NULL) return NULL; geo->Srid = geom->Srid; @@ -15747,6 +17512,7 @@ gaiaGeomCollSimplifyPreserveTopology (gaiaGeomCollPtr geom, double tolerance) geo = gaiaFromGeos_XYZM (g2); else geo = gaiaFromGeos_XY (g2); + GEOSGeom_destroy (g2); if (geo == NULL) return NULL; geo->Srid = geom->Srid; @@ -15775,6 +17541,7 @@ gaiaConvexHull (gaiaGeomCollPtr geom) geo = gaiaFromGeos_XYZM (g2); else geo = gaiaFromGeos_XY (g2); + GEOSGeom_destroy (g2); if (geo == NULL) return NULL; geo->Srid = geom->Srid; @@ -15803,12 +17570,83 @@ gaiaGeomCollBuffer (gaiaGeomCollPtr geom, double radius, int points) geo = gaiaFromGeos_XYZM (g2); else geo = gaiaFromGeos_XY (g2); + GEOSGeom_destroy (g2); if (geo == NULL) return NULL; geo->Srid = geom->Srid; return geo; } +static int +polygonize_eval_rings (gaiaRingPtr rng1, gaiaRingPtr rng2) +{ +/* checking if two rings are identical */ + int iv1; + int iv2; + double x1; + double y1; + double z1; + double m; + double x2; + double y2; + double z2; + int count = 0; + if (rng1->Points != rng2->Points) + return 0; + if (rng1->DimensionModel != rng2->DimensionModel) + return 0; + for (iv1 = 0; iv1 < rng1->Points; iv1++) + { + if (rng1->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (rng1->Coords, iv1, &x1, &y1, &z1); + } + else if (rng1->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (rng1->Coords, iv1, &x1, &y1, &m); + z1 = 0.0; + } + else if (rng1->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (rng1->Coords, iv1, &x1, &y1, &z1, &m); + } + else + { + gaiaGetPoint (rng1->Coords, iv1, &x1, &y1); + z1 = 0.0; + } + for (iv2 = 0; iv2 < rng2->Points; iv2++) + { + if (rng2->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (rng2->Coords, iv2, &x2, &y2, &z2); + } + else if (rng2->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (rng2->Coords, iv2, &x2, &y2, &m); + z2 = 0.0; + } + else if (rng2->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (rng2->Coords, iv2, &x2, &y2, &z2, &m); + } + else + { + gaiaGetPoint (rng2->Coords, iv2, &x2, &y2); + z2 = 0.0; + } + if (x1 == x2 && y1 == y2 && z1 == z2) + { + count++; + break; + } + } + } + if (count == rng1->Points) + return 1; + return 0; +} + GAIAGEO_DECLARE gaiaGeomCollPtr gaiaPolygonize (gaiaGeomCollPtr geom_org, int force_multipolygon) { @@ -15821,6 +17659,8 @@ gaiaPolygonize (gaiaGeomCollPtr geom_org, int force_multipolygon) gaiaLinestringPtr ln2; gaiaPointPtr pt; gaiaPolygonPtr pg; + gaiaPolygonPtr *polygons; + char *valids; GEOSGeometry **g_array; GEOSGeometry *g2; double x; @@ -15830,6 +17670,7 @@ gaiaPolygonize (gaiaGeomCollPtr geom_org, int force_multipolygon) int npt; int nln; int npg; + int ipg; if (!geom_org) return NULL; ln1 = geom_org->FirstLinestring; @@ -15892,6 +17733,10 @@ gaiaPolygonize (gaiaGeomCollPtr geom_org, int force_multipolygon) } } *(g_array + n_geoms) = gaiaToGeos (geom); + + /* memory cleanup: Kashif Rasul 14 Jan 2010 */ + gaiaFreeGeomColl (geom); + n_geoms++; ln1 = ln1->Next; } @@ -15939,6 +17784,61 @@ gaiaPolygonize (gaiaGeomCollPtr geom_org, int force_multipolygon) gaiaFreeGeomColl (result); return NULL; } + polygons = malloc (sizeof (gaiaPolygonPtr) * npg); + valids = malloc (sizeof (char) * npg); + ipg = 0; + pg = result->FirstPolygon; + while (pg) + { + /* identifying any INTERIOR RING corresponding to some EXTERIOR RING */ + gaiaRingPtr ext_rng = pg->Exterior; + gaiaPolygonPtr pg2 = result->FirstPolygon; + polygons[ipg] = pg; + valids[ipg] = 1; + while (pg2) + { + if (pg != pg2) + { + gaiaRingPtr int_rng; + int ib; + for (ib = 0; ib < pg2->NumInteriors; ib++) + { + int_rng = pg2->Interiors + ib; + if (polygonize_eval_rings (int_rng, ext_rng)) + { + /* marking a POLYGON to be deleted */ + valids[ipg] = 0; + break; + } + } + if (valids[ipg] == 0) + break; + } + pg2 = pg2->Next; + } + ipg++; + pg = pg->Next; + } +/* rebuilding the POLYGONs list */ + result->FirstPolygon = NULL; + result->LastPolygon = NULL; + for (ipg = 0; ipg < npg; ipg++) + { + if (valids[ipg] == 0) + gaiaFreePolygon (polygons[ipg]); + else + { + pg = polygons[ipg]; + pg->Next = NULL; + if (result->FirstPolygon == NULL) + result->FirstPolygon = pg; + if (result->LastPolygon != NULL) + result->LastPolygon->Next = pg; + result->LastPolygon = pg; + } + } + free (polygons); + free (valids); result->Srid = geom_org->Srid; if (npg == 1) { @@ -15958,6 +17858,11 @@ gaiaPolygonize (gaiaGeomCollPtr geom_org, int force_multipolygon) /**************** Begin file: gg_geoscvt.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ @@ -15965,7 +17870,12 @@ gaiaPolygonize (gaiaGeomCollPtr geom_org, int force_multipolygon) /* #include */ #endif +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ #ifndef OMIT_GEOS /* including GEOS */ @@ -16817,6 +18727,11 @@ gaiaFromGeos_XYZM (const void *xgeos) /**************** Begin file: gg_shape.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ @@ -16824,11 +18739,19 @@ gaiaFromGeos_XYZM (const void *xgeos) /* #include */ /* #include */ -#ifdef __MINGW32__ +#if OMIT_ICONV == 0 /* if ICONV is disabled no SHP support is available */ + +#if defined(__MINGW32__) || defined(_WIN32) #define LIBICONV_STATIC /* #include */ #define LIBCHARSET_STATIC +#ifdef _MSC_VER +/* isn't supported on OSGeo4W */ +/* applying a tricky workaround to fix this issue */ +extern const char * locale_charset (void); +#else /* sane Windows - not OSGeo4W */ /* #include */ +#endif /* end localcharset */ #else /* not MINGW32 */ #ifdef __APPLE__ /* #include */ @@ -16838,9 +18761,21 @@ gaiaFromGeos_XYZM (const void *xgeos) /* #include */ #endif #endif + +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ +#ifdef _WIN32 +#define atoll _atoi64 +#endif /* not WIN32 */ + +#define SHAPEFILE_NO_DATA 1e-38 + GAIAGEO_DECLARE void gaiaFreeValue (gaiaValuePtr p) { @@ -16975,6 +18910,8 @@ gaiaFreeDbfList (gaiaDbfListPtr list) gaiaFreeDbfField (p); p = pn; } + if (list->Geometry) + gaiaFreeGeomColl (list->Geometry); free (list); } @@ -17003,10 +18940,10 @@ gaiaAddDbfField (gaiaDbfListPtr list, char *name, unsigned char type, int offset, unsigned char length, unsigned char decimals) { /* inserts a Field in the DBF Fields list */ - gaiaDbfFieldPtr p = - gaiaAllocDbfField (name, type, offset, length, decimals); + gaiaDbfFieldPtr p; if (!list) return NULL; + p = gaiaAllocDbfField (name, type, offset, length, decimals); if (!(list->First)) list->First = p; if (list->Last) @@ -17030,8 +18967,6 @@ gaiaResetDbfEntity (gaiaDbfListPtr list) p->Value = NULL; p = p->Next; } - if (list->Geometry) - gaiaFreeGeomColl (list->Geometry); list->Geometry = NULL; } @@ -17173,13 +19108,11 @@ gaiaOpenShpRead (gaiaShapefilePtr shp, const char *path, const char *charFrom, char utf8buf[2048]; #ifdef __MINGW32__ const char *pBuf; - int len; - int utf8len; #else /* not MINGW32 */ char *pBuf; +#endif size_t len; size_t utf8len; -#endif char *pUtf8buf; int endian_arch = gaiaEndianArch (); gaiaDbfListPtr dbf_list = NULL; @@ -17471,13 +19404,11 @@ gaiaOpenShpWrite (gaiaShapefilePtr shp, const char *path, int shape, char utf8buf[2048]; #ifdef __MINGW32__ const char *pBuf; - int len; - int utf8len; #else /* not MINGW32 */ char *pBuf; +#endif size_t len; size_t utf8len; -#endif char *pUtf8buf; int defaultId = 1; if (charFrom && charTo) @@ -17818,27 +19749,119 @@ to_sqlite_julian_date (int year, int month, int day, double *julian) return 1; } +static int +parseDbfField (unsigned char *buf_dbf, void *iconv_obj, gaiaDbfFieldPtr pFld) +{ +/* parsing a generic DBF field */ + unsigned char buf[512]; + char utf8buf[2048]; +#ifdef __MINGW32__ + const char *pBuf; +#else /* not MINGW32 */ + char *pBuf; +#endif + size_t len; + size_t utf8len; + char *pUtf8buf; + int i; + memcpy (buf, buf_dbf + pFld->Offset + 1, pFld->Length); + buf[pFld->Length] = '\0'; + if (*buf == '\0') + gaiaSetNullValue (pFld); + else + { + if (pFld->Type == 'N') + { + /* NUMERIC value */ + if (pFld->Decimals > 0 || pFld->Length > 18) + gaiaSetDoubleValue (pFld, atof ((char *) buf)); + else + gaiaSetIntValue (pFld, atoll ((char *) buf)); + } + else if (pFld->Type == 'F') + { + /* FLOAT value */ + gaiaSetDoubleValue (pFld, atof ((char *) buf)); + } + else if (pFld->Type == 'D') + { + /* DATE value */ + if (strlen ((char *) buf) != 8) + gaiaSetNullValue (pFld); + else + { + /* converting into a Julian Date */ + double julian; + char date[5]; + int year = 0; + int month = 0; + int day = 0; + date[0] = buf[0]; + date[1] = buf[1]; + date[2] = buf[2]; + date[3] = buf[3]; + date[4] = '\0'; + year = atoi (date); + date[0] = buf[4]; + date[1] = buf[5]; + date[2] = '\0'; + month = atoi (date); + date[0] = buf[6]; + date[1] = buf[7]; + date[2] = '\0'; + day = atoi (date); + if (to_sqlite_julian_date (year, month, day, &julian)) + gaiaSetDoubleValue (pFld, julian); + else + gaiaSetNullValue (pFld); + } + } + else if (pFld->Type == 'L') + { + /* LOGICAL [aka Boolean] value */ + if (*buf == '1' || *buf == 't' || *buf == 'T' + || *buf == 'Y' || *buf == 'y') + gaiaSetIntValue (pFld, 1); + else + gaiaSetIntValue (pFld, 0); + } + else + { + /* CHARACTER [aka String, Text] value */ + for (i = strlen ((char *) buf) - 1; i > 1; i--) + { + /* cleaning up trailing spaces */ + if (buf[i] == ' ') + buf[i] = '\0'; + else + break; + } + len = strlen ((char *) buf); + utf8len = 2048; + pBuf = (char *) buf; + pUtf8buf = utf8buf; + if (iconv + ((iconv_t) (iconv_obj), &pBuf, &len, &pUtf8buf, + &utf8len) == (size_t) (-1)) + return 0; + memcpy (buf, utf8buf, 2048 - utf8len); + buf[2048 - utf8len] = '\0'; + gaiaSetStrValue (pFld, (char *) buf); + } + } + return 1; +} + GAIAGEO_DECLARE int gaiaReadShpEntity (gaiaShapefilePtr shp, int current_row, int srid) { /* trying to read an entity from shapefile */ unsigned char buf[512]; - char utf8buf[2048]; -#ifdef __MINGW32__ - const char *pBuf; int len; - int utf8len; -#else /* not MINGW32 */ - char *pBuf; - size_t len; - size_t utf8len; -#endif - char *pUtf8buf; int rd; int skpos; int offset; int off_shp; - int i; int sz; int shape; double x; @@ -18142,6 +20165,8 @@ gaiaReadShpEntity (gaiaShapefilePtr shp, int current_row, int srid) shp->endian_arch); else m = 0.0; + if (m < SHAPEFILE_NO_DATA) + m = 0.0; if (shp->EffectiveDims == GAIA_XY_Z) { gaiaSetPointXYZ (line->Coords, points, x, y, z); @@ -18233,6 +20258,8 @@ gaiaReadShpEntity (gaiaShapefilePtr shp, int current_row, int srid) shp->endian_arch); else m = 0.0; + if (m < SHAPEFILE_NO_DATA) + m = 0.0; if (shp->EffectiveDims == GAIA_XY_Z) { gaiaSetPointXYZ (line->Coords, points, x, y, 0.0); @@ -18421,6 +20448,8 @@ gaiaReadShpEntity (gaiaShapefilePtr shp, int current_row, int srid) shp->endian_arch); else m = 0.0; + if (m < SHAPEFILE_NO_DATA) + m = 0.0; if (shp->EffectiveDims == GAIA_XY_Z) { gaiaSetPointXYZ (ring->Coords, points, x, y, z); @@ -18526,6 +20555,8 @@ gaiaReadShpEntity (gaiaShapefilePtr shp, int current_row, int srid) GAIA_LITTLE_ENDIAN, shp->endian_arch); m = 0.0; + if (m < SHAPEFILE_NO_DATA) + m = 0.0; if (shp->EffectiveDims == GAIA_XY_Z) { gaiaSetPointXYZ (ring->Coords, points, x, y, 0.0); @@ -18660,6 +20691,8 @@ gaiaReadShpEntity (gaiaShapefilePtr shp, int current_row, int srid) GAIA_LITTLE_ENDIAN, shp->endian_arch); else m = 0.0; + if (m < SHAPEFILE_NO_DATA) + m = 0.0; if (shp->EffectiveDims == GAIA_XY_Z) gaiaAddPointToGeomCollXYZ (geom, x, y, z); else if (shp->EffectiveDims == GAIA_XY_M) @@ -18710,6 +20743,8 @@ gaiaReadShpEntity (gaiaShapefilePtr shp, int current_row, int srid) GAIA_LITTLE_ENDIAN, shp->endian_arch); else m = 0.0; + if (m < SHAPEFILE_NO_DATA) + m = 0.0; if (shp->EffectiveDims == GAIA_XY_Z) gaiaAddPointToGeomCollXYZ (geom, x, y, 0.0); else if (shp->EffectiveDims == GAIA_XY_M) @@ -18729,92 +20764,8 @@ gaiaReadShpEntity (gaiaShapefilePtr shp, int current_row, int srid) pFld = shp->Dbf->First; while (pFld) { - memcpy (buf, shp->BufDbf + pFld->Offset + 1, pFld->Length); - buf[pFld->Length] = '\0'; - if (*buf == '\0') - gaiaSetNullValue (pFld); - else - { - if (pFld->Type == 'N') - { - /* NUMERIC value */ - if (pFld->Decimals > 0 || pFld->Length > 18) - gaiaSetDoubleValue (pFld, atof ((char *) buf)); - else - gaiaSetIntValue (pFld, atoll ((char *) buf)); - } - else if (pFld->Type == 'F') - { - /* FLOAT value */ - gaiaSetDoubleValue (pFld, atof ((char *) buf)); - } - else if (pFld->Type == 'D') - { - /* DATE value */ - if (strlen ((char *) buf) != 8) - gaiaSetNullValue (pFld); - else - { - /* converting into a Julian Date */ - double julian; - char date[5]; - int year = 0; - int month = 0; - int day = 0; - date[0] = buf[0]; - date[1] = buf[1]; - date[2] = buf[2]; - date[3] = buf[3]; - date[4] = '\0'; - year = atoi (date); - date[0] = buf[4]; - date[1] = buf[5]; - date[2] = '\0'; - month = atoi (date); - date[0] = buf[6]; - date[1] = buf[7]; - date[2] = '\0'; - day = atoi (date); - if (to_sqlite_julian_date - (year, month, day, &julian)) - gaiaSetDoubleValue (pFld, julian); - else - gaiaSetNullValue (pFld); - } - } - else if (pFld->Type == 'L') - { - /* LOGICAL [aka Boolean] value */ - if (*buf == '1' || *buf == 't' || *buf == 'T' - || *buf == 'Y' || *buf == 'y') - gaiaSetIntValue (pFld, 1); - else - gaiaSetIntValue (pFld, 0); - } - else - { - /* CHARACTER [aka String, Text] value */ - for (i = strlen ((char *) buf) - 1; i > 1; i--) - { - /* cleaning up trailing spaces */ - if (buf[i] == ' ') - buf[i] = '\0'; - else - break; - } - len = strlen ((char *) buf); - utf8len = 2048; - pBuf = (char *) buf; - pUtf8buf = utf8buf; - if (iconv - ((iconv_t) (shp->IconvObj), &pBuf, &len, &pUtf8buf, - &utf8len) == (size_t) (-1)) - goto conversion_error; - memcpy (buf, utf8buf, 2048 - utf8len); - buf[2048 - utf8len] = '\0'; - gaiaSetStrValue (pFld, (char *) buf); - } - } + if (!parseDbfField (shp->BufDbf, shp->IconvObj, pFld)) + goto conversion_error; pFld = pFld->Next; } if (shp->LastError) @@ -18985,13 +20936,11 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) double maxM; #ifdef __MINGW32__ const char *pBuf; - int len; - int utf8len; #else /* not MINGW32 */ char *pBuf; +#endif size_t len; size_t utf8len; -#endif char *pUtf8buf; char buf[512]; char utf8buf[2048]; @@ -19073,7 +21022,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) } if (fld->Value->Type == GAIA_DOUBLE_VALUE) { - sprintf (fmt, "%%1.%dlf", fld->Decimals); + sprintf (fmt, "%%1.%df", fld->Decimals); sprintf (dummy, fmt, fld->Value->DblValue); if (strlen (dummy) <= fld->Length) memcpy (shp->BufDbf + fld->Offset + 1, dummy, @@ -19091,7 +21040,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) gaiaExport32 (shp->BufShp + 4, 2, GAIA_BIG_ENDIAN, endian_arch); /* exports entitiy size [in 16 bits words !!!] */ fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* updating current SHX file position [in 16 bits words !!!] */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, 2, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_NULL, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = NULL */ fwrite (shp->BufShp, 1, 12, shp->flShp); @@ -19130,7 +21079,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* updating current SHX file position [in 16 bits words !!!] */ /* inserting POINT into SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, 10, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POINT, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = POINT */ gaiaExport64 (shp->BufShp + 12, pt->X, GAIA_LITTLE_ENDIAN, endian_arch); /* exports X coordinate */ @@ -19159,7 +21108,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* updating current SHX file position [in 16 bits words !!!] */ /* inserting POINT into SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, 18, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POINTZ, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = POINT Z */ gaiaExport64 (shp->BufShp + 12, pt->X, GAIA_LITTLE_ENDIAN, endian_arch); /* exports X coordinate */ @@ -19190,7 +21139,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* updating current SHX file position [in 16 bits words !!!] */ /* inserting POINT into SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, 14, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POINTM, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = POINT M */ gaiaExport64 (shp->BufShp + 12, pt->X, GAIA_LITTLE_ENDIAN, endian_arch); /* exports X coordinate */ @@ -19238,7 +21187,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* inserting LINESTRING or MULTILINESTRING in SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYLINE, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = POLYLINE */ gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the MBR for this geometry */ @@ -19328,8 +21277,8 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) return 0; } hasM = 0; - if (line->DimensionModel == GAIA_XY_M - || line->DimensionModel == GAIA_XY_Z_M) + if (shp->EffectiveDims == GAIA_XY_M + || shp->EffectiveDims == GAIA_XY_Z_M) hasM = 1; if (hasM) this_size = 38 + (2 * tot_ln) + (tot_v * 16); /* size [in 16 bits words !!!] ZM */ @@ -19348,7 +21297,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* inserting LINESTRING or MULTILINESTRING in SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYLINEZ, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = POLYLINE Z */ gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the MBR for this geometry */ @@ -19534,7 +21483,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* inserting LINESTRING or MULTILINESTRING in SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYLINEM, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = POLYLINE M */ gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the MBR for this geometry */ @@ -19686,7 +21635,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* inserting POLYGON or MULTIPOLYGON in SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYGON, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = POLYGON */ gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the MBR for this geometry */ @@ -19834,8 +21783,8 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) return 0; } hasM = 0; - if (ring->DimensionModel == GAIA_XY_M - || ring->DimensionModel == GAIA_XY_Z_M) + if (shp->EffectiveDims == GAIA_XY_M + || shp->EffectiveDims == GAIA_XY_Z_M) hasM = 1; if (hasM) this_size = 38 + (2 * tot_ln) + (tot_v * 16); /* size [in 16 bits words !!!] ZM */ @@ -19854,7 +21803,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* inserting POLYGON or MULTIPOLYGON in SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYGONZ, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = POLYGON Z */ gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the MBR for this geometry */ @@ -20170,7 +22119,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* inserting POLYGON or MULTIPOLYGON in SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_POLYGONM, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = POLYGON M */ gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the MBR for this geometry */ @@ -20390,7 +22339,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* inserting MULTIPOINT in SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_MULTIPOINT, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = MULTIPOINT */ gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the MBR for this geometry */ @@ -20443,8 +22392,8 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) return 0; } hasM = 0; - if (entity->Geometry->DimensionModel == GAIA_XY_M - || entity->Geometry->DimensionModel == GAIA_XY_Z_M) + if (shp->EffectiveDims == GAIA_XY_M + || shp->EffectiveDims == GAIA_XY_Z_M) hasM = 1; if (hasM) this_size = 36 + (tot_pts * 16); /* size [in 16 bits words !!!] ZM */ @@ -20463,7 +22412,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* inserting MULTIPOINT in SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_MULTIPOINTZ, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = MULTIPOINT Z */ gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the MBR for this geometry */ @@ -20563,7 +22512,7 @@ gaiaWriteShpEntity (gaiaShapefilePtr shp, gaiaDbfListPtr entity) fwrite (shp->BufShp, 1, 8, shp->flShx); (shp->ShxSize) += 4; /* inserting MULTIPOINT in SHP file */ - gaiaExport32 (shp->BufShp, shp->DbfRecno, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ + gaiaExport32 (shp->BufShp, shp->DbfRecno + 1, GAIA_BIG_ENDIAN, endian_arch); /* exports entity ID */ gaiaExport32 (shp->BufShp + 4, this_size, GAIA_BIG_ENDIAN, endian_arch); /* exports entity size [in 16 bits words !!!] */ gaiaExport32 (shp->BufShp + 8, GAIA_SHP_MULTIPOINTM, GAIA_LITTLE_ENDIAN, endian_arch); /* exports geometry type = MULTIPOINT M */ gaiaExport64 (shp->BufShp + 12, entity->Geometry->MinX, GAIA_LITTLE_ENDIAN, endian_arch); /* exports the MBR for this geometry */ @@ -20902,11 +22851,280 @@ gaiaShpAnalyze (gaiaShapefilePtr shp) shp->EffectiveDims = GAIA_XY_Z; } } + +GAIAGEO_DECLARE gaiaDbfPtr +gaiaAllocDbf () +{ +/* allocates and initializes the DBF object */ + gaiaDbfPtr dbf = malloc (sizeof (gaiaDbf)); + dbf->endian_arch = 1; + dbf->Path = NULL; + dbf->flDbf = NULL; + dbf->Dbf = NULL; + dbf->BufDbf = NULL; + dbf->DbfHdsz = 0; + dbf->DbfReclen = 0; + dbf->DbfSize = 0; + dbf->DbfRecno = 0; + dbf->Valid = 0; + dbf->IconvObj = NULL; + dbf->LastError = NULL; + return dbf; +} + +GAIAGEO_DECLARE void +gaiaFreeDbf (gaiaDbfPtr dbf) +{ +/* frees all memory allocations related to the DBF object */ + if (dbf->Path) + free (dbf->Path); + if (dbf->flDbf) + fclose (dbf->flDbf); + if (dbf->Dbf) + gaiaFreeDbfList (dbf->Dbf); + if (dbf->BufDbf) + free (dbf->BufDbf); + if (dbf->IconvObj) + iconv_close ((iconv_t) dbf->IconvObj); + if (dbf->LastError) + free (dbf->LastError); + free (dbf); +} + +GAIAGEO_DECLARE void +gaiaOpenDbfRead (gaiaDbfPtr dbf, const char *path, const char *charFrom, + const char *charTo) +{ +/* trying to open the DBF and initial checkings */ + FILE *fl_dbf = NULL; + int rd; + unsigned char bf[1024]; + int dbf_size; + int dbf_reclen = 0; + int dbf_recno; + int off_dbf; + int ind; + char field_name[2048]; + char *sys_err; + char errMsg[1024]; + iconv_t iconv_ret; + char utf8buf[2048]; +#ifdef __MINGW32__ + const char *pBuf; +#else /* not MINGW32 */ + char *pBuf; +#endif + size_t len; + size_t utf8len; + char *pUtf8buf; + int endian_arch = gaiaEndianArch (); + gaiaDbfListPtr dbf_list = NULL; + if (charFrom && charTo) + { + iconv_ret = iconv_open (charTo, charFrom); + if (iconv_ret == (iconv_t) (-1)) + { + sprintf (errMsg, "conversion from '%s' to '%s' not available\n", + charFrom, charTo); + goto unsupported_conversion; + } + dbf->IconvObj = iconv_ret; + } + else + { + sprintf (errMsg, "a NULL charset-name was passed\n"); + goto unsupported_conversion; + } + if (dbf->flDbf != NULL) + { + sprintf (errMsg, "attempting to reopen an already opened DBF\n"); + goto unsupported_conversion; + } + fl_dbf = fopen (path, "rb"); + if (!fl_dbf) + { + sys_err = strerror (errno); + sprintf (errMsg, "unable to open '%s' for reading: %s", path, + sys_err); + goto no_file; + } +/* reading DBF file header */ + rd = fread (bf, sizeof (unsigned char), 32, fl_dbf); + if (rd != 32) + goto error; + if (*bf != 0x03) /* checks the DBF magic number */ + goto error; + dbf_recno = gaiaImport32 (bf + 4, GAIA_LITTLE_ENDIAN, endian_arch); + dbf_size = gaiaImport16 (bf + 8, GAIA_LITTLE_ENDIAN, endian_arch); + dbf_reclen = gaiaImport16 (bf + 10, GAIA_LITTLE_ENDIAN, endian_arch); + dbf_size--; + off_dbf = 0; + dbf_list = gaiaAllocDbfList (); + for (ind = 32; ind < dbf_size; ind += 32) + { + /* fetches DBF fields definitions */ + rd = fread (bf, sizeof (unsigned char), 32, fl_dbf); + if (rd != 32) + goto error; + memcpy (field_name, bf, 11); + field_name[11] = '\0'; + len = strlen ((char *) field_name); + utf8len = 2048; + pBuf = (char *) field_name; + pUtf8buf = utf8buf; + if (iconv + ((iconv_t) (dbf->IconvObj), &pBuf, &len, &pUtf8buf, + &utf8len) == (size_t) (-1)) + goto conversion_error; + memcpy (field_name, utf8buf, 2048 - utf8len); + field_name[2048 - utf8len] = '\0'; + gaiaAddDbfField (dbf_list, field_name, *(bf + 11), off_dbf, + *(bf + 16), *(bf + 17)); + off_dbf += *(bf + 16); + } + if (!gaiaIsValidDbfList (dbf_list)) + { + /* invalid DBF */ + goto illegal_dbf; + } + len = strlen (path); + dbf->Path = malloc (len + 1); + strcpy (dbf->Path, path); + dbf->flDbf = fl_dbf; + dbf->Dbf = dbf_list; +/* allocating DBF buffer */ + dbf->BufDbf = malloc (sizeof (unsigned char) * dbf_reclen); + dbf->DbfHdsz = dbf_size + 1; + dbf->DbfReclen = dbf_reclen; + dbf->Valid = 1; + dbf->endian_arch = endian_arch; + return; + unsupported_conversion: +/* illegal charset */ + if (dbf->LastError) + free (dbf->LastError); + len = strlen (errMsg); + dbf->LastError = malloc (len + 1); + strcpy (dbf->LastError, errMsg); + return; + no_file: +/* the DBF file can't be accessed */ + if (dbf->LastError) + free (dbf->LastError); + len = strlen (errMsg); + dbf->LastError = malloc (len + 1); + strcpy (dbf->LastError, errMsg); + if (fl_dbf) + fclose (fl_dbf); + return; + error: +/* the DBF is invalid or corrupted */ + if (dbf->LastError) + free (dbf->LastError); + sprintf (errMsg, "'%s' is corrupted / has invalid format", path); + len = strlen (errMsg); + dbf->LastError = malloc (len + 1); + strcpy (dbf->LastError, errMsg); + gaiaFreeDbfList (dbf_list); + fclose (fl_dbf); + return; + illegal_dbf: +/* the DBF-file contains unsupported data types */ + if (dbf->LastError) + free (dbf->LastError); + sprintf (errMsg, "'%s' contains unsupported data types", path); + len = strlen (errMsg); + dbf->LastError = malloc (len + 1); + strcpy (dbf->LastError, errMsg); + gaiaFreeDbfList (dbf_list); + if (fl_dbf) + fclose (fl_dbf); + return; + conversion_error: +/* libiconv error */ + if (dbf->LastError) + free (dbf->LastError); + sprintf (errMsg, "'%s' field name: invalid character sequence", path); + len = strlen (errMsg); + dbf->LastError = malloc (len + 1); + strcpy (dbf->LastError, errMsg); + gaiaFreeDbfList (dbf_list); + if (fl_dbf) + fclose (fl_dbf); + return; +} + +GAIAGEO_DECLARE int +gaiaReadDbfEntity (gaiaDbfPtr dbf, int current_row, int *deleted) +{ +/* trying to read an entity from DBF */ + int rd; + int skpos; + int offset; + int len; + char errMsg[1024]; + gaiaDbfFieldPtr pFld; +/* positioning and reading the DBF file */ + offset = dbf->DbfHdsz + (current_row * dbf->DbfReclen); + skpos = fseek (dbf->flDbf, offset, SEEK_SET); + if (skpos != 0) + goto eof; + rd = fread (dbf->BufDbf, sizeof (unsigned char), dbf->DbfReclen, + dbf->flDbf); + if (rd != dbf->DbfReclen) + goto eof; +/* setting up the current DBF ENTITY */ + gaiaResetDbfEntity (dbf->Dbf); + dbf->Dbf->RowId = current_row; + if (*(dbf->BufDbf) == '*') + { + /* deleted row */ + *deleted = 1; + if (dbf->LastError) + free (dbf->LastError); + dbf->LastError = NULL; + return 1; + } +/* fetching the DBF values */ + pFld = dbf->Dbf->First; + while (pFld) + { + if (!parseDbfField (dbf->BufDbf, dbf->IconvObj, pFld)) + goto conversion_error; + pFld = pFld->Next; + } + if (dbf->LastError) + free (dbf->LastError); + dbf->LastError = NULL; + *deleted = 0; + return 1; + eof: + if (dbf->LastError) + free (dbf->LastError); + dbf->LastError = NULL; + return 0; + conversion_error: + if (dbf->LastError) + free (dbf->LastError); + sprintf (errMsg, "Invalid character sequence"); + len = strlen (errMsg); + dbf->LastError = malloc (len + 1); + strcpy (dbf->LastError, errMsg); + return 0; +} + +#endif /* ICONV enabled/disabled */ + /**************** End file: gg_shape.c **********/ /**************** Begin file: gg_transform.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ @@ -20914,7 +23132,12 @@ gaiaShpAnalyze (gaiaShapefilePtr shp) /* #include */ #endif +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ GAIAGEO_DECLARE void @@ -20969,11 +23192,11 @@ gaiaShiftCoords (gaiaGeomCollPtr geom, double shift_x, double shift_y) { gaiaSetPointXYZ (line->Coords, iv, x, y, z); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (line->Coords, iv, x, y, m); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (line->Coords, iv, x, y, z, m); } @@ -21014,11 +23237,11 @@ gaiaShiftCoords (gaiaGeomCollPtr geom, double shift_x, double shift_y) { gaiaSetPointXYZ (ring->Coords, iv, x, y, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (ring->Coords, iv, x, y, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); } @@ -21055,11 +23278,11 @@ gaiaShiftCoords (gaiaGeomCollPtr geom, double shift_x, double shift_y) { gaiaSetPointXYZ (ring->Coords, iv, x, y, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (ring->Coords, iv, x, y, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); } @@ -21126,11 +23349,11 @@ gaiaScaleCoords (gaiaGeomCollPtr geom, double scale_x, double scale_y) { gaiaSetPointXYZ (line->Coords, iv, x, y, z); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (line->Coords, iv, x, y, m); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (line->Coords, iv, x, y, z, m); } @@ -21171,11 +23394,11 @@ gaiaScaleCoords (gaiaGeomCollPtr geom, double scale_x, double scale_y) { gaiaSetPointXYZ (ring->Coords, iv, x, y, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (ring->Coords, iv, x, y, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); } @@ -21212,11 +23435,11 @@ gaiaScaleCoords (gaiaGeomCollPtr geom, double scale_x, double scale_y) { gaiaSetPointXYZ (ring->Coords, iv, x, y, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (ring->Coords, iv, x, y, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); } @@ -21290,11 +23513,11 @@ gaiaRotateCoords (gaiaGeomCollPtr geom, double angle) { gaiaSetPointXYZ (line->Coords, iv, nx, ny, z); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (line->Coords, iv, nx, ny, m); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (line->Coords, iv, nx, ny, z, m); } @@ -21335,11 +23558,11 @@ gaiaRotateCoords (gaiaGeomCollPtr geom, double angle) { gaiaSetPointXYZ (ring->Coords, iv, nx, ny, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (ring->Coords, iv, nx, ny, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (ring->Coords, iv, nx, ny, z, m); } @@ -21376,11 +23599,11 @@ gaiaRotateCoords (gaiaGeomCollPtr geom, double angle) { gaiaSetPointXYZ (ring->Coords, iv, nx, ny, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (ring->Coords, iv, nx, ny, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (ring->Coords, iv, nx, ny, z, m); } @@ -21403,8 +23626,8 @@ gaiaReflectCoords (gaiaGeomCollPtr geom, int x_axis, int y_axis) int iv; double x; double y; - double z; - double m; + double z = 0.0; + double m = 0.0; gaiaPointPtr point; gaiaPolygonPtr polyg; gaiaLinestringPtr line; @@ -21451,11 +23674,11 @@ gaiaReflectCoords (gaiaGeomCollPtr geom, int x_axis, int y_axis) { gaiaSetPointXYZ (line->Coords, iv, x, y, z); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (line->Coords, iv, x, y, m); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (line->Coords, iv, x, y, z, m); } @@ -21498,11 +23721,11 @@ gaiaReflectCoords (gaiaGeomCollPtr geom, int x_axis, int y_axis) { gaiaSetPointXYZ (ring->Coords, iv, x, y, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (ring->Coords, iv, x, y, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); } @@ -21541,11 +23764,11 @@ gaiaReflectCoords (gaiaGeomCollPtr geom, int x_axis, int y_axis) { gaiaSetPointXYZ (ring->Coords, iv, x, y, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (ring->Coords, iv, x, y, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); } @@ -21615,11 +23838,11 @@ gaiaSwapCoords (gaiaGeomCollPtr geom) { gaiaSetPointXYZ (line->Coords, iv, x, y, z); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (line->Coords, iv, x, y, m); } - else if (line->DimensionModel == GAIA_XY_Z) + else if (line->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (line->Coords, iv, x, y, z, m); } @@ -21661,11 +23884,11 @@ gaiaSwapCoords (gaiaGeomCollPtr geom) { gaiaSetPointXYZ (ring->Coords, iv, x, y, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (ring->Coords, iv, x, y, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); } @@ -21703,11 +23926,11 @@ gaiaSwapCoords (gaiaGeomCollPtr geom) { gaiaSetPointXYZ (ring->Coords, iv, x, y, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaSetPointXYM (ring->Coords, iv, x, y, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); } @@ -21757,11 +23980,11 @@ gaiaTransform (gaiaGeomCollPtr org, char *proj_from, char *proj_to) double *xx; double *yy; double *zz; - double *mm; + double *mm = NULL; double x; double y; - double z; - double m; + double z = 0.0; + double m = 0.0; int error = 0; int from_angle; int to_angle; @@ -22261,11 +24484,21 @@ gaiaTransform (gaiaGeomCollPtr org, char *proj_from, char *proj_to) /**************** Begin file: gg_wkb.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ static void @@ -22668,8 +24901,8 @@ ParseCompressedWkbLine (gaiaGeomCollPtr geo) int iv; double x; double y; - double last_x; - double last_y; + double last_x = 0.0; + double last_y = 0.0; float fx; float fy; gaiaLinestringPtr line; @@ -22718,9 +24951,9 @@ ParseCompressedWkbLineZ (gaiaGeomCollPtr geo) double x; double y; double z; - double last_x; - double last_y; - double last_z; + double last_x = 0.0; + double last_y = 0.0; + double last_z = 0.0; float fx; float fy; float fz; @@ -22776,8 +25009,8 @@ ParseCompressedWkbLineM (gaiaGeomCollPtr geo) double x; double y; double m; - double last_x; - double last_y; + double last_x = 0.0; + double last_y = 0.0; float fx; float fy; gaiaLinestringPtr line; @@ -22831,9 +25064,9 @@ ParseCompressedWkbLineZM (gaiaGeomCollPtr geo) double y; double z; double m; - double last_x; - double last_y; - double last_z; + double last_x = 0.0; + double last_y = 0.0; + double last_z = 0.0; float fx; float fy; float fz; @@ -22894,8 +25127,8 @@ ParseCompressedWkbPolygon (gaiaGeomCollPtr geo) int ib; double x; double y; - double last_x; - double last_y; + double last_x = 0.0; + double last_y = 0.0; float fx; float fy; gaiaPolygonPtr polyg = NULL; @@ -22962,9 +25195,9 @@ ParseCompressedWkbPolygonZ (gaiaGeomCollPtr geo) double x; double y; double z; - double last_x; - double last_y; - double last_z; + double last_x = 0.0; + double last_y = 0.0; + double last_z = 0.0; float fx; float fy; float fz; @@ -23038,8 +25271,8 @@ ParseCompressedWkbPolygonM (gaiaGeomCollPtr geo) double x; double y; double m; - double last_x; - double last_y; + double last_x = 0.0; + double last_y = 0.0; float fx; float fy; gaiaPolygonPtr polyg = NULL; @@ -23111,9 +25344,9 @@ ParseCompressedWkbPolygonZM (gaiaGeomCollPtr geo) double y; double z; double m; - double last_x; - double last_y; - double last_z; + double last_x = 0.0; + double last_y = 0.0; + double last_z = 0.0; float fx; float fy; float fz; @@ -23539,8 +25772,8 @@ gaiaToSpatiaLiteBlobWkb (gaiaGeomCollPtr geom, unsigned char **result, int iv; double x; double y; - double z; - double m; + double z = 0.0; + double m = 0.0; int entities = 0; int n_points = 0; int n_linestrings = 0; @@ -24429,9 +26662,9 @@ gaiaToCompressedBlobWkb (gaiaGeomCollPtr geom, unsigned char **result, double y; double z; double m; - double last_x; - double last_y; - double last_z; + double last_x = 0.0; + double last_y = 0.0; + double last_z = 0.0; float fx; float fy; float fz; @@ -25817,8 +28050,8 @@ gaiaToWkb (gaiaGeomCollPtr geom, unsigned char **result, int *size) int iv; double x; double y; - double z; - double m; + double z = 0.0; + double m = 0.0; int entities = 0; int n_points = 0; int n_linestrings = 0; @@ -26480,7 +28713,7 @@ pointFromFgf (gaiaGeomCollPtr geom, int endian_arch, const unsigned char *blob, z = gaiaImport64 (ptr + 8, GAIA_LITTLE_ENDIAN, endian_arch); gaiaAddPointToGeomCollXYZ (geom, x, y, z); } - else if (type == GAIA_XY_Z_M) + else if (type == GAIA_XY_M) { /* building the POINTM */ x = gaiaImport64 (ptr, GAIA_LITTLE_ENDIAN, endian_arch); @@ -27425,5369 +29658,25 @@ gaiaToFgf (gaiaGeomCollPtr geom, unsigned char **result, int *size, /**************** End file: gg_wkb.c **********/ -/**************** Begin file: gg_wkt.c **********/ - -/* #include */ -/* #include */ -/* #include */ - -/* #include */ -/* #include */ - -typedef struct gaiaTokenStruct -{ -/* linked list of pre-parsed tokens - used in WKT parsing */ - int type; /* token code */ - double coord; /* a coordinate [if any] */ - struct gaiaTokenStruct *next; /* reference to next element in linked list */ -} gaiaToken; -typedef gaiaToken *gaiaTokenPtr; - -typedef struct gaiaListTokenStruct -{ -/* - / a block of consecutive WKT tokens that identify a LINESTRING or RING, - / in the form: (1 2, 3 4, 5 6, 7 8) - */ - gaiaTokenPtr first; /* reference to first element in linked list - has always to be a '(' */ - gaiaTokenPtr last; /* reference to last element in linked list - has always to be a ')' */ - int points; /* number of POINTS contained in the linkek list */ - gaiaLinestringPtr line; /* the LINESTRING builded after successful parsing */ - struct gaiaListTokenStruct *next; /* points to next element in linked list [if any] */ -} gaiaListToken; -typedef gaiaListToken *gaiaListTokenPtr; - -typedef struct gaiaMultiListTokenStruct -{ -/* - / a group of the above token lists, that identify a POLYGON or a MULTILINESTRING - / in the form: ((...),(...),(...)) - */ - gaiaListTokenPtr first; /* reference to first element in linked list - has always to be a '(' */ - gaiaListTokenPtr last; /* reference to last element in linked list - has always to be a ')' */ - struct gaiaMultiListTokenStruct *next; /* points to next element in linked list [if any] */ -} gaiaMultiListToken; -typedef gaiaMultiListToken *gaiaMultiListTokenPtr; - -typedef struct gaiaMultiMultiListTokenStruct -{ -/* - / a group of the above token multi-lists, that identify a MULTIPOLYGON - / in the form: (((...),(...),(...)),((...),(...)),((...))) - */ - gaiaMultiListTokenPtr first; /* reference to first element in linked list - has always to be a '(' */ - gaiaMultiListTokenPtr last; /* reference to last element in linked list - has always to be a ')' */ -} gaiaMultiMultiListToken; -typedef gaiaMultiMultiListToken *gaiaMultiMultiListTokenPtr; - -typedef struct gaiaVarListTokenStruct -{ -/* - / a multitype variable reference that may be associated to: - / - a POINT element - / - a LINESTRING element - / - a POLYGON element -*/ - int type; /* may be GAIA_POINT, GAIA_LINESTRING or GAIA_POLYGON */ - void *pointer; /* - / to be casted as *sple_multi_list_token_ptr* if type is GAIA_LINESTRING/ or as *gaiaMultiMultiListTokenPtr* if type is GAIA_POLYGON - */ - double x; /* X,Y are valids only if type is GAIA_POINT */ - double y; - double z; - double m; - struct gaiaVarListTokenStruct *next; /* points to next element in linked list */ -} gaiaVarListToken; -typedef gaiaVarListToken *gaiaVarListTokenPtr; - -typedef struct gaiaGeomCollListTokenStruct -{ -/* -/ a group of lists and multi-lists that identifies a GEOMETRYCOLLECTION -/ in the form: (ELEM(...),ELEM(...),ELEM(....)) -*/ - gaiaVarListTokenPtr first; /* reference to first element in linked list - has always to be a '(' */ - gaiaVarListTokenPtr last; /* reference to last element in linked list - has always to be a ')' */ -} gaiaGeomCollListToken; -typedef gaiaGeomCollListToken *gaiaGeomCollListTokenPtr; - -static char * -gaiaCleanWkt (const unsigned char *old) -{ -/* cleans and normalizes the WKT encoded string before effective parsing */ - int len; - char *buf; - char *pn; - int error = 0; - int space = 1; - int opened = 0; - int closed = 0; - int ok; - const unsigned char *po; - len = strlen ((char *) old); - if (len == 0) - return NULL; - buf = malloc (len + 1); - pn = buf; - po = old; - while (*po != '\0') - { - if (*po >= '0' && *po <= '9') - { - *pn = *po; - pn++; - space = 0; - } - else if (*po == '+' || *po == '-') - { - *pn = *po; - pn++; - space = 0; - } - else if ((*po >= 'A' && *po <= 'Z') || (*po >= 'a' && *po <= 'z') - || *po == ',' || *po == '.' || *po == '(' || *po == ')') - { - if (pn > buf) - { - if (*(pn - 1) == ' ') - *(pn - 1) = *po; - else - { - *pn = *po; - pn++; - } - } - else - { - *pn = *po; - pn++; - } - if (*po == '(') - opened++; - if (*po == ')') - closed++; - space = 1; - } - else if (*po == ' ' || *po == '\t' || *po == '\n' || *po == '\r') - { - if (!space) - { - *pn = ' '; - pn++; - } - space = 1; - } - else - { - error = 1; - break; - } - po++; - } - if (opened != closed) - error = 1; - *pn = '\0'; - len = strlen (buf); - if (buf[len - 1] != ')') - error = 1; - ok = 0; - if (!error) - { - if (len > 6 && strncasecmp (buf, "POINT(", 6) == 0) - ok = 1; - if (len > 7 && strncasecmp (buf, "POINTZ(", 7) == 0) - ok = 1; - if (len > 7 && strncasecmp (buf, "POINTM(", 7) == 0) - ok = 1; - if (len > 8 && strncasecmp (buf, "POINTZM(", 8) == 0) - ok = 1; - if (len > 11 && strncasecmp (buf, "LINESTRING(", 11) == 0) - ok = 1; - if (len > 12 && strncasecmp (buf, "LINESTRINGZ(", 12) == 0) - ok = 1; - if (len > 12 && strncasecmp (buf, "LINESTRINGM(", 12) == 0) - ok = 1; - if (len > 13 && strncasecmp (buf, "LINESTRINGZM(", 13) == 0) - ok = 1; - if (len > 8 && strncasecmp (buf, "POLYGON(", 8) == 0) - ok = 1; - if (len > 9 && strncasecmp (buf, "POLYGONZ(", 9) == 0) - ok = 1; - if (len > 9 && strncasecmp (buf, "POLYGONM(", 9) == 0) - ok = 1; - if (len > 10 && strncasecmp (buf, "POLYGONZM(", 10) == 0) - ok = 1; - if (len > 11 && strncasecmp (buf, "MULTIPOINT(", 11) == 0) - ok = 1; - if (len > 12 && strncasecmp (buf, "MULTIPOINTZ(", 12) == 0) - ok = 1; - if (len > 12 && strncasecmp (buf, "MULTIPOINTM(", 12) == 0) - ok = 1; - if (len > 13 && strncasecmp (buf, "MULTIPOINTZM(", 13) == 0) - ok = 1; - if (len > 16 && strncasecmp (buf, "MULTILINESTRING(", 16) == 0) - ok = 1; - if (len > 17 && strncasecmp (buf, "MULTILINESTRINGZ(", 17) == 0) - ok = 1; - if (len > 17 && strncasecmp (buf, "MULTILINESTRINGM(", 17) == 0) - ok = 1; - if (len > 18 && strncasecmp (buf, "MULTILINESTRINGZM(", 18) == 0) - ok = 1; - if (len > 13 && strncasecmp (buf, "MULTIPOLYGON(", 13) == 0) - ok = 1; - if (len > 14 && strncasecmp (buf, "MULTIPOLYGONZ(", 14) == 0) - ok = 1; - if (len > 14 && strncasecmp (buf, "MULTIPOLYGONM(", 14) == 0) - ok = 1; - if (len > 15 && strncasecmp (buf, "MULTIPOLYGONZM(", 15) == 0) - ok = 1; - if (len > 19 && strncasecmp (buf, "GEOMETRYCOLLECTION(", 19) == 0) - ok = 1; - if (len > 20 && strncasecmp (buf, "GEOMETRYCOLLECTIONZ(", 20) == 0) - ok = 1; - if (len > 20 && strncasecmp (buf, "GEOMETRYCOLLECTIONM(", 20) == 0) - ok = 1; - if (len > 21 && strncasecmp (buf, "GEOMETRYCOLLECTIONZM(", 21) == 0) - ok = 1; - if (!ok) - error = 1; - } - if (error) - { - free (buf); - return NULL; - } - return buf; -} - -static void -gaiaFreeListToken (gaiaListTokenPtr p) -{ -/* cleans all memory allocations for list token */ - if (!p) - return; - if (p->line) - gaiaFreeLinestring (p->line); - free (p); -} - -static void -gaiaFreeMultiListToken (gaiaMultiListTokenPtr p) -{ -/* cleans all memory allocations for multi list token */ - gaiaListTokenPtr pt; - gaiaListTokenPtr ptn; - if (!p) - return; - pt = p->first; - while (pt) - { - ptn = pt->next; - gaiaFreeListToken (pt); - pt = ptn; - } - free (p); -} - -static void -gaiaFreeMultiMultiListToken (gaiaMultiMultiListTokenPtr p) -{ -/* cleans all memory allocations for multi-multi list token */ - gaiaMultiListTokenPtr pt; - gaiaMultiListTokenPtr ptn; - if (!p) - return; - pt = p->first; - while (pt) - { - ptn = pt->next; - gaiaFreeMultiListToken (pt); - pt = ptn; - } - free (p); -} - -static void -gaiaFreeGeomCollListToken (gaiaGeomCollListTokenPtr p) -{ -/* cleans all memory allocations for geocoll list token */ - gaiaVarListTokenPtr pt; - gaiaVarListTokenPtr ptn; - if (!p) - return; - pt = p->first; - while (pt) - { - ptn = pt->next; - if (pt->type == GAIA_LINESTRING || pt->type == GAIA_LINESTRINGZ - || pt->type == GAIA_LINESTRINGM || pt->type == GAIA_LINESTRINGZM) - gaiaFreeListToken ((gaiaListTokenPtr) (pt->pointer)); - if (pt->type == GAIA_POLYGON || pt->type == GAIA_POLYGONZ - || pt->type == GAIA_POLYGONM || pt->type == GAIA_POLYGONZM) - gaiaFreeMultiListToken ((gaiaMultiListTokenPtr) (pt->pointer)); - pt = ptn; - } - free (p); -} - -static int -gaiaParseDouble (char *token, double *coord) -{ -/* checks if this token is a valid double */ - int i; - int digits = 0; - int errs = 0; - int commas = 0; - int signs = 0; - *coord = 0.0; - for (i = 0; i < (int) strlen (token); i++) - { - if (token[i] == '+' || token[i] == '-') - signs++; - else if (token[i] == '.') - commas++; - else if (token[i] >= '0' && token[i] <= '9') - digits++; - else - errs++; - } - if (errs > 0) - return 0; - if (digits == 0) - return 0; - if (commas > 1) - return 0; - if (signs > 1) - return 0; - if (signs) - { - switch (token[0]) - { - case '-': - case '+': - break; - default: - return 0; - }; - } - *coord = atof (token); - return 1; -} - -static void -gaiaAddToken (char *token, gaiaTokenPtr * first, gaiaTokenPtr * last) -{ -/* inserts a token at the end of the linked list */ - double coord; - gaiaTokenPtr p; - if (strlen (token) == 0) - return; - p = malloc (sizeof (gaiaToken)); - p->type = GAIA_UNKNOWN; - p->coord = 0.0; - if (strcasecmp (token, "POINT") == 0) - p->type = GAIA_POINT; - if (strcasecmp (token, "POINTZ") == 0) - p->type = GAIA_POINTZ; - if (strcasecmp (token, "POINTM") == 0) - p->type = GAIA_POINTM; - if (strcasecmp (token, "POINTZM") == 0) - p->type = GAIA_POINTZM; - if (strcasecmp (token, "LINESTRING") == 0) - p->type = GAIA_LINESTRING; - if (strcasecmp (token, "LINESTRINGZ") == 0) - p->type = GAIA_LINESTRINGZ; - if (strcasecmp (token, "LINESTRINGM") == 0) - p->type = GAIA_LINESTRINGM; - if (strcasecmp (token, "LINESTRINGZM") == 0) - p->type = GAIA_LINESTRINGZM; - if (strcasecmp (token, "POLYGON") == 0) - p->type = GAIA_POLYGON; - if (strcasecmp (token, "POLYGONZ") == 0) - p->type = GAIA_POLYGONZ; - if (strcasecmp (token, "POLYGONM") == 0) - p->type = GAIA_POLYGONM; - if (strcasecmp (token, "POLYGONZM") == 0) - p->type = GAIA_POLYGONZM; - if (strcasecmp (token, "MULTIPOINT") == 0) - p->type = GAIA_MULTIPOINT; - if (strcasecmp (token, "MULTIPOINTZ") == 0) - p->type = GAIA_MULTIPOINTZ; - if (strcasecmp (token, "MULTIPOINTM") == 0) - p->type = GAIA_MULTIPOINTM; - if (strcasecmp (token, "MULTIPOINTZM") == 0) - p->type = GAIA_MULTIPOINTZM; - if (strcasecmp (token, "MULTILINESTRING") == 0) - p->type = GAIA_MULTILINESTRING; - if (strcasecmp (token, "MULTILINESTRINGZ") == 0) - p->type = GAIA_MULTILINESTRINGZ; - if (strcasecmp (token, "MULTILINESTRINGM") == 0) - p->type = GAIA_MULTILINESTRINGM; - if (strcasecmp (token, "MULTILINESTRINGZM") == 0) - p->type = GAIA_MULTILINESTRINGZM; - if (strcasecmp (token, "MULTIPOLYGON") == 0) - p->type = GAIA_MULTIPOLYGON; - if (strcasecmp (token, "MULTIPOLYGONZ") == 0) - p->type = GAIA_MULTIPOLYGONZ; - if (strcasecmp (token, "MULTIPOLYGONM") == 0) - p->type = GAIA_MULTIPOLYGONM; - if (strcasecmp (token, "MULTIPOLYGONZM") == 0) - p->type = GAIA_MULTIPOLYGONZM; - if (strcasecmp (token, "GEOMETRYCOLLECTION") == 0) - p->type = GAIA_GEOMETRYCOLLECTION; - if (strcasecmp (token, "GEOMETRYCOLLECTIONZ") == 0) - p->type = GAIA_GEOMETRYCOLLECTIONZ; - if (strcasecmp (token, "GEOMETRYCOLLECTIONM") == 0) - p->type = GAIA_GEOMETRYCOLLECTIONM; - if (strcasecmp (token, "GEOMETRYCOLLECTIONZM") == 0) - p->type = GAIA_GEOMETRYCOLLECTIONZM; - if (strcmp (token, "(") == 0) - p->type = GAIA_OPENED; - if (strcmp (token, ")") == 0) - p->type = GAIA_CLOSED; - if (strcmp (token, ",") == 0) - p->type = GAIA_COMMA; - if (strcmp (token, " ") == 0) - p->type = GAIA_SPACE; - if (p->type == GAIA_UNKNOWN) - { - if (gaiaParseDouble (token, &coord)) - { - p->type = GAIA_COORDINATE; - p->coord = coord; - } - } - p->next = NULL; - if (*first == NULL) - *first = p; - if (*last != NULL) - (*last)->next = p; - *last = p; -} - -static gaiaListTokenPtr -gaiaBuildListToken (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a list of tokens representing a list in the form -/ (1 2, 3 4, 5 6), as required by LINESTRING, MULTIPOINT or RING -*/ - gaiaListTokenPtr list = NULL; - gaiaTokenPtr pt; - int i = 0; - int ip = 0; - int err = 0; - int nx = 0; - int ny = 0; - int iv; - double x = 0.0; - double y = 0.0; - pt = first; - while (pt != NULL) - { - /* check if this one is a valid list of POINTS */ - if (i == 0) - { - if (pt->type != GAIA_OPENED) - err = 1; - } - else if (pt == last) - { - if (pt->type != GAIA_CLOSED) - err = 1; - } - else - { - if (ip == 0) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - nx++; - } - else if (ip == 1) - { - if (pt->type != GAIA_SPACE) - err = 1; - } - else if (ip == 2) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - ny++; - } - else if (ip == 3) - { - if (pt->type != GAIA_COMMA) - err = 1; - } - ip++; - if (ip > 3) - ip = 0; - } - i++; - pt = pt->next; - if (pt == last) - break; - } - if (nx != ny) - err = 1; - if (nx < 1) - err = 1; - if (err) - return NULL; -/* ok, there is no error. finally we can build the POINTS list */ - list = malloc (sizeof (gaiaListToken)); - list->points = nx; - list->line = gaiaAllocLinestring (nx); - list->next = NULL; - iv = 0; - ip = 0; - i = 0; - pt = first; - while (pt != NULL) - { - /* sets coords for all POINTS */ - if (i == 0) - ; - else if (pt == last) - ; - else - { - if (ip == 0) - x = pt->coord; - else if (ip == 2) - { - y = pt->coord; - gaiaSetPoint (list->line->Coords, iv, x, y); - iv++; - } - ip++; - if (ip > 3) - ip = 0; - } - i++; - pt = pt->next; - if (pt == last) - break; - } - return list; -} - -static gaiaListTokenPtr -gaiaBuildListTokenZ (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a list of tokens representing a list in the form -/ (1 2 3, 4 5 6, 7 8 9), as required by LINESTRINGZ, MULTIPOINTZ or RINGZ -*/ - gaiaListTokenPtr list = NULL; - gaiaTokenPtr pt; - int i = 0; - int ip = 0; - int err = 0; - int nx = 0; - int ny = 0; - int nz = 0; - int iv; - double x = 0.0; - double y = 0.0; - double z = 0.0; - pt = first; - while (pt != NULL) - { - /* check if this one is a valid list of POINTS */ - if (i == 0) - { - if (pt->type != GAIA_OPENED) - err = 1; - } - else if (pt == last) - { - if (pt->type != GAIA_CLOSED) - err = 1; - } - else - { - if (ip == 0) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - nx++; - } - else if (ip == 1) - { - if (pt->type != GAIA_SPACE) - err = 1; - } - else if (ip == 2) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - ny++; - } - else if (ip == 3) - { - if (pt->type != GAIA_SPACE) - err = 1; - } - else if (ip == 4) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - nz++; - } - else if (ip == 5) - { - if (pt->type != GAIA_COMMA) - err = 1; - } - ip++; - if (ip > 5) - ip = 0; - } - i++; - pt = pt->next; - if (pt == last) - break; - } - if (nx != ny) - err = 1; - if (nx != nz) - err = 1; - if (nx < 1) - err = 1; - if (err) - return NULL; -/* ok, there is no error. finally we can build the POINTS list */ - list = malloc (sizeof (gaiaListToken)); - list->points = nx; - list->line = gaiaAllocLinestringXYZ (nx); - list->next = NULL; - iv = 0; - ip = 0; - i = 0; - pt = first; - while (pt != NULL) - { - /* sets coords for all POINTS */ - if (i == 0) - ; - else if (pt == last) - ; - else - { - if (ip == 0) - x = pt->coord; - else if (ip == 2) - y = pt->coord; - else if (ip == 4) - { - z = pt->coord; - gaiaSetPointXYZ (list->line->Coords, iv, x, y, z); - iv++; - } - ip++; - if (ip > 5) - ip = 0; - } - i++; - pt = pt->next; - if (pt == last) - break; - } - return list; -} - -static gaiaListTokenPtr -gaiaBuildListTokenM (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a list of tokens representing a list in the form -/ (1 2 3, 4 5 6, 7 8 9), as required by LINESTRINGM, MULTIPOINTM or RINGM -*/ - gaiaListTokenPtr list = NULL; - gaiaTokenPtr pt; - int i = 0; - int ip = 0; - int err = 0; - int nx = 0; - int ny = 0; - int nm = 0; - int iv; - double x = 0.0; - double y = 0.0; - double m = 0.0; - pt = first; - while (pt != NULL) - { - /* check if this one is a valid list of POINTS */ - if (i == 0) - { - if (pt->type != GAIA_OPENED) - err = 1; - } - else if (pt == last) - { - if (pt->type != GAIA_CLOSED) - err = 1; - } - else - { - if (ip == 0) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - nx++; - } - else if (ip == 1) - { - if (pt->type != GAIA_SPACE) - err = 1; - } - else if (ip == 2) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - ny++; - } - else if (ip == 3) - { - if (pt->type != GAIA_SPACE) - err = 1; - } - else if (ip == 4) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - nm++; - } - else if (ip == 5) - { - if (pt->type != GAIA_COMMA) - err = 1; - } - ip++; - if (ip > 5) - ip = 0; - } - i++; - pt = pt->next; - if (pt == last) - break; - } - if (nx != ny) - err = 1; - if (nx != nm) - err = 1; - if (nx < 1) - err = 1; - if (err) - return NULL; -/* ok, there is no error. finally we can build the POINTS list */ - list = malloc (sizeof (gaiaListToken)); - list->points = nx; - list->line = gaiaAllocLinestringXYM (nx); - list->next = NULL; - iv = 0; - ip = 0; - i = 0; - pt = first; - while (pt != NULL) - { - /* sets coords for all POINTS */ - if (i == 0) - ; - else if (pt == last) - ; - else - { - if (ip == 0) - x = pt->coord; - else if (ip == 2) - y = pt->coord; - else if (ip == 4) - { - m = pt->coord; - gaiaSetPointXYM (list->line->Coords, iv, x, y, m); - iv++; - } - ip++; - if (ip > 5) - ip = 0; - } - i++; - pt = pt->next; - if (pt == last) - break; - } - return list; -} - -static gaiaListTokenPtr -gaiaBuildListTokenZM (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a list of tokens representing a list in the form -/ (1 2 3 4, 5 6 7 8, 9 10 11 12), as required by LINESTRINGZM, MULTIPOINTZM or RINGZM -*/ - gaiaListTokenPtr list = NULL; - gaiaTokenPtr pt; - int i = 0; - int ip = 0; - int err = 0; - int nx = 0; - int ny = 0; - int nz = 0; - int nm = 0; - int iv; - double x = 0.0; - double y = 0.0; - double z = 0.0; - double m = 0.0; - pt = first; - while (pt != NULL) - { - /* check if this one is a valid list of POINTS */ - if (i == 0) - { - if (pt->type != GAIA_OPENED) - err = 1; - } - else if (pt == last) - { - if (pt->type != GAIA_CLOSED) - err = 1; - } - else - { - if (ip == 0) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - nx++; - } - else if (ip == 1) - { - if (pt->type != GAIA_SPACE) - err = 1; - } - else if (ip == 2) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - ny++; - } - else if (ip == 3) - { - if (pt->type != GAIA_SPACE) - err = 1; - } - else if (ip == 4) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - nz++; - } - else if (ip == 5) - { - if (pt->type != GAIA_SPACE) - err = 1; - } - else if (ip == 6) - { - if (pt->type != GAIA_COORDINATE) - err = 1; - else - nm++; - } - else if (ip == 7) - { - if (pt->type != GAIA_COMMA) - err = 1; - } - ip++; - if (ip > 7) - ip = 0; - } - i++; - pt = pt->next; - if (pt == last) - break; - } - if (nx != ny) - err = 1; - if (nx != nz) - err = 1; - if (nx != nm) - err = 1; - if (nx < 1) - err = 1; - if (err) - return NULL; -/* ok, there is no error. finally we can build the POINTS list */ - list = malloc (sizeof (gaiaListToken)); - list->points = nx; - list->line = gaiaAllocLinestringXYZM (nx); - list->next = NULL; - iv = 0; - ip = 0; - i = 0; - pt = first; - while (pt != NULL) - { - /* sets coords for all POINTS */ - if (i == 0) - ; - else if (pt == last) - ; - else - { - if (ip == 0) - x = pt->coord; - else if (ip == 2) - y = pt->coord; - else if (ip == 4) - z = pt->coord; - else if (ip == 6) - { - m = pt->coord; - gaiaSetPointXYZM (list->line->Coords, iv, x, y, z, m); - iv++; - } - ip++; - if (ip > 7) - ip = 0; - } - i++; - pt = pt->next; - if (pt == last) - break; - } - return list; -} - -static gaiaMultiListTokenPtr -gaiaBuildMultiListToken (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a multi list of tokens representing an array of elementar lists in the form -/ ((...),(....),(...)), as required by MULTILINESTRING and POLYGON -*/ - gaiaMultiListTokenPtr multi_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr p_first = NULL; - gaiaListTokenPtr list; - int opened = 0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this multi list */ - if (pt->type == GAIA_OPENED) - { - opened++; - if (opened == 2) - p_first = pt; - } - if (pt->type == GAIA_CLOSED) - { - if (p_first) - { - list = gaiaBuildListToken (p_first, pt); - if (!multi_list) - { - multi_list = malloc (sizeof (gaiaMultiListToken)); - multi_list->first = NULL; - multi_list->last = NULL; - multi_list->next = NULL; - } - if (multi_list->first == NULL) - multi_list->first = list; - if (multi_list->last != NULL) - multi_list->last->next = list; - multi_list->last = list; - p_first = NULL; - } - opened--; - } - pt = pt->next; - if (pt == last) - break; - } - return multi_list; -} - -static gaiaMultiListTokenPtr -gaiaBuildMultiListTokenZ (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a multi list of tokens representing an array of elementar lists in the form -/ ((...),(....),(...)), as required by MULTILINESTRINGZ and POLYGONZ -*/ - gaiaMultiListTokenPtr multi_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr p_first = NULL; - gaiaListTokenPtr list; - int opened = 0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this multi list */ - if (pt->type == GAIA_OPENED) - { - opened++; - if (opened == 2) - p_first = pt; - } - if (pt->type == GAIA_CLOSED) - { - if (p_first) - { - list = gaiaBuildListTokenZ (p_first, pt); - if (!multi_list) - { - multi_list = malloc (sizeof (gaiaMultiListToken)); - multi_list->first = NULL; - multi_list->last = NULL; - multi_list->next = NULL; - } - if (multi_list->first == NULL) - multi_list->first = list; - if (multi_list->last != NULL) - multi_list->last->next = list; - multi_list->last = list; - p_first = NULL; - } - opened--; - } - pt = pt->next; - if (pt == last) - break; - } - return multi_list; -} - -static gaiaMultiListTokenPtr -gaiaBuildMultiListTokenM (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a multi list of tokens representing an array of elementar lists in the form -/ ((...),(....),(...)), as required by MULTILINESTRINGM and POLYGONM -*/ - gaiaMultiListTokenPtr multi_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr p_first = NULL; - gaiaListTokenPtr list; - int opened = 0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this multi list */ - if (pt->type == GAIA_OPENED) - { - opened++; - if (opened == 2) - p_first = pt; - } - if (pt->type == GAIA_CLOSED) - { - if (p_first) - { - list = gaiaBuildListTokenM (p_first, pt); - if (!multi_list) - { - multi_list = malloc (sizeof (gaiaMultiListToken)); - multi_list->first = NULL; - multi_list->last = NULL; - multi_list->next = NULL; - } - if (multi_list->first == NULL) - multi_list->first = list; - if (multi_list->last != NULL) - multi_list->last->next = list; - multi_list->last = list; - p_first = NULL; - } - opened--; - } - pt = pt->next; - if (pt == last) - break; - } - return multi_list; -} - -static gaiaMultiListTokenPtr -gaiaBuildMultiListTokenZM (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a multi list of tokens representing an array of elementar lists in the form -/ ((...),(....),(...)), as required by MULTILINESTRINGZM and POLYGONZM -*/ - gaiaMultiListTokenPtr multi_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr p_first = NULL; - gaiaListTokenPtr list; - int opened = 0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this multi list */ - if (pt->type == GAIA_OPENED) - { - opened++; - if (opened == 2) - p_first = pt; - } - if (pt->type == GAIA_CLOSED) - { - if (p_first) - { - list = gaiaBuildListTokenZM (p_first, pt); - if (!multi_list) - { - multi_list = malloc (sizeof (gaiaMultiListToken)); - multi_list->first = NULL; - multi_list->last = NULL; - multi_list->next = NULL; - } - if (multi_list->first == NULL) - multi_list->first = list; - if (multi_list->last != NULL) - multi_list->last->next = list; - multi_list->last = list; - p_first = NULL; - } - opened--; - } - pt = pt->next; - if (pt == last) - break; - } - return multi_list; -} - -static gaiaMultiMultiListTokenPtr -gaiaBuildMultiMultiListToken (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a multi list of tokens representing an array of complex lists -/ in the form (((...),(....),(...)),((...),(...)),((...))), as required by MULTIPOLYGON -*/ - gaiaMultiMultiListTokenPtr multi_multi_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr p_first = NULL; - gaiaMultiListTokenPtr multi_list; - int opened = 0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this multi list */ - if (pt->type == GAIA_OPENED) - { - opened++; - if (opened == 2) - p_first = pt; - } - if (pt->type == GAIA_CLOSED) - { - if (p_first && opened == 2) - { - multi_list = gaiaBuildMultiListToken (p_first, pt); - if (!multi_multi_list) - { - multi_multi_list = - malloc (sizeof (gaiaMultiMultiListToken)); - multi_multi_list->first = NULL; - multi_multi_list->last = NULL; - } - if (multi_multi_list->first == NULL) - multi_multi_list->first = multi_list; - if (multi_multi_list->last != NULL) - multi_multi_list->last->next = multi_list; - multi_multi_list->last = multi_list; - p_first = NULL; - } - opened--; - } - pt = pt->next; - if (pt == last) - break; - } - return multi_multi_list; -} - -static gaiaMultiMultiListTokenPtr -gaiaBuildMultiMultiListTokenZ (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a multi list of tokens representing an array of complex lists -/ in the form (((...),(....),(...)),((...),(...)),((...))), as required by MULTIPOLYGONZ -*/ - gaiaMultiMultiListTokenPtr multi_multi_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr p_first = NULL; - gaiaMultiListTokenPtr multi_list; - int opened = 0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this multi list */ - if (pt->type == GAIA_OPENED) - { - opened++; - if (opened == 2) - p_first = pt; - } - if (pt->type == GAIA_CLOSED) - { - if (p_first && opened == 2) - { - multi_list = gaiaBuildMultiListTokenZ (p_first, pt); - if (!multi_multi_list) - { - multi_multi_list = - malloc (sizeof (gaiaMultiMultiListToken)); - multi_multi_list->first = NULL; - multi_multi_list->last = NULL; - } - if (multi_multi_list->first == NULL) - multi_multi_list->first = multi_list; - if (multi_multi_list->last != NULL) - multi_multi_list->last->next = multi_list; - multi_multi_list->last = multi_list; - p_first = NULL; - } - opened--; - } - pt = pt->next; - if (pt == last) - break; - } - return multi_multi_list; -} - -static gaiaMultiMultiListTokenPtr -gaiaBuildMultiMultiListTokenM (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a multi list of tokens representing an array of complex lists -/ in the form (((...),(....),(...)),((...),(...)),((...))), as required by MULTIPOLYGONM -*/ - gaiaMultiMultiListTokenPtr multi_multi_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr p_first = NULL; - gaiaMultiListTokenPtr multi_list; - int opened = 0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this multi list */ - if (pt->type == GAIA_OPENED) - { - opened++; - if (opened == 2) - p_first = pt; - } - if (pt->type == GAIA_CLOSED) - { - if (p_first && opened == 2) - { - multi_list = gaiaBuildMultiListTokenM (p_first, pt); - if (!multi_multi_list) - { - multi_multi_list = - malloc (sizeof (gaiaMultiMultiListToken)); - multi_multi_list->first = NULL; - multi_multi_list->last = NULL; - } - if (multi_multi_list->first == NULL) - multi_multi_list->first = multi_list; - if (multi_multi_list->last != NULL) - multi_multi_list->last->next = multi_list; - multi_multi_list->last = multi_list; - p_first = NULL; - } - opened--; - } - pt = pt->next; - if (pt == last) - break; - } - return multi_multi_list; -} - -static gaiaMultiMultiListTokenPtr -gaiaBuildMultiMultiListTokenZM (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a multi list of tokens representing an array of complex lists -/ in the form (((...),(....),(...)),((...),(...)),((...))), as required by MULTIPOLYGONZM -*/ - gaiaMultiMultiListTokenPtr multi_multi_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr p_first = NULL; - gaiaMultiListTokenPtr multi_list; - int opened = 0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this multi list */ - if (pt->type == GAIA_OPENED) - { - opened++; - if (opened == 2) - p_first = pt; - } - if (pt->type == GAIA_CLOSED) - { - if (p_first && opened == 2) - { - multi_list = gaiaBuildMultiListTokenZM (p_first, pt); - if (!multi_multi_list) - { - multi_multi_list = - malloc (sizeof (gaiaMultiMultiListToken)); - multi_multi_list->first = NULL; - multi_multi_list->last = NULL; - } - if (multi_multi_list->first == NULL) - multi_multi_list->first = multi_list; - if (multi_multi_list->last != NULL) - multi_multi_list->last->next = multi_list; - multi_multi_list->last = multi_list; - p_first = NULL; - } - opened--; - } - pt = pt->next; - if (pt == last) - break; - } - return multi_multi_list; -} - -static gaiaGeomCollListTokenPtr -gaiaBuildGeomCollListToken (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a variable list of tokens representing an array of entities in the form -/ (ELEM(),ELEM(),ELEM()) as required by GEOMETRYCOLLECTION -*/ - gaiaGeomCollListTokenPtr geocoll_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr pt2; - gaiaTokenPtr p_first = NULL; - gaiaListTokenPtr list; - gaiaMultiListTokenPtr multi_list; - gaiaVarListTokenPtr var_list; - int opened = 0; - int i; - int err; - double x = 0; - double y = 0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this complex list */ - if (pt->type == GAIA_POINT) - { - /* parsing a POINT list */ - err = 0; - i = 0; - pt2 = pt->next; - while (pt2 != NULL) - { - /* check if this one is a valid POINT */ - switch (i) - { - case 0: - if (pt2->type != GAIA_OPENED) - err = 1; - break; - case 1: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - x = pt2->coord; - break; - case 2: - if (pt2->type != GAIA_SPACE) - err = 1; - break; - case 3: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - y = pt2->coord; - break; - case 4: - if (pt2->type != GAIA_CLOSED) - err = 1; - break; - }; - i++; - if (i > 4) - break; - pt2 = pt2->next; - } - if (err) - goto error; - var_list = malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_POINT; - var_list->x = x; - var_list->y = y; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = malloc (sizeof (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - } - else if (pt->type == GAIA_LINESTRING) - { - /* parsing a LINESTRING list */ - p_first = NULL; - pt2 = pt->next; - while (pt2 != NULL) - { - if (pt2->type == GAIA_OPENED) - p_first = pt2; - if (pt2->type == GAIA_CLOSED) - { - list = gaiaBuildListToken (p_first, pt2); - if (list) - { - var_list = malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_LINESTRING; - var_list->pointer = list; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = - malloc (sizeof - (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - break; - } - else - goto error; - } - pt2 = pt2->next; - if (pt2 == last) - break; - } - } - else if (pt->type == GAIA_POLYGON) - { - /* parsing a POLYGON list */ - opened = 0; - p_first = NULL; - pt2 = pt->next; - while (pt2 != NULL) - { - if (pt2->type == GAIA_OPENED) - { - opened++; - if (opened == 1) - p_first = pt2; - } - if (pt2->type == GAIA_CLOSED) - { - if (p_first && opened == 1) - { - multi_list = - gaiaBuildMultiListToken (p_first, pt2); - if (multi_list) - { - var_list = - malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_POLYGON; - var_list->pointer = multi_list; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = - malloc (sizeof - (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - break; - } - else - goto error; - } - opened--; - } - pt2 = pt2->next; - if (pt2 == last) - break; - } - } - pt = pt->next; - } - return geocoll_list; - error: - gaiaFreeGeomCollListToken (geocoll_list); - return NULL; -} - -static gaiaGeomCollListTokenPtr -gaiaBuildGeomCollListTokenZ (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a variable list of tokens representing an array of entities in the form -/ (ELEM(),ELEM(),ELEM()) as required by GEOMETRYCOLLECTIONZ -*/ - gaiaGeomCollListTokenPtr geocoll_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr pt2; - gaiaTokenPtr p_first = NULL; - gaiaListTokenPtr list; - gaiaMultiListTokenPtr multi_list; - gaiaVarListTokenPtr var_list; - int opened = 0; - int i; - int err; - double x = 0.0; - double y = 0.0; - double z = 0.0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this complex list */ - if (pt->type == GAIA_POINTZ) - { - /* parsing a POINT list */ - err = 0; - i = 0; - pt2 = pt->next; - while (pt2 != NULL) - { - /* check if this one is a valid POINT */ - switch (i) - { - case 0: - if (pt2->type != GAIA_OPENED) - err = 1; - break; - case 1: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - x = pt2->coord; - break; - case 2: - if (pt2->type != GAIA_SPACE) - err = 1; - break; - case 3: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - y = pt2->coord; - break; - case 4: - if (pt2->type != GAIA_SPACE) - err = 1; - break; - case 5: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - z = pt2->coord; - break; - case 6: - if (pt2->type != GAIA_CLOSED) - err = 1; - break; - }; - i++; - if (i > 6) - break; - pt2 = pt2->next; - } - if (err) - goto error; - var_list = malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_POINTZ; - var_list->x = x; - var_list->y = y; - var_list->z = z; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = malloc (sizeof (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - } - else if (pt->type == GAIA_LINESTRINGZ) - { - /* parsing a LINESTRING list */ - p_first = NULL; - pt2 = pt->next; - while (pt2 != NULL) - { - if (pt2->type == GAIA_OPENED) - p_first = pt2; - if (pt2->type == GAIA_CLOSED) - { - list = gaiaBuildListTokenZ (p_first, pt2); - if (list) - { - var_list = malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_LINESTRINGZ; - var_list->pointer = list; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = - malloc (sizeof - (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - break; - } - else - goto error; - } - pt2 = pt2->next; - if (pt2 == last) - break; - } - } - else if (pt->type == GAIA_POLYGONZ) - { - /* parsing a POLYGON list */ - opened = 0; - p_first = NULL; - pt2 = pt->next; - while (pt2 != NULL) - { - if (pt2->type == GAIA_OPENED) - { - opened++; - if (opened == 1) - p_first = pt2; - } - if (pt2->type == GAIA_CLOSED) - { - if (p_first && opened == 1) - { - multi_list = - gaiaBuildMultiListTokenZ (p_first, pt2); - if (multi_list) - { - var_list = - malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_POLYGONZ; - var_list->pointer = multi_list; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = - malloc (sizeof - (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - break; - } - else - goto error; - } - opened--; - } - pt2 = pt2->next; - if (pt2 == last) - break; - } - } - pt = pt->next; - } - return geocoll_list; - error: - gaiaFreeGeomCollListToken (geocoll_list); - return NULL; -} - -static gaiaGeomCollListTokenPtr -gaiaBuildGeomCollListTokenM (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a variable list of tokens representing an array of entities in the form -/ (ELEM(),ELEM(),ELEM()) as required by GEOMETRYCOLLECTIONM -*/ - gaiaGeomCollListTokenPtr geocoll_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr pt2; - gaiaTokenPtr p_first = NULL; - gaiaListTokenPtr list; - gaiaMultiListTokenPtr multi_list; - gaiaVarListTokenPtr var_list; - int opened = 0; - int i; - int err; - double x = 0.0; - double y = 0.0; - double m = 0.0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this complex list */ - if (pt->type == GAIA_POINTM) - { - /* parsing a POINT list */ - err = 0; - i = 0; - pt2 = pt->next; - while (pt2 != NULL) - { - /* check if this one is a valid POINT */ - switch (i) - { - case 0: - if (pt2->type != GAIA_OPENED) - err = 1; - break; - case 1: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - x = pt2->coord; - break; - case 2: - if (pt2->type != GAIA_SPACE) - err = 1; - break; - case 3: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - y = pt2->coord; - break; - case 4: - if (pt2->type != GAIA_SPACE) - err = 1; - break; - case 5: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - m = pt2->coord; - break; - case 6: - if (pt2->type != GAIA_CLOSED) - err = 1; - break; - }; - i++; - if (i > 6) - break; - pt2 = pt2->next; - } - if (err) - goto error; - var_list = malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_POINTM; - var_list->x = x; - var_list->y = y; - var_list->m = m; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = malloc (sizeof (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - } - else if (pt->type == GAIA_LINESTRINGM) - { - /* parsing a LINESTRING list */ - p_first = NULL; - pt2 = pt->next; - while (pt2 != NULL) - { - if (pt2->type == GAIA_OPENED) - p_first = pt2; - if (pt2->type == GAIA_CLOSED) - { - list = gaiaBuildListTokenM (p_first, pt2); - if (list) - { - var_list = malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_LINESTRINGM; - var_list->pointer = list; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = - malloc (sizeof - (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - break; - } - else - goto error; - } - pt2 = pt2->next; - if (pt2 == last) - break; - } - } - else if (pt->type == GAIA_POLYGONM) - { - /* parsing a POLYGON list */ - opened = 0; - p_first = NULL; - pt2 = pt->next; - while (pt2 != NULL) - { - if (pt2->type == GAIA_OPENED) - { - opened++; - if (opened == 1) - p_first = pt2; - } - if (pt2->type == GAIA_CLOSED) - { - if (p_first && opened == 1) - { - multi_list = - gaiaBuildMultiListTokenM (p_first, pt2); - if (multi_list) - { - var_list = - malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_POLYGONM; - var_list->pointer = multi_list; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = - malloc (sizeof - (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - break; - } - else - goto error; - } - opened--; - } - pt2 = pt2->next; - if (pt2 == last) - break; - } - } - pt = pt->next; - } - return geocoll_list; - error: - gaiaFreeGeomCollListToken (geocoll_list); - return NULL; -} - -static gaiaGeomCollListTokenPtr -gaiaBuildGeomCollListTokenZM (gaiaTokenPtr first, gaiaTokenPtr last) -{ -/* -/ builds a variable list of tokens representing an array of entities in the form -/ (ELEM(),ELEM(),ELEM()) as required by GEOMETRYCOLLECTIONZM -*/ - gaiaGeomCollListTokenPtr geocoll_list = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr pt2; - gaiaTokenPtr p_first = NULL; - gaiaListTokenPtr list; - gaiaMultiListTokenPtr multi_list; - gaiaVarListTokenPtr var_list; - int opened = 0; - int i; - int err; - double x = 0.0; - double y = 0.0; - double z = 0.0; - double m = 0.0; - pt = first; - while (pt != NULL) - { - /* identifies the sub-lists contained in this complex list */ - if (pt->type == GAIA_POINTZM) - { - /* parsing a POINT list */ - err = 0; - i = 0; - pt2 = pt->next; - while (pt2 != NULL) - { - /* check if this one is a valid POINT */ - switch (i) - { - case 0: - if (pt2->type != GAIA_OPENED) - err = 1; - break; - case 1: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - x = pt2->coord; - break; - case 2: - if (pt2->type != GAIA_SPACE) - err = 1; - break; - case 3: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - y = pt2->coord; - break; - case 4: - if (pt2->type != GAIA_SPACE) - err = 1; - break; - case 5: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - z = pt2->coord; - break; - case 6: - if (pt2->type != GAIA_SPACE) - err = 1; - break; - case 7: - if (pt2->type != GAIA_COORDINATE) - err = 1; - else - m = pt2->coord; - break; - case 8: - if (pt2->type != GAIA_CLOSED) - err = 1; - break; - }; - i++; - if (i > 8) - break; - pt2 = pt2->next; - } - if (err) - goto error; - var_list = malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_POINTZM; - var_list->x = x; - var_list->y = y; - var_list->z = z; - var_list->m = m; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = malloc (sizeof (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - } - else if (pt->type == GAIA_LINESTRINGZM) - { - /* parsing a LINESTRING list */ - p_first = NULL; - pt2 = pt->next; - while (pt2 != NULL) - { - if (pt2->type == GAIA_OPENED) - p_first = pt2; - if (pt2->type == GAIA_CLOSED) - { - list = gaiaBuildListTokenZM (p_first, pt2); - if (list) - { - var_list = malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_LINESTRINGZM; - var_list->pointer = list; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = - malloc (sizeof - (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - break; - } - else - goto error; - } - pt2 = pt2->next; - if (pt2 == last) - break; - } - } - else if (pt->type == GAIA_POLYGONZM) - { - /* parsing a POLYGON list */ - opened = 0; - p_first = NULL; - pt2 = pt->next; - while (pt2 != NULL) - { - if (pt2->type == GAIA_OPENED) - { - opened++; - if (opened == 1) - p_first = pt2; - } - if (pt2->type == GAIA_CLOSED) - { - if (p_first && opened == 1) - { - multi_list = - gaiaBuildMultiListTokenZM (p_first, pt2); - if (multi_list) - { - var_list = - malloc (sizeof (gaiaVarListToken)); - var_list->type = GAIA_POLYGONZM; - var_list->pointer = multi_list; - var_list->next = NULL; - if (!geocoll_list) - { - geocoll_list = - malloc (sizeof - (gaiaGeomCollListToken)); - geocoll_list->first = NULL; - geocoll_list->last = NULL; - } - if (geocoll_list->first == NULL) - geocoll_list->first = var_list; - if (geocoll_list->last != NULL) - geocoll_list->last->next = var_list; - geocoll_list->last = var_list; - break; - } - else - goto error; - } - opened--; - } - pt2 = pt2->next; - if (pt2 == last) - break; - } - } - pt = pt->next; - } - return geocoll_list; - error: - gaiaFreeGeomCollListToken (geocoll_list); - return NULL; -} - -static gaiaPointPtr -gaiaBuildPoint (gaiaTokenPtr first) -{ -/* builds a POINT, if this token's list contains a valid POINT */ - gaiaPointPtr point = NULL; - gaiaTokenPtr pt = first; - int i = 0; - int err = 0; - double x = 0.0; - double y = 0.0; - while (pt != NULL) - { - /* check if this one is a valid POINT */ - switch (i) - { - case 0: - if (pt->type != GAIA_OPENED) - err = 1; - break; - case 1: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - x = pt->coord; - break; - case 2: - if (pt->type != GAIA_SPACE) - err = 1; - break; - case 3: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - y = pt->coord; - break; - case 4: - if (pt->type != GAIA_CLOSED) - err = 1; - break; - default: - err = 1; - break; - }; - i++; - pt = pt->next; - } - if (err) - return NULL; - point = gaiaAllocPoint (x, y); - return point; -} - -static gaiaPointPtr -gaiaBuildPointZ (gaiaTokenPtr first) -{ -/* builds a POINTZ, if this token's list contains a valid POINTZ */ - gaiaPointPtr point = NULL; - gaiaTokenPtr pt = first; - int i = 0; - int err = 0; - double x = 0.0; - double y = 0.0; - double z = 0.0; - while (pt != NULL) - { - /* check if this one is a valid POINTZ */ - switch (i) - { - case 0: - if (pt->type != GAIA_OPENED) - err = 1; - break; - case 1: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - x = pt->coord; - break; - case 2: - if (pt->type != GAIA_SPACE) - err = 1; - break; - case 3: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - y = pt->coord; - break; - case 4: - if (pt->type != GAIA_SPACE) - err = 1; - break; - case 5: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - z = pt->coord; - break; - case 6: - if (pt->type != GAIA_CLOSED) - err = 1; - break; - default: - err = 1; - break; - }; - i++; - pt = pt->next; - } - if (err) - return NULL; - point = gaiaAllocPointXYZ (x, y, z); - return point; -} - -static gaiaPointPtr -gaiaBuildPointM (gaiaTokenPtr first) -{ -/* builds a POINTM, if this token's list contains a valid POINTM */ - gaiaPointPtr point = NULL; - gaiaTokenPtr pt = first; - int i = 0; - int err = 0; - double x = 0.0; - double y = 0.0; - double m = 0.0; - while (pt != NULL) - { - /* check if this one is a valid POINTM */ - switch (i) - { - case 0: - if (pt->type != GAIA_OPENED) - err = 1; - break; - case 1: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - x = pt->coord; - break; - case 2: - if (pt->type != GAIA_SPACE) - err = 1; - break; - case 3: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - y = pt->coord; - break; - case 4: - if (pt->type != GAIA_SPACE) - err = 1; - break; - case 5: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - m = pt->coord; - break; - case 6: - if (pt->type != GAIA_CLOSED) - err = 1; - break; - default: - err = 1; - break; - }; - i++; - pt = pt->next; - } - if (err) - return NULL; - point = gaiaAllocPointXYM (x, y, m); - return point; -} - -static gaiaPointPtr -gaiaBuildPointZM (gaiaTokenPtr first) -{ -/* builds a POINTZM, if this token's list contains a valid POINTZM */ - gaiaPointPtr point = NULL; - gaiaTokenPtr pt = first; - int i = 0; - int err = 0; - double x = 0.0; - double y = 0.0; - double z = 0.0; - double m = 0.0; - while (pt != NULL) - { - /* check if this one is a valid POINTZM */ - switch (i) - { - case 0: - if (pt->type != GAIA_OPENED) - err = 1; - break; - case 1: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - x = pt->coord; - break; - case 2: - if (pt->type != GAIA_SPACE) - err = 1; - break; - case 3: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - y = pt->coord; - break; - case 4: - if (pt->type != GAIA_SPACE) - err = 1; - break; - case 5: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - z = pt->coord; - break; - case 6: - if (pt->type != GAIA_SPACE) - err = 1; - break; - case 7: - if (pt->type != GAIA_COORDINATE) - err = 1; - else - m = pt->coord; - break; - case 8: - if (pt->type != GAIA_CLOSED) - err = 1; - break; - default: - err = 1; - break; - }; - i++; - pt = pt->next; - } - if (err) - return NULL; - point = gaiaAllocPointXYZM (x, y, z, m); - return point; -} - -static gaiaGeomCollPtr -gaiaGeometryFromPoint (gaiaPointPtr point) -{ -/* builds a GEOMETRY containing a POINT */ - gaiaGeomCollPtr geom = NULL; - geom = gaiaAllocGeomColl (); - geom->DeclaredType = GAIA_POINT; - gaiaAddPointToGeomColl (geom, point->X, point->Y); - gaiaFreePoint (point); - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromPointZ (gaiaPointPtr point) -{ -/* builds a GEOMETRY containing a POINTZ */ - gaiaGeomCollPtr geom = NULL; - geom = gaiaAllocGeomCollXYZ (); - geom->DeclaredType = GAIA_POINT; - gaiaAddPointToGeomCollXYZ (geom, point->X, point->Y, point->Z); - gaiaFreePoint (point); - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromPointM (gaiaPointPtr point) -{ -/* builds a GEOMETRY containing a POINTM */ - gaiaGeomCollPtr geom = NULL; - geom = gaiaAllocGeomCollXYM (); - geom->DeclaredType = GAIA_POINT; - gaiaAddPointToGeomCollXYM (geom, point->X, point->Y, point->M); - gaiaFreePoint (point); - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromPointZM (gaiaPointPtr point) -{ -/* builds a GEOMETRY containing a POINTZM */ - gaiaGeomCollPtr geom = NULL; - geom = gaiaAllocGeomCollXYZM (); - geom->DeclaredType = GAIA_POINTZ; - gaiaAddPointToGeomCollXYZM (geom, point->X, point->Y, point->Z, point->M); - gaiaFreePoint (point); - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromLinestring (gaiaLinestringPtr line) -{ -/* builds a GEOMETRY containing a LINESTRING */ - gaiaGeomCollPtr geom = NULL; - gaiaLinestringPtr line2; - int iv; - double x; - double y; - geom = gaiaAllocGeomColl (); - geom->DeclaredType = GAIA_LINESTRING; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line2->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPoint (line->Coords, iv, &x, &y); - gaiaSetPoint (line2->Coords, iv, x, y); - } - gaiaFreeLinestring (line); - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromLinestringZ (gaiaLinestringPtr line) -{ -/* builds a GEOMETRY containing a LINESTRINGZ */ - gaiaGeomCollPtr geom = NULL; - gaiaLinestringPtr line2; - int iv; - double x; - double y; - double z; - geom = gaiaAllocGeomCollXYZ (); - geom->DeclaredType = GAIA_LINESTRING; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line2->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); - gaiaSetPointXYZ (line2->Coords, iv, x, y, z); - } - gaiaFreeLinestring (line); - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromLinestringM (gaiaLinestringPtr line) -{ -/* builds a GEOMETRY containing a LINESTRINGM */ - gaiaGeomCollPtr geom = NULL; - gaiaLinestringPtr line2; - int iv; - double x; - double y; - double m; - geom = gaiaAllocGeomCollXYM (); - geom->DeclaredType = GAIA_LINESTRING; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line2->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); - gaiaSetPointXYM (line2->Coords, iv, x, y, m); - } - gaiaFreeLinestring (line); - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromLinestringZM (gaiaLinestringPtr line) -{ -/* builds a GEOMETRY containing a LINESTRINGZM */ - gaiaGeomCollPtr geom = NULL; - gaiaLinestringPtr line2; - int iv; - double x; - double y; - double z; - double m; - geom = gaiaAllocGeomCollXYZM (); - geom->DeclaredType = GAIA_LINESTRING; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line2->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); - gaiaSetPointXYZM (line2->Coords, iv, x, y, z, m); - } - gaiaFreeLinestring (line); - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromPolygon (gaiaMultiListTokenPtr polygon) -{ -/* builds a GEOMETRY containing a POLYGON */ - int iv; - int ib; - int borders = 0; - double x; - double y; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaListTokenPtr pt; - pt = polygon->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - if (!borders) - return NULL; - geom = gaiaAllocGeomColl (); - geom->DeclaredType = GAIA_POLYGON; -/* builds the polygon */ - line = polygon->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPoint (line->Coords, iv, &x, &y); - gaiaSetPoint (ring->Coords, iv, x, y); - } - ib = 0; - pt = polygon->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for some interior ring */ - gaiaGetPoint (line->Coords, iv, &x, &y); - gaiaSetPoint (ring->Coords, iv, x, y); - } - ib++; - pt = pt->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromPolygonZ (gaiaMultiListTokenPtr polygon) -{ -/* builds a GEOMETRY containing a POLYGONZ */ - int iv; - int ib; - int borders = 0; - double x; - double y; - double z; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaListTokenPtr pt; - pt = polygon->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - if (!borders) - return NULL; - geom = gaiaAllocGeomCollXYZ (); - geom->DeclaredType = GAIA_POLYGON; -/* builds the polygon */ - line = polygon->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); - gaiaSetPointXYZ (ring->Coords, iv, x, y, z); - } - ib = 0; - pt = polygon->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for some interior ring */ - gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); - gaiaSetPointXYZ (ring->Coords, iv, x, y, z); - } - ib++; - pt = pt->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromPolygonM (gaiaMultiListTokenPtr polygon) -{ -/* builds a GEOMETRY containing a POLYGONM */ - int iv; - int ib; - int borders = 0; - double x; - double y; - double m; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaListTokenPtr pt; - pt = polygon->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - if (!borders) - return NULL; - geom = gaiaAllocGeomCollXYM (); - geom->DeclaredType = GAIA_POLYGON; -/* builds the polygon */ - line = polygon->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); - gaiaSetPointXYM (ring->Coords, iv, x, y, m); - } - ib = 0; - pt = polygon->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for some interior ring */ - gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); - gaiaSetPointXYM (ring->Coords, iv, x, y, m); - } - ib++; - pt = pt->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromPolygonZM (gaiaMultiListTokenPtr polygon) -{ -/* builds a GEOMETRY containing a POLYGONZM */ - int iv; - int ib; - int borders = 0; - double x; - double y; - double z; - double m; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaListTokenPtr pt; - pt = polygon->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - if (!borders) - return NULL; - geom = gaiaAllocGeomCollXYZM (); - geom->DeclaredType = GAIA_POLYGON; -/* builds the polygon */ - line = polygon->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); - gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); - } - ib = 0; - pt = polygon->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for some interior ring */ - gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); - gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); - } - ib++; - pt = pt->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMPoint (gaiaLinestringPtr mpoint) -{ -/* builds a GEOMETRY containing a MULTIPOINT */ - int ie; - double x; - double y; - gaiaGeomCollPtr geom = NULL; - geom = gaiaAllocGeomColl (); - geom->DeclaredType = GAIA_MULTIPOINT; - for (ie = 0; ie < mpoint->Points; ie++) - { - gaiaGetPoint (mpoint->Coords, ie, &x, &y); - gaiaAddPointToGeomColl (geom, x, y); - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMPointZ (gaiaLinestringPtr mpoint) -{ -/* builds a GEOMETRY containing a MULTIPOINTZ */ - int ie; - double x; - double y; - double z; - gaiaGeomCollPtr geom = NULL; - geom = gaiaAllocGeomCollXYZ (); - geom->DeclaredType = GAIA_MULTIPOINT; - for (ie = 0; ie < mpoint->Points; ie++) - { - gaiaGetPointXYZ (mpoint->Coords, ie, &x, &y, &z); - gaiaAddPointToGeomCollXYZ (geom, x, y, z); - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMPointM (gaiaLinestringPtr mpoint) -{ -/* builds a GEOMETRY containing a MULTIPOINTM */ - int ie; - double x; - double y; - double m; - gaiaGeomCollPtr geom = NULL; - geom = gaiaAllocGeomCollXYM (); - geom->DeclaredType = GAIA_MULTIPOINT; - for (ie = 0; ie < mpoint->Points; ie++) - { - gaiaGetPointXYM (mpoint->Coords, ie, &x, &y, &m); - gaiaAddPointToGeomCollXYM (geom, x, y, m); - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMPointZM (gaiaLinestringPtr mpoint) -{ -/* builds a GEOMETRY containing a MULTIPOINTZM */ - int ie; - double x; - double y; - double z; - double m; - gaiaGeomCollPtr geom = NULL; - geom = gaiaAllocGeomCollXYZM (); - geom->DeclaredType = GAIA_MULTIPOINT; - for (ie = 0; ie < mpoint->Points; ie++) - { - gaiaGetPointXYZM (mpoint->Coords, ie, &x, &y, &z, &m); - gaiaAddPointToGeomCollXYZM (geom, x, y, z, m); - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMLine (gaiaMultiListTokenPtr mline) -{ -/* builds a GEOMETRY containing a MULTILINESTRING */ - int iv; - int lines = 0; - double x; - double y; - gaiaListTokenPtr pt; - gaiaLinestringPtr line; - gaiaLinestringPtr line2; - gaiaGeomCollPtr geom = NULL; - pt = mline->first; - while (pt != NULL) - { -/* counts how many linestrings are in the list */ - lines++; - pt = pt->next; - } - if (!lines) - return NULL; - geom = gaiaAllocGeomColl (); - geom->DeclaredType = GAIA_MULTILINESTRING; - pt = mline->first; - while (pt != NULL) - { - /* creates and initializes one linestring for each iteration */ - line = pt->line; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line->Points; iv++) - { - gaiaGetPoint (line->Coords, iv, &x, &y); - gaiaSetPoint (line2->Coords, iv, x, y); - } - pt = pt->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMLineZ (gaiaMultiListTokenPtr mline) -{ -/* builds a GEOMETRY containing a MULTILINESTRINGZ */ - int iv; - int lines = 0; - double x; - double y; - double z; - gaiaListTokenPtr pt; - gaiaLinestringPtr line; - gaiaLinestringPtr line2; - gaiaGeomCollPtr geom = NULL; - pt = mline->first; - while (pt != NULL) - { -/* counts how many linestrings are in the list */ - lines++; - pt = pt->next; - } - if (!lines) - return NULL; - geom = gaiaAllocGeomCollXYZ (); - geom->DeclaredType = GAIA_MULTILINESTRING; - pt = mline->first; - while (pt != NULL) - { - /* creates and initializes one linestring for each iteration */ - line = pt->line; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line->Points; iv++) - { - gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); - gaiaSetPointXYZ (line2->Coords, iv, x, y, z); - } - pt = pt->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMLineM (gaiaMultiListTokenPtr mline) -{ -/* builds a GEOMETRY containing a MULTILINESTRINGM */ - int iv; - int lines = 0; - double x; - double y; - double m; - gaiaListTokenPtr pt; - gaiaLinestringPtr line; - gaiaLinestringPtr line2; - gaiaGeomCollPtr geom = NULL; - pt = mline->first; - while (pt != NULL) - { -/* counts how many linestrings are in the list */ - lines++; - pt = pt->next; - } - if (!lines) - return NULL; - geom = gaiaAllocGeomCollXYM (); - geom->DeclaredType = GAIA_MULTILINESTRING; - pt = mline->first; - while (pt != NULL) - { - /* creates and initializes one linestring for each iteration */ - line = pt->line; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line->Points; iv++) - { - gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); - gaiaSetPointXYM (line2->Coords, iv, x, y, m); - } - pt = pt->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMLineZM (gaiaMultiListTokenPtr mline) -{ -/* builds a GEOMETRY containing a MULTILINESTRINGZM */ - int iv; - int lines = 0; - double x; - double y; - double z; - double m; - gaiaListTokenPtr pt; - gaiaLinestringPtr line; - gaiaLinestringPtr line2; - gaiaGeomCollPtr geom = NULL; - pt = mline->first; - while (pt != NULL) - { -/* counts how many linestrings are in the list */ - lines++; - pt = pt->next; - } - if (!lines) - return NULL; - geom = gaiaAllocGeomCollXYZM (); - geom->DeclaredType = GAIA_MULTILINESTRING; - pt = mline->first; - while (pt != NULL) - { - /* creates and initializes one linestring for each iteration */ - line = pt->line; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line->Points; iv++) - { - gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); - gaiaSetPointXYZM (line2->Coords, iv, x, y, z, m); - } - pt = pt->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMPoly (gaiaMultiMultiListTokenPtr mpoly) -{ -/* builds a GEOMETRY containing a MULTIPOLYGON */ - int iv; - int ib; - int borders; - int entities = 0; - double x; - double y; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaMultiListTokenPtr multi; - gaiaListTokenPtr pt; - multi = mpoly->first; - while (multi != NULL) - { - /* counts how many polygons are in the list */ - entities++; - multi = multi->next; - } - if (!entities) - return NULL; -/* allocates and initializes the geometry to be returned */ - geom = gaiaAllocGeomColl (); - geom->DeclaredType = GAIA_MULTIPOLYGON; - multi = mpoly->first; - while (multi != NULL) - { - borders = 0; - pt = multi->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - /* builds one polygon */ - line = multi->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPoint (line->Coords, iv, &x, &y); - gaiaSetPoint (ring->Coords, iv, x, y); - } - ib = 0; - pt = multi->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPoint (line->Coords, iv, &x, &y); - gaiaSetPoint (ring->Coords, iv, x, y); - } - ib++; - pt = pt->next; - } - multi = multi->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMPolyZ (gaiaMultiMultiListTokenPtr mpoly) -{ -/* builds a GEOMETRY containing a MULTIPOLYGONZ */ - int iv; - int ib; - int borders; - int entities = 0; - double x; - double y; - double z; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaMultiListTokenPtr multi; - gaiaListTokenPtr pt; - multi = mpoly->first; - while (multi != NULL) - { - /* counts how many polygons are in the list */ - entities++; - multi = multi->next; - } - if (!entities) - return NULL; -/* allocates and initializes the geometry to be returned */ - geom = gaiaAllocGeomCollXYZ (); - geom->DeclaredType = GAIA_MULTIPOLYGON; - multi = mpoly->first; - while (multi != NULL) - { - borders = 0; - pt = multi->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - /* builds one polygon */ - line = multi->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); - gaiaSetPointXYZ (ring->Coords, iv, x, y, z); - } - ib = 0; - pt = multi->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); - gaiaSetPointXYZ (ring->Coords, iv, x, y, z); - } - ib++; - pt = pt->next; - } - multi = multi->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMPolyM (gaiaMultiMultiListTokenPtr mpoly) -{ -/* builds a GEOMETRY containing a MULTIPOLYGONM */ - int iv; - int ib; - int borders; - int entities = 0; - double x; - double y; - double m; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaMultiListTokenPtr multi; - gaiaListTokenPtr pt; - multi = mpoly->first; - while (multi != NULL) - { - /* counts how many polygons are in the list */ - entities++; - multi = multi->next; - } - if (!entities) - return NULL; -/* allocates and initializes the geometry to be returned */ - geom = gaiaAllocGeomCollXYM (); - geom->DeclaredType = GAIA_MULTIPOLYGON; - multi = mpoly->first; - while (multi != NULL) - { - borders = 0; - pt = multi->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - /* builds one polygon */ - line = multi->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); - gaiaSetPointXYM (ring->Coords, iv, x, y, m); - } - ib = 0; - pt = multi->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); - gaiaSetPointXYM (ring->Coords, iv, x, y, m); - } - ib++; - pt = pt->next; - } - multi = multi->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromMPolyZM (gaiaMultiMultiListTokenPtr mpoly) -{ -/* builds a GEOMETRY containing a MULTIPOLYGONZM */ - int iv; - int ib; - int borders; - int entities = 0; - double x; - double y; - double z; - double m; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaMultiListTokenPtr multi; - gaiaListTokenPtr pt; - multi = mpoly->first; - while (multi != NULL) - { - /* counts how many polygons are in the list */ - entities++; - multi = multi->next; - } - if (!entities) - return NULL; -/* allocates and initializes the geometry to be returned */ - geom = gaiaAllocGeomCollXYZM (); - geom->DeclaredType = GAIA_MULTIPOLYGON; - multi = mpoly->first; - while (multi != NULL) - { - borders = 0; - pt = multi->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - /* builds one polygon */ - line = multi->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); - gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); - } - ib = 0; - pt = multi->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); - gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); - } - ib++; - pt = pt->next; - } - multi = multi->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromGeomColl (gaiaGeomCollListTokenPtr geocoll) -{ -/* builds a GEOMETRY containing a GEOMETRYCOLLECTION */ - int iv; - int ib; - int borders; - int entities = 0; - double x; - double y; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line2; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaListTokenPtr linestring; - gaiaMultiListTokenPtr polyg; - gaiaVarListTokenPtr multi; - gaiaListTokenPtr pt; - multi = geocoll->first; - while (multi != NULL) - { - /* counts how many polygons are in the list */ - entities++; - multi = multi->next; - } - if (!entities) - return NULL; -/* allocates and initializes the geometry to be returned */ - geom = gaiaAllocGeomColl (); - geom->DeclaredType = GAIA_GEOMETRYCOLLECTION; - multi = geocoll->first; - while (multi != NULL) - { - switch (multi->type) - { - case GAIA_POINT: - gaiaAddPointToGeomColl (geom, multi->x, multi->y); - break; - case GAIA_LINESTRING: - linestring = (gaiaListTokenPtr) (multi->pointer); - line = linestring->line; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line2->Points; iv++) - { - /* sets the POINTS for the LINESTRING */ - gaiaGetPoint (line->Coords, iv, &x, &y); - gaiaSetPoint (line2->Coords, iv, x, y); - } - break; - case GAIA_POLYGON: - polyg = multi->pointer; - borders = 0; - pt = polyg->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - /* builds one polygon */ - line = polyg->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPoint (line->Coords, iv, &x, &y); - gaiaSetPoint (ring->Coords, iv, x, y); - } - ib = 0; - pt = polyg->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPoint (line->Coords, iv, &x, &y); - gaiaSetPoint (ring->Coords, iv, x, y); - } - ib++; - pt = pt->next; - } - break; - }; - multi = multi->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromGeomCollZ (gaiaGeomCollListTokenPtr geocoll) -{ -/* builds a GEOMETRY containing a GEOMETRYCOLLECTIONZ */ - int iv; - int ib; - int borders; - int entities = 0; - double x; - double y; - double z; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line2; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaListTokenPtr linestring; - gaiaMultiListTokenPtr polyg; - gaiaVarListTokenPtr multi; - gaiaListTokenPtr pt; - multi = geocoll->first; - while (multi != NULL) - { - /* counts how many polygons are in the list */ - entities++; - multi = multi->next; - } - if (!entities) - return NULL; -/* allocates and initializes the geometry to be returned */ - geom = gaiaAllocGeomCollXYZ (); - geom->DeclaredType = GAIA_GEOMETRYCOLLECTION; - multi = geocoll->first; - while (multi != NULL) - { - switch (multi->type) - { - case GAIA_POINTZ: - gaiaAddPointToGeomCollXYZ (geom, multi->x, multi->y, multi->z); - break; - case GAIA_LINESTRINGZ: - linestring = (gaiaListTokenPtr) (multi->pointer); - line = linestring->line; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line2->Points; iv++) - { - /* sets the POINTS for the LINESTRING */ - gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); - gaiaSetPointXYZ (line2->Coords, iv, x, y, z); - } - break; - case GAIA_POLYGONZ: - polyg = multi->pointer; - borders = 0; - pt = polyg->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - /* builds one polygon */ - line = polyg->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); - gaiaSetPointXYZ (ring->Coords, iv, x, y, z); - } - ib = 0; - pt = polyg->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); - gaiaSetPointXYZ (ring->Coords, iv, x, y, z); - } - ib++; - pt = pt->next; - } - break; - }; - multi = multi->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromGeomCollM (gaiaGeomCollListTokenPtr geocoll) -{ -/* builds a GEOMETRY containing a GEOMETRYCOLLECTIONM */ - int iv; - int ib; - int borders; - int entities = 0; - double x; - double y; - double m; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line2; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaListTokenPtr linestring; - gaiaMultiListTokenPtr polyg; - gaiaVarListTokenPtr multi; - gaiaListTokenPtr pt; - multi = geocoll->first; - while (multi != NULL) - { - /* counts how many polygons are in the list */ - entities++; - multi = multi->next; - } - if (!entities) - return NULL; -/* allocates and initializes the geometry to be returned */ - geom = gaiaAllocGeomCollXYM (); - geom->DeclaredType = GAIA_GEOMETRYCOLLECTION; - multi = geocoll->first; - while (multi != NULL) - { - switch (multi->type) - { - case GAIA_POINTM: - gaiaAddPointToGeomCollXYM (geom, multi->x, multi->y, multi->m); - break; - case GAIA_LINESTRINGM: - linestring = (gaiaListTokenPtr) (multi->pointer); - line = linestring->line; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line2->Points; iv++) - { - /* sets the POINTS for the LINESTRING */ - gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); - gaiaSetPointXYM (line2->Coords, iv, x, y, m); - } - break; - case GAIA_POLYGONM: - polyg = multi->pointer; - borders = 0; - pt = polyg->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - /* builds one polygon */ - line = polyg->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); - gaiaSetPointXYM (ring->Coords, iv, x, y, m); - } - ib = 0; - pt = polyg->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); - gaiaSetPointXYM (ring->Coords, iv, x, y, m); - } - ib++; - pt = pt->next; - } - break; - }; - multi = multi->next; - } - return geom; -} - -static gaiaGeomCollPtr -gaiaGeometryFromGeomCollZM (gaiaGeomCollListTokenPtr geocoll) -{ -/* builds a GEOMETRY containing a GEOMETRYCOLLECTIONZM */ - int iv; - int ib; - int borders; - int entities = 0; - double x; - double y; - double z; - double m; - gaiaPolygonPtr pg; - gaiaRingPtr ring; - gaiaLinestringPtr line2; - gaiaLinestringPtr line; - gaiaGeomCollPtr geom = NULL; - gaiaListTokenPtr linestring; - gaiaMultiListTokenPtr polyg; - gaiaVarListTokenPtr multi; - gaiaListTokenPtr pt; - multi = geocoll->first; - while (multi != NULL) - { - /* counts how many polygons are in the list */ - entities++; - multi = multi->next; - } - if (!entities) - return NULL; -/* allocates and initializes the geometry to be returned */ - geom = gaiaAllocGeomCollXYZM (); - geom->DeclaredType = GAIA_GEOMETRYCOLLECTION; - multi = geocoll->first; - while (multi != NULL) - { - switch (multi->type) - { - case GAIA_POINTZM: - gaiaAddPointToGeomCollXYZM (geom, multi->x, multi->y, multi->z, - multi->m); - break; - case GAIA_LINESTRINGZM: - linestring = (gaiaListTokenPtr) (multi->pointer); - line = linestring->line; - line2 = gaiaAddLinestringToGeomColl (geom, line->Points); - for (iv = 0; iv < line2->Points; iv++) - { - /* sets the POINTS for the LINESTRING */ - gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); - gaiaSetPointXYZM (line2->Coords, iv, x, y, z, m); - } - break; - case GAIA_POLYGONZM: - polyg = multi->pointer; - borders = 0; - pt = polyg->first; - while (pt != NULL) - { - /* counts how many rings are in the list */ - borders++; - pt = pt->next; - } - /* builds one polygon */ - line = polyg->first->line; - pg = gaiaAddPolygonToGeomColl (geom, line->Points, borders - 1); - ring = pg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); - gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); - } - ib = 0; - pt = polyg->first->next; - while (pt != NULL) - { - /* builds the interior rings [if any] */ - line = pt->line; - ring = gaiaAddInteriorRing (pg, ib, line->Points); - for (iv = 0; iv < ring->Points; iv++) - { - /* sets the POINTS for the exterior ring */ - gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); - gaiaSetPointXYZM (ring->Coords, iv, x, y, z, m); - } - ib++; - pt = pt->next; - } - break; - }; - multi = multi->next; - } - return geom; -} - -static int -checkValidity (gaiaGeomCollPtr geom) -{ -/* checks if this one is a degenerated geometry */ - gaiaPointPtr pt; - gaiaLinestringPtr ln; - gaiaPolygonPtr pg; - gaiaRingPtr rng; - int ib; - int entities = 0; - pt = geom->FirstPoint; - while (pt) - { - /* checking points */ - entities++; - pt = pt->Next; - } - ln = geom->FirstLinestring; - while (ln) - { - /* checking linestrings */ - if (ln->Points < 2) - return 0; - entities++; - ln = ln->Next; - } - pg = geom->FirstPolygon; - while (pg) - { - /* checking polygons */ - rng = pg->Exterior; - if (rng->Points < 4) - return 0; - for (ib = 0; ib < pg->NumInteriors; ib++) - { - rng = pg->Interiors + ib; - if (rng->Points < 4) - return 0; - } - entities++; - pg = pg->Next; - } - if (!entities) - return 0; - return 1; -} - -GAIAGEO_DECLARE gaiaGeomCollPtr -gaiaParseWkt (const unsigned char *dirty_buffer, short type) -{ -/* tryes to build a GEOMETRY by parsing a WKT encoded string */ - gaiaTokenPtr first = NULL; - gaiaTokenPtr last = NULL; - gaiaTokenPtr pt; - gaiaTokenPtr ptn; - char *buffer = NULL; - char dummy[256]; - char *po = dummy; - char *p; - int opened; - int max_opened; - int closed; - gaiaListTokenPtr list_token = NULL; - gaiaMultiListTokenPtr multi_list_token = NULL; - gaiaMultiMultiListTokenPtr multi_multi_list_token = NULL; - gaiaGeomCollListTokenPtr geocoll_list_token = NULL; - gaiaPointPtr point; - gaiaLinestringPtr line; - gaiaGeomCollPtr geo = NULL; -/* normalizing the WKT string */ - buffer = gaiaCleanWkt (dirty_buffer); - if (!buffer) - return NULL; - p = buffer; - while (*p != '\0') - { - /* breaking the WKT string into tokens */ - if (*p == '(') - { - *po = '\0'; - gaiaAddToken (dummy, &first, &last); - gaiaAddToken ("(", &first, &last); - po = dummy; - p++; - continue; - } - if (*p == ')') - { - *po = '\0'; - gaiaAddToken (dummy, &first, &last); - gaiaAddToken (")", &first, &last); - po = dummy; - p++; - continue; - } - if (*p == ' ') - { - *po = '\0'; - gaiaAddToken (dummy, &first, &last); - gaiaAddToken (" ", &first, &last); - po = dummy; - p++; - continue; - } - if (*p == ',') - { - *po = '\0'; - gaiaAddToken (dummy, &first, &last); - gaiaAddToken (",", &first, &last); - po = dummy; - p++; - continue; - } - *po++ = *p++; - } - if (first == NULL) - goto err; - max_opened = 0; - opened = 0; - closed = 0; - pt = first; - while (pt != NULL) - { - /* checks for absence of serious errors */ - if (pt->type == GAIA_UNKNOWN) - goto err; - if (pt->type == GAIA_OPENED) - { - opened++; - if (opened > 3) - goto err; - if (opened > max_opened) - max_opened = opened; - } - if (pt->type == GAIA_CLOSED) - { - closed++; - if (closed > opened) - goto err; - opened--; - closed--; - } - pt = pt->next; - } - if (opened == 0 && closed == 0) - ; - else - goto err; - if (type < 0) - ; /* no restrinction about GEOMETRY CLASS TYPE */ - else - { - if (first->type != type) - goto err; /* invalid CLASS TYPE for request */ - } -/* preparing the organized token-list structures */ - switch (first->type) - { - case GAIA_POINT: - case GAIA_POINTZ: - case GAIA_POINTM: - case GAIA_POINTZM: - if (max_opened != 1) - goto err; - break; - case GAIA_LINESTRING: - if (max_opened != 1) - goto err; - list_token = gaiaBuildListToken (first->next, last); - break; - case GAIA_LINESTRINGZ: - if (max_opened != 1) - goto err; - list_token = gaiaBuildListTokenZ (first->next, last); - break; - case GAIA_LINESTRINGM: - if (max_opened != 1) - goto err; - list_token = gaiaBuildListTokenM (first->next, last); - break; - case GAIA_LINESTRINGZM: - if (max_opened != 1) - goto err; - list_token = gaiaBuildListTokenZM (first->next, last); - break; - case GAIA_POLYGON: - if (max_opened != 2) - goto err; - multi_list_token = gaiaBuildMultiListToken (first->next, last); - break; - case GAIA_POLYGONZ: - if (max_opened != 2) - goto err; - multi_list_token = gaiaBuildMultiListTokenZ (first->next, last); - break; - case GAIA_POLYGONM: - if (max_opened != 2) - goto err; - multi_list_token = gaiaBuildMultiListTokenM (first->next, last); - break; - case GAIA_POLYGONZM: - if (max_opened != 2) - goto err; - multi_list_token = gaiaBuildMultiListTokenZM (first->next, last); - break; - case GAIA_MULTIPOINT: - if (max_opened != 1) - goto err; - list_token = gaiaBuildListToken (first->next, last); - break; - case GAIA_MULTIPOINTZ: - if (max_opened != 1) - goto err; - list_token = gaiaBuildListTokenZ (first->next, last); - break; - case GAIA_MULTIPOINTM: - if (max_opened != 1) - goto err; - list_token = gaiaBuildListTokenM (first->next, last); - break; - case GAIA_MULTIPOINTZM: - if (max_opened != 1) - goto err; - list_token = gaiaBuildListTokenZM (first->next, last); - break; - case GAIA_MULTILINESTRING: - if (max_opened != 2) - goto err; - multi_list_token = gaiaBuildMultiListToken (first->next, last); - break; - case GAIA_MULTILINESTRINGZ: - if (max_opened != 2) - goto err; - multi_list_token = gaiaBuildMultiListTokenZ (first->next, last); - break; - case GAIA_MULTILINESTRINGM: - if (max_opened != 2) - goto err; - multi_list_token = gaiaBuildMultiListTokenM (first->next, last); - break; - case GAIA_MULTILINESTRINGZM: - if (max_opened != 2) - goto err; - multi_list_token = gaiaBuildMultiListTokenZM (first->next, last); - break; - case GAIA_MULTIPOLYGON: - if (max_opened != 3) - goto err; - multi_multi_list_token = - gaiaBuildMultiMultiListToken (first->next, last); - break; - case GAIA_MULTIPOLYGONZ: - if (max_opened != 3) - goto err; - multi_multi_list_token = - gaiaBuildMultiMultiListTokenZ (first->next, last); - break; - case GAIA_MULTIPOLYGONM: - if (max_opened != 3) - goto err; - multi_multi_list_token = - gaiaBuildMultiMultiListTokenM (first->next, last); - break; - case GAIA_MULTIPOLYGONZM: - if (max_opened != 3) - goto err; - multi_multi_list_token = - gaiaBuildMultiMultiListTokenZM (first->next, last); - break; - case GAIA_GEOMETRYCOLLECTION: - if (max_opened == 2 || max_opened == 3) - ; - else - goto err; - geocoll_list_token = gaiaBuildGeomCollListToken (first->next, last); - break; - case GAIA_GEOMETRYCOLLECTIONZ: - if (max_opened == 2 || max_opened == 3) - ; - else - goto err; - geocoll_list_token = gaiaBuildGeomCollListTokenZ (first->next, last); - break; - case GAIA_GEOMETRYCOLLECTIONM: - if (max_opened == 2 || max_opened == 3) - ; - else - goto err; - geocoll_list_token = gaiaBuildGeomCollListTokenM (first->next, last); - break; - case GAIA_GEOMETRYCOLLECTIONZM: - if (max_opened == 2 || max_opened == 3) - ; - else - goto err; - geocoll_list_token = gaiaBuildGeomCollListTokenZM (first->next, last); - break; - } - switch (first->type) - { - case GAIA_POINT: - point = gaiaBuildPoint (first->next); - if (point) - geo = gaiaGeometryFromPoint (point); - break; - case GAIA_POINTZ: - point = gaiaBuildPointZ (first->next); - if (point) - geo = gaiaGeometryFromPointZ (point); - break; - case GAIA_POINTM: - point = gaiaBuildPointM (first->next); - if (point) - geo = gaiaGeometryFromPointM (point); - break; - case GAIA_POINTZM: - point = gaiaBuildPointZM (first->next); - if (point) - geo = gaiaGeometryFromPointZM (point); - break; - case GAIA_LINESTRING: - line = list_token->line; - if (line) - geo = gaiaGeometryFromLinestring (line); - list_token->line = NULL; - break; - case GAIA_LINESTRINGZ: - line = list_token->line; - if (line) - geo = gaiaGeometryFromLinestringZ (line); - list_token->line = NULL; - break; - case GAIA_LINESTRINGM: - line = list_token->line; - if (line) - geo = gaiaGeometryFromLinestringM (line); - list_token->line = NULL; - break; - case GAIA_LINESTRINGZM: - line = list_token->line; - if (line) - geo = gaiaGeometryFromLinestringZM (line); - list_token->line = NULL; - break; - case GAIA_POLYGON: - if (multi_list_token) - geo = gaiaGeometryFromPolygon (multi_list_token); - break; - case GAIA_POLYGONZ: - if (multi_list_token) - geo = gaiaGeometryFromPolygonZ (multi_list_token); - break; - case GAIA_POLYGONM: - if (multi_list_token) - geo = gaiaGeometryFromPolygonM (multi_list_token); - break; - case GAIA_POLYGONZM: - if (multi_list_token) - geo = gaiaGeometryFromPolygonZM (multi_list_token); - break; - case GAIA_MULTIPOINT: - line = list_token->line; - if (line) - geo = gaiaGeometryFromMPoint (line); - list_token->line = NULL; - break; - case GAIA_MULTIPOINTZ: - line = list_token->line; - if (line) - geo = gaiaGeometryFromMPointZ (line); - list_token->line = NULL; - break; - case GAIA_MULTIPOINTM: - line = list_token->line; - if (line) - geo = gaiaGeometryFromMPointM (line); - list_token->line = NULL; - break; - case GAIA_MULTIPOINTZM: - line = list_token->line; - if (line) - geo = gaiaGeometryFromMPointZM (line); - list_token->line = NULL; - break; - case GAIA_MULTILINESTRING: - if (multi_list_token) - geo = gaiaGeometryFromMLine (multi_list_token); - break; - case GAIA_MULTILINESTRINGZ: - if (multi_list_token) - geo = gaiaGeometryFromMLineZ (multi_list_token); - break; - case GAIA_MULTILINESTRINGM: - if (multi_list_token) - geo = gaiaGeometryFromMLineM (multi_list_token); - break; - case GAIA_MULTILINESTRINGZM: - if (multi_list_token) - geo = gaiaGeometryFromMLineZM (multi_list_token); - break; - case GAIA_MULTIPOLYGON: - if (multi_multi_list_token) - geo = gaiaGeometryFromMPoly (multi_multi_list_token); - break; - case GAIA_MULTIPOLYGONZ: - if (multi_multi_list_token) - geo = gaiaGeometryFromMPolyZ (multi_multi_list_token); - break; - case GAIA_MULTIPOLYGONM: - if (multi_multi_list_token) - geo = gaiaGeometryFromMPolyM (multi_multi_list_token); - break; - case GAIA_MULTIPOLYGONZM: - if (multi_multi_list_token) - geo = gaiaGeometryFromMPolyZM (multi_multi_list_token); - break; - case GAIA_GEOMETRYCOLLECTION: - if (geocoll_list_token) - geo = gaiaGeometryFromGeomColl (geocoll_list_token); - break; - case GAIA_GEOMETRYCOLLECTIONZ: - if (geocoll_list_token) - geo = gaiaGeometryFromGeomCollZ (geocoll_list_token); - break; - case GAIA_GEOMETRYCOLLECTIONM: - if (geocoll_list_token) - geo = gaiaGeometryFromGeomCollM (geocoll_list_token); - break; - case GAIA_GEOMETRYCOLLECTIONZM: - if (geocoll_list_token) - geo = gaiaGeometryFromGeomCollZM (geocoll_list_token); - break; - } - if (buffer) - free (buffer); - gaiaFreeListToken (list_token); - gaiaFreeMultiListToken (multi_list_token); - gaiaFreeMultiMultiListToken (multi_multi_list_token); - gaiaFreeGeomCollListToken (geocoll_list_token); - pt = first; - while (pt != NULL) - { - /* cleans the token's list */ - ptn = pt->next; - free (pt); - pt = ptn; - } - if (!geo) - return NULL; - if (!checkValidity (geo)) - { - gaiaFreeGeomColl (geo); - return NULL; - } - gaiaMbrGeometry (geo); - return geo; - err: - if (buffer) - free (buffer); - gaiaFreeListToken (list_token); - gaiaFreeMultiListToken (multi_list_token); - gaiaFreeMultiMultiListToken (multi_multi_list_token); - gaiaFreeGeomCollListToken (geocoll_list_token); - pt = first; - while (pt != NULL) - { - /* cleans the token's list */ - ptn = pt->next; - free (pt); - pt = ptn; - } - return NULL; -} - -static void -gaiaOutClean (char *buffer) -{ -/* cleans unneeded trailing zeros */ - int i; - for (i = strlen (buffer) - 1; i > 0; i--) - { - if (buffer[i] == '0') - buffer[i] = '\0'; - else - break; - } - if (buffer[i] == '.') - buffer[i] = '\0'; -} - -static void -gaiaOutCheckBuffer (char **buffer, int *size) -{ -/* checks if the receiving buffer has enough free room, and in case reallocates it */ - char *old = *buffer; - int len = strlen (*buffer); - if ((*size - len) < 1024) - { - *size += 4096; - *buffer = realloc (old, *size); - } -} - -static void -gaiaOutText (char *text, char **buffer, int *size) -{ -/* formats a WKT generic text */ - gaiaOutCheckBuffer (buffer, size); - strcat (*buffer, text); -} - -static void -gaiaOutPoint (gaiaPointPtr point, char **buffer, int *size) -{ -/* formats a WKT POINT */ - char buf_x[128]; - char buf_y[128]; - char buf[256]; - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", point->X); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", point->Y); - gaiaOutClean (buf_y); - sprintf (buf, "%s %s", buf_x, buf_y); - strcat (*buffer, buf); -} - -static void -gaiaOutPointZ (gaiaPointPtr point, char **buffer, int *size) -{ -/* formats a WKT POINTZ */ - char buf_x[128]; - char buf_y[128]; - char buf_z[128]; - char buf[512]; - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", point->X); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", point->Y); - gaiaOutClean (buf_y); - sprintf (buf_z, "%1.6f", point->Z); - gaiaOutClean (buf_z); - sprintf (buf, "%s %s %s", buf_x, buf_y, buf_z); - strcat (*buffer, buf); -} - -static void -gaiaOutPointM (gaiaPointPtr point, char **buffer, int *size) -{ -/* formats a WKT POINTM */ - char buf_x[128]; - char buf_y[128]; - char buf_m[128]; - char buf[512]; - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", point->X); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", point->Y); - gaiaOutClean (buf_y); - sprintf (buf_m, "%1.6f", point->M); - gaiaOutClean (buf_m); - sprintf (buf, "%s %s %s", buf_x, buf_y, buf_m); - strcat (*buffer, buf); -} - -static void -gaiaOutPointZM (gaiaPointPtr point, char **buffer, int *size) -{ -/* formats a WKT POINTZM */ - char buf_x[128]; - char buf_y[128]; - char buf_z[128]; - char buf_m[128]; - char buf[1024]; - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", point->X); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", point->Y); - gaiaOutClean (buf_y); - sprintf (buf_z, "%1.6f", point->Z); - gaiaOutClean (buf_z); - sprintf (buf_m, "%1.6f", point->M); - gaiaOutClean (buf_m); - sprintf (buf, "%s %s %s %s", buf_x, buf_y, buf_z, buf_m); - strcat (*buffer, buf); -} - -static void -gaiaOutLinestring (gaiaLinestringPtr line, char **buffer, int *size) -{ -/* formats a WKT LINESTRING */ - char buf_x[128]; - char buf_y[128]; - char buf[256]; - double x; - double y; - int iv; - for (iv = 0; iv < line->Points; iv++) - { - gaiaGetPoint (line->Coords, iv, &x, &y); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - if (iv > 0) - sprintf (buf, ", %s %s", buf_x, buf_y); - else - sprintf (buf, "%s %s", buf_x, buf_y); - strcat (*buffer, buf); - } -} - -static void -gaiaOutLinestringZ (gaiaLinestringPtr line, char **buffer, int *size) -{ -/* formats a WKT LINESTRINGZ */ - char buf_x[128]; - char buf_y[128]; - char buf_z[128]; - char buf[512]; - double x; - double y; - double z; - int iv; - for (iv = 0; iv < line->Points; iv++) - { - gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - sprintf (buf_z, "%1.6f", z); - gaiaOutClean (buf_z); - if (iv > 0) - sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_z); - else - sprintf (buf, "%s %s %s", buf_x, buf_y, buf_z); - strcat (*buffer, buf); - } -} - -static void -gaiaOutLinestringM (gaiaLinestringPtr line, char **buffer, int *size) -{ -/* formats a WKT LINESTRINGM */ - char buf_x[128]; - char buf_y[128]; - char buf_m[128]; - char buf[512]; - double x; - double y; - double m; - int iv; - for (iv = 0; iv < line->Points; iv++) - { - gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - sprintf (buf_m, "%1.6f", m); - gaiaOutClean (buf_m); - if (iv > 0) - sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_m); - else - sprintf (buf, "%s %s %s", buf_x, buf_y, buf_m); - strcat (*buffer, buf); - } -} - -static void -gaiaOutLinestringZM (gaiaLinestringPtr line, char **buffer, int *size) -{ -/* formats a WKT LINESTRINGZM */ - char buf_x[128]; - char buf_y[128]; - char buf_z[128]; - char buf_m[128]; - char buf[1024]; - double x; - double y; - double z; - double m; - int iv; - for (iv = 0; iv < line->Points; iv++) - { - gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - sprintf (buf_z, "%1.6f", z); - gaiaOutClean (buf_z); - sprintf (buf_m, "%1.6f", m); - gaiaOutClean (buf_m); - if (iv > 0) - sprintf (buf, ", %s %s %s %s", buf_x, buf_y, buf_z, buf_m); - else - sprintf (buf, "%s %s %s %s", buf_x, buf_y, buf_z, buf_m); - strcat (*buffer, buf); - } -} - -static void -gaiaOutPolygon (gaiaPolygonPtr polyg, char **buffer, int *size) -{ -/* formats a WKT POLYGON */ - char buf_x[128]; - char buf_y[128]; - char buf[256]; - int ib; - int iv; - double x; - double y; - gaiaRingPtr ring = polyg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - gaiaGetPoint (ring->Coords, iv, &x, &y); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - if (iv == 0) - sprintf (buf, "(%s %s", buf_x, buf_y); - else if (iv == (ring->Points - 1)) - sprintf (buf, ", %s %s)", buf_x, buf_y); - else - sprintf (buf, ", %s %s", buf_x, buf_y); - strcat (*buffer, buf); - } - for (ib = 0; ib < polyg->NumInteriors; ib++) - { - ring = polyg->Interiors + ib; - for (iv = 0; iv < ring->Points; iv++) - { - gaiaGetPoint (ring->Coords, iv, &x, &y); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - if (iv == 0) - sprintf (buf, ", (%s %s", buf_x, buf_y); - else if (iv == (ring->Points - 1)) - sprintf (buf, ", %s %s)", buf_x, buf_y); - else - sprintf (buf, ", %s %s", buf_x, buf_y); - strcat (*buffer, buf); - } - } -} - -static void -gaiaOutPolygonZ (gaiaPolygonPtr polyg, char **buffer, int *size) -{ -/* formats a WKT POLYGONZ */ - char buf_x[128]; - char buf_y[128]; - char buf_z[128]; - char buf[512]; - int ib; - int iv; - double x; - double y; - double z; - gaiaRingPtr ring = polyg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - sprintf (buf_z, "%1.6f", z); - gaiaOutClean (buf_z); - if (iv == 0) - sprintf (buf, "(%s %s %s", buf_x, buf_y, buf_z); - else if (iv == (ring->Points - 1)) - sprintf (buf, ", %s %s %s)", buf_x, buf_y, buf_z); - else - sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_z); - strcat (*buffer, buf); - } - for (ib = 0; ib < polyg->NumInteriors; ib++) - { - ring = polyg->Interiors + ib; - for (iv = 0; iv < ring->Points; iv++) - { - gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - sprintf (buf_z, "%1.6f", z); - gaiaOutClean (buf_z); - if (iv == 0) - sprintf (buf, ", (%s %s %s", buf_x, buf_y, buf_z); - else if (iv == (ring->Points - 1)) - sprintf (buf, ", %s %s %s)", buf_x, buf_y, buf_z); - else - sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_z); - strcat (*buffer, buf); - } - } -} - -static void -gaiaOutPolygonM (gaiaPolygonPtr polyg, char **buffer, int *size) -{ -/* formats a WKT POLYGONM */ - char buf_x[128]; - char buf_y[128]; - char buf_m[128]; - char buf[512]; - int ib; - int iv; - double x; - double y; - double m; - gaiaRingPtr ring = polyg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - sprintf (buf_m, "%1.6f", m); - gaiaOutClean (buf_m); - if (iv == 0) - sprintf (buf, "(%s %s %s", buf_x, buf_y, buf_m); - else if (iv == (ring->Points - 1)) - sprintf (buf, ", %s %s %s)", buf_x, buf_y, buf_m); - else - sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_m); - strcat (*buffer, buf); - } - for (ib = 0; ib < polyg->NumInteriors; ib++) - { - ring = polyg->Interiors + ib; - for (iv = 0; iv < ring->Points; iv++) - { - gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - sprintf (buf_m, "%1.6f", m); - gaiaOutClean (buf_m); - if (iv == 0) - sprintf (buf, ", (%s %s %s", buf_x, buf_y, buf_m); - else if (iv == (ring->Points - 1)) - sprintf (buf, ", %s %s %s)", buf_x, buf_y, buf_m); - else - sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_m); - strcat (*buffer, buf); - } - } -} - -static void -gaiaOutPolygonZM (gaiaPolygonPtr polyg, char **buffer, int *size) -{ -/* formats a WKT POLYGONZM */ - char buf_x[128]; - char buf_y[128]; - char buf_z[128]; - char buf_m[128]; - char buf[1024]; - int ib; - int iv; - double x; - double y; - double z; - double m; - gaiaRingPtr ring = polyg->Exterior; - for (iv = 0; iv < ring->Points; iv++) - { - gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - sprintf (buf_z, "%1.6f", z); - gaiaOutClean (buf_z); - sprintf (buf_m, "%1.6f", m); - gaiaOutClean (buf_m); - if (iv == 0) - sprintf (buf, "(%s %s %s %s", buf_x, buf_y, buf_z, buf_m); - else if (iv == (ring->Points - 1)) - sprintf (buf, ", %s %s %s %s)", buf_x, buf_y, buf_z, buf_m); - else - sprintf (buf, ", %s %s %s %s", buf_x, buf_y, buf_z, buf_m); - strcat (*buffer, buf); - } - for (ib = 0; ib < polyg->NumInteriors; ib++) - { - ring = polyg->Interiors + ib; - for (iv = 0; iv < ring->Points; iv++) - { - gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%1.6f", x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%1.6f", y); - gaiaOutClean (buf_y); - sprintf (buf_z, "%1.6f", z); - gaiaOutClean (buf_z); - sprintf (buf_m, "%1.6f", m); - gaiaOutClean (buf_m); - if (iv == 0) - sprintf (buf, ", (%s %s %s %s", buf_x, buf_y, buf_z, buf_m); - else if (iv == (ring->Points - 1)) - sprintf (buf, ", %s %s %s %s)", buf_x, buf_y, buf_z, buf_m); - else - sprintf (buf, ", %s %s %s %s", buf_x, buf_y, buf_z, buf_m); - strcat (*buffer, buf); - } - } -} - -GAIAGEO_DECLARE void -gaiaOutWkt (gaiaGeomCollPtr geom, char **result) -{ -/* -/ prints the WKT representation of current geometry -/ *result* returns the decoded WKT or NULL if any error is encountered -*/ - int txt_size = 1024; - int pts = 0; - int lns = 0; - int pgs = 0; - gaiaPointPtr point; - gaiaLinestringPtr line; - gaiaPolygonPtr polyg; - if (!geom) - { - *result = NULL; - return; - } - *result = malloc (txt_size); - memset (*result, '\0', txt_size); - point = geom->FirstPoint; - while (point) - { - /* counting how many POINTs are there */ - pts++; - point = point->Next; - } - line = geom->FirstLinestring; - while (line) - { - /* counting how many LINESTRINGs are there */ - lns++; - line = line->Next; - } - polyg = geom->FirstPolygon; - while (polyg) - { - /* counting how many POLYGONs are there */ - pgs++; - polyg = polyg->Next; - } - if ((pts + lns + pgs) == 1 - && (geom->DeclaredType == GAIA_POINT - || geom->DeclaredType == GAIA_LINESTRING - || geom->DeclaredType == GAIA_POLYGON)) - { - /* we have only one elementary geometry */ - point = geom->FirstPoint; - while (point) - { - if (point->DimensionModel == GAIA_XY_Z) - { - /* processing POINTZ */ - strcpy (*result, "POINT Z("); - gaiaOutPointZ (point, result, &txt_size); - } - else if (point->DimensionModel == GAIA_XY_M) - { - /* processing POINTM */ - strcpy (*result, "POINT M("); - gaiaOutPointM (point, result, &txt_size); - } - else if (point->DimensionModel == GAIA_XY_Z_M) - { - /* processing POINTZM */ - strcpy (*result, "POINT ZM("); - gaiaOutPointZM (point, result, &txt_size); - } - else - { - /* processing POINT */ - strcpy (*result, "POINT("); - gaiaOutPoint (point, result, &txt_size); - } - gaiaOutText (")", result, &txt_size); - point = point->Next; - } - line = geom->FirstLinestring; - while (line) - { - if (line->DimensionModel == GAIA_XY_Z) - { - /* processing LINESTRINGZ */ - strcpy (*result, "LINESTRING Z("); - gaiaOutLinestringZ (line, result, &txt_size); - } - else if (line->DimensionModel == GAIA_XY_M) - { - /* processing LINESTRINGM */ - strcpy (*result, "LINESTRING M("); - gaiaOutLinestringM (line, result, &txt_size); - } - else if (line->DimensionModel == GAIA_XY_Z_M) - { - /* processing LINESTRINGZM */ - strcpy (*result, "LINESTRING ZM("); - gaiaOutLinestringZM (line, result, &txt_size); - } - else - { - /* processing LINESTRING */ - strcpy (*result, "LINESTRING("); - gaiaOutLinestring (line, result, &txt_size); - } - gaiaOutText (")", result, &txt_size); - line = line->Next; - } - polyg = geom->FirstPolygon; - while (polyg) - { - if (polyg->DimensionModel == GAIA_XY_Z) - { - /* processing POLYGONZ */ - strcpy (*result, "POLYGON Z("); - gaiaOutPolygonZ (polyg, result, &txt_size); - } - else if (polyg->DimensionModel == GAIA_XY_M) - { - /* processing POLYGONM */ - strcpy (*result, "POLYGON M("); - gaiaOutPolygonM (polyg, result, &txt_size); - } - else if (polyg->DimensionModel == GAIA_XY_Z_M) - { - /* processing POLYGONZM */ - strcpy (*result, "POLYGON ZM("); - gaiaOutPolygonZM (polyg, result, &txt_size); - } - else - { - /* processing POLYGON */ - strcpy (*result, "POLYGON("); - gaiaOutPolygon (polyg, result, &txt_size); - } - gaiaOutText (")", result, &txt_size); - polyg = polyg->Next; - } - } - else - { - /* we have some kind of complex geometry */ - if (pts > 0 && lns == 0 && pgs == 0 - && geom->DeclaredType == GAIA_MULTIPOINT) - { - /* some kind of MULTIPOINT */ - if (geom->DimensionModel == GAIA_XY_Z) - strcpy (*result, "MULTIPOINT Z("); - else if (geom->DimensionModel == GAIA_XY_M) - strcpy (*result, "MULTIPOINT M("); - else if (geom->DimensionModel == GAIA_XY_Z_M) - strcpy (*result, "MULTIPOINT ZM("); - else - strcpy (*result, "MULTIPOINT("); - point = geom->FirstPoint; - while (point) - { - if (point->DimensionModel == GAIA_XY_Z) - { - if (point != geom->FirstPoint) - gaiaOutText (", ", result, &txt_size); - gaiaOutPointZ (point, result, &txt_size); - } - else if (point->DimensionModel == GAIA_XY_M) - { - if (point != geom->FirstPoint) - gaiaOutText (", ", result, &txt_size); - gaiaOutPointM (point, result, &txt_size); - } - else if (point->DimensionModel == GAIA_XY_Z_M) - { - if (point != geom->FirstPoint) - gaiaOutText (", ", result, &txt_size); - gaiaOutPointZM (point, result, &txt_size); - } - else - { - if (point != geom->FirstPoint) - gaiaOutText (", ", result, &txt_size); - gaiaOutPoint (point, result, &txt_size); - } - point = point->Next; - } - gaiaOutText (")", result, &txt_size); - } - else if (pts == 0 && lns > 0 && pgs == 0 - && geom->DeclaredType == GAIA_MULTILINESTRING) - { - /* some kind of MULTILINESTRING */ - if (geom->DimensionModel == GAIA_XY_Z) - strcpy (*result, "MULTILINESTRING Z("); - else if (geom->DimensionModel == GAIA_XY_M) - strcpy (*result, "MULTILINESTRING M("); - else if (geom->DimensionModel == GAIA_XY_Z_M) - strcpy (*result, "MULTILINESTRING ZM("); - else - strcpy (*result, "MULTILINESTRING("); - line = geom->FirstLinestring; - while (line) - { - if (line != geom->FirstLinestring) - gaiaOutText (", (", result, &txt_size); - else - gaiaOutText ("(", result, &txt_size); - if (line->DimensionModel == GAIA_XY_Z) - { - gaiaOutLinestringZ (line, result, &txt_size); - gaiaOutText (")", result, &txt_size); - } - else if (line->DimensionModel == GAIA_XY_M) - { - gaiaOutLinestringM (line, result, &txt_size); - gaiaOutText (")", result, &txt_size); - } - else if (line->DimensionModel == GAIA_XY_Z_M) - { - gaiaOutLinestringZM (line, result, &txt_size); - gaiaOutText (")", result, &txt_size); - } - else - { - gaiaOutLinestring (line, result, &txt_size); - gaiaOutText (")", result, &txt_size); - } - line = line->Next; - } - gaiaOutText (")", result, &txt_size); - } - else if (pts == 0 && lns == 0 && pgs > 0 - && geom->DeclaredType == GAIA_MULTIPOLYGON) - { - /* some kind of MULTIPOLYGON */ - if (geom->DimensionModel == GAIA_XY_Z) - strcpy (*result, "MULTIPOLYGON Z("); - else if (geom->DimensionModel == GAIA_XY_M) - strcpy (*result, "MULTIPOLYGON M("); - else if (geom->DimensionModel == GAIA_XY_Z_M) - strcpy (*result, "MULTIPOLYGON ZM("); - else - strcpy (*result, "MULTIPOLYGON("); - polyg = geom->FirstPolygon; - while (polyg) - { - if (polyg != geom->FirstPolygon) - gaiaOutText (", (", result, &txt_size); - else - gaiaOutText ("(", result, &txt_size); - if (polyg->DimensionModel == GAIA_XY_Z) - { - gaiaOutPolygonZ (polyg, result, &txt_size); - gaiaOutText (")", result, &txt_size); - } - else if (polyg->DimensionModel == GAIA_XY_M) - { - gaiaOutPolygonM (polyg, result, &txt_size); - gaiaOutText (")", result, &txt_size); - } - else if (polyg->DimensionModel == GAIA_XY_Z_M) - { - gaiaOutPolygonZM (polyg, result, &txt_size); - gaiaOutText (")", result, &txt_size); - } - else - { - gaiaOutPolygon (polyg, result, &txt_size); - gaiaOutText (")", result, &txt_size); - } - polyg = polyg->Next; - } - gaiaOutText (")", result, &txt_size); - } - else - { - /* some kind of GEOMETRYCOLLECTION */ - int ie = 0; - if (geom->DimensionModel == GAIA_XY_Z) - strcpy (*result, "GEOMETRYCOLLECTION Z("); - else if (geom->DimensionModel == GAIA_XY_M) - strcpy (*result, "GEOMETRYCOLLECTION M("); - else if (geom->DimensionModel == GAIA_XY_Z_M) - strcpy (*result, "GEOMETRYCOLLECTION ZM("); - else - strcpy (*result, "GEOMETRYCOLLECTION("); - point = geom->FirstPoint; - while (point) - { - /* processing POINTs */ - if (ie > 0) - gaiaOutText (", ", result, &txt_size); - ie++; - if (point->DimensionModel == GAIA_XY_Z) - { - strcat (*result, "POINT Z("); - gaiaOutPointZ (point, result, &txt_size); - } - else if (point->DimensionModel == GAIA_XY_M) - { - strcat (*result, "POINT M("); - gaiaOutPointM (point, result, &txt_size); - } - else if (point->DimensionModel == GAIA_XY_Z_M) - { - strcat (*result, "POINT ZM("); - gaiaOutPointZM (point, result, &txt_size); - } - else - { - strcat (*result, "POINT("); - gaiaOutPoint (point, result, &txt_size); - } - gaiaOutText (")", result, &txt_size); - point = point->Next; - } - line = geom->FirstLinestring; - while (line) - { - /* processing LINESTRINGs */ - if (ie > 0) - gaiaOutText (", ", result, &txt_size); - ie++; - if (line->DimensionModel == GAIA_XY_Z) - { - strcat (*result, "LINESTRING Z("); - gaiaOutLinestringZ (line, result, &txt_size); - } - else if (line->DimensionModel == GAIA_XY_M) - { - strcat (*result, "LINESTRING M("); - gaiaOutLinestringM (line, result, &txt_size); - } - else if (line->DimensionModel == GAIA_XY_Z_M) - { - strcat (*result, "LINESTRING ZM("); - gaiaOutLinestringZM (line, result, &txt_size); - } - else - { - strcat (*result, "LINESTRING("); - gaiaOutLinestring (line, result, &txt_size); - } - gaiaOutText (")", result, &txt_size); - line = line->Next; - } - polyg = geom->FirstPolygon; - while (polyg) - { - /* processing POLYGONs */ - if (ie > 0) - gaiaOutText (", ", result, &txt_size); - ie++; - if (polyg->DimensionModel == GAIA_XY_Z) - { - strcat (*result, "POLYGON Z("); - gaiaOutPolygonZ (polyg, result, &txt_size); - } - else if (polyg->DimensionModel == GAIA_XY_M) - { - strcat (*result, "POLYGON M("); - gaiaOutPolygonM (polyg, result, &txt_size); - } - else if (polyg->DimensionModel == GAIA_XY_Z_M) - { - strcat (*result, "POLYGON ZM("); - gaiaOutPolygonZM (polyg, result, &txt_size); - } - else - { - strcat (*result, "POLYGON("); - gaiaOutPolygon (polyg, result, &txt_size); - } - gaiaOutText (")", result, &txt_size); - polyg = polyg->Next; - } - gaiaOutText (")", result, &txt_size); - } - } -} - -/* -/ -/ Gaia common support for SVG encoded geometries -/ -//////////////////////////////////////////////////////////// -/ -/ Author: Klaus Foerster klaus.foerster@svg.cc -/ version 0.9. 2008 September 21 - / - */ - -static void -SvgCoords (gaiaPointPtr point, char **buffer, int *size, int precision) -{ -/* formats POINT as SVG-attributes x,y */ - char buf_x[128]; - char buf_y[128]; - char buf[256]; - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%.*f", precision, point->X); - gaiaOutClean (buf_x); - sprintf (buf_y, "%.*f", precision, point->Y * -1); - gaiaOutClean (buf_y); - sprintf (buf, "x=\"%s\" y=\"%s\"", buf_x, buf_y); - strcat (*buffer, buf); -} - -static void -SvgCircle (gaiaPointPtr point, char **buffer, int *size, int precision) -{ -/* formats POINT as SVG-attributes cx,cy */ - char buf_x[128]; - char buf_y[128]; - char buf[256]; - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%.*f", precision, point->X); - gaiaOutClean (buf_x); - sprintf (buf_y, "%.*f", precision, point->Y * -1); - gaiaOutClean (buf_y); - sprintf (buf, "cx=\"%s\" cy=\"%s\"", buf_x, buf_y); - strcat (*buffer, buf); -} - -static void -SvgPathRelative (int dims, int points, double *coords, char **buffer, int *size, - int precision, int closePath) -{ -/* formats LINESTRING as SVG-path d-attribute with relative coordinate moves */ - char buf_x[128]; - char buf_y[128]; - char buf[256]; - double x; - double y; - double z; - double m; - double lastX = 0.0; - double lastY = 0.0; - int iv; - for (iv = 0; iv < points; iv++) - { - if (dims == GAIA_XY_Z) - { - gaiaGetPointXYZ (coords, iv, &x, &y, &z); - } - else if (dims == GAIA_XY_M) - { - gaiaGetPointXYM (coords, iv, &x, &y, &m); - } - else if (dims == GAIA_XY_Z_M) - { - gaiaGetPointXYZM (coords, iv, &x, &y, &z, &m); - } - else - { - gaiaGetPoint (coords, iv, &x, &y); - } - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%.*f", precision, x - lastX); - gaiaOutClean (buf_x); - sprintf (buf_y, "%.*f", precision, (y - lastY) * -1); - gaiaOutClean (buf_y); - if (iv == 0) - sprintf (buf, "M %s %s l ", buf_x, buf_y); - else - sprintf (buf, "%s %s ", buf_x, buf_y); - lastX = x; - lastY = y; - if (iv == points - 1 && closePath == 1) - sprintf (buf, "z "); - strcat (*buffer, buf); - } -} - -static void -SvgPathAbsolute (int dims, int points, double *coords, char **buffer, int *size, - int precision, int closePath) -{ -/* formats LINESTRING as SVG-path d-attribute with relative coordinate moves */ - char buf_x[128]; - char buf_y[128]; - char buf[256]; - double x; - double y; - double z; - double m; - int iv; - for (iv = 0; iv < points; iv++) - { - if (dims == GAIA_XY_Z) - { - gaiaGetPointXYZ (coords, iv, &x, &y, &z); - } - else if (dims == GAIA_XY_M) - { - gaiaGetPointXYM (coords, iv, &x, &y, &m); - } - else if (dims == GAIA_XY_Z_M) - { - gaiaGetPointXYZM (coords, iv, &x, &y, &z, &m); - } - else - { - gaiaGetPoint (coords, iv, &x, &y); - } - gaiaOutCheckBuffer (buffer, size); - sprintf (buf_x, "%.*f", precision, x); - gaiaOutClean (buf_x); - sprintf (buf_y, "%.*f", precision, y * -1); - gaiaOutClean (buf_y); - if (iv == 0) - sprintf (buf, "M %s %s L ", buf_x, buf_y); - else - sprintf (buf, "%s %s ", buf_x, buf_y); - if (iv == points - 1 && closePath == 1) - sprintf (buf, "z "); - strcat (*buffer, buf); - } -} - -GAIAGEO_DECLARE void -gaiaOutSvg (gaiaGeomCollPtr geom, char **result, int relative, int precision) -{ -/* -/ prints the SVG representation of current geometry -/ *result* returns the decoded SVG or NULL if any error is encountered -*/ - int txt_size = 1024; - int pts = 0; - int lns = 0; - int pgs = 0; - int ib; - gaiaPointPtr point; - gaiaLinestringPtr line; - gaiaPolygonPtr polyg; - gaiaRingPtr ring; - if (!geom) - { - *result = NULL; - return; - } - *result = malloc (txt_size); - memset (*result, '\0', txt_size); - point = geom->FirstPoint; - while (point) - { - /* counting how many POINTs are there */ - pts++; - point = point->Next; - } - line = geom->FirstLinestring; - while (line) - { - /* counting how many LINESTRINGs are there */ - lns++; - line = line->Next; - } - polyg = geom->FirstPolygon; - while (polyg) - { - /* counting how many POLYGONs are there */ - pgs++; - polyg = polyg->Next; - } - - if ((pts + lns + pgs) == 1) - { - /* we have only one elementary geometry */ - point = geom->FirstPoint; - while (point) - { - /* processing POINT */ - if (relative == 1) - SvgCoords (point, result, &txt_size, precision); - else - SvgCircle (point, result, &txt_size, precision); - point = point->Next; - } - line = geom->FirstLinestring; - while (line) - { - /* processing LINESTRING */ - if (relative == 1) - SvgPathRelative (line->DimensionModel, line->Points, - line->Coords, result, &txt_size, precision, - 0); - else - SvgPathAbsolute (line->DimensionModel, line->Points, - line->Coords, result, &txt_size, precision, - 0); - line = line->Next; - } - polyg = geom->FirstPolygon; - while (polyg) - { - /* process exterior and interior rings */ - ring = polyg->Exterior; - if (relative == 1) - { - SvgPathRelative (ring->DimensionModel, ring->Points, - ring->Coords, result, &txt_size, - precision, 1); - for (ib = 0; ib < polyg->NumInteriors; ib++) - { - ring = polyg->Interiors + ib; - SvgPathRelative (ring->DimensionModel, ring->Points, - ring->Coords, result, &txt_size, - precision, 1); - } - } - else - { - SvgPathAbsolute (ring->DimensionModel, ring->Points, - ring->Coords, result, &txt_size, - precision, 1); - for (ib = 0; ib < polyg->NumInteriors; ib++) - { - ring = polyg->Interiors + ib; - SvgPathAbsolute (ring->DimensionModel, ring->Points, - ring->Coords, result, &txt_size, - precision, 1); - } - } - polyg = polyg->Next; - } - } - else - { - /* we have some kind of complex geometry */ - if (pts > 0 && lns == 0 && pgs == 0) - { - /* this one is a MULTIPOINT */ - point = geom->FirstPoint; - while (point) - { - /* processing POINTs */ - if (point != geom->FirstPoint) - gaiaOutText (",", result, &txt_size); - if (relative == 1) - SvgCoords (point, result, &txt_size, precision); - else - SvgCircle (point, result, &txt_size, precision); - point = point->Next; - } - } - else if (pts == 0 && lns > 0 && pgs == 0) - { - /* this one is a MULTILINESTRING */ - line = geom->FirstLinestring; - while (line) - { - /* processing LINESTRINGs */ - if (relative == 1) - SvgPathRelative (line->DimensionModel, line->Points, - line->Coords, result, &txt_size, - precision, 0); - else - SvgPathAbsolute (line->DimensionModel, line->Points, - line->Coords, result, &txt_size, - precision, 0); - line = line->Next; - } - } - else if (pts == 0 && lns == 0 && pgs > 0) - { - /* this one is a MULTIPOLYGON */ - polyg = geom->FirstPolygon; - while (polyg) - { - /* processing POLYGONs */ - ring = polyg->Exterior; - if (relative == 1) - { - SvgPathRelative (ring->DimensionModel, ring->Points, - ring->Coords, result, &txt_size, - precision, 1); - for (ib = 0; ib < polyg->NumInteriors; ib++) - { - ring = polyg->Interiors + ib; - SvgPathRelative (ring->DimensionModel, - ring->Points, ring->Coords, - result, &txt_size, precision, - 1); - } - } - else - { - SvgPathAbsolute (ring->DimensionModel, ring->Points, - ring->Coords, result, &txt_size, - precision, 1); - for (ib = 0; ib < polyg->NumInteriors; ib++) - { - ring = polyg->Interiors + ib; - SvgPathAbsolute (ring->DimensionModel, - ring->Points, ring->Coords, - result, &txt_size, precision, - 1); - } - } - polyg = polyg->Next; - } - } - else - { - /* this one is a GEOMETRYCOLLECTION */ - int ie = 0; - point = geom->FirstPoint; - while (point) - { - /* processing POINTs */ - if (ie > 0) - { - gaiaOutText (";", result, &txt_size); - } - ie++; - if (relative == 1) - SvgCoords (point, result, &txt_size, precision); - else - SvgCircle (point, result, &txt_size, precision); - point = point->Next; - } - line = geom->FirstLinestring; - while (line) - { - /* processing LINESTRINGs */ - if (ie > 0) - gaiaOutText (";", result, &txt_size); - ie++; - if (relative == 1) - SvgPathRelative (line->DimensionModel, line->Points, - line->Coords, result, &txt_size, - precision, 0); - else - SvgPathAbsolute (line->DimensionModel, line->Points, - line->Coords, result, &txt_size, - precision, 0); - line = line->Next; - } - polyg = geom->FirstPolygon; - while (polyg) - { - /* processing POLYGONs */ - ie++; - /* process exterior and interior rings */ - ring = polyg->Exterior; - if (relative == 1) - { - SvgPathRelative (ring->DimensionModel, ring->Points, - ring->Coords, result, &txt_size, - precision, 1); - for (ib = 0; ib < polyg->NumInteriors; ib++) - { - ring = polyg->Interiors + ib; - SvgPathRelative (ring->DimensionModel, - ring->Points, ring->Coords, - result, &txt_size, precision, - 1); - } - } - else - { - SvgPathAbsolute (ring->DimensionModel, ring->Points, - ring->Coords, result, &txt_size, - precision, 1); - for (ib = 0; ib < polyg->NumInteriors; ib++) - { - ring = polyg->Interiors + ib; - SvgPathAbsolute (ring->DimensionModel, - ring->Points, ring->Coords, - result, &txt_size, precision, - 1); - } - } - polyg = polyg->Next; - } - } - } -} - -/* END of Klaus Foerster SVG implementation */ -/**************** End file: gg_wkt.c **********/ - - /**************** Begin file: gg_geodesic.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ +/* #include */ +/* #include */ +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ #define DEG2RAD 0.0174532925199432958 @@ -33014,8 +29903,8 @@ gaiaGreatCircleTotalLength (double a, double b, int dims, double *coords, { /* computing the GreatCircle total length for some Linestring/Ring */ int iv; - double x1; - double y1; + double x1 = 0.0; + double y1 = 0.0; double x2; double y2; double z; @@ -33040,7 +29929,7 @@ gaiaGreatCircleTotalLength (double a, double b, int dims, double *coords, gaiaGetPoint (coords, iv, &x2, &y2); } if (iv > 0) - len += gaiaGreatCircleDistance (a, b, x1, y1, x2, y2); + len += gaiaGreatCircleDistance (a, b, y1, x1, y2, x2); x1 = x2; y1 = y2; } @@ -33053,8 +29942,8 @@ gaiaGeodesicTotalLength (double a, double b, double rf, int dims, { /* computing the Geodesic total length for some Linestring/Ring */ int iv; - double x1; - double y1; + double x1 = 0.0; + double y1 = 0.0; double x2; double y2; double z; @@ -33081,7 +29970,7 @@ gaiaGeodesicTotalLength (double a, double b, double rf, int dims, } if (iv > 0) { - l = gaiaGeodesicDistance (a, b, rf, x1, y1, x2, y2); + l = gaiaGeodesicDistance (a, b, rf, y1, x1, y2, x2); if (l < 0.0) return -1.0; len += l; @@ -33138,6 +30027,11 @@ gaiaConvertLength (double value, int unit_from, int unit_to, double *cvt) /**************** Begin file: spatialite.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ @@ -33146,14 +30040,42 @@ gaiaConvertLength (double value, int unit_from, int unit_to, double *cvt) /* #include */ /* #include */ +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ /* #include */ +#if OMIT_GEOS == 0 /* including GEOS */ +/* #include */ +#endif + +#if OMIT_PROJ == 0 /* including PROJ.4 */ +/* #include */ +#endif + +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif /* not WIN32 */ + #define GAIA_UNUSED() if (argc || argv) argc = argc; +#ifndef OMIT_GEOCALLBACKS /* supporting RTree geometry callbacks */ +struct gaia_rtree_mbr +{ +/* a struct used by R*Tree GeometryCallback functions [MBR] */ + double minx; + double miny; + double maxx; + double maxy; +}; +#endif /* end RTree geometry callbacks */ + static SQLITE_EXTENSION_INIT1 struct spatial_index_str { /* a struct to implement a linked list of spatial-indexes */ @@ -33239,6 +30161,42 @@ fnct_proj4_version (sqlite3_context * context, int argc, sqlite3_value ** argv) #endif } +static void +clean_sql_string (char *buf) +{ +/* well-formatting a string to be used as an SQL string-value */ + char tmp[1024]; + char *in = tmp; + char *out = buf; + strcpy (tmp, buf); + while (*in != '\0') + { + if (*in == '\'') + *out++ = '\''; + *out++ = *in++; + } + *out = '\0'; +} + +static void +double_quoted_sql (char *buf) +{ +/* well-formatting a string to be used as an SQL name */ + char tmp[1024]; + char *in = tmp; + char *out = buf; + strcpy (tmp, buf); + *out++ = '"'; + while (*in != '\0') + { + if (*in == '"') + *out++ = '"'; + *out++ = *in++; + } + *out++ = '"'; + *out = '\0'; +} + static void fnct_GeometryConstraints (sqlite3_context * context, int argc, sqlite3_value ** argv) @@ -33512,6 +30470,86 @@ fnct_GeometryConstraints (sqlite3_context * context, int argc, } } +static void +fnct_RTreeAlign (sqlite3_context * context, int argc, sqlite3_value ** argv) +{ +/* SQL function: +/ RTreeAlign(RTree-table-name, PKID-value, BLOBencoded geometry) +/ +/ attempts to update the associated R*Tree, returning: +/ +/ -1 - if some invalid arg was passed +/ 1 - succesfull update +/ 0 - update failure +/ +*/ + unsigned char *p_blob = NULL; + int n_bytes = 0; + sqlite3_int64 pkid; + const unsigned char *rtree_table; + gaiaGeomCollPtr geom = NULL; + int ret; + char sql[4192]; + sqlite3 *sqlite = sqlite3_context_db_handle (context); + GAIA_UNUSED (); + if (sqlite3_value_type (argv[0]) == SQLITE_TEXT) + rtree_table = sqlite3_value_text (argv[0]); + else + { + sqlite3_result_int (context, -1); + return; + } + if (sqlite3_value_type (argv[1]) == SQLITE_INTEGER) + pkid = sqlite3_value_int64 (argv[1]); + else + { + sqlite3_result_int (context, -1); + return; + } + if (sqlite3_value_type (argv[2]) == SQLITE_BLOB + || sqlite3_value_type (argv[2]) == SQLITE_NULL) + ; + else + { + sqlite3_result_int (context, -1); + return; + } + if (sqlite3_value_type (argv[2]) == SQLITE_BLOB) + { + p_blob = (unsigned char *) sqlite3_value_blob (argv[2]); + n_bytes = sqlite3_value_bytes (argv[2]); + geom = gaiaFromSpatiaLiteBlobWkb (p_blob, n_bytes); + } + + if (geom == NULL) + { + /* NULL geometry: nothing to do */ + sqlite3_result_int (context, 1); + } + else + { + /* INSERTing into the R*Tree */ +#if defined(_WIN32) || defined(__MINGW32__) +/* CAVEAT: M$ rutime doesn't supports %lld for 64 bits */ + sprintf (sql, "INSERT INTO %s (pkid, xmin, ymin, xmax, ymax) " + "VALUES (%I64d, %1.12f, %1.12f, %1.12f, %1.12f)", + rtree_table, pkid, geom->MinX, geom->MinY, geom->MaxX, + geom->MaxY); +#else + sprintf (sql, "INSERT INTO %s (pkid, xmin, ymin, xmax, ymax) " + "VALUES (%lld, %1.12f, %1.12f, %1.12f, %1.12f)", + rtree_table, pkid, geom->MinX, geom->MinY, geom->MaxX, + geom->MaxY); +#endif + gaiaFreeGeomColl (geom); + ret = sqlite3_exec (sqlite, sql, NULL, NULL, NULL); + if (ret != SQLITE_OK) + sqlite3_result_int (context, 0); + else + sqlite3_result_int (context, 1); + } +} + static int checkSpatialMetaData (sqlite3 * sqlite) { @@ -33551,7 +30589,7 @@ checkSpatialMetaData (sqlite3 * sqlite) int rows; int columns; /* checking the GEOMETRY_COLUMNS table */ - strcpy (sql, "PRAGMA table_info(\"geometry_columns\")"); + strcpy (sql, "PRAGMA table_info(geometry_columns)"); ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, NULL); if (ret != SQLITE_OK) goto unknown; @@ -33592,7 +30630,7 @@ checkSpatialMetaData (sqlite3 * sqlite) && geometry_type && coord_dimension && gc_srid && geometry_format) fdo_gc = 1; /* checking the SPATIAL_REF_SYS table */ - strcpy (sql, "PRAGMA table_info(\"spatial_ref_sys\")"); + strcpy (sql, "PRAGMA table_info(spatial_ref_sys)"); ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, NULL); if (ret != SQLITE_OK) goto unknown; @@ -33688,6 +30726,8 @@ fnct_AutoFDOStart (sqlite3_context * context, int argc, sqlite3_value ** argv) struct fdo_table *last = NULL; struct fdo_table *p; int len; + char xname[1024]; + char xtable[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (checkSpatialMetaData (sqlite) == 2) @@ -33717,14 +30757,17 @@ fnct_AutoFDOStart (sqlite3_context * context, int argc, sqlite3_value ** argv) while (p) { /* destroying the VirtualFDO table [if existing] */ - sprintf (sql, "DROP TABLE IF EXISTS \"fdo_%s\"", p->table); + sprintf (xname, "fdo_%s", p->table); + double_quoted_sql (xname); + sprintf (sql, "DROP TABLE IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, 0, NULL); if (ret != SQLITE_OK) goto error; /* creating the VirtualFDO table */ - sprintf (sql, - "CREATE VIRTUAL TABLE \"fdo_%s\" USING VirtualFDO(%s)", - p->table, p->table); + strcpy (xtable, p->table); + double_quoted_sql (xtable); + sprintf (sql, "CREATE VIRTUAL TABLE %s USING VirtualFDO(%s)", + xname, xtable); ret = sqlite3_exec (sqlite, sql, NULL, 0, NULL); if (ret != SQLITE_OK) goto error; @@ -33763,6 +30806,7 @@ fnct_AutoFDOStop (sqlite3_context * context, int argc, sqlite3_value ** argv) struct fdo_table *last = NULL; struct fdo_table *p; int len; + char xname[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (checkSpatialMetaData (sqlite) == 2) @@ -33792,7 +30836,9 @@ fnct_AutoFDOStop (sqlite3_context * context, int argc, sqlite3_value ** argv) while (p) { /* destroying the VirtualFDO table [if existing] */ - sprintf (sql, "DROP TABLE IF EXISTS \"fdo_%s\"", p->table); + sprintf (xname, "fdo_%s", p->table); + double_quoted_sql (xname); + sprintf (sql, "DROP TABLE IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, 0, NULL); if (ret != SQLITE_OK) goto error; @@ -33929,20 +30975,21 @@ fnct_InitSpatialMetaData (sqlite3_context * context, int argc, /* creating the SPATIAL_REF_SYS table */ strcpy (sql, "CREATE TABLE spatial_ref_sys (\n"); strcat (sql, "srid INTEGER NOT NULL PRIMARY KEY,\n"); - strcat (sql, "auth_name VARCHAR(256) NOT NULL,\n"); + strcat (sql, "auth_name TEXT NOT NULL,\n"); strcat (sql, "auth_srid INTEGER NOT NULL,\n"); - strcat (sql, "ref_sys_name VARCHAR(256),\n"); - strcat (sql, "proj4text VARCHAR(2048) NOT NULL)"); + strcat (sql, "ref_sys_name TEXT,\n"); + strcat (sql, "proj4text TEXT NOT NULL,\n"); + strcat (sql, "srs_wkt TEXT) "); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; /* creating the GEOMETRY_COLUMN table */ strcpy (sql, "CREATE TABLE geometry_columns (\n"); - strcat (sql, "f_table_name VARCHAR(256) NOT NULL,\n"); - strcat (sql, "f_geometry_column VARCHAR(256) NOT NULL,\n"); - strcat (sql, "type VARCHAR(30) NOT NULL,\n"); + strcat (sql, "f_table_name TEXT NOT NULL,\n"); + strcat (sql, "f_geometry_column TEXT NOT NULL,\n"); + strcat (sql, "type TEXT NOT NULL,\n"); strcat (sql, "coord_dimension TEXT NOT NULL,\n"); - strcat (sql, "srid INTEGER,\n"); + strcat (sql, "srid INTEGER NOT NULL,\n"); strcat (sql, "spatial_index_enabled INTEGER NOT NULL,\n"); strcat (sql, "CONSTRAINT pk_geom_cols PRIMARY KEY "); strcat (sql, "(f_table_name, f_geometry_column),\n"); @@ -33953,13 +31000,13 @@ fnct_InitSpatialMetaData (sqlite3_context * context, int argc, goto error; /* creating an INDEX corresponding to the SRID FK */ strcpy (sql, "CREATE INDEX idx_srid_geocols ON geometry_columns\n"); - strcat (sql, "(srid)"); + strcat (sql, "(srid) "); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; /* creating the GEOM_COLS_REF_SYS view */ strcpy (sql, "CREATE VIEW geom_cols_ref_sys AS\n"); - strcat (sql, "SELECT f_table_name, f_geometry_column, type,\n"); + strcat (sql, "SELECT f_table_name, f_geometry_column, type,\n"); strcat (sql, "coord_dimension, spatial_ref_sys.srid AS srid,\n"); strcat (sql, "auth_name, auth_srid, ref_sys_name, proj4text\n"); strcat (sql, "FROM geometry_columns, spatial_ref_sys\n"); @@ -33969,10 +31016,11 @@ fnct_InitSpatialMetaData (sqlite3_context * context, int argc, goto error; if (!createAdvancedMetaData (sqlite)) goto error; + spatial_ref_sys_init (sqlite, 0); sqlite3_result_int (context, 1); return; error: - fprintf (stderr, "InitSpatiaMetaData() error: \"%s\"\n", errMsg); + fprintf (stderr, " InitSpatiaMetaData ()error:\"%s\"\n", errMsg); sqlite3_free (errMsg); sqlite3_result_int (context, 0); return; @@ -33992,7 +31040,13 @@ recoverGeomColumn (sqlite3 * sqlite, const unsigned char *table, int len; int ret; int i_col; - sprintf (sql, "SELECT %s FROM \"%s\"", column, table); + char xcolumn[1024]; + char xtable[1024]; + strcpy (xcolumn, (char *) column); + double_quoted_sql (xcolumn); + strcpy (xtable, (char *) table); + double_quoted_sql (xtable); + sprintf (sql, "SELECT %s FROM %s", xcolumn, xtable); /* compiling SQL prepared statement */ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL); if (ret != SQLITE_OK) @@ -34059,12 +31113,20 @@ buildSpatialIndex (sqlite3 * sqlite, const unsigned char *table, char *col_name) char sql2[1024]; char *errMsg = NULL; int ret; - sprintf (sql, - "INSERT INTO \"idx_%s_%s\" (\"pkid\", \"xmin\", \"xmax\", \"ymin\", \"ymax\") ", - table, col_name); + char xname[1024]; + char xtable[1024]; + sprintf (xname, "idx_%s_%s", table, col_name); + double_quoted_sql (xname); + sprintf (sql, "INSERT INTO %s (pkid, xmin, xmax, ymin, ymax) ", xname); + strcpy (xname, col_name); + double_quoted_sql (xname); + strcpy (xtable, (char *) table); + double_quoted_sql (xtable); sprintf (sql2, - "SELECT ROWID, MbrMinX(\"%s\"), MbrMaxX(\"%s\"), MbrMinY(\"%s\"), MbrMaxY(\"%s\") FROM \"%s\"", - col_name, col_name, col_name, col_name, table); + "SELECT ROWID, MbrMinX(%s), MbrMaxX(%s), MbrMinY(%s), MbrMaxY(%s) FROM %s", + xname, xname, xname, xname, xtable); + strcat (sql, sql2); + sprintf (sql2, " WHERE MbrMinX(%s) IS NOT NULL", xname); strcat (sql, sql2); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) @@ -34100,14 +31162,24 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table, int len; char *errMsg = NULL; char dummy[512]; + char sqltable[1024]; + char sqlcolumn[1024]; + char xname[1024]; + char xcolname[1024]; + char xtable[1024]; + char xindex[1024]; struct spatial_index_str *first_idx = NULL; struct spatial_index_str *last_idx = NULL; struct spatial_index_str *curr_idx; struct spatial_index_str *next_idx; + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); sprintf (sql, "SELECT f_table_name, f_geometry_column, type, srid, spatial_index_enabled, coord_dimension " "FROM geometry_columns WHERE f_table_name LIKE '%s' AND f_geometry_column LIKE '%s'", - table, column); + sqltable, sqlcolumn); ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg); if (ret != SQLITE_OK) { @@ -34121,7 +31193,16 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table, strcpy (tblname, results[(i * columns)]); strcpy (colname, results[(i * columns) + 1]); strcpy (col_type, results[(i * columns) + 2]); - strcpy (col_srid, results[(i * columns) + 3]); + /* + / Even Rouault - 3 Mar 2010 + / the OGR driver wrongly inserts a NULL SRID + / into GEOMETRY_COLUMNS, so we must check such + / an odd condition to avoid a crash + */ + if (results[(i * columns) + 3] == NULL) + strcpy (col_srid, "-1"); + else + strcpy (col_srid, results[(i * columns) + 3]); strcpy (col_index, results[(i * columns) + 4]); strcpy (col_dims, results[(i * columns) + 5]); srid = atoi (col_srid); @@ -34157,80 +31238,91 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table, }; /* trying to delete old versions [v2.0, v2.2] triggers[if any] */ - sprintf (trigger, "DROP TRIGGER IF EXISTS \"gti_%s_%s\"", tblname, - colname); + strcpy (sqltable, (char *) tblname); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) colname); + clean_sql_string (sqlcolumn); + sprintf (xname, "gti_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (trigger, "DROP TRIGGER IF EXISTS \"gtu_%s_%s\"", tblname, - colname); + sprintf (xname, "gtu_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (trigger, "DROP TRIGGER IF EXISTS \"gsi_%s_%s\"", tblname, - colname); + sprintf (xname, "gsi_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (trigger, "DROP TRIGGER IF EXISTS \"gsu_%s_%s\"", tblname, - colname); + sprintf (xname, "gsu_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; /* end deletion old versions [v2.0, v2.2] triggers[if any] */ /* deleting the old INSERT trigger TYPE [if any] */ - sprintf (trigger, "DROP TRIGGER IF EXISTS \"ggi_%s_%s\"", tblname, - colname); + sprintf (xname, "ggi_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; /* inserting the new INSERT trigger TYPE */ - sprintf (trigger, - "CREATE TRIGGER \"ggi_%s_%s\" BEFORE INSERT ON \"%s\"\n", - tblname, colname, tblname); + strcpy (xtable, tblname); + double_quoted_sql (xtable); + strcpy (xcolname, colname); + double_quoted_sql (xcolname); + sprintf (trigger, "CREATE TRIGGER %s BEFORE INSERT ON %s\n", xname, + xtable); strcat (trigger, "FOR EACH ROW BEGIN\n"); sprintf (dummy, - "SELECT RAISE(ROLLBACK, '\"%s\".\"%s\" violates Geometry constraint [geom-type or SRID not allowed]')\n", - tblname, colname); + "SELECT RAISE(ROLLBACK, '%s.%s violates Geometry constraint [geom-type or SRID not allowed]')\n", + sqltable, sqlcolumn); strcat (trigger, dummy); strcat (trigger, "WHERE (SELECT type FROM geometry_columns\n"); sprintf (dummy, "WHERE f_table_name = '%s' AND f_geometry_column = '%s'\n", - tblname, colname); + sqltable, sqlcolumn); strcat (trigger, dummy); sprintf (dummy, - "AND GeometryConstraints(NEW.\"%s\", type, srid, '%s') = 1) IS NULL;\n", - colname, txt_dims); + "AND GeometryConstraints(NEW.%s, type, srid, '%s') = 1) IS NULL;\n", + xcolname, txt_dims); strcat (trigger, dummy); strcat (trigger, "END;"); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; /* deleting the old UPDATE trigger TYPE [if any] */ - sprintf (trigger, "DROP TRIGGER IF EXISTS \"ggu_%s_%s\"", tblname, - colname); + sprintf (xname, "ggu_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; /* inserting the new UPDATE trigger TYPE */ - sprintf (trigger, - "CREATE TRIGGER \"ggu_%s_%s\" BEFORE UPDATE ON \"%s\"\n", - tblname, colname, tblname); + sprintf (trigger, "CREATE TRIGGER %s BEFORE UPDATE ON %s\n", xname, + xtable); strcat (trigger, "FOR EACH ROW BEGIN\n"); sprintf (dummy, - "SELECT RAISE(ROLLBACK, '\"%s\".\"%s\" violates Geometry constraint [geom-type or SRID not allowed]')\n", - tblname, colname); + "SELECT RAISE(ROLLBACK, '%s.%s violates Geometry constraint [geom-type or SRID not allowed]')\n", + sqltable, sqlcolumn); strcat (trigger, dummy); - strcat (trigger, - "WHERE (SELECT \"type\" FROM \"geometry_columns\"\n"); + strcat (trigger, "WHERE (SELECT type FROM geometry_columns\n"); sprintf (dummy, "WHERE f_table_name = '%s' AND f_geometry_column = '%s'\n", - tblname, colname); + sqltable, sqlcolumn); strcat (trigger, dummy); sprintf (dummy, - "AND GeometryConstraints(NEW.\"%s\", type, srid, '%s') = 1) IS NULL;\n", - colname, txt_dims); + "AND GeometryConstraints(NEW.%s, type, srid, '%s') = 1) IS NULL;\n", + xcolname, txt_dims); strcat (trigger, dummy); strcat (trigger, "END;"); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); @@ -34253,29 +31345,25 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table, last_idx->Next = curr_idx; last_idx = curr_idx; /* deleting the old INSERT trigger SPATIAL_INDEX [if any] */ - sprintf (trigger, "DROP TRIGGER IF EXISTS \"gii_%s_%s\"", tblname, - colname); + sprintf (xname, "gii_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; if (index) { /* inserting the new INSERT trigger SRID */ - sprintf (trigger, - "CREATE TRIGGER \"gii_%s_%s\" AFTER INSERT ON \"%s\"\n", - tblname, colname, tblname); + sprintf (xindex, "idx_%s_%s", tblname, colname); + double_quoted_sql (xindex); + sprintf (trigger, "CREATE TRIGGER %s AFTER INSERT ON %s\n", + xname, xtable); strcat (trigger, "FOR EACH ROW BEGIN\n"); - sprintf (dummy, - "INSERT INTO \"idx_%s_%s\" (pkid, xmin, xmax, ymin, ymax) VALUES (NEW.ROWID,\n", - tblname, colname); + sprintf (dummy, "DELETE FROM %s WHERE pkid=NEW.ROWID;\n", + xindex); strcat (trigger, dummy); - sprintf (dummy, "MbrMinX(NEW.\"%s\"), ", colname); - strcat (trigger, dummy); - sprintf (dummy, "MbrMaxX(NEW.\"%s\"), ", colname); - strcat (trigger, dummy); - sprintf (dummy, "MbrMinY(NEW.\"%s\"), ", colname); - strcat (trigger, dummy); - sprintf (dummy, "MbrMaxY(NEW.\"%s\"));\n", colname); + sprintf (dummy, "SELECT RTreeAlign('%s', NEW.ROWID, NEW.%s);", + xindex, xcolname); strcat (trigger, dummy); strcat (trigger, "END;"); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); @@ -34283,50 +31371,48 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table, goto error; } /* deleting the old UPDATE trigger SPATIAL_INDEX [if any] */ - sprintf (trigger, "DROP TRIGGER IF EXISTS \"giu_%s_%s\"", tblname, - colname); + sprintf (xname, "giu_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; if (index) { /* inserting the new UPDATE trigger SRID */ - sprintf (trigger, - "CREATE TRIGGER \"giu_%s_%s\" AFTER UPDATE ON \"%s\"\n", - tblname, colname, tblname); + sprintf (xindex, "idx_%s_%s", tblname, colname); + double_quoted_sql (xindex); + sprintf (trigger, "CREATE TRIGGER %s AFTER UPDATE ON %s\n", + xname, xtable); strcat (trigger, "FOR EACH ROW BEGIN\n"); - sprintf (dummy, "UPDATE \"idx_%s_%s\" SET ", tblname, colname); + sprintf (dummy, "DELETE FROM %s WHERE pkid=NEW.ROWID;\n", + xindex); strcat (trigger, dummy); - sprintf (dummy, "\"xmin\" = MbrMinX(NEW.\"%s\"), ", colname); + sprintf (dummy, "SELECT RTreeAlign('%s', NEW.ROWID, NEW.%s);", + xindex, xcolname); strcat (trigger, dummy); - sprintf (dummy, "\"xmax\" = MbrMaxX(NEW.\"%s\"), ", colname); - strcat (trigger, dummy); - sprintf (dummy, "\"ymin\" = MbrMinY(NEW.\"%s\"), ", colname); - strcat (trigger, dummy); - sprintf (dummy, "\"ymax\" = MbrMaxY(NEW.\"%s\")\n", colname); - strcat (trigger, dummy); - strcat (trigger, "WHERE \"pkid\" = NEW.ROWID;\n"); strcat (trigger, "END;"); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; } /* deleting the old UPDATE trigger SPATIAL_INDEX [if any] */ - sprintf (trigger, "DROP TRIGGER IF EXISTS \"gid_%s_%s\"", tblname, - colname); + sprintf (xname, "gid_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; if (index) { /* inserting the new DELETE trigger SRID */ - sprintf (trigger, - "CREATE TRIGGER \"gid_%s_%s\" AFTER DELETE ON \"%s\"\n", - tblname, colname, tblname); + sprintf (xindex, "idx_%s_%s", tblname, colname); + double_quoted_sql (xindex); + sprintf (trigger, "CREATE TRIGGER %s AFTER DELETE ON %s\n", + xname, xtable); strcat (trigger, "FOR EACH ROW BEGIN\n"); - sprintf (dummy, - "DELETE FROM \"idx_%s_%s\" WHERE pkid = OLD.ROWID;\n", - tblname, colname); + sprintf (dummy, "DELETE FROM %s WHERE pkid = OLD.ROWID;\n", + xindex); strcat (trigger, dummy); strcat (trigger, "END;"); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); @@ -34334,29 +31420,31 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table, goto error; } /* deleting the old INSERT trigger MBR_CACHE [if any] */ - sprintf (trigger, "DROP TRIGGER IF EXISTS \"gci_%s_%s\"", tblname, - colname); + sprintf (xname, "gci_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; if (cached) { /* inserting the new INSERT trigger SRID */ - sprintf (trigger, - "CREATE TRIGGER \"gci_%s_%s\" AFTER INSERT ON \"%s\"\n", - tblname, colname, tblname); + sprintf (xindex, "cache_%s_%s", tblname, colname); + double_quoted_sql (xindex); + sprintf (trigger, "CREATE TRIGGER %s AFTER INSERT ON %s\n", + xname, xtable); strcat (trigger, "FOR EACH ROW BEGIN\n"); sprintf (dummy, - "INSERT INTO \"cache_%s_%s\" (rowid, mbr) VALUES (NEW.ROWID,\nBuildMbrFilter(", - tblname, colname); + "INSERT INTO %s (rowid, mbr) VALUES (NEW.ROWID,\nBuildMbrFilter(", + xindex); strcat (trigger, dummy); - sprintf (dummy, "MbrMinX(NEW.\"%s\"), ", colname); + sprintf (dummy, "MbrMinX(NEW.%s), ", xcolname); strcat (trigger, dummy); - sprintf (dummy, "MbrMinY(NEW.\"%s\"), ", colname); + sprintf (dummy, "MbrMinY(NEW.%s), ", xcolname); strcat (trigger, dummy); - sprintf (dummy, "MbrMaxX(NEW.\"%s\"), ", colname); + sprintf (dummy, "MbrMaxX(NEW.%s), ", xcolname); strcat (trigger, dummy); - sprintf (dummy, "MbrMaxY(NEW.\"%s\")));\n", colname); + sprintf (dummy, "MbrMaxY(NEW.%s)));\n", xcolname); strcat (trigger, dummy); strcat (trigger, "END;"); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); @@ -34364,53 +31452,54 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table, goto error; } /* deleting the old UPDATE trigger MBR_CACHE [if any] */ - sprintf (trigger, "DROP TRIGGER IF EXISTS \"gcu_%s_%s\"", tblname, - colname); + sprintf (xname, "gcu_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; if (cached) { /* inserting the new UPDATE trigger SRID */ - sprintf (trigger, - "CREATE TRIGGER \"gcu_%s_%s\" AFTER UPDATE ON \"%s\"\n", - tblname, colname, tblname); + sprintf (xindex, "cache_%s_%s", tblname, colname); + double_quoted_sql (xindex); + sprintf (trigger, "CREATE TRIGGER %s AFTER UPDATE ON %s\n", + xname, xtable); strcat (trigger, "FOR EACH ROW BEGIN\n"); - sprintf (dummy, "UPDATE \"cache_%s_%s\" SET ", tblname, - colname); + sprintf (dummy, "UPDATE %s SET ", xindex); strcat (trigger, dummy); - sprintf (dummy, - "\"mbr\" = BuildMbrFilter(MbrMinX(NEW.\"%s\"), ", - colname); + sprintf (dummy, "mbr = BuildMbrFilter(MbrMinX(NEW.%s), ", + xcolname); strcat (trigger, dummy); - sprintf (dummy, "MbrMinY(NEW.\"%s\"), ", colname); + sprintf (dummy, "MbrMinY(NEW.%s), ", xcolname); strcat (trigger, dummy); - sprintf (dummy, "MbrMaxX(NEW.\"%s\"), ", colname); + sprintf (dummy, "MbrMaxX(NEW.%s), ", xcolname); strcat (trigger, dummy); - sprintf (dummy, "MbrMaxY(NEW.\"%s\"))\n", colname); + sprintf (dummy, "MbrMaxY(NEW.%s))\n", xcolname); strcat (trigger, dummy); - strcat (trigger, "WHERE \"rowid\" = NEW.ROWID;\n"); + strcat (trigger, "WHERE rowid = NEW.ROWID;\n"); strcat (trigger, "END;"); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; } /* deleting the old UPDATE trigger MBR_CACHE [if any] */ - sprintf (trigger, "DROP TRIGGER IF EXISTS \"gcd_%s_%s\"", tblname, - colname); + sprintf (xname, "gcd_%s_%s", tblname, colname); + double_quoted_sql (xname); + sprintf (trigger, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; if (cached) { /* inserting the new DELETE trigger SRID */ - sprintf (trigger, - "CREATE TRIGGER \"gcd_%s_%s\" AFTER DELETE ON \"%s\"\n", - tblname, colname, tblname); + sprintf (xindex, "cache_%s_%s", tblname, colname); + double_quoted_sql (xindex); + sprintf (trigger, "CREATE TRIGGER %s AFTER DELETE ON %s\n", + xname, xtable); strcat (trigger, "FOR EACH ROW BEGIN\n"); - sprintf (dummy, - "DELETE FROM \"cache_%s_%s\" WHERE \"rowid\" = OLD.ROWID;\n", - tblname, colname); + sprintf (dummy, "DELETE FROM %s WHERE rowid = OLD.ROWID;\n", + xindex); strcat (trigger, dummy); strcat (trigger, "END;"); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); @@ -34426,9 +31515,11 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table, if (curr_idx->ValidRtree) { /* building RTree SpatialIndex */ - sprintf (trigger, - "CREATE VIRTUAL TABLE \"idx_%s_%s\" USING rtree(\n", - curr_idx->TableName, curr_idx->ColumnName); + sprintf (xindex, "idx_%s_%s", curr_idx->TableName, + curr_idx->ColumnName); + double_quoted_sql (xindex); + sprintf (trigger, "CREATE VIRTUAL TABLE %s USING rtree(\n", + xindex); strcat (trigger, "pkid, xmin, xmax, ymin, ymax)"); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) @@ -34440,10 +31531,16 @@ updateGeometryTriggers (sqlite3 * sqlite, const unsigned char *table, if (curr_idx->ValidCache) { /* building MbrCache SpatialIndex */ + sprintf (xindex, "cache_%s_%s", curr_idx->TableName, + curr_idx->ColumnName); + double_quoted_sql (xindex); + strcpy (xtable, curr_idx->TableName); + double_quoted_sql (xtable); + strcpy (xcolname, curr_idx->ColumnName); + double_quoted_sql (xcolname); sprintf (trigger, - "CREATE VIRTUAL TABLE \"cache_%s_%s\" USING MbrCache(%s, %s)\n", - curr_idx->TableName, curr_idx->ColumnName, - curr_idx->TableName, curr_idx->ColumnName); + "CREATE VIRTUAL TABLE %s USING MbrCache(%s, %s)\n", + xindex, xtable, xcolname); ret = sqlite3_exec (sqlite, trigger, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; @@ -34496,6 +31593,10 @@ fnct_AddGeometryColumn (sqlite3_context * context, int argc, int columns; int i; char tblname[256]; + char xtable[1024]; + char xcolumn[1024]; + char sqltable[1024]; + char sqlcolumn[1024]; int notNull = 0; sqlite3 *sqlite = sqlite3_context_db_handle (context); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) @@ -34589,7 +31690,7 @@ fnct_AddGeometryColumn (sqlite3_context * context, int argc, if (xtype == GAIA_UNKNOWN) { fprintf (stderr, - "AddGeometryColumn() error: argument 3 [geometry_type] has an illegal value\n"); + "AddGeometryColumn() error: argument 4 [geometry_type] has an illegal value\n"); sqlite3_result_int (context, 0); return; } @@ -34604,9 +31705,13 @@ fnct_AddGeometryColumn (sqlite3_context * context, int argc, return; } /* checking if the table exists */ + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); sprintf (sql, "SELECT name FROM sqlite_master WHERE type = 'table' AND name LIKE '%s'", - table); + sqltable); ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg); if (ret != SQLITE_OK) { @@ -34627,11 +31732,15 @@ fnct_AddGeometryColumn (sqlite3_context * context, int argc, return; } /* trying to add the column */ - strcpy (sql, "ALTER TABLE \""); - strcat (sql, (char *) table); - strcat (sql, "\" ADD COLUMN \""); - strcat (sql, (char *) column); - strcat (sql, "\" "); + strcpy (xtable, (char *) table); + double_quoted_sql (xtable); + strcpy (xcolumn, (char *) column); + double_quoted_sql (xcolumn); + strcpy (sql, "ALTER TABLE "); + strcat (sql, xtable); + strcat (sql, " ADD COLUMN "); + strcat (sql, xcolumn); + strcat (sql, " "); switch (xtype) { case GAIA_POINT: @@ -34672,9 +31781,9 @@ fnct_AddGeometryColumn (sqlite3_context * context, int argc, "INSERT INTO geometry_columns (f_table_name, f_geometry_column, type, "); strcat (sql, "coord_dimension, srid, spatial_index_enabled) VALUES ("); strcat (sql, "'"); - strcat (sql, (char *) tblname); + strcat (sql, sqltable); strcat (sql, "', '"); - strcat (sql, (char *) column); + strcat (sql, sqlcolumn); strcat (sql, "', '"); switch (xtype) { @@ -34771,6 +31880,8 @@ fnct_RecoverGeometryColumn (sqlite3_context * context, int argc, int columns; int i; char tblname[256]; + char sqltable[1024]; + char sqlcolumn[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) @@ -34852,7 +31963,7 @@ fnct_RecoverGeometryColumn (sqlite3_context * context, int argc, if (xtype == GAIA_UNKNOWN) { fprintf (stderr, - "RecoverGeometryColumn() error: argument 3 [geometry_type] has an illegal value\n"); + "RecoverGeometryColumn() error: argument 4 [geometry_type] has an illegal value\n"); sqlite3_result_int (context, 0); return; } @@ -34867,9 +31978,13 @@ fnct_RecoverGeometryColumn (sqlite3_context * context, int argc, return; } /* checking if the table exists */ + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); sprintf (sql, "SELECT name FROM sqlite_master WHERE type = 'table' AND name LIKE '%s'", - table); + sqltable); ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg); if (ret != SQLITE_OK) { @@ -35031,9 +32146,9 @@ fnct_RecoverGeometryColumn (sqlite3_context * context, int argc, "INSERT INTO geometry_columns (f_table_name, f_geometry_column, type, "); strcat (sql, "coord_dimension, srid, spatial_index_enabled) VALUES ("); strcat (sql, "'"); - strcat (sql, (char *) tblname); + strcat (sql, sqltable); strcat (sql, "', '"); - strcat (sql, (char *) column); + strcat (sql, sqlcolumn); strcat (sql, "', '"); switch (xtype) { @@ -35116,6 +32231,9 @@ fnct_DiscardGeometryColumn (sqlite3_context * context, int argc, char sql[1024]; char *errMsg = NULL; int ret; + char xname[1024]; + char sqltable[1024]; + char sqlcolumn[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) @@ -35134,76 +32252,88 @@ fnct_DiscardGeometryColumn (sqlite3_context * context, int argc, return; } column = sqlite3_value_text (argv[1]); + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); sprintf (sql, "DELETE FROM geometry_columns WHERE f_table_name LIKE '%s' AND f_geometry_column LIKE '%s'", - (char *) table, (char *) column); + sqltable, sqlcolumn); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; /* removing triggers too */ - sprintf (sql, - "DROP TRIGGER IF EXISTS \"ggi_%s_%s\"", - (char *) table, (char *) column); + sprintf (xname, "ggi_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (sql, - "DROP TRIGGER IF EXISTS \"ggu_%s_%s\"", - (char *) table, (char *) column); + sprintf (xname, "ggu_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (sql, - "DROP TRIGGER IF EXISTS \"gii_%s_%s\"", - (char *) table, (char *) column); + sprintf (xname, "gii_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (sql, - "DROP TRIGGER IF EXISTS \"giu_%s_%s\"", - (char *) table, (char *) column); + sprintf (xname, "giu_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (sql, - "DROP TRIGGER IF EXISTS \"gid_%s_%s\"", - (char *) table, (char *) column); + sprintf (xname, "gid_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (sql, - "DROP TRIGGER IF EXISTS \"gci_%s_%s\"", - (char *) table, (char *) column); + sprintf (xname, "gci_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (sql, - "DROP TRIGGER IF EXISTS \"gcu_%s_%s\"", - (char *) table, (char *) column); + sprintf (xname, "gcu_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (sql, - "DROP TRIGGER IF EXISTS \"gcd_%s_%s\"", - (char *) table, (char *) column); + sprintf (xname, "gcd_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; /* trying to delete old versions [v2.0, v2.2] triggers[if any] */ - sprintf (sql, "DROP TRIGGER IF EXISTS \"gti_%s_%s\"", table, column); + sprintf (xname, "gti_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (sql, "DROP TRIGGER IF EXISTS \"gtu_%s_%s\"", table, column); + sprintf (xname, "gtu_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (sql, "DROP TRIGGER IF EXISTS \"gsi_%s_%s\"", table, column); + sprintf (xname, "gsi_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; - sprintf (sql, "DROP TRIGGER IF EXISTS \"gsu_%s_%s\"", table, column); + sprintf (xname, "gsu_%s_%s", (char *) table, (char *) column); + double_quoted_sql (xname); + sprintf (sql, "DROP TRIGGER IF EXISTS %s", xname); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; @@ -35256,8 +32386,8 @@ fnct_InitFDOSpatialMetaData (sqlite3_context * context, int argc, goto error; sqlite3_result_int (context, 1); return; - error: - fprintf (stderr, "InitFDOSpatiaMetaData() error: \"%s\"\n", errMsg); + error:fprintf (stderr, "InitFDOSpatiaMetaData() error: \"%s\"\n", + errMsg); sqlite3_free (errMsg); sqlite3_result_int (context, 0); return; @@ -35277,7 +32407,13 @@ recoverFDOGeomColumn (sqlite3 * sqlite, const unsigned char *table, int len; int ret; int i_col; - sprintf (sql, "SELECT \"%s\" FROM \"%s\"", column, table); + char xcolumn[1024]; + char xtable[1024]; + strcpy (xcolumn, (char *) column); + double_quoted_sql (xcolumn); + strcpy (xtable, (char *) table); + double_quoted_sql (xtable); + sprintf (sql, "SELECT %s FROM %s", xcolumn, xtable); /* compiling SQL prepared statement */ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL); if (ret != SQLITE_OK) @@ -35361,6 +32497,10 @@ fnct_AddFDOGeometryColumn (sqlite3_context * context, int argc, int columns; int i; char tblname[256]; + char xtable[1024]; + char xcolumn[1024]; + char sqltable[1024]; + char sqlcolumn[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) @@ -35451,9 +32591,17 @@ fnct_AddFDOGeometryColumn (sqlite3_context * context, int argc, return; } /* checking if the table exists */ + strcpy (xtable, (char *) table); + double_quoted_sql (xtable); + strcpy (xcolumn, (char *) column); + double_quoted_sql (xcolumn); + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); sprintf (sql, "SELECT name FROM sqlite_master WHERE type = 'table' AND name LIKE '%s'", - table); + sqltable); ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg); if (ret != SQLITE_OK) { @@ -35477,9 +32625,9 @@ fnct_AddFDOGeometryColumn (sqlite3_context * context, int argc, } /* trying to add the column */ strcpy (sql, "ALTER TABLE "); - strcat (sql, (char *) table); + strcat (sql, xtable); strcat (sql, " ADD COLUMN "); - strcat (sql, (char *) column); + strcat (sql, xcolumn); strcat (sql, " BLOB"); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) @@ -35489,9 +32637,9 @@ fnct_AddFDOGeometryColumn (sqlite3_context * context, int argc, "INSERT INTO geometry_columns (f_table_name, f_geometry_column, geometry_type, "); strcat (sql, "coord_dimension, srid, geometry_format) VALUES ("); strcat (sql, "'"); - strcat (sql, (char *) tblname); + strcat (sql, sqltable); strcat (sql, "', '"); - strcat (sql, (char *) column); + strcat (sql, sqlcolumn); strcat (sql, "', "); sprintf (dummy, "%d, %d, ", type, dimension); strcat (sql, dummy); @@ -35545,6 +32693,8 @@ fnct_RecoverFDOGeometryColumn (sqlite3_context * context, int argc, int columns; int i; char tblname[256]; + char sqltable[1024]; + char sqlcolumn[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) @@ -35635,9 +32785,13 @@ fnct_RecoverFDOGeometryColumn (sqlite3_context * context, int argc, return; } /* checking if the table exists */ + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); sprintf (sql, "SELECT name FROM sqlite_master WHERE type = 'table' AND name LIKE '%s'", - table); + sqltable); ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg); if (ret != SQLITE_OK) { @@ -35667,13 +32821,15 @@ fnct_RecoverFDOGeometryColumn (sqlite3_context * context, int argc, sqlite3_result_int (context, 0); return; } + strcpy (sqltable, (char *) tblname); + clean_sql_string (sqltable); strcpy (sql, "INSERT INTO geometry_columns (f_table_name, f_geometry_column, geometry_type, "); strcat (sql, "coord_dimension, srid, geometry_format) VALUES ("); strcat (sql, "'"); - strcat (sql, (char *) tblname); + strcat (sql, sqltable); strcat (sql, "', '"); - strcat (sql, (char *) column); + strcat (sql, sqlcolumn); strcat (sql, "', "); sprintf (dummy, "%d, %d, ", type, dimension); strcat (sql, dummy); @@ -35715,6 +32871,8 @@ fnct_DiscardFDOGeometryColumn (sqlite3_context * context, int argc, char sql[1024]; char *errMsg = NULL; int ret; + char sqltable[1024]; + char sqlcolumn[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) @@ -35733,9 +32891,13 @@ fnct_DiscardFDOGeometryColumn (sqlite3_context * context, int argc, return; } column = sqlite3_value_text (argv[1]); + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); sprintf (sql, "DELETE FROM geometry_columns WHERE f_table_name LIKE '%s' AND f_geometry_column LIKE '%s'", - (char *) table, (char *) column); + sqltable, sqlcolumn); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) goto error; @@ -35764,6 +32926,8 @@ fnct_CreateSpatialIndex (sqlite3_context * context, int argc, char sql[1024]; char *errMsg = NULL; int ret; + char sqltable[1024]; + char sqlcolumn[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) @@ -35782,11 +32946,15 @@ fnct_CreateSpatialIndex (sqlite3_context * context, int argc, return; } column = sqlite3_value_text (argv[1]); + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); strcpy (sql, "UPDATE geometry_columns SET spatial_index_enabled = 1 WHERE f_table_name LIKE '"); - strcat (sql, (char *) table); + strcat (sql, sqltable); strcat (sql, "' AND f_geometry_column LIKE '"); - strcat (sql, (char *) column); + strcat (sql, sqlcolumn); strcat (sql, "' AND spatial_index_enabled = 0"); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) @@ -35824,6 +32992,8 @@ fnct_CreateMbrCache (sqlite3_context * context, int argc, sqlite3_value ** argv) char sql[1024]; char *errMsg = NULL; int ret; + char sqltable[1024]; + char sqlcolumn[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) @@ -35842,11 +33012,15 @@ fnct_CreateMbrCache (sqlite3_context * context, int argc, sqlite3_value ** argv) return; } column = sqlite3_value_text (argv[1]); + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); strcpy (sql, "UPDATE geometry_columns SET spatial_index_enabled = 2 WHERE f_table_name LIKE '"); - strcat (sql, (char *) table); + strcat (sql, sqltable); strcat (sql, "' AND f_geometry_column LIKE '"); - strcat (sql, (char *) column); + strcat (sql, sqlcolumn); strcat (sql, "' AND spatial_index_enabled = 0"); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) @@ -35885,6 +33059,8 @@ fnct_DisableSpatialIndex (sqlite3_context * context, int argc, char sql[1024]; char *errMsg = NULL; int ret; + char sqltable[1024]; + char sqlcolumn[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) @@ -35903,11 +33079,15 @@ fnct_DisableSpatialIndex (sqlite3_context * context, int argc, return; } column = sqlite3_value_text (argv[1]); + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); strcpy (sql, "UPDATE geometry_columns SET spatial_index_enabled = 0 WHERE f_table_name LIKE '"); - strcat (sql, (char *) table); + strcat (sql, sqltable); strcat (sql, "' AND f_geometry_column LIKE '"); - strcat (sql, (char *) column); + strcat (sql, sqlcolumn); strcat (sql, "' AND spatial_index_enabled <> 0"); ret = sqlite3_exec (sqlite, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) @@ -35949,6 +33129,8 @@ fnct_RebuildGeometryTriggers (sqlite3_context * context, int argc, char **results; int rows; int columns; + char sqltable[1024]; + char sqlcolumn[1024]; sqlite3 *sqlite = sqlite3_context_db_handle (context); GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) @@ -35967,11 +33149,15 @@ fnct_RebuildGeometryTriggers (sqlite3_context * context, int argc, return; } column = sqlite3_value_text (argv[1]); + strcpy (sqltable, (char *) table); + clean_sql_string (sqltable); + strcpy (sqlcolumn, (char *) column); + clean_sql_string (sqlcolumn); strcpy (sql, "SELECT f_table_name FROM geometry_columns WHERE f_table_name LIKE '"); - strcat (sql, (char *) table); + strcat (sql, sqltable); strcat (sql, "' AND f_geometry_column LIKE '"); - strcat (sql, (char *) column); + strcat (sql, sqlcolumn); strcat (sql, "'"); ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, NULL); if (ret != SQLITE_OK) @@ -36091,7 +33277,7 @@ fnct_AsText (sqlite3_context * context, int argc, sqlite3_value ** argv) unsigned char *p_blob; int n_bytes; int len; - char *p_result = NULL; + gaiaOutBuffer out_buf; gaiaGeomCollPtr geo = NULL; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) @@ -36106,16 +33292,19 @@ fnct_AsText (sqlite3_context * context, int argc, sqlite3_value ** argv) sqlite3_result_null (context); else { - gaiaOutWkt (geo, &p_result); - if (!p_result) + gaiaOutBufferInitialize (&out_buf); + gaiaOutWkt (&out_buf, geo); + if (out_buf.Error || out_buf.Buffer == NULL) sqlite3_result_null (context); else { - len = strlen (p_result); - sqlite3_result_text (context, p_result, len, free); + len = out_buf.WriteOffset; + sqlite3_result_text (context, out_buf.Buffer, len, free); + out_buf.Buffer = NULL; } } gaiaFreeGeomColl (geo); + gaiaOutBufferReset (&out_buf); } /* @@ -36140,7 +33329,7 @@ fnct_AsSvg (sqlite3_context * context, int argc, sqlite3_value ** argv, unsigned char *p_blob; int n_bytes; int len; - char *p_result = NULL; + gaiaOutBuffer out_buf; gaiaGeomCollPtr geo = NULL; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) @@ -36166,16 +33355,19 @@ fnct_AsSvg (sqlite3_context * context, int argc, sqlite3_value ** argv, if (precision < 0) precision = 0; /* produce SVG-notation - actual work is done in gaiageo/gg_wkt.c */ - gaiaOutSvg (geo, &p_result, relative, precision); - if (!p_result) + gaiaOutBufferInitialize (&out_buf); + gaiaOutSvg (&out_buf, geo, relative, precision); + if (out_buf.Error || out_buf.Buffer == NULL) sqlite3_result_null (context); else { - len = strlen (p_result); - sqlite3_result_text (context, p_result, len, free); + len = out_buf.WriteOffset; + sqlite3_result_text (context, out_buf.Buffer, len, free); + out_buf.Buffer = NULL; } } gaiaFreeGeomColl (geo); + gaiaOutBufferReset (&out_buf); } static void @@ -36211,6 +33403,404 @@ fnct_AsSvg3 (sqlite3_context * context, int argc, sqlite3_value ** argv) /* END of Klaus Foerster AsSvg() implementation */ +static void +proj_params (sqlite3 * sqlite, int srid, char *proj_params) +{ +/* retrives the PROJ params from SPATIAL_SYS_REF table, if possible */ + char sql[256]; + char **results; + int rows; + int columns; + int i; + int ret; + char *errMsg = NULL; + *proj_params = '\0'; + sprintf (sql, + "SELECT proj4text FROM spatial_ref_sys WHERE srid = %d", srid); + ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg); + if (ret != SQLITE_OK) + { + fprintf (stderr, "unknown SRID: %d\t<%s>\n", srid, errMsg); + sqlite3_free (errMsg); + return; + } + for (i = 1; i <= rows; i++) + strcpy (proj_params, results[(i * columns)]); + if (*proj_params == '\0') + fprintf (stderr, "unknown SRID: %d\n", srid); + sqlite3_free_table (results); +} + +#ifndef OMIT_PROJ /* PROJ.4 is strictly required to support KML */ +static void +fnct_AsKml1 (sqlite3_context * context, int argc, sqlite3_value ** argv) +{ +/* SQL function: +/ AsKml(BLOB encoded geometry [, Integer precision]) +/ +/ returns the corresponding 'bare geom' KML representation +/ or NULL if any error is encountered +*/ + unsigned char *p_blob; + int n_bytes; + int len; + gaiaOutBuffer out_buf; + gaiaGeomCollPtr geo = NULL; + gaiaGeomCollPtr geo_wgs84; + char proj_from[2048]; + char proj_to[2048]; + int precision = 15; + sqlite3 *sqlite = sqlite3_context_db_handle (context); + GAIA_UNUSED (); + if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) + { + sqlite3_result_null (context); + return; + } + p_blob = (unsigned char *) sqlite3_value_blob (argv[0]); + n_bytes = sqlite3_value_bytes (argv[0]); + if (argc == 2) + { + if (sqlite3_value_type (argv[1]) == SQLITE_INTEGER) + precision = sqlite3_value_int (argv[1]); + else + { + sqlite3_result_null (context); + return; + } + } + geo = gaiaFromSpatiaLiteBlobWkb (p_blob, n_bytes); + if (!geo) + sqlite3_result_null (context); + else + { + if (geo->Srid == 4326) + ; /* already WGS84 */ + else + { + /* attempting to reproject into WGS84 */ + proj_params (sqlite, geo->Srid, proj_from); + proj_params (sqlite, 4326, proj_to); + if (*proj_to == '\0' || *proj_from == '\0') + { + sqlite3_result_null (context); + goto stop; + } + geo_wgs84 = gaiaTransform (geo, proj_from, proj_to); + if (!geo_wgs84) + { + sqlite3_result_null (context); + goto stop; + } + /* ok, reprojection was succesfull */ + gaiaFreeGeomColl (geo); + geo = geo_wgs84; + } + /* produce KML-notation - actual work is done in gaiageo/gg_wkt.c */ + gaiaOutBufferInitialize (&out_buf); + gaiaOutBareKml (&out_buf, geo, precision); + if (out_buf.Error || out_buf.Buffer == NULL) + sqlite3_result_null (context); + else + { + len = out_buf.WriteOffset; + sqlite3_result_text (context, out_buf.Buffer, len, free); + out_buf.Buffer = NULL; + } + } + stop: + gaiaFreeGeomColl (geo); + gaiaOutBufferReset (&out_buf); +} + +static void +fnct_AsKml3 (sqlite3_context * context, int argc, sqlite3_value ** argv) +{ +/* SQL function: +/ AsKml(Anything name, Anything description, BLOB encoded geometry [, Integer precision]) +/ +/ returns the corresponding 'full' KML representation +/ or NULL if any error is encountered +*/ + unsigned char *p_blob; + int n_bytes; + int len; + gaiaOutBuffer out_buf; + gaiaGeomCollPtr geo = NULL; + gaiaGeomCollPtr geo_wgs84; + sqlite3_int64 int_value; + double dbl_value; + const char *name; + const char *desc; + char *name_malloc = NULL; + char *desc_malloc = NULL; + char dummy[128]; + char proj_from[2048]; + char proj_to[2048]; + int precision = 15; + sqlite3 *sqlite = sqlite3_context_db_handle (context); + GAIA_UNUSED (); + switch (sqlite3_value_type (argv[0])) + { + case SQLITE_TEXT: + name = (const char *) sqlite3_value_text (argv[0]); + len = strlen (name); + name_malloc = malloc (len + 1); + strcpy (name_malloc, name); + name = name_malloc; + break; + case SQLITE_INTEGER: + int_value = sqlite3_value_int64 (argv[0]); +#if defined(_WIN32) || defined(__MINGW32__) +/* CAVEAT: M$ rutime doesn't supports %lld for 64 bits */ + sprintf (dummy, "%I64d", int_value); +#else + sprintf (dummy, "%lld", int_value); +#endif + len = strlen (dummy); + name_malloc = malloc (len + 1); + strcpy (name_malloc, dummy); + name = name_malloc; + break; + case SQLITE_FLOAT: + dbl_value = sqlite3_value_double (argv[0]); + sprintf (dummy, "%1.6f", dbl_value); + len = strlen (dummy); + name_malloc = malloc (len + 1); + strcpy (name_malloc, dummy); + name = name_malloc; + break; + case SQLITE_BLOB: + name = "BLOB"; + break; + default: + name = "NULL"; + break; + }; + switch (sqlite3_value_type (argv[1])) + { + case SQLITE_TEXT: + desc = (const char *) sqlite3_value_text (argv[1]); + len = strlen (desc); + desc_malloc = malloc (len + 1); + strcpy (desc_malloc, desc); + desc = desc_malloc; + break; + case SQLITE_INTEGER: + int_value = sqlite3_value_int64 (argv[1]); +#if defined(_WIN32) || defined(__MINGW32__) +/* CAVEAT: M$ rutime doesn't supports %lld for 64 bits */ + sprintf (dummy, "%I64d", int_value); +#else + sprintf (dummy, "%lld", int_value); +#endif + len = strlen (dummy); + desc_malloc = malloc (len + 1); + strcpy (desc_malloc, dummy); + desc = desc_malloc; + break; + case SQLITE_FLOAT: + dbl_value = sqlite3_value_double (argv[1]); + sprintf (dummy, "%1.6f", dbl_value); + len = strlen (dummy); + desc_malloc = malloc (len + 1); + strcpy (desc_malloc, dummy); + desc = desc_malloc; + break; + case SQLITE_BLOB: + desc = "BLOB"; + break; + default: + desc = "NULL"; + break; + }; + if (sqlite3_value_type (argv[2]) != SQLITE_BLOB) + { + sqlite3_result_null (context); + return; + } + p_blob = (unsigned char *) sqlite3_value_blob (argv[2]); + n_bytes = sqlite3_value_bytes (argv[2]); + if (argc == 4) + { + if (sqlite3_value_type (argv[3]) == SQLITE_INTEGER) + precision = sqlite3_value_int (argv[3]); + else + { + sqlite3_result_null (context); + return; + } + } + geo = gaiaFromSpatiaLiteBlobWkb (p_blob, n_bytes); + if (!geo) + sqlite3_result_null (context); + else + { + if (geo->Srid == 4326) + ; /* already WGS84 */ + else + { + /* attempting to reproject into WGS84 */ + proj_params (sqlite, geo->Srid, proj_from); + proj_params (sqlite, 4326, proj_to); + if (*proj_to == '\0' || *proj_from == '\0') + { + sqlite3_result_null (context); + goto stop; + } + geo_wgs84 = gaiaTransform (geo, proj_from, proj_to); + if (!geo_wgs84) + { + sqlite3_result_null (context); + goto stop; + } + /* ok, reprojection was succesfull */ + gaiaFreeGeomColl (geo); + geo = geo_wgs84; + } + /* produce KML-notation - actual work is done in gaiageo/gg_wkt.c */ + gaiaOutBufferInitialize (&out_buf); + gaiaOutFullKml (&out_buf, name, desc, geo, precision); + if (out_buf.Error || out_buf.Buffer == NULL) + sqlite3_result_null (context); + else + { + len = out_buf.WriteOffset; + sqlite3_result_text (context, out_buf.Buffer, len, free); + out_buf.Buffer = NULL; + } + } + stop: + gaiaFreeGeomColl (geo); + if (name_malloc) + free (name_malloc); + if (desc_malloc) + free (desc_malloc); + gaiaOutBufferReset (&out_buf); +} + +static void +fnct_AsKml (sqlite3_context * context, int argc, sqlite3_value ** argv) +{ +/* SQL function: +/ AsKml(Anything name, Anything description, BLOB encoded geometry) +/ or +/ AsKml(BLOB encoded geometry) +/ +/ returns the corresponding KML representation +/ or NULL if any error is encountered +*/ + if (argc == 3 || argc == 4) + fnct_AsKml3 (context, argc, argv); + else + fnct_AsKml1 (context, argc, argv); +} +#endif /* end including PROJ.4 */ + +static void +fnct_AsGml (sqlite3_context * context, int argc, sqlite3_value ** argv) +{ +/* SQL function: +/ AsGml(BLOB encoded geometry) +/ or +/ AsGml(integer version, BLOB encoded geometry) +/ or +/ AsGml(integer version, BLOB encoded geometry, integer precision) +/ +/ *version* may be 2 (GML 2.1.2) or 3 (GML 3.1.1) +/ default *version*: 2 +/ +/ *precision* is the number of output decimal digits +/ default *precision*: 15 +/ +/ returns the corresponding GML representation +/ or NULL if any error is encountered +*/ + unsigned char *p_blob; + int n_bytes; + int len; + int version = 2; + int precision = 15; + gaiaOutBuffer out_buf; + gaiaGeomCollPtr geo = NULL; + GAIA_UNUSED (); + if (argc == 3) + { + if (sqlite3_value_type (argv[0]) == SQLITE_INTEGER) + version = sqlite3_value_int (argv[0]); + else + { + sqlite3_result_null (context); + return; + } + if (sqlite3_value_type (argv[1]) != SQLITE_BLOB) + { + sqlite3_result_null (context); + return; + } + p_blob = (unsigned char *) sqlite3_value_blob (argv[1]); + n_bytes = sqlite3_value_bytes (argv[1]); + if (sqlite3_value_type (argv[2]) == SQLITE_INTEGER) + precision = sqlite3_value_int (argv[2]); + else + { + sqlite3_result_null (context); + return; + } + } + else if (argc == 2) + { + if (sqlite3_value_type (argv[0]) == SQLITE_INTEGER + && sqlite3_value_type (argv[1]) == SQLITE_BLOB) + { + version = sqlite3_value_int (argv[0]); + p_blob = (unsigned char *) sqlite3_value_blob (argv[1]); + n_bytes = sqlite3_value_bytes (argv[1]); + } + else if (sqlite3_value_type (argv[0]) == SQLITE_BLOB + && sqlite3_value_type (argv[1]) == SQLITE_INTEGER) + { + p_blob = (unsigned char *) sqlite3_value_blob (argv[0]); + n_bytes = sqlite3_value_bytes (argv[0]); + precision = sqlite3_value_int (argv[1]); + } + else + { + sqlite3_result_null (context); + return; + } + } + else + { + if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) + { + sqlite3_result_null (context); + return; + } + p_blob = (unsigned char *) sqlite3_value_blob (argv[0]); + n_bytes = sqlite3_value_bytes (argv[0]); + } + geo = gaiaFromSpatiaLiteBlobWkb (p_blob, n_bytes); + if (!geo) + sqlite3_result_null (context); + else + { + /* produce GML-notation - actual work is done in gaiageo/gg_wkt.c */ + gaiaOutBufferInitialize (&out_buf); + gaiaOutGml (&out_buf, version, precision, geo); + if (out_buf.Error || out_buf.Buffer == NULL) + sqlite3_result_null (context); + else + { + len = out_buf.WriteOffset; + sqlite3_result_text (context, out_buf.Buffer, len, free); + out_buf.Buffer = NULL; + } + } + gaiaFreeGeomColl (geo); + gaiaOutBufferReset (&out_buf); +} + static void fnct_AsBinary (sqlite3_context * context, int argc, sqlite3_value ** argv) { @@ -36963,6 +34553,48 @@ fnct_UncompressGeometry (sqlite3_context * context, int argc, gaiaFreeGeomColl (geo); } +static void +fnct_SanitizeGeometry (sqlite3_context * context, int argc, + sqlite3_value ** argv) +{ +/* SQL function: +/ SanitizeGeometry(BLOB encoded geometry) +/ +/ returns a SANITIZED geometry [if a valid Geometry was supplied] +/ or NULL in any other case +/ +/ Sanitizing includes: +/ - repeated vertices suppression +/ - enforcing ring closure +/ +*/ + unsigned char *p_blob; + int n_bytes; + int len; + unsigned char *p_result = NULL; + gaiaGeomCollPtr geo = NULL; + gaiaGeomCollPtr sanitized = NULL; + GAIA_UNUSED (); + if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) + { + sqlite3_result_null (context); + return; + } + p_blob = (unsigned char *) sqlite3_value_blob (argv[0]); + n_bytes = sqlite3_value_bytes (argv[0]); + geo = gaiaFromSpatiaLiteBlobWkb (p_blob, n_bytes); + if (!geo) + sqlite3_result_null (context); + else + { + sanitized = gaiaSanitize (geo); + gaiaToSpatiaLiteBlobWkb (sanitized, &p_result, &len); + sqlite3_result_blob (context, p_result, len, free); + } + gaiaFreeGeomColl (geo); + gaiaFreeGeomColl (sanitized); +} + static void cast_count (gaiaGeomCollPtr geom, int *pts, int *lns, int *pgs) { @@ -37860,6 +35492,9 @@ fnct_GeometryAliasType (sqlite3_context * context, int argc, / GeometryAliasType(BLOB encoded geometry) / / returns the alias-class for current geometry: +/ 'POINT' +/ 'LINESTRING' +/ 'POLYGON' / 'MULTIPOINT' / 'MULTILINESTRING' / 'MULTIPOLYGON' @@ -38080,8 +35715,8 @@ fnct_Envelope (sqlite3_context * context, int argc, sqlite3_value ** argv) } static void -build_filter_mbr (sqlite3_context * context, int argc, sqlite3_value ** argv, - int mode) +build_filter_mbr (sqlite3_context * context, int argc, + sqlite3_value ** argv, int mode) { /* SQL functions: / BuildMbrFilter(double X1, double Y1, double X2, double Y2) @@ -38571,6 +36206,261 @@ fnct_MbrMaxY (sqlite3_context * context, int argc, sqlite3_value ** argv) sqlite3_result_double (context, coord); } +#ifndef OMIT_GEOCALLBACKS /* supporting RTree geometry callbacks */ +static void +gaia_mbr_del (void *p) +{ +/* freeing data used by R*Tree Geometry Callback */ + sqlite3_free (p); +} + +static int +fnct_RTreeWithin (sqlite3_rtree_geometry * p, int nCoord, double *aCoord, + int *pRes) +{ +/* R*Tree Geometry callback function: +/ ... MATCH RTreeWithin(double x1, double y1, double x2, double y2) +*/ + struct gaia_rtree_mbr *mbr; + double xmin; + double xmax; + double ymin; + double ymax; + + if (p->pUser == 0) + { + /* first call: we must check args and then initialize the MBR struct */ + if (nCoord != 4) + return SQLITE_ERROR; + if (p->nParam != 4) + return SQLITE_ERROR; + mbr = (struct gaia_rtree_mbr *) (p->pUser = + sqlite3_malloc (sizeof + (struct + gaia_rtree_mbr))); + if (!mbr) + return SQLITE_NOMEM; + p->xDelUser = gaia_mbr_del; + xmin = p->aParam[0]; + ymin = p->aParam[1]; + xmax = p->aParam[2]; + ymax = p->aParam[3]; + if (xmin > xmax) + { + xmin = p->aParam[2]; + xmax = p->aParam[0]; + } + if (ymin > ymax) + { + ymin = p->aParam[3]; + ymax = p->aParam[1]; + } + mbr->minx = xmin; + mbr->miny = ymin; + mbr->maxx = xmax; + mbr->maxy = ymax; + } + + mbr = (struct gaia_rtree_mbr *) (p->pUser); + xmin = aCoord[0]; + xmax = aCoord[1]; + ymin = aCoord[2]; + ymax = aCoord[3]; + *pRes = 1; +/* evaluating Within relationship */ + if (xmin < mbr->minx) + *pRes = 0; + if (xmax > mbr->maxx) + *pRes = 0; + if (ymin < mbr->miny) + *pRes = 0; + if (ymax > mbr->maxy) + *pRes = 0; + return SQLITE_OK; +} + +static int +fnct_RTreeContains (sqlite3_rtree_geometry * p, int nCoord, double *aCoord, + int *pRes) +{ +/* R*Tree Geometry callback function: +/ ... MATCH RTreeContains(double x1, double y1, double x2, double y2) +*/ + struct gaia_rtree_mbr *mbr; + double xmin; + double xmax; + double ymin; + double ymax; + + if (p->pUser == 0) + { + /* first call: we must check args and then initialize the MBR struct */ + if (nCoord != 4) + return SQLITE_ERROR; + if (p->nParam != 4) + return SQLITE_ERROR; + mbr = (struct gaia_rtree_mbr *) (p->pUser = + sqlite3_malloc (sizeof + (struct + gaia_rtree_mbr))); + if (!mbr) + return SQLITE_NOMEM; + p->xDelUser = gaia_mbr_del; + xmin = p->aParam[0]; + ymin = p->aParam[1]; + xmax = p->aParam[2]; + ymax = p->aParam[3]; + if (xmin > xmax) + { + xmin = p->aParam[2]; + xmax = p->aParam[0]; + } + if (ymin > ymax) + { + ymin = p->aParam[3]; + ymax = p->aParam[1]; + } + mbr->minx = xmin; + mbr->miny = ymin; + mbr->maxx = xmax; + mbr->maxy = ymax; + } + + mbr = (struct gaia_rtree_mbr *) (p->pUser); + xmin = aCoord[0]; + xmax = aCoord[1]; + ymin = aCoord[2]; + ymax = aCoord[3]; + *pRes = 1; +/* evaluating Contains relationship */ + if (mbr->minx < xmin) + *pRes = 0; + if (mbr->maxx > xmax) + *pRes = 0; + if (mbr->miny < ymin) + *pRes = 0; + if (mbr->maxy > ymax) + *pRes = 0; + return SQLITE_OK; +} + +static int +fnct_RTreeIntersects (sqlite3_rtree_geometry * p, int nCoord, double *aCoord, + int *pRes) +{ +/* R*Tree Geometry callback function: +/ ... MATCH RTreeIntersects(double x1, double y1, double x2, double y2) +*/ + struct gaia_rtree_mbr *mbr; + double xmin; + double xmax; + double ymin; + double ymax; + + if (p->pUser == 0) + { + /* first call: we must check args and then initialize the MBR struct */ + if (nCoord != 4) + return SQLITE_ERROR; + if (p->nParam != 4) + return SQLITE_ERROR; + mbr = (struct gaia_rtree_mbr *) (p->pUser = + sqlite3_malloc (sizeof + (struct + gaia_rtree_mbr))); + if (!mbr) + return SQLITE_NOMEM; + p->xDelUser = gaia_mbr_del; + xmin = p->aParam[0]; + ymin = p->aParam[1]; + xmax = p->aParam[2]; + ymax = p->aParam[3]; + if (xmin > xmax) + { + xmin = p->aParam[2]; + xmax = p->aParam[0]; + } + if (ymin > ymax) + { + ymin = p->aParam[3]; + ymax = p->aParam[1]; + } + mbr->minx = xmin; + mbr->miny = ymin; + mbr->maxx = xmax; + mbr->maxy = ymax; + } + + mbr = (struct gaia_rtree_mbr *) (p->pUser); + xmin = aCoord[0]; + xmax = aCoord[1]; + ymin = aCoord[2]; + ymax = aCoord[3]; + *pRes = 1; +/* evaluating Intersects relationship */ + if (xmin > mbr->maxx) + *pRes = 0; + if (xmax < mbr->minx) + *pRes = 0; + if (ymin > mbr->maxy) + *pRes = 0; + if (ymax < mbr->miny) + *pRes = 0; + return SQLITE_OK; +} + +static int +fnct_RTreeDistWithin (sqlite3_rtree_geometry * p, int nCoord, double *aCoord, + int *pRes) +{ +/* R*Tree Geometry callback function: +/ ... MATCH RTreeDistWithin(double x, double y, double radius) +*/ + struct gaia_rtree_mbr *mbr; + double xmin; + double xmax; + double ymin; + double ymax; + + if (p->pUser == 0) + { + /* first call: we must check args and then initialize the MBR struct */ + if (nCoord != 4) + return SQLITE_ERROR; + if (p->nParam != 3) + return SQLITE_ERROR; + mbr = (struct gaia_rtree_mbr *) (p->pUser = + sqlite3_malloc (sizeof + (struct + gaia_rtree_mbr))); + if (!mbr) + return SQLITE_NOMEM; + p->xDelUser = gaia_mbr_del; + mbr->minx = p->aParam[0] - p->aParam[2]; + mbr->miny = p->aParam[1] - p->aParam[2]; + mbr->maxx = p->aParam[0] + p->aParam[2]; + mbr->maxy = p->aParam[1] + p->aParam[2]; + } + + mbr = (struct gaia_rtree_mbr *) (p->pUser); + xmin = aCoord[0]; + xmax = aCoord[1]; + ymin = aCoord[2]; + ymax = aCoord[3]; + *pRes = 1; +/* evaluating Intersects relationship */ + if (xmin > mbr->maxx) + *pRes = 0; + if (xmax < mbr->minx) + *pRes = 0; + if (ymin > mbr->maxy) + *pRes = 0; + if (ymax < mbr->miny) + *pRes = 0; + return SQLITE_OK; +} +#endif /* end RTree geometry callbacks */ + static void fnct_BuildRings (sqlite3_context * context, int argc, sqlite3_value ** argv) { @@ -39097,13 +36987,13 @@ fnct_InteriorRingN (sqlite3_context * context, int argc, sqlite3_value ** argv) &z); gaiaSetPointXYZ (line->Coords, iv, x, y, z); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_M) { gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); gaiaSetPointXYM (line->Coords, iv, x, y, m); } - else if (ring->DimensionModel == GAIA_XY_Z) + else if (ring->DimensionModel == GAIA_XY_Z_M) { gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); @@ -39789,34 +37679,6 @@ fnct_SwapCoords (sqlite3_context * context, int argc, sqlite3_value ** argv) gaiaFreeGeomColl (geo); } -static void -proj_params (sqlite3 * sqlite, int srid, char *proj_params) -{ -/* retrives the PROJ params from SPATIAL_SYS_REF table, if possible */ - char sql[256]; - char **results; - int rows; - int columns; - int i; - int ret; - char *errMsg = NULL; - *proj_params = '\0'; - sprintf (sql, - "SELECT proj4text FROM spatial_ref_sys WHERE srid = %d", srid); - ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg); - if (ret != SQLITE_OK) - { - fprintf (stderr, "unknown SRID: %d\t<%s>\n", srid, errMsg); - sqlite3_free (errMsg); - return; - } - for (i = 1; i <= rows; i++) - strcpy (proj_params, results[(i * columns)]); - if (*proj_params == '\0') - fprintf (stderr, "unknown SRID: %d\n", srid); - sqlite3_free_table (results); -} - static int get_ellipse_params (sqlite3 * sqlite, int srid, double *a, double *b, double *rf) @@ -41273,31 +39135,237 @@ fnct_Distance (sqlite3_context * context, int argc, sqlite3_value ** argv) } static void -geos_error (const char *fmt, ...) +fnct_PtDistWithin (sqlite3_context * context, int argc, sqlite3_value ** argv) { -/* reporting some GEOS warning/error */ - va_list ap; - fprintf (stderr, "GEOS: "); - va_start (ap, fmt); - vfprintf (stdout, fmt, ap); - va_end (ap); - fprintf (stdout, "\n"); +/* SQL function: +/ PtDistWithin(BLOBencoded geom1, BLOBencoded geom2, double dist +/ [, boolen use_spheroid]) +/ +/ returns TRUE if the distance between GEOM-1 and GEOM-2 +/ is less or equale to dist +/ +/ - if both geom1 and geom2 are in the 4326 (WGS84) SRID, +/ (and does actually contains a single POINT each one) +/ dist is assumed to be measured in Meters +/ - in this case the optional arg use_spheroid is +/ checked to determine if geodesic distance has to be +/ computed on the sphere (quickest) or on the spheroid +/ default: use_spheroid = FALSE +/ +/ in any other case the "plain" distance is evaluted +*/ + unsigned char *p_blob; + int n_bytes; + gaiaGeomCollPtr geo1 = NULL; + gaiaGeomCollPtr geo2 = NULL; + gaiaPointPtr pt; + gaiaLinestringPtr ln; + gaiaPolygonPtr pg; + double ref_dist; + int use_spheroid = 0; + double x0; + double y0; + double x1; + double y1; + int pt0 = 0; + int ln0 = 0; + int pg0 = 0; + int pt1 = 0; + int ln1 = 0; + int pg1 = 0; + double dist; + double a; + double b; + double rf; + int ret; + GAIA_UNUSED (); + if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) + { + sqlite3_result_null (context); + return; + } + if (sqlite3_value_type (argv[1]) != SQLITE_BLOB) + { + sqlite3_result_null (context); + return; + } + if (sqlite3_value_type (argv[2]) == SQLITE_INTEGER + || sqlite3_value_type (argv[2]) == SQLITE_FLOAT) + ; + else + { + sqlite3_result_null (context); + return; + } + if (argc == 4) + { + /* optional use_spheroid arg */ + if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER) + { + sqlite3_result_null (context); + return; + } + } + p_blob = (unsigned char *) sqlite3_value_blob (argv[0]); + n_bytes = sqlite3_value_bytes (argv[0]); + geo1 = gaiaFromSpatiaLiteBlobWkb (p_blob, n_bytes); + p_blob = (unsigned char *) sqlite3_value_blob (argv[1]); + n_bytes = sqlite3_value_bytes (argv[1]); + geo2 = gaiaFromSpatiaLiteBlobWkb (p_blob, n_bytes); + if (sqlite3_value_type (argv[2]) == SQLITE_INTEGER) + { + int dst = sqlite3_value_int (argv[2]); + ref_dist = dst; + } + else + ref_dist = sqlite3_value_double (argv[2]); + if (argc == 4) + use_spheroid = sqlite3_value_int (argv[3]); + if (!geo1 || !geo2) + sqlite3_result_null (context); + else + { + if (geo1->Srid == 4326 && geo2->Srid == 4326) + { + /* checking for single points */ + pt = geo1->FirstPoint; + while (pt) + { + x0 = pt->X; + y0 = pt->Y; + pt0++; + pt = pt->Next; + } + ln = geo1->FirstLinestring; + while (ln) + { + ln0++; + ln = ln->Next; + } + pg = geo1->FirstPolygon; + while (pg) + { + pg0++; + pg = pg->Next; + } + pt = geo2->FirstPoint; + while (pt) + { + x1 = pt->X; + y1 = pt->Y; + pt1++; + pt = pt->Next; + } + ln = geo2->FirstLinestring; + while (ln) + { + ln1++; + ln = ln->Next; + } + pg = geo2->FirstPolygon; + while (pg) + { + pg1++; + pg = pg->Next; + } + if (pt0 == 1 && pt1 == 1 && ln0 == 0 && ln1 == 0 && pg0 == 0 + && pg1 == 0) + { + /* using geodesic distance */ + a = 6378137.0; + rf = 298.257223563; + b = (a * (1.0 - (1.0 / rf))); + if (use_spheroid) + { + dist = + gaiaGeodesicDistance (a, b, rf, y0, x0, y1, x1); + if (dist <= ref_dist) + sqlite3_result_int (context, 1); + else + sqlite3_result_int (context, 0); + } + else + { + dist = + gaiaGreatCircleDistance (a, b, y0, x0, y1, x1); + if (dist <= ref_dist) + sqlite3_result_int (context, 1); + else + sqlite3_result_int (context, 0); + } + } + goto stop; + } +/* defaulting to flat distance */ + ret = gaiaGeomCollDistance (geo1, geo2, &dist); + if (!ret) + sqlite3_result_null (context); + if (dist <= ref_dist) + sqlite3_result_int (context, 1); + else + sqlite3_result_int (context, 0); + } + stop: + gaiaFreeGeomColl (geo1); + gaiaFreeGeomColl (geo2); } static void -fnct_polygonize (sqlite3_context * context, gaiaGeomCollPtr geom_org, - int force_multipolygon) +geos_error (const char *fmt, ...) +{ +/* reporting some GEOS error */ + va_list ap; + char msg[2048]; + va_start (ap, fmt); + vsprintf (msg, fmt, ap); + va_end (ap); + fprintf (stderr, "GEOS error: %s\n", msg); + gaiaSetGeosErrorMsg (msg); +} + + +static void +geos_warning (const char *fmt, ...) +{ +/* reporting some GEOS warning */ + va_list ap; + char msg[2048]; + va_start (ap, fmt); + vsprintf (msg, fmt, ap); + va_end (ap); + fprintf (stderr, "GEOS warning: %s\n", msg); + gaiaSetGeosWarningMsg (msg); +} + +static void +fnct_aux_polygonize (sqlite3_context * context, gaiaGeomCollPtr geom_org, + int force_multipolygon, int allow_multipolygon) { /* a common function performing any kind of polygonization op */ gaiaGeomCollPtr geom_new = NULL; int len; unsigned char *p_result = NULL; + gaiaPolygonPtr pg; + int pgs = 0; if (!geom_org) goto invalid; geom_new = gaiaPolygonize (geom_org, force_multipolygon); if (!geom_new) goto invalid; gaiaFreeGeomColl (geom_org); + pg = geom_new->FirstPolygon; + while (pg) + { + pgs++; + pg = pg->Next; + } + if (pgs > 1 && allow_multipolygon == 0) + { + /* invalid: a POLYGON is expected !!! */ + gaiaFreeGeomColl (geom_new); + sqlite3_result_null (context); + return; + } gaiaToSpatiaLiteBlobWkb (geom_new, &p_result, &len); gaiaFreeGeomColl (geom_new); sqlite3_result_blob (context, p_result, len, free); @@ -41310,7 +39378,7 @@ fnct_polygonize (sqlite3_context * context, gaiaGeomCollPtr geom_org, /* / the following functions performs initial argument checking, -/ and then readdressing the request to fnct_polygonize() +/ and then readdressing the request to fnct_aux_polygonize() / for actual processing */ @@ -41319,9 +39387,9 @@ fnct_BdPolyFromText1 (sqlite3_context * context, int argc, sqlite3_value ** argv) { /* SQL function: -/ BdPolyFromText(WKT encoded LINESTRING) +/ BdPolyFromText(WKT encoded MULTILINESTRING) / -/ returns the current geometry [POLYGON] by parsing a WKT encoded LINESTRING +/ returns the current geometry [POLYGON] by parsing a WKT encoded MULTILINESTRING / or NULL if any error is encountered / */ @@ -41332,6 +39400,8 @@ fnct_BdPolyFromText1 (sqlite3_context * context, int argc, double y0; double xn; double yn; + double z; + double m; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) { @@ -41345,6 +39415,11 @@ fnct_BdPolyFromText1 (sqlite3_context * context, int argc, sqlite3_result_null (context); return; } + if (geo->DeclaredType != GAIA_MULTILINESTRING) + { + sqlite3_result_null (context); + return; + } geo->Srid = -1; /* one or more closed LINESTINGs are expected */ if (geo->FirstPoint || geo->FirstPolygon) @@ -41354,13 +39429,31 @@ fnct_BdPolyFromText1 (sqlite3_context * context, int argc, ln = geo->FirstLinestring; while (ln) { - gaiaGetPoint (ln->Coords, 0, &x0, &y0); - gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } if (x0 != xn || y0 != yn) goto invalid; ln = ln->Next; } - fnct_polygonize (context, geo, 0); + fnct_aux_polygonize (context, geo, 0, 0); return; invalid: gaiaFreeGeomColl (geo); @@ -41372,9 +39465,9 @@ fnct_BdPolyFromText2 (sqlite3_context * context, int argc, sqlite3_value ** argv) { /* SQL function: -/ BdPolyFromText(WKT encoded LINESTRING, SRID) +/ BdPolyFromText(WKT encoded MULTILINESTRING, SRID) / -/ returns the current geometry [POLYGON] by parsing a WKT encoded LINESTRING +/ returns the current geometry [POLYGON] by parsing a WKT encoded MULTILINESTRING / or NULL if any error is encountered / */ @@ -41385,6 +39478,8 @@ fnct_BdPolyFromText2 (sqlite3_context * context, int argc, double y0; double xn; double yn; + double z; + double m; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) { @@ -41403,6 +39498,11 @@ fnct_BdPolyFromText2 (sqlite3_context * context, int argc, sqlite3_result_null (context); return; } + if (geo->DeclaredType != GAIA_MULTILINESTRING) + { + sqlite3_result_null (context); + return; + } geo->Srid = sqlite3_value_int (argv[1]); /* one or more closed LINESTINGs are expected */ if (geo->FirstPoint || geo->FirstPolygon) @@ -41412,13 +39512,31 @@ fnct_BdPolyFromText2 (sqlite3_context * context, int argc, ln = geo->FirstLinestring; while (ln) { - gaiaGetPoint (ln->Coords, 0, &x0, &y0); - gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } if (x0 != xn || y0 != yn) goto invalid; ln = ln->Next; } - fnct_polygonize (context, geo, 0); + fnct_aux_polygonize (context, geo, 0, 0); return; invalid: gaiaFreeGeomColl (geo); @@ -41430,7 +39548,7 @@ fnct_BdMPolyFromText1 (sqlite3_context * context, int argc, sqlite3_value ** argv) { /* SQL function: -/ BdMPolyFromText(WKT encoded MULTILINESTRING) +/ BdMPolyFromText(WKT encoded MULTILINESTRING) / / returns the current geometry [MULTIPOLYGON] by parsing a WKT encoded MULTILINESTRING / or NULL if any error is encountered @@ -41443,6 +39561,8 @@ fnct_BdMPolyFromText1 (sqlite3_context * context, int argc, double y0; double xn; double yn; + double z; + double m; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) { @@ -41456,6 +39576,11 @@ fnct_BdMPolyFromText1 (sqlite3_context * context, int argc, sqlite3_result_null (context); return; } + if (geo->DeclaredType != GAIA_MULTILINESTRING) + { + sqlite3_result_null (context); + return; + } geo->Srid = -1; /* one or more closed LINESTINGs are expected */ if (geo->FirstPoint || geo->FirstPolygon) @@ -41465,13 +39590,31 @@ fnct_BdMPolyFromText1 (sqlite3_context * context, int argc, ln = geo->FirstLinestring; while (ln) { - gaiaGetPoint (ln->Coords, 0, &x0, &y0); - gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } if (x0 != xn || y0 != yn) goto invalid; ln = ln->Next; } - fnct_polygonize (context, geo, 1); + fnct_aux_polygonize (context, geo, 1, 1); return; invalid: gaiaFreeGeomColl (geo); @@ -41496,6 +39639,8 @@ fnct_BdMPolyFromText2 (sqlite3_context * context, int argc, double y0; double xn; double yn; + double z; + double m; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_TEXT) { @@ -41514,6 +39659,11 @@ fnct_BdMPolyFromText2 (sqlite3_context * context, int argc, sqlite3_result_null (context); return; } + if (geo->DeclaredType != GAIA_MULTILINESTRING) + { + sqlite3_result_null (context); + return; + } geo->Srid = sqlite3_value_int (argv[1]); /* one or more closed LINESTINGs are expected */ if (geo->FirstPoint || geo->FirstPolygon) @@ -41523,13 +39673,31 @@ fnct_BdMPolyFromText2 (sqlite3_context * context, int argc, ln = geo->FirstLinestring; while (ln) { - gaiaGetPoint (ln->Coords, 0, &x0, &y0); - gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } if (x0 != xn || y0 != yn) goto invalid; ln = ln->Next; } - fnct_polygonize (context, geo, 1); + fnct_aux_polygonize (context, geo, 1, 1); return; invalid: gaiaFreeGeomColl (geo); @@ -41540,9 +39708,9 @@ static void fnct_BdPolyFromWKB1 (sqlite3_context * context, int argc, sqlite3_value ** argv) { /* SQL function: -/ BdPolyFromWKB(WKB encoded LINESTRING) +/ BdPolyFromWKB(WKB encoded MULTILINESTRING) / -/ returns the current geometry [POLYGON] by parsing a WKB encoded LINESTRING +/ returns the current geometry [POLYGON] by parsing a WKB encoded MULTILINESTRING / or NULL if any error is encountered / */ @@ -41554,6 +39722,8 @@ fnct_BdPolyFromWKB1 (sqlite3_context * context, int argc, sqlite3_value ** argv) double y0; double xn; double yn; + double z; + double m; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) { @@ -41570,6 +39740,11 @@ fnct_BdPolyFromWKB1 (sqlite3_context * context, int argc, sqlite3_value ** argv) sqlite3_result_null (context); return; } + if (geo->DeclaredType != GAIA_MULTILINESTRING) + { + sqlite3_result_null (context); + return; + } geo->Srid = -1; /* one or more closed LINESTINGs are expected */ if (geo->FirstPoint || geo->FirstPolygon) @@ -41579,13 +39754,31 @@ fnct_BdPolyFromWKB1 (sqlite3_context * context, int argc, sqlite3_value ** argv) ln = geo->FirstLinestring; while (ln) { - gaiaGetPoint (ln->Coords, 0, &x0, &y0); - gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } if (x0 != xn || y0 != yn) goto invalid; ln = ln->Next; } - fnct_polygonize (context, geo, 0); + fnct_aux_polygonize (context, geo, 0, 0); return; invalid: gaiaFreeGeomColl (geo); @@ -41596,9 +39789,9 @@ static void fnct_BdPolyFromWKB2 (sqlite3_context * context, int argc, sqlite3_value ** argv) { /* SQL function: -/ BdPolyFromWKB(WKB encoded LINESTRING) +/ BdPolyFromWKB(WKB encoded MULTILINESTRING) / -/ returns the current geometry [POLYGON] by parsing a WKB encoded LINESTRING +/ returns the current geometry [POLYGON] by parsing a WKB encoded MULTILINESTRING / or NULL if any error is encountered / */ @@ -41610,6 +39803,8 @@ fnct_BdPolyFromWKB2 (sqlite3_context * context, int argc, sqlite3_value ** argv) double y0; double xn; double yn; + double z; + double m; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) { @@ -41631,6 +39826,11 @@ fnct_BdPolyFromWKB2 (sqlite3_context * context, int argc, sqlite3_value ** argv) sqlite3_result_null (context); return; } + if (geo->DeclaredType != GAIA_MULTILINESTRING) + { + sqlite3_result_null (context); + return; + } geo->Srid = sqlite3_value_int (argv[1]); /* one or more closed LINESTINGs are expected */ if (geo->FirstPoint || geo->FirstPolygon) @@ -41640,13 +39840,31 @@ fnct_BdPolyFromWKB2 (sqlite3_context * context, int argc, sqlite3_value ** argv) ln = geo->FirstLinestring; while (ln) { - gaiaGetPoint (ln->Coords, 0, &x0, &y0); - gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } if (x0 != xn || y0 != yn) goto invalid; ln = ln->Next; } - fnct_polygonize (context, geo, 0); + fnct_aux_polygonize (context, geo, 0, 0); return; invalid: gaiaFreeGeomColl (geo); @@ -41658,7 +39876,7 @@ fnct_BdMPolyFromWKB1 (sqlite3_context * context, int argc, sqlite3_value ** argv) { /* SQL function: -/ BdMPolyFromWKB(WKB encoded MULTILINESTRING) +/ BdMPolyFromWKB(WKB encoded MULTILINESTRING) / / returns the current geometry [MULTIPOLYGON] by parsing a WKB encoded MULTILINESTRING / or NULL if any error is encountered @@ -41672,6 +39890,8 @@ fnct_BdMPolyFromWKB1 (sqlite3_context * context, int argc, double y0; double xn; double yn; + double z; + double m; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) { @@ -41688,6 +39908,11 @@ fnct_BdMPolyFromWKB1 (sqlite3_context * context, int argc, sqlite3_result_null (context); return; } + if (geo->DeclaredType != GAIA_MULTILINESTRING) + { + sqlite3_result_null (context); + return; + } geo->Srid = -1; /* one or more closed LINESTINGs are expected */ if (geo->FirstPoint || geo->FirstPolygon) @@ -41697,13 +39922,31 @@ fnct_BdMPolyFromWKB1 (sqlite3_context * context, int argc, ln = geo->FirstLinestring; while (ln) { - gaiaGetPoint (ln->Coords, 0, &x0, &y0); - gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } if (x0 != xn || y0 != yn) goto invalid; ln = ln->Next; } - fnct_polygonize (context, geo, 1); + fnct_aux_polygonize (context, geo, 1, 1); return; invalid: gaiaFreeGeomColl (geo); @@ -41715,7 +39958,7 @@ fnct_BdMPolyFromWKB2 (sqlite3_context * context, int argc, sqlite3_value ** argv) { /* SQL function: -/ BdMPolyFromWKB(WKB encoded MULTILINESTRING) +/ BdMPolyFromWKB(WKB encoded MULTILINESTRING) / / returns the current geometry [MULTIPOLYGON] by parsing a WKB encoded MULTILINESTRING / or NULL if any error is encountered @@ -41729,6 +39972,8 @@ fnct_BdMPolyFromWKB2 (sqlite3_context * context, int argc, double y0; double xn; double yn; + double z; + double m; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) { @@ -41750,6 +39995,11 @@ fnct_BdMPolyFromWKB2 (sqlite3_context * context, int argc, sqlite3_result_null (context); return; } + if (geo->DeclaredType != GAIA_MULTILINESTRING) + { + sqlite3_result_null (context); + return; + } geo->Srid = sqlite3_value_int (argv[1]); /* one or more closed LINESTINGs are expected */ if (geo->FirstPoint || geo->FirstPolygon) @@ -41759,13 +40009,31 @@ fnct_BdMPolyFromWKB2 (sqlite3_context * context, int argc, ln = geo->FirstLinestring; while (ln) { - gaiaGetPoint (ln->Coords, 0, &x0, &y0); - gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } if (x0 != xn || y0 != yn) goto invalid; ln = ln->Next; } - fnct_polygonize (context, geo, 1); + fnct_aux_polygonize (context, geo, 1, 1); return; invalid: gaiaFreeGeomColl (geo); @@ -41773,18 +40041,490 @@ fnct_BdMPolyFromWKB2 (sqlite3_context * context, int argc, } static void -fnct_Polygonize1 (sqlite3_context * context, int argc, sqlite3_value ** argv) +fnct_BuildArea (sqlite3_context * context, int argc, sqlite3_value ** argv) +{ +/* SQL function: +/ BuildArea(BLOBencoded geometry) +/ +/ returns a new geometry [POLYGON or MULTIPOLYGON] +/ by parsing a WKB encoded MULTILINESTRING +/ [each LINESTRING is expected to be a closed RING +/ or NULL if any error is encountered +*/ + unsigned char *p_blob; + int n_bytes; + gaiaGeomCollPtr geo = NULL; + gaiaLinestringPtr ln; + double x0; + double y0; + double xn; + double yn; + double z; + double m; + GAIA_UNUSED (); + if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) + { + sqlite3_result_null (context); + return; + } + p_blob = (unsigned char *) sqlite3_value_blob (argv[0]); + n_bytes = sqlite3_value_bytes (argv[0]); + geo = gaiaFromSpatiaLiteBlobWkb (p_blob, n_bytes); + if (geo == NULL) + { + sqlite3_result_null (context); + return; + } +/* one or more CLOSED LINESTINGs are expected */ + if (geo->FirstPoint || geo->FirstPolygon) + goto invalid; + if (!geo->FirstLinestring) + goto invalid; + ln = geo->FirstLinestring; + while (ln) + { + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } + if (x0 != xn || y0 != yn) + goto invalid; + ln = ln->Next; + } + fnct_aux_polygonize (context, geo, 0, 1); + return; + invalid: + gaiaFreeGeomColl (geo); + sqlite3_result_null (context); +} + +static gaiaLinestringPtr +fnct_aux_join_segments (gaiaLinestringPtr ln1, gaiaLinestringPtr ln2, + int reverse) +{ + int iv; + int pti = 0; + int points = ln1->Points + ln2->Points - 1; + gaiaLinestringPtr ln; + double x; + double y; + double z; + double m; + if (ln1->DimensionModel == GAIA_XY_Z) + ln = gaiaAllocLinestringXYZ (points); + if (ln1->DimensionModel == GAIA_XY_M) + ln = gaiaAllocLinestringXYM (points); + if (ln1->DimensionModel == GAIA_XY_Z_M) + ln = gaiaAllocLinestringXYZM (points); + else + ln = gaiaAllocLinestring (points); + if (reverse == 1) + { + /* copying points from Segm-1 [reversed] */ + for (iv = ln1->Points - 1; iv > 0; iv--) + { + if (ln1->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln1->Coords, iv, &x, &y, &z); + gaiaSetPointXYZ (ln->Coords, pti, x, y, z); + } + else if (ln1->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln1->Coords, iv, &x, &y, &m); + gaiaSetPointXYM (ln->Coords, pti, x, y, m); + } + else if (ln1->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln1->Coords, iv, &x, &y, &z, &m); + gaiaSetPointXYZM (ln->Coords, pti, x, y, z, m); + } + else + { + gaiaGetPoint (ln1->Coords, iv, &x, &y); + gaiaSetPoint (ln->Coords, pti, x, y); + } + pti++; + } + } + else + { + /* copying points from Segm-1 [normal] */ + for (iv = 0; iv < ln1->Points - 1; iv++) + { + if (ln1->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln1->Coords, iv, &x, &y, &z); + gaiaSetPointXYZ (ln->Coords, pti, x, y, z); + } + else if (ln1->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln1->Coords, iv, &x, &y, &m); + gaiaSetPointXYM (ln->Coords, pti, x, y, m); + } + else if (ln1->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln1->Coords, iv, &x, &y, &z, &m); + gaiaSetPointXYZM (ln->Coords, pti, x, y, z, m); + } + else + { + gaiaGetPoint (ln1->Coords, iv, &x, &y); + gaiaSetPoint (ln->Coords, pti, x, y); + } + pti++; + } + } + if (reverse == 2) + { + /* copying points from Segm-2 [reversed] */ + for (iv = ln2->Points - 1; iv >= 0; iv--) + { + if (ln2->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln2->Coords, iv, &x, &y, &z); + gaiaSetPointXYZ (ln->Coords, pti, x, y, z); + } + else if (ln2->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln2->Coords, iv, &x, &y, &m); + gaiaSetPointXYM (ln->Coords, pti, x, y, m); + } + else if (ln2->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln2->Coords, iv, &x, &y, &z, &m); + gaiaSetPointXYZM (ln->Coords, pti, x, y, z, m); + } + else + { + gaiaGetPoint (ln2->Coords, iv, &x, &y); + gaiaSetPoint (ln->Coords, pti, x, y); + } + pti++; + } + } + else + { + /* copying points from Segm-2 [normal] */ + for (iv = 0; iv < ln2->Points; iv++) + { + if (ln2->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln2->Coords, iv, &x, &y, &z); + gaiaSetPointXYZ (ln->Coords, pti, x, y, z); + } + else if (ln2->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln2->Coords, iv, &x, &y, &m); + gaiaSetPointXYM (ln->Coords, pti, x, y, m); + } + else if (ln2->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln2->Coords, iv, &x, &y, &z, &m); + gaiaSetPointXYZM (ln->Coords, pti, x, y, z, m); + } + else + { + gaiaGetPoint (ln2->Coords, iv, &x, &y); + gaiaSetPoint (ln->Coords, pti, x, y); + } + pti++; + } + } + return ln; +} + +static int +fnct_aux_join_rings (gaiaGeomCollPtr geo) +{ +/* helper function +/ +/ trying to build closed rings joining adjacent fragments +/ +*/ + double x0; + double y0; + double xn; + double yn; + double z; + double m; + int count = 0; + int count_unclosed = 0; + gaiaLinestringPtr *segments; + gaiaLinestringPtr *linestrings; + gaiaLinestringPtr *merged; + double *start_x; + double *start_y; + double *end_x; + double *end_y; + int *already_processed; + int i; + int ir; + int retval = 0; + gaiaLinestringPtr ln = geo->FirstLinestring; + while (ln) + { + /* counting how many linestrings are there */ + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } + if (x0 != xn || y0 != yn) + count_unclosed++; + count++; + ln = ln->Next; + } + if (!count_unclosed) + { + /* not a single unclosed LINESTRING was found */ + return 0; + } +/* allocating the helper arrays */ + linestrings = malloc (sizeof (gaiaLinestringPtr) * count); + segments = malloc (sizeof (gaiaLinestringPtr) * count); + merged = malloc (sizeof (gaiaLinestringPtr) * count); + start_x = malloc (sizeof (double) * count); + start_y = malloc (sizeof (double) * count); + end_x = malloc (sizeof (double) * count); + end_y = malloc (sizeof (double) * count); + already_processed = malloc (sizeof (int) * count); + for (i = 0; i < count; i++) + { + merged[i] = NULL; + segments[i] = NULL; + already_processed[i] = 0; + } + i = 0; + ln = geo->FirstLinestring; + while (ln) + { + /* feeding the helper arrays */ + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } + linestrings[i] = ln; + if (x0 != xn || y0 != yn) + { + segments[i] = ln; + start_x[i] = x0; + start_y[i] = y0; + end_x[i] = xn; + end_y[i] = yn; + } + i++; + ln = ln->Next; + } + for (i = 0; i < count; i++) + { + /* identifying adjacent segments */ + int i2; + gaiaLinestringPtr rng; + if (segments[i] == NULL) + continue; + if (already_processed[i]) + continue; + for (i2 = 0; i2 < count; i2++) + { + if (already_processed[i]) + break; + if (i == i2) + continue; + if (segments[i2] == NULL) + continue; + if (already_processed[i2]) + continue; + if (end_x[i] == start_x[i2] && end_y[i] == start_y[i2]) + { + /* joining Segm-1 and Segm-2 */ + rng = + fnct_aux_join_segments (segments[i], segments[i2], 0); + for (ir = 0; ir < count; ir++) + { + if (merged[ir] == NULL) + { + merged[ir] = rng; + break; + } + } + already_processed[i] = 1; + already_processed[i2] = 1; + retval = 1; + continue; + } + if (start_x[i] == end_x[i2] && start_y[i] == end_y[i2]) + { + /* joining Segm-2 and Segm-1 */ + rng = + fnct_aux_join_segments (segments[i2], segments[i], 0); + for (ir = 0; ir < count; ir++) + { + if (merged[ir] == NULL) + { + merged[ir] = rng; + break; + } + } + already_processed[i] = 1; + already_processed[i2] = 1; + retval = 1; + continue; + } + if (start_x[i] == start_x[i2] && start_y[i] == start_y[i2]) + { + /* joining Segm-2 [reversed] and Segm-1 */ + rng = + fnct_aux_join_segments (segments[i2], segments[i], 1); + for (ir = 0; ir < count; ir++) + { + if (merged[ir] == NULL) + { + merged[ir] = rng; + break; + } + } + already_processed[i] = 1; + already_processed[i2] = 1; + retval = 1; + continue; + } + if (end_x[i] == end_x[i2] && end_y[i] == end_y[i2]) + { + /* joining Segm-1 and Segm-2 [reversed] */ + rng = + fnct_aux_join_segments (segments[i], segments[i2], 2); + for (ir = 0; ir < count; ir++) + { + if (merged[ir] == NULL) + { + merged[ir] = rng; + break; + } + } + already_processed[i] = 1; + already_processed[i2] = 1; + retval = 1; + continue; + } + } + } + if (retval) + { + /* adjusting the actual geometry */ + geo->FirstLinestring = NULL; + geo->LastLinestring = NULL; + for (i = 0; i < count; i++) + { + if (segments[i] != NULL && already_processed[i] == 1) + { + /* destroying an already merged segment */ + gaiaFreeLinestring (segments[i]); + continue; + } + /* re-inserting any unprocessed segment */ + ln = linestrings[i]; + ln->Next = NULL; + if (geo->FirstLinestring == NULL) + geo->FirstLinestring = ln; + if (geo->LastLinestring != NULL) + geo->LastLinestring->Next = ln; + geo->LastLinestring = ln; + } + for (i = 0; i < count; i++) + { + if (merged[i] != NULL) + { + /* inserting any merged segment */ + ln = merged[i]; + ln->Next = NULL; + if (geo->FirstLinestring == NULL) + geo->FirstLinestring = ln; + if (geo->LastLinestring != NULL) + geo->LastLinestring->Next = ln; + geo->LastLinestring = ln; + } + } + } +/* memory cleanup */ + free (segments); + free (linestrings); + free (merged); + free (start_x); + free (start_y); + free (end_x); + free (end_y); + free (already_processed); + return retval; +} + +static void +fnct_Polygonize (sqlite3_context * context, int argc, sqlite3_value ** argv) { /* SQL function: / Polygonize(BLOBencoded geometry) / / returns a new geometry [POLYGON or MULTIPOLYGON] representing -/ the polygonization for current LINESTRING or MULTILINESTRING geometry +/ the polygonization for current (MULTI)LINESTRING geometry / or NULL if any error is encountered */ unsigned char *p_blob; int n_bytes; gaiaGeomCollPtr geo = NULL; + gaiaLinestringPtr ln; + double x0; + double y0; + double xn; + double yn; + double z; + double m; + int join = 1; GAIA_UNUSED (); if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) { @@ -41799,58 +40539,42 @@ fnct_Polygonize1 (sqlite3_context * context, int argc, sqlite3_value ** argv) sqlite3_result_null (context); return; } -/* one or more LINESTINGs are expected */ +/* trying to build closed rings joining adjacent fragments */ + while (join) + join = fnct_aux_join_rings (geo); +/* one or more CLOSED LINESTINGs are expected */ if (geo->FirstPoint || geo->FirstPolygon) goto invalid; if (!geo->FirstLinestring) goto invalid; - fnct_polygonize (context, geo, 0); - return; - invalid: - gaiaFreeGeomColl (geo); - sqlite3_result_null (context); -} - -static void -fnct_Polygonize2 (sqlite3_context * context, int argc, sqlite3_value ** argv) -{ -/* SQL function: -/ Polygonize(BLOBencoded geometry, BOOL force_multipolygon) -/ -/ returns a new geometry [POLYGON or MULTIPOLYGON] representing -/ the polygonization for current LINESTRING or MULTILINESTRING geometry -/ or NULL if any error is encountered -*/ - unsigned char *p_blob; - int n_bytes; - gaiaGeomCollPtr geo = NULL; - int force_multipolygon; - GAIA_UNUSED (); - if (sqlite3_value_type (argv[0]) != SQLITE_BLOB) + ln = geo->FirstLinestring; + while (ln) { - sqlite3_result_null (context); - return; + if (ln->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ln->Coords, 0, &x0, &y0, &z); + gaiaGetPointXYZ (ln->Coords, ln->Points - 1, &xn, &yn, &z); + } + else if (ln->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ln->Coords, 0, &x0, &y0, &m); + gaiaGetPointXYM (ln->Coords, ln->Points - 1, &xn, &yn, &m); + } + else if (ln->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ln->Coords, 0, &x0, &y0, &z, &m); + gaiaGetPointXYZM (ln->Coords, ln->Points - 1, &xn, &yn, &z, &m); + } + else + { + gaiaGetPoint (ln->Coords, 0, &x0, &y0); + gaiaGetPoint (ln->Coords, ln->Points - 1, &xn, &yn); + } + if (x0 != xn || y0 != yn) + goto invalid; + ln = ln->Next; } - if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER) - { - sqlite3_result_null (context); - return; - } - p_blob = (unsigned char *) sqlite3_value_blob (argv[0]); - n_bytes = sqlite3_value_bytes (argv[0]); - geo = gaiaFromSpatiaLiteBlobWkb (p_blob, n_bytes); - if (geo == NULL) - { - sqlite3_result_null (context); - return; - } - force_multipolygon = sqlite3_value_int (argv[1]); -/* one or more LINESTINGs are expected */ - if (geo->FirstPoint || geo->FirstPolygon) - goto invalid; - if (!geo->FirstLinestring) - goto invalid; - fnct_polygonize (context, geo, force_multipolygon); + fnct_aux_polygonize (context, geo, 0, 1); return; invalid: gaiaFreeGeomColl (geo); @@ -42443,7 +41167,7 @@ fnct_math_stddev_pop_final (sqlite3_context * context) sqlite3_result_null (context); return; } - x = sqrt (p->quot / (p->count - 1.0)); + x = sqrt (p->quot / p->count); sqlite3_result_double (context, x); } @@ -42462,7 +41186,7 @@ fnct_math_stddev_samp_final (sqlite3_context * context) sqlite3_result_null (context); return; } - x = sqrt (p->quot / p->count); + x = sqrt (p->quot / (p->count - 1.0)); sqlite3_result_double (context, x); } @@ -42481,7 +41205,7 @@ fnct_math_var_pop_final (sqlite3_context * context) sqlite3_result_null (context); return; } - x = p->quot / (p->count - 1.0); + x = p->quot / p->count; sqlite3_result_double (context, x); } @@ -42500,7 +41224,7 @@ fnct_math_var_samp_final (sqlite3_context * context) sqlite3_result_null (context); return; } - x = p->quot / p->count; + x = p->quot / (p->count - 1.0); sqlite3_result_double (context, x); } @@ -42732,7 +41456,7 @@ blob_guess (sqlite3_context * context, int argc, sqlite3_value ** argv, /* SQL function: / IsGifBlob(BLOB encoded image) / IsPngBlob, IsJpegBlob, IsExifBlob, IsExifGpsBlob, IsTiffBlob, -/ IsWaveletBlob, IsZipBlob, IsPdfBlob,IsGeometryBlob +/ IsZipBlob, IsPdfBlob,IsGeometryBlob / / returns: / 1 if the required BLOB_TYPE is TRUE @@ -42775,14 +41499,6 @@ blob_guess (sqlite3_context * context, int argc, sqlite3_value ** argv, sqlite3_result_int (context, 0); return; } - if (request == GAIA_WAVELET_BLOB) - { - if (blob_type == GAIA_WAVELET_BLOB) - sqlite3_result_int (context, 1); - else - sqlite3_result_int (context, 0); - return; - } if (request == GAIA_TIFF_BLOB) { if (blob_type == GAIA_TIFF_BLOB) @@ -42862,12 +41578,6 @@ fnct_IsPdfBlob (sqlite3_context * context, int argc, sqlite3_value ** argv) blob_guess (context, argc, argv, GAIA_PDF_BLOB); } -static void -fnct_IsWaveletBlob (sqlite3_context * context, int argc, sqlite3_value ** argv) -{ - blob_guess (context, argc, argv, GAIA_WAVELET_BLOB); -} - static void fnct_IsTiffBlob (sqlite3_context * context, int argc, sqlite3_value ** argv) { @@ -43388,6 +42098,8 @@ init_static_spatialite (sqlite3 * db, char **pzErrMsg, fnct_GeometryConstraints, 0, 0); sqlite3_create_function (db, "GeometryConstraints", 4, SQLITE_ANY, 0, fnct_GeometryConstraints, 0, 0); + sqlite3_create_function (db, "RTreeAlign", 3, SQLITE_ANY, 0, + fnct_RTreeAlign, 0, 0); sqlite3_create_function (db, "CheckSpatialMetaData", 0, SQLITE_ANY, 0, fnct_CheckSpatialMetaData, 0, 0); sqlite3_create_function (db, "AutoFDOStart", 0, SQLITE_ANY, 0, @@ -43426,6 +42138,17 @@ init_static_spatialite (sqlite3 * db, char **pzErrMsg, sqlite3_create_function (db, "AsSvg", 1, SQLITE_ANY, 0, fnct_AsSvg1, 0, 0); sqlite3_create_function (db, "AsSvg", 2, SQLITE_ANY, 0, fnct_AsSvg2, 0, 0); sqlite3_create_function (db, "AsSvg", 3, SQLITE_ANY, 0, fnct_AsSvg3, 0, 0); + +#ifndef OMIT_PROJ /* PROJ.4 is strictly required to support KML */ + sqlite3_create_function (db, "AsKml", 1, SQLITE_ANY, 0, fnct_AsKml, 0, 0); + sqlite3_create_function (db, "AsKml", 2, SQLITE_ANY, 0, fnct_AsKml, 0, 0); + sqlite3_create_function (db, "AsKml", 3, SQLITE_ANY, 0, fnct_AsKml, 0, 0); + sqlite3_create_function (db, "AsKml", 4, SQLITE_ANY, 0, fnct_AsKml, 0, 0); +#endif /* end including PROJ.4 */ + + sqlite3_create_function (db, "AsGml", 1, SQLITE_ANY, 0, fnct_AsGml, 0, 0); + sqlite3_create_function (db, "AsGml", 2, SQLITE_ANY, 0, fnct_AsGml, 0, 0); + sqlite3_create_function (db, "AsGml", 3, SQLITE_ANY, 0, fnct_AsGml, 0, 0); sqlite3_create_function (db, "AsFGF", 2, SQLITE_ANY, 0, fnct_AsFGF, 0, 0); sqlite3_create_function (db, "AsBinary", 1, SQLITE_ANY, 0, fnct_AsBinary, 0, 0); @@ -43679,6 +42402,8 @@ init_static_spatialite (sqlite3 * db, char **pzErrMsg, fnct_CompressGeometry, 0, 0); sqlite3_create_function (db, "UncompressGeometry", 1, SQLITE_ANY, 0, fnct_UncompressGeometry, 0, 0); + sqlite3_create_function (db, "SanitizeGeometry", 1, SQLITE_ANY, 0, + fnct_SanitizeGeometry, 0, 0); sqlite3_create_function (db, "CastToPoint", 1, SQLITE_ANY, 0, fnct_CastToPoint, 0, 0); sqlite3_create_function (db, "CastToLinestring", 1, SQLITE_ANY, 0, @@ -43695,6 +42420,8 @@ init_static_spatialite (sqlite3 * db, char **pzErrMsg, fnct_CastToGeometryCollection, 0, 0); sqlite3_create_function (db, "CastToMulti", 1, SQLITE_ANY, 0, fnct_CastToMulti, 0, 0); + sqlite3_create_function (db, "ST_Multi", 1, SQLITE_ANY, 0, + fnct_CastToMulti, 0, 0); sqlite3_create_function (db, "CastToSingle", 1, SQLITE_ANY, 0, fnct_CastToSingle, 0, 0); sqlite3_create_function (db, "CastToXY", 1, SQLITE_ANY, 0, fnct_CastToXY, 0, @@ -43843,6 +42570,16 @@ init_static_spatialite (sqlite3 * db, char **pzErrMsg, sqlite3_create_function (db, "BuildRings", 1, SQLITE_ANY, 0, fnct_BuildRings, 0, 0); +#ifndef OMIT_GEOCALLBACKS /* supporting RTree geometry callbacks */ + sqlite3_rtree_geometry_callback (db, "RTreeWithin", fnct_RTreeWithin, 0); + sqlite3_rtree_geometry_callback (db, "RTreeContains", fnct_RTreeContains, + 0); + sqlite3_rtree_geometry_callback (db, "RTreeIntersects", + fnct_RTreeIntersects, 0); + sqlite3_rtree_geometry_callback (db, "RTreeDistWithin", + fnct_RTreeDistWithin, 0); +#endif /* end RTree geometry callbacks */ + /* some BLOB/JPEG/EXIF functions */ sqlite3_create_function (db, "IsGeometryBlob", 1, SQLITE_ANY, 0, fnct_IsGeometryBlob, 0, 0); @@ -43850,8 +42587,6 @@ init_static_spatialite (sqlite3 * db, char **pzErrMsg, 0, 0); sqlite3_create_function (db, "IsPdfBlob", 1, SQLITE_ANY, 0, fnct_IsPdfBlob, 0, 0); - sqlite3_create_function (db, "IsWaveletBlob", 1, SQLITE_ANY, 0, - fnct_IsWaveletBlob, 0, 0); sqlite3_create_function (db, "IsTiffBlob", 1, SQLITE_ANY, 0, fnct_IsTiffBlob, 0, 0); sqlite3_create_function (db, "IsGifBlob", 1, SQLITE_ANY, 0, fnct_IsGifBlob, @@ -44019,7 +42754,7 @@ init_static_spatialite (sqlite3 * db, char **pzErrMsg, #ifndef OMIT_GEOS /* including GEOS */ - initGEOS (geos_error, geos_error); + initGEOS (geos_warning, geos_error); sqlite3_create_function (db, "Boundary", 1, SQLITE_ANY, 0, fnct_Boundary, 0, 0); sqlite3_create_function (db, "ST_Boundary", 1, SQLITE_ANY, 0, fnct_Boundary, @@ -44037,6 +42772,8 @@ init_static_spatialite (sqlite3 * db, char **pzErrMsg, 0); sqlite3_create_function (db, "IsValid", 1, SQLITE_ANY, 0, fnct_IsValid, 0, 0); + sqlite3_create_function (db, "ST_IsValid", 1, SQLITE_ANY, 0, fnct_IsValid, + 0, 0); sqlite3_create_function (db, "GLength", 1, SQLITE_ANY, 0, fnct_Length, 0, 0); sqlite3_create_function (db, "ST_Length", 1, SQLITE_ANY, 0, fnct_Length, 0, @@ -44120,6 +42857,10 @@ init_static_spatialite (sqlite3 * db, char **pzErrMsg, 0); sqlite3_create_function (db, "ST_Distance", 2, SQLITE_ANY, 0, fnct_Distance, 0, 0); + sqlite3_create_function (db, "PtDistWithin", 3, SQLITE_ANY, 0, + fnct_PtDistWithin, 0, 0); + sqlite3_create_function (db, "PtDistWithin", 4, SQLITE_ANY, 0, + fnct_PtDistWithin, 0, 0); sqlite3_create_function (db, "BdPolyFromText", 1, SQLITE_ANY, 0, fnct_BdPolyFromText1, 0, 0); sqlite3_create_function (db, "BdPolyFromText", 2, SQLITE_ANY, 0, @@ -44136,17 +42877,38 @@ init_static_spatialite (sqlite3 * db, char **pzErrMsg, fnct_BdMPolyFromWKB1, 0, 0); sqlite3_create_function (db, "BdMPolyFromWKB", 2, SQLITE_ANY, 0, fnct_BdMPolyFromWKB2, 0, 0); + sqlite3_create_function (db, "ST_BdPolyFromText", 1, SQLITE_ANY, 0, + fnct_BdPolyFromText1, 0, 0); + sqlite3_create_function (db, "ST_BdPolyFromText", 2, SQLITE_ANY, 0, + fnct_BdPolyFromText2, 0, 0); + sqlite3_create_function (db, "ST_BdMPolyFromText", 1, SQLITE_ANY, 0, + fnct_BdMPolyFromText1, 0, 0); + sqlite3_create_function (db, "ST_BdMPolyFromText", 2, SQLITE_ANY, 0, + fnct_BdMPolyFromText2, 0, 0); + sqlite3_create_function (db, "ST_BdPolyFromWKB", 1, SQLITE_ANY, 0, + fnct_BdPolyFromWKB1, 0, 0); + sqlite3_create_function (db, "ST_BdPolyFromWKB", 2, SQLITE_ANY, 0, + fnct_BdPolyFromWKB2, 0, 0); + sqlite3_create_function (db, "ST_BdMPolyFromWKB", 1, SQLITE_ANY, 0, + fnct_BdMPolyFromWKB1, 0, 0); + sqlite3_create_function (db, "ST_BdMPolyFromWKB", 2, SQLITE_ANY, 0, + fnct_BdMPolyFromWKB2, 0, 0); + sqlite3_create_function (db, "BuildArea", 1, SQLITE_ANY, 0, fnct_BuildArea, + 0, 0); sqlite3_create_function (db, "Polygonize", 1, SQLITE_ANY, 0, - fnct_Polygonize1, 0, 0); - sqlite3_create_function (db, "Polygonize", 2, SQLITE_ANY, 0, - fnct_Polygonize2, 0, 0); + fnct_Polygonize, 0, 0); #endif /* end including GEOS */ +#if OMIT_ICONV == 0 /* ICONV is disabled: SHP/DBF/TXT cannot be supported */ /* initializing the VirtualShape extension */ virtualshape_extension_init (db); +/* initializing the VirtualDbf extension */ + virtualdbf_extension_init (db); /* initializing the VirtualText extension */ virtualtext_extension_init (db); +#endif /* ICONV enabled/disabled */ + /* initializing the VirtualNetwork extension */ virtualnetwork_extension_init (db); /* initializing the MbrCache extension */ @@ -44166,9 +42928,12 @@ spatialite_init (int verbose) { printf ("SpatiaLite version ..: %s", spatialite_version ()); printf ("\tSupported Extensions:\n"); +#if OMIT_ICONV == 0 /* ICONV is required by SHP/DBF/TXT */ printf ("\t- 'VirtualShape'\t[direct Shapefile access]\n"); - printf ("\t- 'VirtualText\t\t[direct CSV/TXT access]\n"); - printf ("\t- 'VirtualNetwork\t[Dijkstra shortest path]\n"); + printf ("\t- 'VirtualDbf'\t\t[direct DBF access]\n"); + printf ("\t- 'VirtualText'\t\t[direct CSV/TXT access]\n"); +#endif /* end ICONV conditional */ + printf ("\t- 'VirtualNetwork'\t[Dijkstra shortest path]\n"); printf ("\t- 'RTree'\t\t[Spatial Index - R*Tree]\n"); printf ("\t- 'MbrCache'\t\t[Spatial Index - MBR cache]\n"); printf ("\t- 'VirtualFDO'\t\t[FDO-OGR interoperability]\n"); @@ -44202,6 +42967,8 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, fnct_GeometryConstraints, 0, 0); sqlite3_create_function (db, "GeometryConstraints", 4, SQLITE_ANY, 0, fnct_GeometryConstraints, 0, 0); + sqlite3_create_function (db, "RTreeAlign", 3, SQLITE_ANY, 0, + fnct_RTreeAlign, 0, 0); sqlite3_create_function (db, "CheckSpatialMetaData", 0, SQLITE_ANY, 0, fnct_CheckSpatialMetaData, 0, 0); sqlite3_create_function (db, "AutoFDOStart", 0, SQLITE_ANY, 0, @@ -44240,6 +43007,17 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, sqlite3_create_function (db, "AsSvg", 1, SQLITE_ANY, 0, fnct_AsSvg1, 0, 0); sqlite3_create_function (db, "AsSvg", 2, SQLITE_ANY, 0, fnct_AsSvg2, 0, 0); sqlite3_create_function (db, "AsSvg", 3, SQLITE_ANY, 0, fnct_AsSvg3, 0, 0); + +#ifndef OMIT_PROJ /* PROJ.4 is strictly required to support KML */ + sqlite3_create_function (db, "AsKml", 1, SQLITE_ANY, 0, fnct_AsKml, 0, 0); + sqlite3_create_function (db, "AsKml", 2, SQLITE_ANY, 0, fnct_AsKml, 0, 0); + sqlite3_create_function (db, "AsKml", 3, SQLITE_ANY, 0, fnct_AsKml, 0, 0); + sqlite3_create_function (db, "AsKml", 4, SQLITE_ANY, 0, fnct_AsKml, 0, 0); +#endif /* end including PROJ.4 */ + + sqlite3_create_function (db, "AsGml", 1, SQLITE_ANY, 0, fnct_AsGml, 0, 0); + sqlite3_create_function (db, "AsGml", 2, SQLITE_ANY, 0, fnct_AsGml, 0, 0); + sqlite3_create_function (db, "AsGml", 3, SQLITE_ANY, 0, fnct_AsGml, 0, 0); sqlite3_create_function (db, "AsFGF", 2, SQLITE_ANY, 0, fnct_AsFGF, 0, 0); sqlite3_create_function (db, "AsBinary", 1, SQLITE_ANY, 0, fnct_AsBinary, 0, 0); @@ -44493,6 +43271,8 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, fnct_CompressGeometry, 0, 0); sqlite3_create_function (db, "UncompressGeometry", 1, SQLITE_ANY, 0, fnct_UncompressGeometry, 0, 0); + sqlite3_create_function (db, "SanitizeGeometry", 1, SQLITE_ANY, 0, + fnct_SanitizeGeometry, 0, 0); sqlite3_create_function (db, "CastToPoint", 1, SQLITE_ANY, 0, fnct_CastToPoint, 0, 0); sqlite3_create_function (db, "CastToLinestring", 1, SQLITE_ANY, 0, @@ -44509,6 +43289,8 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, fnct_CastToGeometryCollection, 0, 0); sqlite3_create_function (db, "CastToMulti", 1, SQLITE_ANY, 0, fnct_CastToMulti, 0, 0); + sqlite3_create_function (db, "ST_Multi", 1, SQLITE_ANY, 0, + fnct_CastToMulti, 0, 0); sqlite3_create_function (db, "CastToSingle", 1, SQLITE_ANY, 0, fnct_CastToSingle, 0, 0); sqlite3_create_function (db, "CastToXY", 1, SQLITE_ANY, 0, fnct_CastToXY, 0, @@ -44657,6 +43439,16 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, sqlite3_create_function (db, "BuildRings", 1, SQLITE_ANY, 0, fnct_BuildRings, 0, 0); +#ifndef OMIT_GEOCALLBACKS /* supporting RTree geometry callbacks */ + sqlite3_rtree_geometry_callback (db, "RTreeWithin", fnct_RTreeWithin, 0); + sqlite3_rtree_geometry_callback (db, "RTreeContains", fnct_RTreeContains, + 0); + sqlite3_rtree_geometry_callback (db, "RTreeIntersects", + fnct_RTreeIntersects, 0); + sqlite3_rtree_geometry_callback (db, "RTreeDistWithin", + fnct_RTreeDistWithin, 0); +#endif /* end RTree geometry callbacks */ + /* some BLOB/JPEG/EXIF functions */ sqlite3_create_function (db, "IsGeometryBlob", 1, SQLITE_ANY, 0, fnct_IsGeometryBlob, 0, 0); @@ -44664,8 +43456,6 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, 0, 0); sqlite3_create_function (db, "IsPdfBlob", 1, SQLITE_ANY, 0, fnct_IsPdfBlob, 0, 0); - sqlite3_create_function (db, "IsWaveletBlob", 1, SQLITE_ANY, 0, - fnct_IsWaveletBlob, 0, 0); sqlite3_create_function (db, "IsTiffBlob", 1, SQLITE_ANY, 0, fnct_IsTiffBlob, 0, 0); sqlite3_create_function (db, "IsGifBlob", 1, SQLITE_ANY, 0, fnct_IsGifBlob, @@ -44833,7 +43623,7 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, #ifndef OMIT_GEOS /* including GEOS */ - initGEOS (geos_error, geos_error); + initGEOS (geos_warning, geos_error); sqlite3_create_function (db, "Equals", 2, SQLITE_ANY, 0, fnct_Equals, 0, 0); sqlite3_create_function (db, "ST_Equals", 2, SQLITE_ANY, 0, fnct_Equals, 0, 0); @@ -44871,6 +43661,10 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, 0); sqlite3_create_function (db, "ST_Distance", 2, SQLITE_ANY, 0, fnct_Distance, 0, 0); + sqlite3_create_function (db, "PtDistWithin", 3, SQLITE_ANY, 0, + fnct_PtDistWithin, 0, 0); + sqlite3_create_function (db, "PtDistWithin", 4, SQLITE_ANY, 0, + fnct_PtDistWithin, 0, 0); sqlite3_create_function (db, "Intersection", 2, SQLITE_ANY, 0, fnct_Intersection, 0, 0); sqlite3_create_function (db, "ST_Intersection", 2, SQLITE_ANY, 0, @@ -44934,6 +43728,8 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, 0); sqlite3_create_function (db, "IsValid", 1, SQLITE_ANY, 0, fnct_IsValid, 0, 0); + sqlite3_create_function (db, "ST_IsValid", 1, SQLITE_ANY, 0, fnct_IsValid, + 0, 0); sqlite3_create_function (db, "BdPolyFromText", 1, SQLITE_ANY, 0, fnct_BdPolyFromText1, 0, 0); sqlite3_create_function (db, "BdPolyFromText", 2, SQLITE_ANY, 0, @@ -44950,17 +43746,38 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, fnct_BdMPolyFromWKB1, 0, 0); sqlite3_create_function (db, "BdMPolyFromWKB", 2, SQLITE_ANY, 0, fnct_BdMPolyFromWKB2, 0, 0); + sqlite3_create_function (db, "ST_BdPolyFromText", 1, SQLITE_ANY, 0, + fnct_BdPolyFromText1, 0, 0); + sqlite3_create_function (db, "ST_BdPolyFromText", 2, SQLITE_ANY, 0, + fnct_BdPolyFromText2, 0, 0); + sqlite3_create_function (db, "ST_BdMPolyFromText", 1, SQLITE_ANY, 0, + fnct_BdMPolyFromText1, 0, 0); + sqlite3_create_function (db, "ST_BdMPolyFromText", 2, SQLITE_ANY, 0, + fnct_BdMPolyFromText2, 0, 0); + sqlite3_create_function (db, "ST_BdPolyFromWKB", 1, SQLITE_ANY, 0, + fnct_BdPolyFromWKB1, 0, 0); + sqlite3_create_function (db, "ST_BdPolyFromWKB", 2, SQLITE_ANY, 0, + fnct_BdPolyFromWKB2, 0, 0); + sqlite3_create_function (db, "ST_BdMPolyFromWKB", 1, SQLITE_ANY, 0, + fnct_BdMPolyFromWKB1, 0, 0); + sqlite3_create_function (db, "ST_BdMPolyFromWKB", 2, SQLITE_ANY, 0, + fnct_BdMPolyFromWKB2, 0, 0); + sqlite3_create_function (db, "BuildArea", 1, SQLITE_ANY, 0, + fnct_BuildArea, 0, 0); sqlite3_create_function (db, "Polygonize", 1, SQLITE_ANY, 0, - fnct_Polygonize1, 0, 0); - sqlite3_create_function (db, "Polygonize", 2, SQLITE_ANY, 0, - fnct_Polygonize2, 0, 0); + fnct_Polygonize, 0, 0); #endif /* end including GEOS */ +#if OMIT_ICONV == 0 /* ICONV is disabled: SHP/DBF/TXT cannot be supported */ /* initializing the VirtualShape extension */ virtualshape_extension_init (db); +/* initializing the VirtualDbf extension */ + virtualdbf_extension_init (db); /* initializing the VirtualText extension */ virtualtext_extension_init (db); +#endif /* ICONV enabled/disabled */ + /* initializing the VirtualNetwork extension */ virtualnetwork_extension_init (db); /* initializing the MbrCache extension */ @@ -44972,9 +43789,12 @@ sqlite3_extension_init (sqlite3 * db, char **pzErrMsg, printf ("SpatiaLite version ..: %s", spatialite_version ()); printf ("\tSupported Extensions:\n"); +#if OMIT_ICONV == 0 /* ICONV is required by SHP/DBF/TXT */ printf ("\t- 'VirtualShape'\t[direct Shapefile access]\n"); + printf ("\t- 'VirtualDbf'\t\t[direct Dbf access]\n"); printf ("\t- 'VirtualText'\t\t[direct CSV/TXT access]\n"); - printf ("\t- 'VirtualNetwork\t[Dijkstra shortest path]\n"); +#endif /* end ICONV conditional */ + printf ("\t- 'VirtualNetwork'\t[Dijkstra shortest path]\n"); printf ("\t- 'RTree'\t\t[Spatial Index - R*Tree]\n"); printf ("\t- 'MbrCache'\t\t[Spatial Index - MBR cache]\n"); printf ("\t- 'VirtualFDO'\t\t[FDO-OGR interoperability]\n"); @@ -45011,15 +43831,29 @@ math_round (double value) /**************** Begin file: mbrcache.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ /* #include */ +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ /* #include */ +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif /* not WIN32 */ + #if defined(_WIN32) && !defined(__MINGW32__) #define LONG64_MAX _I64_MAX #define LONG64_MIN _I64_MIN @@ -45249,8 +44083,27 @@ cache_bitmask (int x) return 0x00000000; } +static void +mbrc_double_quoted_sql (char *buf) +{ +/* well-formatting a string to be used as an SQL name */ + char tmp[1024]; + char *in = tmp; + char *out = buf; + strcpy (tmp, buf); + *out++ = '"'; + while (*in != '\0') + { + if (*in == '"') + *out++ = '"'; + *out++ = *in++; + } + *out++ = '"'; + *out = '\0'; +} + static struct mbr_cache * -cache_alloc () +cache_alloc (void) { /* allocates and initializes an empty cache struct */ struct mbr_cache *p = malloc (sizeof (struct mbr_cache)); @@ -45261,7 +44114,7 @@ cache_alloc () } static struct mbr_cache_page * -cache_page_alloc () +cache_page_alloc (void) { /* allocates and initializes a cache page */ int i; @@ -45450,9 +44303,15 @@ retrieving any existing entity from the main table int v4; int v5; struct mbr_cache *p_cache; + char xcolumn[1024]; + char xtable[1024]; + strcpy (xcolumn, column); + mbrc_double_quoted_sql (xcolumn); + strcpy (xtable, table); + mbrc_double_quoted_sql (xtable); sprintf (sql, - "SELECT ROWID, MbrMinX(\"%s\"), MbrMinY(\"%s\"), MbrMaxX(\"%s\"), MbrMaxY(\"%s\") FROM \"%s\"", - column, column, column, column, table); + "SELECT ROWID, MbrMinX(%s), MbrMinY(%s), MbrMaxX(%s), MbrMaxY(%s) FROM %s", + xcolumn, xcolumn, xcolumn, xcolumn, xtable); ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL); if (ret != SQLITE_OK) { @@ -45826,6 +44685,7 @@ mbrc_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, int ok_tbl; int ok_col; MbrCachePtr p_vt; + char xname[1024]; if (pAux) pAux = pAux; /* unused arg warning suppression */ p_vt = (MbrCachePtr) sqlite3_malloc (sizeof (MbrCache)); @@ -45863,7 +44723,9 @@ mbrc_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, err = 0; ok_tbl = 0; ok_col = 0; - sprintf (sql, "PRAGMA table_info(\"%s\")", table); + strcpy (xname, table); + mbrc_double_quoted_sql (xname); + sprintf (sql, "PRAGMA table_info(%s)", xname); ret = sqlite3_get_table (db, sql, &results, &n_rows, &n_columns, &err_msg); if (ret != SQLITE_OK) { @@ -45889,8 +44751,9 @@ mbrc_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, if (err) { /* something is going the wrong way; creating a stupid default table */ - sprintf (sql, "CREATE TABLE \"%s\" (\"rowid\" INTEGER, \"mbr\" BLOB)", - vtable); + strcpy (xname, vtable); + mbrc_double_quoted_sql (xname); + sprintf (sql, "CREATE TABLE %s (rowid INTEGER, mbr BLOB)", xname); if (sqlite3_declare_vtab (db, sql) != SQLITE_OK) { *pzErr = @@ -45903,8 +44766,10 @@ mbrc_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, return SQLITE_OK; } p_vt->error = 0; - sprintf (sql, "CREATE TABLE \"%s\" (", vtable); - strcat (sql, "\"rowid\" INTEGER, \"mbr\" BLOB)"); + strcpy (xname, vtable); + mbrc_double_quoted_sql (xname); + sprintf (sql, "CREATE TABLE %s (", xname); + strcat (sql, "rowid INTEGER, mbr BLOB)"); if (sqlite3_declare_vtab (db, sql) != SQLITE_OK) { *pzErr = @@ -46429,14 +45294,31 @@ mbrcache_extension_init (sqlite3 * db) /**************** Begin file: virtualshape.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ + +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif /* not WIN32 */ + +#if OMIT_ICONV == 0 /* if ICONV is disabled no SHP support is available */ + static struct sqlite3_module my_shape_module; typedef struct VirtualShapeStruct @@ -46462,6 +45344,25 @@ typedef struct VirtualShapeCursorStruct } VirtualShapeCursor; typedef VirtualShapeCursor *VirtualShapeCursorPtr; +static void +vshp_double_quoted_sql (char *buf) +{ +/* well-formatting a string to be used as an SQL name */ + char tmp[1024]; + char *in = tmp; + char *out = buf; + strcpy (tmp, buf); + *out++ = '"'; + while (*in != '\0') + { + if (*in == '"') + *out++ = '"'; + *out++ = *in++; + } + *out++ = '"'; + *out = '\0'; +} + static int vshp_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, sqlite3_vtab ** ppVTab, char **pzErr) @@ -46539,8 +45440,10 @@ vshp_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, if (!(p_vt->Shp->Valid)) { /* something is going the wrong way; creating a stupid default table */ + strcpy (dummyName, argv[2]); + vshp_double_quoted_sql (dummyName); sprintf (buf, "CREATE TABLE %s (PKUID INTEGER, Geometry BLOB)", - argv[1]); + dummyName); if (sqlite3_declare_vtab (db, buf) != SQLITE_OK) { *pzErr = @@ -46560,7 +45463,9 @@ vshp_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, } /* preparing the COLUMNs for this VIRTUAL TABLE */ strcpy (buf, "CREATE TABLE "); - strcat (buf, argv[2]); + strcpy (dummyName, argv[2]); + vshp_double_quoted_sql (dummyName); + strcat (buf, dummyName); strcat (buf, " (PKUID INTEGER, Geometry BLOB"); /* checking for duplicate / illegal column names and antialising them */ col_cnt = 0; @@ -46577,7 +45482,8 @@ vshp_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, pFld = p_vt->Shp->Dbf->First; while (pFld) { - sprintf (dummyName, "\"%s\"", pFld->Name); + sprintf (dummyName, "%s", pFld->Name); + vshp_double_quoted_sql (dummyName); dup = 0; for (idup = 0; idup < cnt; idup++) { @@ -46589,7 +45495,10 @@ vshp_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, if (strcasecmp (dummyName, "Geometry") == 0) dup = 1; if (dup) - sprintf (dummyName, "COL_%d", seed++); + { + sprintf (dummyName, "COL_%d", seed++); + vshp_double_quoted_sql (dummyName); + } if (pFld->Type == 'N') { if (pFld->Decimals > 0 || pFld->Length > 18) @@ -46913,22 +45822,548 @@ virtualshape_extension_init (sqlite3 * db) { return sqlite3VirtualShapeInit (db); } + +#endif /* ICONV enabled/disabled */ + /**************** End file: virtualshape.c **********/ -/**************** Begin file: virtualnetwork.c **********/ +/**************** Begin file: virtualdbf.c **********/ + +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif /* #include */ /* #include */ /* #include */ -/* #include */ + +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + +/* #include */ +/* #include */ +/* #include */ + +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif /* not WIN32 */ + +#if OMIT_ICONV == 0 /* if ICONV is disabled no DBF support is available */ + +static struct sqlite3_module my_dbf_module; + +typedef struct VirtualDbfStruct +{ +/* extends the sqlite3_vtab struct */ + const sqlite3_module *pModule; /* ptr to sqlite module: USED INTERNALLY BY SQLITE */ + int nRef; /* # references: USED INTERNALLY BY SQLITE */ + char *zErrMsg; /* error message: USE INTERNALLY BY SQLITE */ + sqlite3 *db; /* the sqlite db holding the virtual table */ + gaiaDbfPtr dbf; /* the DBF struct */ +} VirtualDbf; +typedef VirtualDbf *VirtualDbfPtr; + +typedef struct VirtualDbfCursorStruct +{ +/* extends the sqlite3_vtab_cursor struct */ + VirtualDbfPtr pVtab; /* Virtual table of this cursor */ + long current_row; /* the current row ID */ + int eof; /* the EOF marker */ +} VirtualDbfCursor; +typedef VirtualDbfCursor *VirtualDbfCursorPtr; + +static void +vdbf_double_quoted_sql (char *buf) +{ +/* well-formatting a string to be used as an SQL name */ + char tmp[1024]; + char *in = tmp; + char *out = buf; + strcpy (tmp, buf); + *out++ = '"'; + while (*in != '\0') + { + if (*in == '"') + *out++ = '"'; + *out++ = *in++; + } + *out++ = '"'; + *out = '\0'; +} + +static int +vdbf_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, + sqlite3_vtab ** ppVTab, char **pzErr) +{ +/* creates the virtual table connected to some DBF */ + char buf[4096]; + char field[128]; + VirtualDbfPtr p_vt; + char path[2048]; + char encoding[128]; + const char *pEncoding = NULL; + int len; + const char *pPath = NULL; + gaiaDbfFieldPtr pFld; + int cnt; + int col_cnt; + int seed; + int dup; + int idup; + char dummyName[4096]; + char **col_name = NULL; + if (pAux) + pAux = pAux; /* unused arg warning suppression */ +/* checking for DBF PATH */ + if (argc == 5) + { + pPath = argv[3]; + len = strlen (pPath); + if ((*(pPath + 0) == '\'' || *(pPath + 0) == '"') + && (*(pPath + len - 1) == '\'' || *(pPath + len - 1) == '"')) + { + /* the path is enclosed between quotes - we need to dequote it */ + strcpy (path, pPath + 1); + len = strlen (path); + *(path + len - 1) = '\0'; + } + else + strcpy (path, pPath); + pEncoding = argv[4]; + len = strlen (pEncoding); + if ((*(pEncoding + 0) == '\'' || *(pEncoding + 0) == '"') + && (*(pEncoding + len - 1) == '\'' + || *(pEncoding + len - 1) == '"')) + { + /* the charset-name is enclosed between quotes - we need to dequote it */ + strcpy (encoding, pEncoding + 1); + len = strlen (encoding); + *(encoding + len - 1) = '\0'; + } + else + strcpy (encoding, pEncoding); + } + else + { + *pzErr = + sqlite3_mprintf + ("[VirtualDbf module] CREATE VIRTUAL: illegal arg list {dbf_path, encoding}"); + return SQLITE_ERROR; + } + p_vt = (VirtualDbfPtr) sqlite3_malloc (sizeof (VirtualDbf)); + if (!p_vt) + return SQLITE_NOMEM; + p_vt->pModule = &my_dbf_module; + p_vt->nRef = 0; + p_vt->zErrMsg = NULL; + p_vt->db = db; + p_vt->dbf = gaiaAllocDbf (); +/* trying to open file */ + gaiaOpenDbfRead (p_vt->dbf, path, encoding, "UTF-8"); + if (!(p_vt->dbf->Valid)) + { + /* something is going the wrong way; creating a stupid default table */ + strcpy (dummyName, argv[2]); + vdbf_double_quoted_sql (dummyName); + sprintf (buf, "CREATE TABLE %s (PKUID INTEGER)", dummyName); + if (sqlite3_declare_vtab (db, buf) != SQLITE_OK) + { + *pzErr = + sqlite3_mprintf + ("[VirtualDbf module] cannot build a table from DBF\n"); + return SQLITE_ERROR; + } + *ppVTab = (sqlite3_vtab *) p_vt; + return SQLITE_OK; + } +/* preparing the COLUMNs for this VIRTUAL TABLE */ + strcpy (buf, "CREATE TABLE "); + strcpy (dummyName, argv[2]); + vdbf_double_quoted_sql (dummyName); + strcat (buf, dummyName); + strcat (buf, " (PKUID INTEGER"); +/* checking for duplicate / illegal column names and antialising them */ + col_cnt = 0; + pFld = p_vt->dbf->Dbf->First; + while (pFld) + { + /* counting DBF fields */ + col_cnt++; + pFld = pFld->Next; + } + col_name = malloc (sizeof (char *) * col_cnt); + cnt = 0; + seed = 0; + pFld = p_vt->dbf->Dbf->First; + while (pFld) + { + sprintf (dummyName, "%s", pFld->Name); + vdbf_double_quoted_sql (dummyName); + dup = 0; + for (idup = 0; idup < cnt; idup++) + { + if (strcasecmp (dummyName, *(col_name + idup)) == 0) + dup = 1; + } + if (strcasecmp (dummyName, "PKUID") == 0) + dup = 1; + if (dup) + { + sprintf (dummyName, "COL_%d", seed++); + vdbf_double_quoted_sql (dummyName); + } + if (pFld->Type == 'N') + { + if (pFld->Decimals > 0 || pFld->Length > 18) + sprintf (field, "%s DOUBLE", dummyName); + else + sprintf (field, "%s INTEGER", dummyName); + } + else if (pFld->Type == 'F') + sprintf (field, "%s DOUBLE", dummyName); + else + sprintf (field, "%s VARCHAR(%d)", dummyName, pFld->Length); + strcat (buf, ", "); + strcat (buf, field); + len = strlen (dummyName); + *(col_name + cnt) = malloc (len + 1); + strcpy (*(col_name + cnt), dummyName); + cnt++; + pFld = pFld->Next; + } + strcat (buf, ")"); + if (col_name) + { + /* releasing memory allocation for column names */ + for (cnt = 0; cnt < col_cnt; cnt++) + free (*(col_name + cnt)); + free (col_name); + } + if (sqlite3_declare_vtab (db, buf) != SQLITE_OK) + { + *pzErr = + sqlite3_mprintf + ("[VirtualDbf module] CREATE VIRTUAL: invalid SQL statement \"%s\"", + buf); + return SQLITE_ERROR; + } + *ppVTab = (sqlite3_vtab *) p_vt; + return SQLITE_OK; +} + +static int +vdbf_connect (sqlite3 * db, void *pAux, int argc, const char *const *argv, + sqlite3_vtab ** ppVTab, char **pzErr) +{ +/* connects the virtual table to some DBF - simply aliases vdbf_create() */ + return vdbf_create (db, pAux, argc, argv, ppVTab, pzErr); +} + +static int +vdbf_best_index (sqlite3_vtab * pVTab, sqlite3_index_info * pIndex) +{ +/* best index selection */ + if (pVTab || pIndex) + pVTab = pVTab; /* unused arg warning suppression */ + return SQLITE_OK; +} + +static int +vdbf_disconnect (sqlite3_vtab * pVTab) +{ +/* disconnects the virtual table */ + VirtualDbfPtr p_vt = (VirtualDbfPtr) pVTab; + if (p_vt->dbf) + gaiaFreeDbf (p_vt->dbf); + sqlite3_free (p_vt); + return SQLITE_OK; +} + +static int +vdbf_destroy (sqlite3_vtab * pVTab) +{ +/* destroys the virtual table - simply aliases vdbf_disconnect() */ + return vdbf_disconnect (pVTab); +} + +static void +vdbf_read_row (VirtualDbfCursorPtr cursor, int *deleted_row) +{ +/* trying to read a "row" from DBF */ + int ret; + int deleted; + if (!(cursor->pVtab->dbf->Valid)) + { + cursor->eof = 1; + return; + } + ret = gaiaReadDbfEntity (cursor->pVtab->dbf, cursor->current_row, &deleted); + if (!ret) + { + if (!(cursor->pVtab->dbf->LastError)) /* normal DBF EOF */ + { + cursor->eof = 1; + return; + } + /* an error occurred */ + fprintf (stderr, "%s\n", cursor->pVtab->dbf->LastError); + cursor->eof = 1; + return; + } + cursor->current_row++; + *deleted_row = deleted; +} + +static int +vdbf_open (sqlite3_vtab * pVTab, sqlite3_vtab_cursor ** ppCursor) +{ +/* opening a new cursor */ + int deleted; + VirtualDbfCursorPtr cursor = + (VirtualDbfCursorPtr) sqlite3_malloc (sizeof (VirtualDbfCursor)); + if (cursor == NULL) + return SQLITE_ERROR; + cursor->pVtab = (VirtualDbfPtr) pVTab; + cursor->current_row = 0; + cursor->eof = 0; + *ppCursor = (sqlite3_vtab_cursor *) cursor; + while (1) + { + vdbf_read_row (cursor, &deleted); + if (!deleted) + break; + if (cursor->eof) + break; + } + return SQLITE_OK; +} + +static int +vdbf_close (sqlite3_vtab_cursor * pCursor) +{ +/* closing the cursor */ + sqlite3_free (pCursor); + return SQLITE_OK; +} + +static int +vdbf_filter (sqlite3_vtab_cursor * pCursor, int idxNum, const char *idxStr, + int argc, sqlite3_value ** argv) +{ +/* setting up a cursor filter */ + if (pCursor || idxNum || idxStr || argc || argv) + pCursor = pCursor; /* unused arg warning suppression */ + return SQLITE_OK; +} + +static int +vdbf_next (sqlite3_vtab_cursor * pCursor) +{ +/* fetching a next row from cursor */ + int deleted; + VirtualDbfCursorPtr cursor = (VirtualDbfCursorPtr) pCursor; + while (1) + { + vdbf_read_row (cursor, &deleted); + if (!deleted) + break; + if (cursor->eof) + break; + } + return SQLITE_OK; +} + +static int +vdbf_eof (sqlite3_vtab_cursor * pCursor) +{ +/* cursor EOF */ + VirtualDbfCursorPtr cursor = (VirtualDbfCursorPtr) pCursor; + return cursor->eof; +} + +static int +vdbf_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, + int column) +{ +/* fetching value for the Nth column */ + int nCol = 1; + gaiaDbfFieldPtr pFld; + VirtualDbfCursorPtr cursor = (VirtualDbfCursorPtr) pCursor; + if (column == 0) + { + /* the PRIMARY KEY column */ + sqlite3_result_int (pContext, cursor->current_row); + return SQLITE_OK; + } + pFld = cursor->pVtab->dbf->Dbf->First; + while (pFld) + { + /* column values */ + if (nCol == column) + { + if (!(pFld->Value)) + sqlite3_result_null (pContext); + else + { + switch (pFld->Value->Type) + { + case GAIA_INT_VALUE: + sqlite3_result_int64 (pContext, + pFld->Value->IntValue); + break; + case GAIA_DOUBLE_VALUE: + sqlite3_result_double (pContext, + pFld->Value->DblValue); + break; + case GAIA_TEXT_VALUE: + sqlite3_result_text (pContext, + pFld->Value->TxtValue, + strlen (pFld->Value->TxtValue), + SQLITE_STATIC); + break; + default: + sqlite3_result_null (pContext); + break; + } + } + break; + } + nCol++; + pFld = pFld->Next; + } + return SQLITE_OK; +} + +static int +vdbf_rowid (sqlite3_vtab_cursor * pCursor, sqlite_int64 * pRowid) +{ +/* fetching the ROWID */ + VirtualDbfCursorPtr cursor = (VirtualDbfCursorPtr) pCursor; + *pRowid = cursor->current_row; + return SQLITE_OK; +} + +static int +vdbf_update (sqlite3_vtab * pVTab, int argc, sqlite3_value ** argv, + sqlite_int64 * pRowid) +{ +/* generic update [INSERT / UPDATE / DELETE */ + if (pVTab || argc || argv || pRowid) + pVTab = pVTab; /* unused arg warning suppression */ + return SQLITE_READONLY; +} + +static int +vdbf_begin (sqlite3_vtab * pVTab) +{ +/* BEGIN TRANSACTION */ + if (pVTab) + pVTab = pVTab; /* unused arg warning suppression */ + return SQLITE_OK; +} + +static int +vdbf_sync (sqlite3_vtab * pVTab) +{ +/* BEGIN TRANSACTION */ + if (pVTab) + pVTab = pVTab; /* unused arg warning suppression */ + return SQLITE_OK; +} + +static int +vdbf_commit (sqlite3_vtab * pVTab) +{ +/* BEGIN TRANSACTION */ + if (pVTab) + pVTab = pVTab; /* unused arg warning suppression */ + return SQLITE_OK; +} + +static int +vdbf_rollback (sqlite3_vtab * pVTab) +{ +/* BEGIN TRANSACTION */ + if (pVTab) + pVTab = pVTab; /* unused arg warning suppression */ + return SQLITE_OK; +} + +int +sqlite3VirtualDbfInit (sqlite3 * db) +{ + int rc = SQLITE_OK; + my_dbf_module.iVersion = 1; + my_dbf_module.xCreate = &vdbf_create; + my_dbf_module.xConnect = &vdbf_connect; + my_dbf_module.xBestIndex = &vdbf_best_index; + my_dbf_module.xDisconnect = &vdbf_disconnect; + my_dbf_module.xDestroy = &vdbf_destroy; + my_dbf_module.xOpen = &vdbf_open; + my_dbf_module.xClose = &vdbf_close; + my_dbf_module.xFilter = &vdbf_filter; + my_dbf_module.xNext = &vdbf_next; + my_dbf_module.xEof = &vdbf_eof; + my_dbf_module.xColumn = &vdbf_column; + my_dbf_module.xRowid = &vdbf_rowid; + my_dbf_module.xUpdate = &vdbf_update; + my_dbf_module.xBegin = &vdbf_begin; + my_dbf_module.xSync = &vdbf_sync; + my_dbf_module.xCommit = &vdbf_commit; + my_dbf_module.xRollback = &vdbf_rollback; + my_dbf_module.xFindFunction = NULL; + sqlite3_create_module_v2 (db, "VirtualDbf", &my_dbf_module, NULL, 0); + return rc; +} + +int +virtualdbf_extension_init (sqlite3 * db) +{ + return sqlite3VirtualDbfInit (db); +} + +#endif /* ICONV enabled/disabled */ + +/**************** End file: virtualdbf.c **********/ + + +/**************** Begin file: virtualnetwork.c **********/ + +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ +/* #include */ +#else +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ static struct sqlite3_module my_net_module; +#define VNET_DIJKSTRA_ALGORITHM 1 +#define VNET_A_STAR_ALGORITHM 2 + +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif /* not WIN32 */ + /****************************************************************************** / / VirtualNetwork structs @@ -46951,6 +46386,8 @@ typedef struct NetworkNodeStruct int InternalIndex; sqlite3_int64 Id; char *Code; + double CoordX; + double CoordY; int NumArcs; NetworkArcPtr Arcs; } NetworkNode; @@ -46960,6 +46397,7 @@ typedef struct NetworkStruct { /* the main NETWORK structure */ int Net64; + int AStar; int EndianArch; int MaxCodeLength; int CurrentIndex; @@ -46970,6 +46408,7 @@ typedef struct NetworkStruct char *ToColumn; char *GeometryColumn; char *NameColumn; + double AStarHeuristicCoeff; NetworkNodePtr Nodes; } Network; typedef Network *NetworkPtr; @@ -46993,7 +46432,7 @@ typedef ArcSolution *ArcSolutionPtr; typedef struct RowSolutionStruct { -/* a row into the Dijkstra shortest path solution */ +/* a row into the shortest path solution */ NetworkArcPtr Arc; char *Name; struct RowSolutionStruct *Next; @@ -47003,7 +46442,7 @@ typedef RowSolution *RowSolutionPtr; typedef struct SolutionStruct { -/* the Dijkstra shortest path solution */ +/* the shortest path solution */ ArcSolutionPtr FirstArc; ArcSolutionPtr LastArc; NetworkNodePtr From; @@ -47019,38 +46458,41 @@ typedef Solution *SolutionPtr; /****************************************************************************** / -/ Dijkstra structs +/ Dijkstra and A* common structs / ******************************************************************************/ -typedef struct DijkstraNode +typedef struct RoutingNode { - sqlite3_int64 Id; - struct DijkstraNode **To; + int Id; + struct RoutingNode **To; NetworkArcPtr *Link; int DimTo; - struct DijkstraNode *PreviousNode; + struct RoutingNode *PreviousNode; NetworkArcPtr Arc; double Distance; - int Value; -} DijkstraNode; -typedef DijkstraNode *DijkstraNodePtr; + double HeuristicDistance; + int Inspected; +} RoutingNode; +typedef RoutingNode *RoutingNodePtr; -typedef struct DijkstraNodes +typedef struct RoutingNodes { - DijkstraNodePtr Nodes; + RoutingNodePtr Nodes; + NetworkArcPtr *ArcsBuffer; + RoutingNodePtr *NodesBuffer; int Dim; int DimLink; -} DijkstraNodes; -typedef DijkstraNodes *DijkstraNodesPtr; +} RoutingNodes; +typedef RoutingNodes *RoutingNodesPtr; -typedef struct DjikstraHeapStruct +typedef struct RoutingHeapStruct { - DijkstraNodePtr *Values; + RoutingNodePtr *Values; int Head; int Tail; -} DijkstraHeap; -typedef DijkstraHeap *DijkstraHeapPtr; +} RoutingHeap; +typedef RoutingHeap *RoutingHeapPtr; /****************************************************************************** / @@ -47066,6 +46508,8 @@ typedef struct VirtualNetworkStruct char *zErrMsg; /* error message: USE INTERNALLY BY SQLITE */ sqlite3 *db; /* the sqlite db holding the virtual table */ NetworkPtr graph; /* the NETWORK structure */ + RoutingNodesPtr routing; /* the ROUTING structure */ + int currentAlgorithm; /* the currently selected Shortest Path Algorithm */ } VirtualNetwork; typedef VirtualNetwork *VirtualNetworkPtr; @@ -47089,141 +46533,149 @@ typedef VirtualNetworkCursor *VirtualNetworkCursorPtr; / */ -static DijkstraNodesPtr -dijkstra_init (NetworkPtr graph) +static RoutingNodesPtr +routing_init (NetworkPtr graph) { -/* allocating and initializing the Dijkstra struct */ +/* allocating and initializing the ROUTING struct */ int i; int j; - DijkstraNodesPtr nd; + int cnt = 0; + RoutingNodesPtr nd; + RoutingNodePtr ndn; NetworkNodePtr nn; /* allocating the main Nodes struct */ - nd = malloc (sizeof (DijkstraNodes)); + nd = malloc (sizeof (RoutingNodes)); /* allocating and initializing Nodes array */ - nd->Nodes = malloc (sizeof (DijkstraNode) * graph->NumNodes); + nd->Nodes = malloc (sizeof (RoutingNode) * graph->NumNodes); nd->Dim = graph->NumNodes; nd->DimLink = 0; + +/* pre-alloc buffer strategy - GENSCHER 2010-01-05 */ + for (i = 0; i < graph->NumNodes; cnt += graph->Nodes[i].NumArcs, i++); + nd->NodesBuffer = malloc (sizeof (RoutingNodePtr) * cnt); + nd->ArcsBuffer = malloc (sizeof (NetworkArcPtr) * cnt); + + cnt = 0; for (i = 0; i < graph->NumNodes; i++) { /* initializing the Nodes array */ nn = graph->Nodes + i; - nd->Nodes[i].Id = nn->InternalIndex; - nd->Nodes[i].DimTo = nn->NumArcs; - nd->Nodes[i].To = malloc (sizeof (DijkstraNodePtr) * nn->NumArcs); - nd->Nodes[i].Link = malloc (sizeof (NetworkArcPtr) * nn->NumArcs); + ndn = nd->Nodes + i; + ndn->Id = nn->InternalIndex; + ndn->DimTo = nn->NumArcs; + ndn->To = &(nd->NodesBuffer[cnt]); + ndn->Link = &(nd->ArcsBuffer[cnt]); + cnt += nn->NumArcs; + for (j = 0; j < nn->NumArcs; j++) { /* setting the outcoming Arcs for the current Node */ nd->DimLink++; - nd->Nodes[i].To[j] = - nd->Nodes + nn->Arcs[j].NodeTo->InternalIndex; - nd->Nodes[i].Link[j] = nn->Arcs + j; + ndn->To[j] = nd->Nodes + nn->Arcs[j].NodeTo->InternalIndex; + ndn->Link[j] = nn->Arcs + j; } } return (nd); } static void -dijkstra_free (DijkstraNodes * e) +routing_free (RoutingNodes * e) { -/* memory cleanup; freeing the Dijkstra struct */ - int i; - for (i = 0; i < e->Dim; i++) - { - if (e->Nodes[i].DimTo != 0) - { - free (e->Nodes[i].Link); - free (e->Nodes[i].To); - } - } +/* memory cleanup; freeing the ROUTING struct */ + free (e->ArcsBuffer); + free (e->NodesBuffer); free (e->Nodes); free (e); } -static DijkstraHeapPtr -dijkstra_heap_init (int dim) +static RoutingHeapPtr +routing_heap_init (int dim) { /* allocating the Nodes ordered list */ - DijkstraHeapPtr h; - h = malloc (sizeof (DijkstraHeap)); - h->Values = malloc (sizeof (DijkstraNodePtr) * dim); + RoutingHeapPtr h; + h = malloc (sizeof (RoutingHeap)); + h->Values = malloc (sizeof (RoutingNodePtr) * dim); h->Head = 0; h->Tail = 0; return (h); } static void -dijkstra_heap_free (DijkstraHeapPtr h) +routing_heap_free (RoutingHeapPtr h) { /* freeing the Nodes ordered list */ free (h->Values); free (h); } -static int -dijkstra_compare (const void *a, const void *b) -{ -/* comparison function for QSORT */ - DijkstraNodePtr *na = (DijkstraNodePtr *) a; - DijkstraNodePtr *nb = (DijkstraNodePtr *) b; - if ((*na)->Distance == (*nb)->Distance) - return 0; - if ((*na)->Distance > (*nb)->Distance) - return 1; - return -1; -} - static void -dijkstra_push (DijkstraHeapPtr h, DijkstraNodePtr n) +routing_push (RoutingHeapPtr h, RoutingNodePtr n) { -/* inserting a Node into the ordered list */ +/* inserting a Node into the list */ h->Values[h->Tail] = n; h->Tail++; } -static DijkstraNodePtr -dijkstra_pop (DijkstraHeapPtr h) +static RoutingNodePtr +dijkstra_pop (RoutingHeapPtr h) { -/* fetching the minimum value from the ordered list */ - DijkstraNodePtr n; - qsort (h-> - Values + - h->Head, - h->Tail - h->Head, sizeof (DijkstraNodePtr), dijkstra_compare); +/* fetching the minimum value */ + int i; + RoutingNodePtr n; + double min = DBL_MAX; + int i_min = h->Head; + for (i = h->Head; i < h->Tail; i++) + { + n = h->Values[i]; + if (n->Distance < min) + { + min = n->Distance; + i_min = i; + } + } + if (i_min > h->Head) + { + n = h->Values[i_min]; + h->Values[i_min] = h->Values[h->Head]; + h->Values[h->Head] = n; + } n = h->Values[h->Head]; h->Head++; return (n); } static NetworkArcPtr * -dijkstra_shortest_path (DijkstraNodesPtr e, NetworkNodePtr pfrom, +dijkstra_shortest_path (RoutingNodesPtr e, NetworkNodePtr pfrom, NetworkNodePtr pto, int *ll) { -/* identifying the Shortest Path */ +/* identifying the Shortest Path - Dijkstra's algorithm */ int from; int to; int i; int k; - DijkstraNodePtr n; + RoutingNodePtr n; + RoutingNodePtr p_to; + NetworkArcPtr p_link; int cnt; NetworkArcPtr *result; - DijkstraHeapPtr h; + RoutingHeapPtr h; /* setting From/To */ from = pfrom->InternalIndex; to = pto->InternalIndex; /* initializing the heap */ - h = dijkstra_heap_init (e->DimLink); + h = routing_heap_init (e->DimLink); /* initializing the graph */ for (i = 0; i < e->Dim; i++) { - e->Nodes[i].PreviousNode = NULL; - e->Nodes[i].Arc = NULL; - e->Nodes[i].Value = 0; - e->Nodes[i].Distance = DBL_MAX; + n = e->Nodes + i; + n->PreviousNode = NULL; + n->Arc = NULL; + n->Inspected = 0; + n->Distance = DBL_MAX; } /* pushes the From node into the Nodes list */ e->Nodes[from].Distance = 0.0; - dijkstra_push (h, e->Nodes + from); + routing_push (h, e->Nodes + from); while (h->Tail != h->Head) { /* Dijsktra loop */ @@ -47233,22 +46685,32 @@ dijkstra_shortest_path (DijkstraNodesPtr e, NetworkNodePtr pfrom, /* destination reached */ break; } - n->Value = 1; + n->Inspected = 1; for (i = 0; i < n->DimTo; i++) { - if (n->To[i]->Value == 0) + p_to = *(n->To + i); + p_link = *(n->Link + i); + if (p_to->Inspected == 0) { - if (n->To[i]->Distance > n->Distance + n->Link[i]->Cost) + if (p_to->Distance == DBL_MAX) { - n->To[i]->Distance = n->Distance + n->Link[i]->Cost; - n->To[i]->PreviousNode = n; - n->To[i]->Arc = n->Link[i]; - dijkstra_push (h, n->To[i]); + /* inserting a new node into the list */ + p_to->Distance = n->Distance + p_link->Cost; + p_to->PreviousNode = n; + p_to->Arc = p_link; + routing_push (h, p_to); + } + else if (p_to->Distance > n->Distance + p_link->Cost) + { + /* updating an already inserted node */ + p_to->Distance = n->Distance + p_link->Cost; + p_to->PreviousNode = n; + p_to->Arc = p_link; } } } } - dijkstra_heap_free (h); + routing_heap_free (h); cnt = 0; n = e->Nodes + to; while (n->PreviousNode != NULL) @@ -47274,6 +46736,224 @@ dijkstra_shortest_path (DijkstraNodesPtr e, NetworkNodePtr pfrom, /* END of Luigi Costalli Dijkstra Shortest Path implementation */ +/* +/ +/ implementation of the A* Shortest Path algorithm +/ +*/ + +static RoutingNodePtr +a_star_pop (RoutingHeapPtr h) +{ +/* fetching the minimum value */ + int i; + RoutingNodePtr n; + double min = DBL_MAX; + int i_min = h->Head; + for (i = h->Head; i < h->Tail; i++) + { + n = h->Values[i]; + if (n->HeuristicDistance < min) + { + min = n->HeuristicDistance; + i_min = i; + } + } + if (i_min > h->Head) + { + n = h->Values[i_min]; + h->Values[i_min] = h->Values[h->Head]; + h->Values[h->Head] = n; + } + n = h->Values[h->Head]; + h->Head++; + return (n); +} + +static double +a_star_heuristic_distance (NetworkNodePtr n1, NetworkNodePtr n2, double coeff) +{ +/* computing the euclidean distance intercurring between two nodes */ + double dx = n1->CoordX - n2->CoordX; + double dy = n1->CoordY - n2->CoordY; + double dist = sqrt ((dx * dx) + (dy * dy)) * coeff; + return dist; +} + +static NetworkArcPtr * +a_star_shortest_path (RoutingNodesPtr e, NetworkNodePtr nodes, + NetworkNodePtr pfrom, NetworkNodePtr pto, + double heuristic_coeff, int *ll) +{ +/* identifying the Shortest Path - A* algorithm */ + int from; + int to; + int i; + int k; + RoutingNodePtr pAux; + RoutingNodePtr n; + RoutingNodePtr p_to; + NetworkNodePtr pOrg; + NetworkNodePtr pDest; + NetworkArcPtr p_link; + int cnt; + NetworkArcPtr *result; + RoutingHeapPtr h; +/* setting From/To */ + from = pfrom->InternalIndex; + to = pto->InternalIndex; + pAux = e->Nodes + from; + pOrg = nodes + pAux->Id; + pAux = e->Nodes + to; + pDest = nodes + pAux->Id; +/* initializing the heap */ + h = routing_heap_init (e->DimLink); +/* initializing the graph */ + for (i = 0; i < e->Dim; i++) + { + n = e->Nodes + i; + n->PreviousNode = NULL; + n->Arc = NULL; + n->Inspected = 0; + n->Distance = DBL_MAX; + n->HeuristicDistance = DBL_MAX; + } +/* pushes the From node into the Nodes list */ + e->Nodes[from].Distance = 0.0; + e->Nodes[from].HeuristicDistance = + a_star_heuristic_distance (pOrg, pDest, heuristic_coeff); + routing_push (h, e->Nodes + from); + while (h->Tail != h->Head) + { + /* A* loop */ + n = a_star_pop (h); + if (n->Id == to) + { + /* destination reached */ + break; + } + n->Inspected = 1; + for (i = 0; i < n->DimTo; i++) + { + p_to = *(n->To + i); + p_link = *(n->Link + i); + if (p_to->Inspected == 0) + { + if (p_to->Distance == DBL_MAX) + { + /* inserting a new node into the list */ + p_to->Distance = n->Distance + p_link->Cost; + pOrg = nodes + p_to->Id; + p_to->HeuristicDistance = + p_to->Distance + + a_star_heuristic_distance (pOrg, pDest, + heuristic_coeff); + p_to->PreviousNode = n; + p_to->Arc = p_link; + routing_push (h, p_to); + } + else if (p_to->Distance > n->Distance + p_link->Cost) + { + /* updating an already inserted node */ + p_to->Distance = n->Distance + p_link->Cost; + pOrg = nodes + p_to->Id; + p_to->HeuristicDistance = + p_to->Distance + + a_star_heuristic_distance (pOrg, pDest, + heuristic_coeff); + p_to->PreviousNode = n; + p_to->Arc = p_link; + } + } + } + } + routing_heap_free (h); + cnt = 0; + n = e->Nodes + to; + while (n->PreviousNode != NULL) + { + /* counting how many Arcs are into the Shortest Path solution */ + cnt++; + n = n->PreviousNode; + } +/* allocating the solution */ + result = malloc (sizeof (NetworkArcPtr) * cnt); + k = cnt - 1; + n = e->Nodes + to; + while (n->PreviousNode != NULL) + { + /* inserting an Arc into the solution */ + result[k] = n->Arc; + n = n->PreviousNode; + k--; + } + *ll = cnt; + return (result); +} + +/* END of A* Shortest Path implementation */ + +static void +vnet_double_quoted_sql (char *buf) +{ +/* well-formatting a string to be used as an SQL name */ + char tmp[1024]; + char *in = tmp; + char *out = buf; + strcpy (tmp, buf); + *out++ = '"'; + while (*in != '\0') + { + if (*in == '"') + *out++ = '"'; + *out++ = *in++; + } + *out++ = '"'; + *out = '\0'; +} + +static void +vnet_dequote (char *buf) +{ +/* dequoting an SQL string */ + char tmp[1024]; + char *in = tmp; + char *out = buf; + char strip = '\0'; + int first = 0; + int len = strlen (buf); + if (buf[0] == '\'' && buf[len - 1] == '\'') + strip = '\''; + if (buf[0] == '"' && buf[len - 1] == '"') + strip = '"'; + if (strip == '\0') + return; + strcpy (tmp, buf + 1); + len = strlen (tmp); + tmp[len - 1] = '\0'; + while (*in != '\0') + { + if (*in == strip) + { + if (first) + { + first = 0; + in++; + continue; + } + else + { + first = 1; + *out++ = *in++; + continue; + } + } + first = 0; + *out++ = *in++; + } + *out = '\0'; +} + static int cmp_nodes_code (const void *p1, const void *p2) { @@ -47408,7 +47088,7 @@ reset_solution (SolutionPtr solution) } static SolutionPtr -alloc_solution () +alloc_solution (void) { /* allocates and initializes the current solution */ SolutionPtr p = malloc (sizeof (Solution)); @@ -47428,7 +47108,7 @@ alloc_solution () static void add_arc_to_solution (SolutionPtr solution, NetworkArcPtr arc) { -/* inserts an Arc into the Dijkstra Shortest Path solution */ +/* inserts an Arc into the Shortest Path solution */ RowSolutionPtr p = malloc (sizeof (RowSolution)); p->Arc = arc; p->Name = NULL; @@ -47448,7 +47128,7 @@ add_arc_geometry_to_solution (SolutionPtr solution, sqlite3_int64 arc_id, int points, double *coords, int srid, const char *name) { -/* inserts an Arc Geometry into the Dijkstra Shortest Path solution */ +/* inserts an Arc Geometry into the Shortest Path solution */ int len; ArcSolutionPtr p = malloc (sizeof (ArcSolution)); p->ArcRowid = arc_id; @@ -47488,10 +47168,10 @@ add_arc_geometry_to_solution (SolutionPtr solution, sqlite3_int64 arc_id, } static void -dijkstra_solve (sqlite3 * handle, NetworkPtr graph, SolutionPtr solution) +build_solution (sqlite3 * handle, NetworkPtr graph, SolutionPtr solution, + NetworkArcPtr * shortest_path, int cnt) { -/* computing a Dijkstra Shortest Path solution */ - int cnt; +/* formatting the Shortest Path solution */ int i; char sql[8192]; int err; @@ -47511,11 +47191,11 @@ dijkstra_solve (sqlite3 * handle, NetworkPtr graph, SolutionPtr solution) int block = 128; int how_many; sqlite3_stmt *stmt; - NetworkArcPtr *shortest_path; - DijkstraNodesPtr dijkstra = dijkstra_init (graph); - shortest_path = - dijkstra_shortest_path (dijkstra, solution->From, solution->To, &cnt); - dijkstra_free (dijkstra); + char xfrom[1024]; + char xto[1024]; + char xgeom[1024]; + char xname[1024]; + char xtable[1024]; if (cnt > 0) { /* building the solution */ @@ -47536,19 +47216,34 @@ dijkstra_solve (sqlite3 * handle, NetworkPtr graph, SolutionPtr solution) if (graph->NameColumn) { /* a Name column is defined */ + strcpy (xfrom, graph->FromColumn); + vnet_double_quoted_sql (xfrom); + strcpy (xto, graph->ToColumn); + vnet_double_quoted_sql (xto); + strcpy (xgeom, graph->GeometryColumn); + vnet_double_quoted_sql (xgeom); + strcpy (xname, graph->NameColumn); + vnet_double_quoted_sql (xname); + strcpy (xtable, graph->TableName); + vnet_double_quoted_sql (xtable); sprintf (sql, - "SELECT ROWID, \"%s\", \"%s\", \"%s\", \"%s\" FROM \"%s\" WHERE ROWID IN (", - graph->FromColumn, graph->ToColumn, - graph->GeometryColumn, graph->NameColumn, - graph->TableName); + "SELECT ROWID, %s, %s, %s, %s FROM %s WHERE ROWID IN (", + xfrom, xto, xgeom, xname, xtable); } else { /* no Name column is defined */ + strcpy (xfrom, graph->FromColumn); + vnet_double_quoted_sql (xfrom); + strcpy (xto, graph->ToColumn); + vnet_double_quoted_sql (xto); + strcpy (xgeom, graph->GeometryColumn); + vnet_double_quoted_sql (xgeom); + strcpy (xtable, graph->TableName); + vnet_double_quoted_sql (xtable); sprintf (sql, - "SELECT ROWID, \"%s\", \"%s\", \"%s\" FROM \"%s\" WHERE ROWID IN (", - graph->FromColumn, graph->ToColumn, - graph->GeometryColumn, graph->TableName); + "SELECT ROWID, %s, %s, %s FROM %s WHERE ROWID IN (", + xfrom, xto, xgeom, xtable); } for (i = 0; i < how_many; i++) { @@ -47700,7 +47395,7 @@ dijkstra_solve (sqlite3 * handle, NetworkPtr graph, SolutionPtr solution) free (shortest_path); if (!error) { - /* building the Geometry representing the Dijsktra Shortest Path Solution */ + /* building the Geometry representing the Shortest Path Solution */ gaiaLinestringPtr ln; int tot_pts = 0; RowSolutionPtr pR; @@ -47819,6 +47514,29 @@ dijkstra_solve (sqlite3 * handle, NetworkPtr graph, SolutionPtr solution) } } +static void +dijkstra_solve (sqlite3 * handle, NetworkPtr graph, RoutingNodesPtr routing, + SolutionPtr solution) +{ +/* computing a Dijkstra Shortest Path solution */ + int cnt; + NetworkArcPtr *shortest_path = + dijkstra_shortest_path (routing, solution->From, solution->To, &cnt); + build_solution (handle, graph, solution, shortest_path, cnt); +} + +static void +a_star_solve (sqlite3 * handle, NetworkPtr graph, RoutingNodesPtr routing, + SolutionPtr solution) +{ +/* computing an A* Shortest Path solution */ + int cnt; + NetworkArcPtr *shortest_path = + a_star_shortest_path (routing, graph->Nodes, solution->From, + solution->To, graph->AStarHeuristicCoeff, &cnt); + build_solution (handle, graph, solution, shortest_path, cnt); +} + static void network_free (NetworkPtr p) { @@ -47854,6 +47572,7 @@ network_init (const unsigned char *blob, int size) /* parsing the HEADER block */ NetworkPtr graph; int net64; + int aStar = 0; int nodes; int node_code; int max_code_length; @@ -47862,7 +47581,8 @@ network_init (const unsigned char *blob, int size) const char *from; const char *to; const char *geom; - const char *name; + const char *name = NULL; + double a_star_coeff = 1.0; int len; const unsigned char *ptr; if (size < 9) @@ -47871,6 +47591,11 @@ network_init (const unsigned char *blob, int size) net64 = 0; else if (*(blob + 0) == GAIA_NET64_START) /* signature - format using 64bit ints */ net64 = 1; + else if (*(blob + 0) == GAIA_NET64_A_STAR_START) /* signature - format using 64bit ints AND supporting A* */ + { + net64 = 1; + aStar = 1; + } else return NULL; if (*(blob + 1) != GAIA_NET_HEADER) /* signature */ @@ -47923,10 +47648,19 @@ network_init (const unsigned char *blob, int size) name = (char *) ptr; ptr += len; } + if (net64 && aStar) + { + if (*ptr != GAIA_NET_A_STAR_COEFF) /* signature for A* Heuristic Coeff */ + return NULL; + ptr++; + a_star_coeff = gaiaImport64 (ptr, 1, endian_arch); + ptr += 8; + } if (*ptr != GAIA_NET_END) /* signature */ return NULL; graph = malloc (sizeof (Network)); graph->Net64 = net64; + graph->AStar = aStar; graph->EndianArch = endian_arch; graph->CurrentIndex = 0; graph->NodeCode = node_code; @@ -47961,6 +47695,7 @@ network_init (const unsigned char *blob, int size) strcpy (graph->NameColumn, name); } } + graph->AStarHeuristicCoeff = a_star_coeff; return graph; } @@ -47974,6 +47709,8 @@ network_block (NetworkPtr graph, const unsigned char *blob, int size) int ia; int index; char code[256]; + double x; + double y; sqlite3_int64 nodeId = -1; int arcs; NetworkNodePtr pN; @@ -48025,6 +47762,23 @@ network_block (NetworkPtr graph, const unsigned char *blob, int size) in += 4; } } + if (graph->AStar) + { + /* fetching node's X,Y coords */ + if ((size - (in - blob)) < 8) + goto error; + x = gaiaImport64 (in, 1, graph->EndianArch); /* X coord */ + in += 8; + if ((size - (in - blob)) < 8) + goto error; + y = gaiaImport64 (in, 1, graph->EndianArch); /* Y coord */ + in += 8; + } + else + { + x = DBL_MAX; + y = DBL_MAX; + } if ((size - (in - blob)) < 2) goto error; arcs = gaiaImport16 (in, 1, graph->EndianArch); /* # Arcs */ @@ -48048,6 +47802,8 @@ network_block (NetworkPtr graph, const unsigned char *blob, int size) pN->Id = nodeId; pN->Code = NULL; } + pN->CoordX = x; + pN->CoordY = y; pN->NumArcs = arcs; if (arcs) { @@ -48117,7 +47873,10 @@ load_network (sqlite3 * handle, const char *table) int header = 1; const unsigned char *blob; int size; - sprintf (sql, "SELECT \"NetworkData\" FROM \"%s\" ORDER BY \"Id\"", table); + char xname[1024]; + strcpy (xname, table); + vnet_double_quoted_sql (xname); + sprintf (sql, "SELECT NetworkData FROM %s ORDER BY Id", xname); ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL); if (ret != SQLITE_OK) goto abort; @@ -48185,23 +47944,26 @@ vnet_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, int i; int n_rows; int n_columns; - const char *vtable; - const char *table; - const char *col_name; + char vtable[1024]; + char table[1024]; + const char *col_name = NULL; char **results; char *err_msg = NULL; char sql[4096]; int ok_tbl; int ok_id; int ok_data; + char xname[1024]; NetworkPtr graph = NULL; if (pAux) pAux = pAux; /* unused arg warning suppression */ /* checking for table_name and geo_column_name */ if (argc == 4) { - vtable = argv[2]; - table = argv[3]; + strcpy (vtable, argv[2]); + vnet_dequote (vtable); + strcpy (table, argv[3]); + vnet_dequote (table); } else { @@ -48215,7 +47977,9 @@ vnet_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, ok_tbl = 0; ok_id = 0; ok_data = 0; - sprintf (sql, "PRAGMA table_info(\"%s\")", table); + strcpy (xname, table); + vnet_double_quoted_sql (xname); + sprintf (sql, "PRAGMA table_info(%s)", xname); ret = sqlite3_get_table (db, sql, &results, &n_rows, &n_columns, &err_msg); if (ret != SQLITE_OK) { @@ -48264,20 +48028,24 @@ vnet_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, } p_vt->db = db; p_vt->graph = graph; + p_vt->currentAlgorithm = VNET_DIJKSTRA_ALGORITHM; + p_vt->routing = NULL; p_vt->pModule = &my_net_module; p_vt->nRef = 0; p_vt->zErrMsg = NULL; /* preparing the COLUMNs for this VIRTUAL TABLE */ - strcpy (buf, "CREATE TABLE \""); - strcat (buf, vtable); - strcat (buf, "\" (\"ArcRowid\" INTEGER, "); + strcpy (buf, "CREATE TABLE "); + strcpy (xname, vtable); + vnet_double_quoted_sql (xname); + strcat (buf, xname); + strcat (buf, " (Algorithm TEXT, ArcRowid INTEGER, "); if (p_vt->graph->NodeCode) - strcat (buf, "\"NodeFrom\" TEXT, \"NodeTo\" TEXT,"); + strcat (buf, "NodeFrom TEXT, NodeTo TEXT,"); else - strcat (buf, "\"NodeFrom\" INTEGER, \"NodeTo\" INTEGER,"); - strcat (buf, " \"Cost\" DOUBLE, \"Geometry\" BLOB"); + strcat (buf, "NodeFrom INTEGER, NodeTo INTEGER,"); + strcat (buf, " Cost DOUBLE, Geometry BLOB"); if (p_vt->graph->NameColumn) - strcat (buf, ", \"Name\" TEXT)"); + strcat (buf, ", Name TEXT)"); else strcat (buf, ")"); if (sqlite3_declare_vtab (db, buf) != SQLITE_OK) @@ -48289,6 +48057,7 @@ vnet_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, return SQLITE_ERROR; } *ppVTab = (sqlite3_vtab *) p_vt; + p_vt->routing = routing_init (p_vt->graph); return SQLITE_OK; } @@ -48319,12 +48088,12 @@ vnet_best_index (sqlite3_vtab * pVTab, sqlite3_index_info * pIdxInfo) struct sqlite3_index_constraint *p = &(pIdxInfo->aConstraint[i]); if (p->usable) { - if (p->iColumn == 1 && p->op == SQLITE_INDEX_CONSTRAINT_EQ) + if (p->iColumn == 2 && p->op == SQLITE_INDEX_CONSTRAINT_EQ) { from++; i_from = i; } - else if (p->iColumn == 2 && p->op == SQLITE_INDEX_CONSTRAINT_EQ) + else if (p->iColumn == 3 && p->op == SQLITE_INDEX_CONSTRAINT_EQ) { to++; i_to = i; @@ -48335,7 +48104,7 @@ vnet_best_index (sqlite3_vtab * pVTab, sqlite3_index_info * pIdxInfo) } if (from == 1 && to == 1 && errors == 0) { - /* this one is a valid Dijskra Shortest Path query */ + /* this one is a valid Shortest Path query */ if (i_from < i_to) pIdxInfo->idxNum = 1; /* first arg is FROM */ else @@ -48364,6 +48133,8 @@ vnet_disconnect (sqlite3_vtab * pVTab) { /* disconnects the virtual table */ VirtualNetworkPtr p_vt = (VirtualNetworkPtr) pVTab; + if (p_vt->routing) + routing_free (p_vt->routing); if (p_vt->graph) network_free (p_vt->graph); sqlite3_free (p_vt); @@ -48380,7 +48151,7 @@ vnet_destroy (sqlite3_vtab * pVTab) static void vnet_read_row (VirtualNetworkCursorPtr cursor) { -/* trying to read a "row" from Dijkstra solution */ +/* trying to read a "row" from Shortest Path solution */ if (cursor->solution->CurrentRow == NULL) cursor->eof = 1; else @@ -48429,7 +48200,7 @@ vnet_filter (sqlite3_vtab_cursor * pCursor, int idxNum, const char *idxStr, cursor->eof = 1; if (idxNum == 1 && argc == 2) { - /* retrieving the Dijkstra From/To params */ + /* retrieving the Shortest Path From/To params */ if (node_code) { /* Nodes are identified by TEXT Codes */ @@ -48459,7 +48230,7 @@ vnet_filter (sqlite3_vtab_cursor * pCursor, int idxNum, const char *idxStr, } if (idxNum == 2 && argc == 2) { - /* retrieving the Dijkstra To/From params */ + /* retrieving the Shortest Path To/From params */ if (node_code) { /* Nodes are identified by TEXT Codes */ @@ -48490,9 +48261,15 @@ vnet_filter (sqlite3_vtab_cursor * pCursor, int idxNum, const char *idxStr, if (cursor->solution->From && cursor->solution->To) { cursor->eof = 0; - dijkstra_solve (net->db, net->graph, cursor->solution); + if (net->currentAlgorithm == VNET_A_STAR_ALGORITHM) + a_star_solve (net->db, net->graph, net->routing, + cursor->solution); + else + dijkstra_solve (net->db, net->graph, net->routing, + cursor->solution); return SQLITE_OK; } + cursor->eof = 0; return SQLITE_OK; } @@ -48530,6 +48307,7 @@ vnet_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, /* fetching value for the Nth column */ RowSolutionPtr row; int node_code = 0; + const char *algorithm; VirtualNetworkCursorPtr cursor = (VirtualNetworkCursorPtr) pCursor; VirtualNetworkPtr net = (VirtualNetworkPtr) cursor->pVtab; node_code = net->graph->NodeCode; @@ -48537,11 +48315,28 @@ vnet_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, { /* special case: this one is the solution summary */ if (column == 0) + { + /* the currently used Algorithm */ + if (net->currentAlgorithm == VNET_A_STAR_ALGORITHM) + algorithm = "A*"; + else + algorithm = "Dijkstra"; + sqlite3_result_text (pContext, algorithm, strlen (algorithm), + SQLITE_STATIC); + } + if (cursor->solution->From == NULL || cursor->solution->To == NULL) + { + /* empty [uninitialized] solution */ + if (column > 0) + sqlite3_result_null (pContext); + return SQLITE_OK; + } + if (column == 1) { /* the ArcRowId column */ sqlite3_result_null (pContext); } - if (column == 1) + if (column == 2) { /* the NodeFrom column */ if (node_code) @@ -48551,7 +48346,7 @@ vnet_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, else sqlite3_result_int64 (pContext, cursor->solution->From->Id); } - if (column == 2) + if (column == 3) { /* the NodeTo column */ if (node_code) @@ -48561,12 +48356,12 @@ vnet_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, else sqlite3_result_int64 (pContext, cursor->solution->To->Id); } - if (column == 3) + if (column == 4) { /* the Cost column */ sqlite3_result_double (pContext, cursor->solution->TotalCost); } - if (column == 4) + if (column == 5) { /* the Geometry column */ if (!(cursor->solution->Geometry)) @@ -48581,7 +48376,7 @@ vnet_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, sqlite3_result_blob (pContext, p_result, len, free); } } - if (column == 5) + if (column == 6) { /* the [optional] Name column */ sqlite3_result_null (pContext); @@ -48592,11 +48387,21 @@ vnet_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, /* ordinary case: this one is an Arc used by the solution */ row = cursor->solution->CurrentRow; if (column == 0) + { + /* the currently used Algorithm */ + if (net->currentAlgorithm == VNET_A_STAR_ALGORITHM) + algorithm = "A*"; + else + algorithm = "Dijkstra"; + sqlite3_result_text (pContext, algorithm, strlen (algorithm), + SQLITE_STATIC); + } + if (column == 1) { /* the ArcRowId column */ sqlite3_result_int64 (pContext, row->Arc->ArcRowid); } - if (column == 1) + if (column == 2) { /* the NodeFrom column */ if (node_code) @@ -48606,7 +48411,7 @@ vnet_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, else sqlite3_result_int64 (pContext, row->Arc->NodeFrom->Id); } - if (column == 2) + if (column == 3) { /* the NodeTo column */ if (node_code) @@ -48616,17 +48421,17 @@ vnet_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, else sqlite3_result_int64 (pContext, row->Arc->NodeTo->Id); } - if (column == 3) + if (column == 4) { /* the Cost column */ sqlite3_result_double (pContext, row->Arc->Cost); } - if (column == 4) + if (column == 5) { /* the Geometry column */ sqlite3_result_null (pContext); } - if (column == 5) + if (column == 6) { /* the [optional] Name column */ if (row->Name) @@ -48653,8 +48458,44 @@ vnet_update (sqlite3_vtab * pVTab, int argc, sqlite3_value ** argv, sqlite_int64 * pRowid) { /* generic update [INSERT / UPDATE / DELETE */ - if (pVTab || argc || argv || pRowid) - pVTab = pVTab; /* unused arg warning suppression */ + VirtualNetworkPtr p_vtab = (VirtualNetworkPtr) pVTab; + if (pRowid) + pRowid = pRowid; /* unused arg warning suppression */ + if (argc == 1) + { + /* performing a DELETE is forbidden */ + return SQLITE_READONLY; + } + else + { + if (sqlite3_value_type (argv[0]) == SQLITE_NULL) + { + /* performing an INSERT is forbidden */ + return SQLITE_READONLY; + } + else + { + /* performing an UPDATE */ + if (argc == 9) + { + p_vtab->currentAlgorithm = VNET_DIJKSTRA_ALGORITHM; + if (sqlite3_value_type (argv[2]) == SQLITE_TEXT) + { + const unsigned char *algorithm = + sqlite3_value_text (argv[2]); + if (strcmp ((char *) algorithm, "A*") == 0) + p_vtab->currentAlgorithm = + VNET_A_STAR_ALGORITHM; + if (strcmp ((char *) algorithm, "a*") == 0) + p_vtab->currentAlgorithm = + VNET_A_STAR_ALGORITHM; + } + if (p_vtab->graph->AStar == 0) + p_vtab->currentAlgorithm = VNET_DIJKSTRA_ALGORITHM; + } + return SQLITE_OK; + } + } return SQLITE_READONLY; } @@ -48731,11 +48572,22 @@ virtualnetwork_extension_init (sqlite3 * db) /**************** Begin file: virtualfdo.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ /* #include */ + +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ @@ -48746,6 +48598,10 @@ virtualnetwork_extension_init (sqlite3 * db) #define FDO_OGR_WKB 2 #define FDO_OGR_FGF 3 +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif /* not WIN32 */ + #if defined(_WIN32) && !defined(__MINGW32__) #define LONG64_MAX _I64_MAX #define LONG64_MIN _I64_MIN @@ -48799,8 +48655,87 @@ typedef struct VirtualFDOCursorStruct } VirtualFDOCursor; typedef VirtualFDOCursor *VirtualFDOCursorPtr; +static void +vfdo_double_quoted_sql (char *buf) +{ +/* well-formatting a string to be used as an SQL name */ + char tmp[1024]; + char *in = tmp; + char *out = buf; + strcpy (tmp, buf); + *out++ = '"'; + while (*in != '\0') + { + if (*in == '"') + *out++ = '"'; + *out++ = *in++; + } + *out++ = '"'; + *out = '\0'; +} + + +static void +vfdo_clean_sql_string (char *buf) +{ +/* returns a well formatted TEXT value for SQL */ + char tmp[1024]; + char *in = tmp; + char *out = buf; + strcpy (tmp, buf); + while (*in != '\0') + { + if (*in == '\'') + *out++ = '\''; + *out++ = *in++; + } + *out = '\0'; +} + +static void +vfdo_dequote (char *buf) +{ +/* dequoting an SQL string */ + char tmp[1024]; + char *in = tmp; + char *out = buf; + char strip = '\0'; + int first = 0; + int len = strlen (buf); + if (buf[0] == '\'' && buf[len - 1] == '\'') + strip = '\''; + if (buf[0] == '"' && buf[len - 1] == '"') + strip = '"'; + if (strip == '\0') + return; + strcpy (tmp, buf + 1); + len = strlen (tmp); + tmp[len - 1] = '\0'; + while (*in != '\0') + { + if (*in == strip) + { + if (first) + { + first = 0; + in++; + continue; + } + else + { + first = 1; + *out++ = *in++; + continue; + } + } + first = 0; + *out++ = *in++; + } + *out = '\0'; +} + static SqliteValuePtr -value_alloc () +value_alloc (void) { /* allocates and initialites a Value multitype */ SqliteValuePtr p = malloc (sizeof (SqliteValue)); @@ -48976,20 +48911,25 @@ vfdo_insert_row (VirtualFDOPtr p_vt, sqlite3_int64 * rowid, int argc, char prefix[16]; const char *text; const unsigned char *blob; - char *text_wkt; + gaiaOutBuffer out_buf; unsigned char *blob_wkb; int size; char sql[4096]; char buf[256]; - gaiaGeomCollPtr geom; - sprintf (sql, "INSERT INTO \"%s\" ", p_vt->table); + char xname[1024]; + gaiaGeomCollPtr geom = NULL; + strcpy (xname, p_vt->table); + vfdo_double_quoted_sql (xname); + sprintf (sql, "INSERT INTO %s ", xname); for (ic = 0; ic < p_vt->nColumns; ic++) { if (ic == 0) strcpy (prefix, "("); else strcpy (prefix, ", "); - sprintf (buf, "%s\"%s\"", prefix, *(p_vt->Column + ic)); + strcpy (xname, *(p_vt->Column + ic)); + vfdo_double_quoted_sql (xname); + sprintf (buf, "%s%s", prefix, xname); strcat (sql, buf); } strcat (sql, ") VALUES "); @@ -49039,13 +48979,19 @@ vfdo_insert_row (VirtualFDOPtr p_vt, sqlite3_int64 * rowid, int argc, switch (*(p_vt->Format + ig)) { case FDO_OGR_WKT: - gaiaOutWkt (geom, &text_wkt); - if (text_wkt) - sqlite3_bind_text (stmt, i - 1, - text_wkt, - strlen - (text_wkt), - free); + gaiaOutBufferInitialize (&out_buf); + gaiaOutWkt (&out_buf, geom); + if (out_buf.Error == 0 + && out_buf.Buffer != NULL) + { + sqlite3_bind_text (stmt, i - 1, + out_buf.Buffer, + out_buf. + WriteOffset, + free); + out_buf.Buffer = NULL; + gaiaOutBufferReset (&out_buf); + } else { err_geom = 1; @@ -49101,7 +49047,15 @@ vfdo_insert_row (VirtualFDOPtr p_vt, sqlite3_int64 * rowid, int argc, } } if (geom_done) - continue; + { + if (geom) + { + /* memory cleanup: Kashif Rasul 14 Jan 2010 */ + gaiaFreeGeomColl (geom); + geom = NULL; + } + continue; + } switch (sqlite3_value_type (argv[i])) { case SQLITE_INTEGER: @@ -49128,6 +49082,11 @@ vfdo_insert_row (VirtualFDOPtr p_vt, sqlite3_int64 * rowid, int argc, }; } error: + if (geom) + { + /* memory cleanup: Kashif Rasul 14 Jan 2010 */ + gaiaFreeGeomColl (geom); + } if (err_geom || geom_constraint_err) { sqlite3_finalize (stmt); @@ -49162,20 +49121,25 @@ vfdo_update_row (VirtualFDOPtr p_vt, sqlite3_int64 rowid, int argc, char prefix[16]; const char *text; const unsigned char *blob; - char *text_wkt; + gaiaOutBuffer out_buf; unsigned char *blob_wkb; int size; char sql[4096]; char buf[256]; + char xname[1024]; gaiaGeomCollPtr geom; - sprintf (sql, "UPDATE \"%s\" SET", p_vt->table); + strcpy (xname, p_vt->table); + vfdo_double_quoted_sql (xname); + sprintf (sql, "UPDATE %s SET", xname); for (ic = 0; ic < p_vt->nColumns; ic++) { if (ic == 0) strcpy (prefix, " "); else strcpy (prefix, ", "); - sprintf (buf, "%s\"%s\" = ?", prefix, *(p_vt->Column + ic)); + strcpy (xname, *(p_vt->Column + ic)); + vfdo_double_quoted_sql (xname); + sprintf (buf, "%s%s = ?", prefix, xname); strcat (sql, buf); } #if defined(_WIN32) || defined(__MINGW32__) @@ -49221,13 +49185,19 @@ vfdo_update_row (VirtualFDOPtr p_vt, sqlite3_int64 rowid, int argc, switch (*(p_vt->Format + ig)) { case FDO_OGR_WKT: - gaiaOutWkt (geom, &text_wkt); - if (text_wkt) - sqlite3_bind_text (stmt, i - 1, - text_wkt, - strlen - (text_wkt), - free); + gaiaOutBufferInitialize (&out_buf); + gaiaOutWkt (&out_buf, geom); + if (out_buf.Error == 0 + && out_buf.Buffer != NULL) + { + sqlite3_bind_text (stmt, i - 1, + out_buf.Buffer, + out_buf. + WriteOffset, + free); + out_buf.Buffer = NULL; + gaiaOutBufferReset (&out_buf); + } else { err_geom = 1; @@ -49333,11 +49303,14 @@ vfdo_delete_row (VirtualFDOPtr p_vt, sqlite3_int64 rowid) /* trying to delete a row from FDO-OGR real-table */ char sql[1024]; int ret; + char xname[1024]; + strcpy (xname, p_vt->table); + vfdo_double_quoted_sql (xname); #if defined(_WIN32) || defined(__MINGW32__) /* CAVEAT: M$ runtime doesn't supports %lld for 64 bits */ - sprintf (sql, "DELETE FROM \"%s\" WHERE ROWID = %I64d", p_vt->table, rowid); + sprintf (sql, "DELETE FROM %s WHERE ROWID = %I64d", xname, rowid); #else - sprintf (sql, "DELETE FROM \"%s\" WHERE ROWID = %lld", p_vt->table, rowid); + sprintf (sql, "DELETE FROM %s WHERE ROWID = %lld", xname, rowid); #endif ret = sqlite3_exec (p_vt->db, sql, NULL, NULL, NULL); return ret; @@ -49361,20 +49334,25 @@ vfdo_read_row (VirtualFDOCursorPtr cursor) sqlite3_int64 pk; int geom_done; gaiaGeomCollPtr geom; + char xname[1024]; strcpy (sql, "SELECT ROWID"); for (ic = 0; ic < cursor->pVtab->nColumns; ic++) { - sprintf (buf, ",\"%s\"", *(cursor->pVtab->Column + ic)); + strcpy (xname, *(cursor->pVtab->Column + ic)); + vfdo_double_quoted_sql (xname); + sprintf (buf, ",%s", xname); strcat (sql, buf); } + strcpy (xname, cursor->pVtab->table); + vfdo_double_quoted_sql (xname); sprintf (buf, #if defined(_WIN32) || defined (__MINGW32__) /* CAVEAT: M$ runtime doesn't supports %lld for 64 bits */ - " FROM \"%s\" WHERE ROWID >= %I64d", + " FROM %s WHERE ROWID >= %I64d", #else - " FROM \"%s\" WHERE ROWID >= %lld", + " FROM %s WHERE ROWID >= %lld", #endif - cursor->pVtab->table, cursor->current_row); + xname, cursor->current_row); strcat (sql, buf); ret = sqlite3_prepare_v2 (cursor->pVtab->db, sql, strlen (sql), &stmt, NULL); @@ -49411,8 +49389,9 @@ vfdo_read_row (VirtualFDOCursorPtr cursor) geom = gaiaParseWkt (wkt, -1); if (!geom) value_set_null (* - (cursor->pVtab-> - Value + ic)); + (cursor-> + pVtab->Value + + ic)); else { geom->Srid = @@ -49422,15 +49401,13 @@ vfdo_read_row (VirtualFDOCursorPtr cursor) &size); if (xblob) value_set_blob (* - (cursor-> - pVtab-> - Value + ic), - xblob, size); + (cursor->pVtab->Value + + ic), xblob, + size); else value_set_null (* - (cursor-> - pVtab-> - Value + ic)); + (cursor->pVtab->Value + + ic)); gaiaFreeGeomColl (geom); } } @@ -49451,8 +49428,9 @@ vfdo_read_row (VirtualFDOCursorPtr cursor) geom = gaiaFromWkb (blob, size); if (!geom) value_set_null (* - (cursor->pVtab-> - Value + ic)); + (cursor-> + pVtab->Value + + ic)); else { geom->Srid = @@ -49462,15 +49440,13 @@ vfdo_read_row (VirtualFDOCursorPtr cursor) &size); if (xblob) value_set_blob (* - (cursor-> - pVtab-> - Value + ic), - xblob, size); + (cursor->pVtab->Value + + ic), xblob, + size); else value_set_null (* - (cursor-> - pVtab-> - Value + ic)); + (cursor->pVtab->Value + + ic)); gaiaFreeGeomColl (geom); } } @@ -49491,8 +49467,9 @@ vfdo_read_row (VirtualFDOCursorPtr cursor) geom = gaiaFromFgf (blob, size); if (!geom) value_set_null (* - (cursor->pVtab-> - Value + ic)); + (cursor-> + pVtab->Value + + ic)); else { geom->Srid = @@ -49502,15 +49479,13 @@ vfdo_read_row (VirtualFDOCursorPtr cursor) &size); if (xblob) value_set_blob (* - (cursor-> - pVtab-> - Value + ic), - xblob, size); + (cursor->pVtab->Value + + ic), xblob, + size); else value_set_null (* - (cursor-> - pVtab-> - Value + ic)); + (cursor->pVtab->Value + + ic)); gaiaFreeGeomColl (geom); } } @@ -49567,13 +49542,14 @@ vfdo_read_row (VirtualFDOCursorPtr cursor) cursor->current_row = pk; } + static int vfdo_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, sqlite3_vtab ** ppVTab, char **pzErr) { /* creates the virtual table connected to some FDO-OGR table */ - const char *vtable; - const char *table; + char vtable[1024]; + char table[1024]; int ret; int i; int len; @@ -49590,14 +49566,17 @@ vfdo_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, char sql[4096]; char buf[256]; char prefix[16]; + char xname[1024]; VirtualFDOPtr p_vt = NULL; if (pAux) pAux = pAux; /* unused arg warning suppression */ /* checking for table_name */ if (argc == 4) { - vtable = argv[2]; - table = argv[3]; + strcpy (vtable, argv[2]); + vfdo_dequote (vtable); + strcpy (table, argv[3]); + vfdo_dequote (table); } else { @@ -49607,7 +49586,9 @@ vfdo_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, return SQLITE_ERROR; } /* retrieving the base table columns */ - sprintf (sql, "PRAGMA table_info(\"%s\")", table); + strcpy (xname, table); + vfdo_double_quoted_sql (xname); + sprintf (sql, "PRAGMA table_info(%s)", xname); ret = sqlite3_get_table (db, sql, &results, &n_rows, &n_columns, NULL); if (ret != SQLITE_OK) goto illegal; @@ -49664,7 +49645,9 @@ vfdo_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, strcpy (sql, "SELECT f_geometry_column, geometry_type, srid, geometry_format, coord_dimension\n"); strcat (sql, "FROM geometry_columns WHERE f_table_name LIKE '"); - strcat (sql, table); + strcpy (xname, table); + vfdo_clean_sql_string (xname); + strcat (sql, xname); strcat (sql, "'"); ret = sqlite3_get_table (db, sql, &results, &n_rows, &n_columns, NULL); if (ret != SQLITE_OK) @@ -49715,17 +49698,20 @@ vfdo_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, else goto illegal; /* preparing the COLUMNs for this VIRTUAL TABLE */ - strcpy (sql, "CREATE TABLE \""); - strcat (sql, vtable); - strcat (sql, "\" "); + strcpy (sql, "CREATE TABLE "); + strcpy (xname, vtable); + vfdo_double_quoted_sql (xname); + strcat (sql, xname); + strcat (sql, " "); for (i = 0; i < p_vt->nColumns; i++) { if (i == 0) strcpy (prefix, "("); else strcpy (prefix, ", "); - sprintf (buf, "%s\"%s\" %s", prefix, *(p_vt->Column + i), - *(p_vt->Type + i)); + strcpy (xname, *(p_vt->Column + i)); + vfdo_double_quoted_sql (xname); + sprintf (buf, "%s%s %s", prefix, xname, *(p_vt->Type + i)); if (*(p_vt->NotNull + i)) strcat (buf, " NOT NULL"); strcat (sql, buf); @@ -49887,7 +49873,7 @@ vfdo_update (sqlite3_vtab * pVTab, int argc, sqlite3_value ** argv, sqlite_int64 * pRowid) { /* generic update [INSERT / UPDATE / DELETE */ - sqlite3_int64 rowid; + sqlite3_int64 rowid = 0; int ret; VirtualFDOPtr p_vt = (VirtualFDOPtr) pVTab; if (argc == 1) @@ -49993,38 +49979,33 @@ virtualfdo_extension_init (sqlite3 * db) /**************** Begin file: virtualtext.c **********/ +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + /* #include */ /* #include */ /* #include */ + +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ /* #include */ +/* #include */ -#define VRTTXT_TEXT 1 -#define VRTTXT_INTEGER 2 -#define VRTTXT_DOUBLE 3 +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif /* not WIN32 */ + +#if OMIT_ICONV == 0 /* if ICONV is disabled no TXT support is available */ struct sqlite3_module virtualtext_module; -struct row_buffer -{ -/* a complete row */ - int n_cells; /* how many cells are stored into this line */ - char **cells; /* the cells array */ - struct row_buffer *next; /* pointer for linked list */ -}; - -struct text_buffer -{ - int max_n_cells; /* the maximun cell index */ - char **titles; /* the column titles array */ - char *types; /* the column types array */ - int n_rows; /* the number of rows */ - struct row_buffer **rows; /* the rows array */ - struct row_buffer *first; /* pointers to build a linked list of rows */ - struct row_buffer *last; -}; - typedef struct VirtualTextStruct { /* extends the sqlite3_vtab struct */ @@ -50032,7 +50013,7 @@ typedef struct VirtualTextStruct int nRef; /* # references: USED INTERNALLY BY SQLITE */ char *zErrMsg; /* error message: USED INTERNALLY BY SQLITE */ sqlite3 *db; /* the sqlite db holding the virtual table */ - struct text_buffer *buffer; /* the in-memory buffer storing text */ + gaiaTextReaderPtr reader; /* the TextReader object */ } VirtualText; typedef VirtualText *VirtualTextPtr; @@ -50045,157 +50026,6 @@ typedef struct VirtualTextCursortStruct } VirtualTextCursor; typedef VirtualTextCursor *VirtualTextCursorPtr; -static void -text_insert_row (struct text_buffer *text, char **fields, int max_cell) -{ -/* inserting a row into the text buffer struct */ - int i; - struct row_buffer *row = malloc (sizeof (struct row_buffer)); - row->n_cells = max_cell + 1; - if (max_cell < 0) - row->cells = NULL; - else - { - row->cells = malloc (sizeof (char *) * (max_cell + 1)); - for (i = 0; i < row->n_cells; i++) - { - /* setting cell values */ - *(row->cells + i) = *(fields + i); - } - } - row->next = NULL; -/* inserting the row into the linked list */ - if (!(text->first)) - text->first = row; - if (text->last) - text->last->next = row; - text->last = row; -} - -static struct text_buffer * -text_buffer_alloc () -{ -/* allocating and initializing the text buffer struct */ - struct text_buffer *text = malloc (sizeof (struct text_buffer)); - text->max_n_cells = 0; - text->titles = NULL; - text->types = NULL; - text->n_rows = 0; - text->rows = NULL; - text->first = NULL; - text->last = NULL; - return text; -} - -static void -text_buffer_free (struct text_buffer *text) -{ -/* memory cleanup - freeing the text buffer */ - int i; - struct row_buffer *row; - if (!text) - return; - row = text->first; - while (row) - { - for (i = 0; i < row->n_cells; i++) - { - if (*(row->cells + i)) - free (*(row->cells + i)); - } - row = row->next; - } - if (text->types) - free (text->types); - free (text); -} - -static int -text_is_integer (char *value) -{ -/* checking if this value can be an INTEGER */ - int invalids = 0; - int digits = 0; - int signs = 0; - char last = '\0'; - char *p = value; - while (*p != '\0') - { - last = *p; - if (*p >= '0' && *p <= '9') - digits++; - else if (*p == '+' || *p == '-') - signs++; - else - signs++; - p++; - } - if (invalids) - return 0; - if (signs > 1) - return 0; - if (signs) - { - if (*value == '+' || *value == '-' || last == '+' || last == '-') - ; - else - return 0; - } - return 1; -} - -static int -text_is_double (char *value, char decimal_separator) -{ -/* checking if this value can be a DOUBLE */ - int invalids = 0; - int digits = 0; - int signs = 0; - int points = 0; - char last = '\0'; - char *p = value; - while (*p != '\0') - { - last = *p; - if (*p >= '0' && *p <= '9') - digits++; - else if (*p == '+' || *p == '-') - points++; - else - { - if (decimal_separator == ',') - { - if (*p == ',') - points++; - else - invalids++; - } - else - { - if (*p == '.') - points++; - else - invalids++; - } - } - p++; - } - if (invalids) - return 0; - if (points > 1) - return 0; - if (signs > 1) - return 0; - if (signs) - { - if (*value == '+' || *value == '-' || last == '+' || last == '-') - ; - else - return 0; - } - return 1; -} - static void text_clean_integer (char *value) { @@ -50241,338 +50071,6 @@ text_clean_double (char *value) } } -static int -text_clean_text (char **value, void *toUtf8) -{ -/* cleaning a TEXT value and converting to UTF-8 */ - char *text = *value; - char *utf8text; - int err; - int i; - int oldlen = strlen (text); - int newlen; - for (i = oldlen - 1; i > 0; i++) - { - /* cleaning up trailing spaces */ - if (text[i] == ' ') - text[i] = '\0'; - else - break; - } - utf8text = gaiaConvertToUTF8 (toUtf8, text, oldlen, &err); - if (err) - return 1; - newlen = strlen (utf8text); - if (newlen <= oldlen) - strcpy (*value, utf8text); - else - { - free (*value); - *value = malloc (newlen + 1); - strcpy (*value, utf8text); - } - return 0; -} - -static struct text_buffer * -text_parse (char *path, char *encoding, char first_line_titles, - char field_separator, char text_separator, char decimal_separator) -{ -/* trying to open and parse the text file */ - int c; - int fld; - int len; - int max_cell; - int is_string = 0; - char last = '\0'; - char *fields[4096]; - char buffer[35536]; - char *p = buffer; - struct text_buffer *text; - int nrows; - int ncols; - int errs; - struct row_buffer *row; - void *toUtf8; - int encoding_errors; - int ir; - char title[64]; - char *first_valid_row; - int i; - char *name; - FILE *in; - for (fld = 0; fld < 4096; fld++) - { - /* preparing an empty row */ - fields[fld] = NULL; - } -/* trying to open the text file */ - in = fopen (path, "rb"); - if (!in) - return NULL; - text = text_buffer_alloc (); - fld = 0; - while ((c = getc (in)) != EOF) - { - /* parsing the file, one char at each time */ - if (c == '\r' && !is_string) - { - last = (char) c; - continue; - } - if (c == field_separator && !is_string) - { - /* inserting a field into the fields tmp array */ - last = (char) c; - *p = '\0'; - len = strlen (buffer); - if (len) - { - fields[fld] = malloc (len + 1); - strcpy (fields[fld], buffer); - } - fld++; - p = buffer; - *p = '\0'; - continue; - } - if (c == text_separator) - { - /* found a text separator */ - if (is_string) - { - is_string = 0; - last = (char) c; - } - else - { - if (last == text_separator) - *p++ = text_separator; - is_string = 1; - } - continue; - } - last = (char) c; - if (c == '\n' && !is_string) - { - /* inserting the row into the text buffer */ - *p = '\0'; - len = strlen (buffer); - if (len) - { - fields[fld] = malloc (len + 1); - strcpy (fields[fld], buffer); - } - fld++; - p = buffer; - *p = '\0'; - max_cell = -1; - for (fld = 0; fld < 4096; fld++) - { - if (fields[fld]) - max_cell = fld; - } - text_insert_row (text, fields, max_cell); - for (fld = 0; fld < 4096; fld++) - { - /* resetting an empty row */ - fields[fld] = NULL; - } - fld = 0; - continue; - } - *p++ = c; - } - fclose (in); -/* checking if the text file really seems to contain a table */ - nrows = 0; - ncols = 0; - errs = 0; - row = text->first; - while (row) - { - if (first_line_titles && row == text->first) - { - /* skipping first line */ - row = row->next; - continue; - } - nrows++; - if (row->n_cells > ncols) - ncols = row->n_cells; - row = row->next; - } - if (nrows == 0 && ncols == 0) - { - text_buffer_free (text); - return NULL; - } - text->n_rows = nrows; -/* going to check the column types */ - text->max_n_cells = ncols; - text->types = malloc (sizeof (char) * text->max_n_cells); - first_valid_row = malloc (sizeof (char) * text->max_n_cells); - for (fld = 0; fld < text->max_n_cells; fld++) - { - /* initally assuming any cell contains TEXT */ - *(text->types + fld) = VRTTXT_TEXT; - *(first_valid_row + fld) = 1; - } - row = text->first; - while (row) - { - if (first_line_titles && row == text->first) - { - /* skipping first line */ - row = row->next; - continue; - } - for (fld = 0; fld < row->n_cells; fld++) - { - if (*(row->cells + fld)) - { - if (text_is_integer (*(row->cells + fld))) - { - if (*(first_valid_row + fld)) - { - *(text->types + fld) = VRTTXT_INTEGER; - *(first_valid_row + fld) = 0; - } - } - else if (text_is_double - (*(row->cells + fld), decimal_separator)) - { - if (*(first_valid_row + fld)) - { - *(text->types + fld) = VRTTXT_DOUBLE; - *(first_valid_row + fld) = 0; - } - else - { - /* promoting an INTEGER column to be of the DOUBLE type */ - if (*(text->types + fld) == VRTTXT_INTEGER) - *(text->types + fld) = VRTTXT_DOUBLE; - } - } - else - { - /* this column is anyway of the TEXT type */ - *(text->types + fld) = VRTTXT_TEXT; - if (*(first_valid_row + fld)) - *(first_valid_row + fld) = 0; - } - } - } - row = row->next; - } - free (first_valid_row); -/* preparing the column names */ - text->titles = malloc (sizeof (char *) * text->max_n_cells); - if (first_line_titles) - { - for (fld = 0; fld < text->max_n_cells; fld++) - { - if (fld >= text->first->n_cells) - { - /* this column name is NULL; setting a default name */ - sprintf (title, "COL%03d", fld + 1); - len = strlen (title); - *(text->titles + fld) = malloc (len + 1); - strcpy (*(text->titles + fld), title); - } - else - { - if (*(text->first->cells + fld)) - { - len = strlen (*(text->first->cells + fld)); - *(text->titles + fld) = malloc (len + 1); - strcpy (*(text->titles + fld), - *(text->first->cells + fld)); - name = *(text->titles + fld); - for (i = 0; i < len; i++) - { - /* masking any space in the column name */ - if (*(name + i) == ' ') - *(name + i) = '_'; - } - } - else - { - /* this column name is NULL; setting a default name */ - sprintf (title, "COL%03d", fld + 1); - len = strlen (title); - *(text->titles + fld) = malloc (len + 1); - strcpy (*(text->titles + fld), title); - } - } - } - } - else - { - for (fld = 0; fld < text->max_n_cells; fld++) - { - sprintf (title, "COL%03d", fld + 1); - len = strlen (title); - *(text->titles + fld) = malloc (len + 1); - strcpy (*(text->titles + fld), title); - } - } -/* cleaning cell values when needed */ - toUtf8 = gaiaCreateUTF8Converter (encoding); - if (!toUtf8) - { - text_buffer_free (text); - return NULL; - } - encoding_errors = 0; - row = text->first; - while (row) - { - if (first_line_titles && row == text->first) - { - /* skipping first line */ - row = row->next; - continue; - } - for (fld = 0; fld < row->n_cells; fld++) - { - if (*(row->cells + fld)) - { - if (*(text->types + fld) == VRTTXT_INTEGER) - text_clean_integer (*(row->cells + fld)); - else if (*(text->types + fld) == VRTTXT_DOUBLE) - text_clean_double (*(row->cells + fld)); - else - encoding_errors += - text_clean_text (row->cells + fld, toUtf8); - } - } - row = row->next; - } - gaiaFreeUTF8Converter (toUtf8); - if (encoding_errors) - { - text_buffer_free (text); - return NULL; - } -/* ok, we can now go to prepare the rows array */ - text->rows = malloc (sizeof (struct row_buffer *) * text->n_rows); - ir = 0; - row = text->first; - while (row) - { - if (first_line_titles && row == text->first) - { - /* skipping first line */ - row = row->next; - continue; - } - *(text->rows + ir++) = row; - row = row->next; - } - return text; -} - static int vtxt_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, sqlite3_vtab ** ppVTab, char **pzErr) @@ -50583,14 +50081,14 @@ vtxt_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, const char *vtable; const char *pEncoding = NULL; int len; - struct text_buffer *text = NULL; + gaiaTextReaderPtr text = NULL; const char *pPath = NULL; char field_separator = '\t'; char text_separator = '"'; char decimal_separator = '.'; char first_line_titles = 1; int i; - char sql[4096]; + char sql[65535]; int seed; int dup; int idup; @@ -50637,11 +50135,17 @@ vtxt_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, { if (strcasecmp (argv[6], "COMMA") == 0) decimal_separator = ','; + if (strcasecmp (argv[6], "POINT") == 0) + decimal_separator = '.'; } if (argc >= 8) { if (strcasecmp (argv[7], "SINGLEQUOTE") == 0) text_separator = '\''; + if (strcasecmp (argv[7], "DOUBLEQUOTE") == 0) + text_separator = '"'; + if (strcasecmp (argv[7], "NONE") == 0) + text_separator = '\0'; } if (argc == 9) { @@ -50669,12 +50173,22 @@ vtxt_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, p_vt->nRef = 0; p_vt->zErrMsg = NULL; p_vt->db = db; - text = - text_parse (path, encoding, first_line_titles, field_separator, - text_separator, decimal_separator); + text = gaiaTextReaderAlloc (path, field_separator, + text_separator, decimal_separator, + first_line_titles, encoding); + if (text) + { + if (gaiaTextReaderParse (text) == 0) + { + gaiaTextReaderDestroy (text); + text = NULL; + } + } if (!text) { /* something is going the wrong way; creating a stupid default table */ + fprintf (stderr, "VirtualText: invalid data source\n"); + fflush (stderr); sprintf (sql, "CREATE TABLE %s (ROWNO INTEGER)", vtable); if (sqlite3_declare_vtab (db, sql) != SQLITE_OK) { @@ -50683,38 +50197,36 @@ vtxt_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, ("[VirtualText module] cannot build a table from TEXT file\n"); return SQLITE_ERROR; } - p_vt->buffer = NULL; + p_vt->reader = NULL; *ppVTab = (sqlite3_vtab *) p_vt; return SQLITE_OK; } - p_vt->buffer = text; + p_vt->reader = text; /* preparing the COLUMNs for this VIRTUAL TABLE */ sprintf (sql, "CREATE TABLE %s (ROWNO INTEGER", vtable); - col_name = malloc (sizeof (char *) * text->max_n_cells); + col_name = malloc (sizeof (char *) * text->max_fields); seed = 0; - for (i = 0; i < text->max_n_cells; i++) + for (i = 0; i < text->max_fields; i++) { strcat (sql, ", "); - sprintf (dummyName, "\"%s\"", *(text->titles + i)); + sprintf (dummyName, "\"%s\"", text->columns[i].name); dup = 0; for (idup = 0; idup < i; idup++) { if (strcasecmp (dummyName, *(col_name + idup)) == 0) dup = 1; } - if (strcasecmp (dummyName, "PKUID") == 0) - dup = 1; - if (strcasecmp (dummyName, "Geometry") == 0) + if (strcasecmp (dummyName, "ROWNO") == 0) dup = 1; if (dup) - sprintf (dummyName, "COL_%d", seed++); + sprintf (dummyName, "DUPCOL_%d", seed++); len = strlen (dummyName); *(col_name + i) = malloc (len + 1); strcpy (*(col_name + i), dummyName); strcat (sql, dummyName); - if (*(text->types + i) == VRTTXT_INTEGER) + if (text->columns[i].type == VRTTXT_INTEGER) strcat (sql, " INTEGER"); - else if (*(text->types + i) == VRTTXT_DOUBLE) + else if (text->columns[i].type == VRTTXT_DOUBLE) strcat (sql, " DOUBLE"); else strcat (sql, " TEXT"); @@ -50723,7 +50235,7 @@ vtxt_create (sqlite3 * db, void *pAux, int argc, const char *const *argv, if (col_name) { /* releasing memory allocation for column names */ - for (i = 0; i < text->max_n_cells; i++) + for (i = 0; i < text->max_fields; i++) free (*(col_name + i)); free (col_name); } @@ -50761,8 +50273,8 @@ vtxt_disconnect (sqlite3_vtab * pVTab) { /* disconnects the virtual table */ VirtualTextPtr p_vt = (VirtualTextPtr) pVTab; - if (p_vt->buffer) - text_buffer_free (p_vt->buffer); + if (p_vt->reader) + gaiaTextReaderDestroy (p_vt->reader); sqlite3_free (p_vt); return SQLITE_OK; } @@ -50778,6 +50290,7 @@ static int vtxt_open (sqlite3_vtab * pVTab, sqlite3_vtab_cursor ** ppCursor) { /* opening a new cursor */ + gaiaTextReaderPtr text; VirtualTextCursorPtr cursor = (VirtualTextCursorPtr) sqlite3_malloc (sizeof (VirtualTextCursor)); if (cursor == NULL) @@ -50786,8 +50299,14 @@ vtxt_open (sqlite3_vtab * pVTab, sqlite3_vtab_cursor ** ppCursor) cursor->current_row = 0; cursor->eof = 0; *ppCursor = (sqlite3_vtab_cursor *) cursor; - if (!(cursor->pVtab->buffer)) + text = cursor->pVtab->reader; + if (!text) cursor->eof = 1; + else + { + if (!gaiaTextReaderGetRow (text, cursor->current_row)) + cursor->eof = 1; + } return SQLITE_OK; } @@ -50815,14 +50334,15 @@ vtxt_next (sqlite3_vtab_cursor * pCursor) { /* fetching next row from cursor */ VirtualTextCursorPtr cursor = (VirtualTextCursorPtr) pCursor; - if (!(cursor->pVtab->buffer)) - { - cursor->eof = 1; - return SQLITE_OK; - } - cursor->current_row++; - if (cursor->current_row >= cursor->pVtab->buffer->n_rows) + gaiaTextReaderPtr text = cursor->pVtab->reader; + if (!text) cursor->eof = 1; + else + { + cursor->current_row++; + if (!gaiaTextReaderGetRow (text, cursor->current_row)) + cursor->eof = 1; + } return SQLITE_OK; } @@ -50839,41 +50359,49 @@ vtxt_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, int column) { /* fetching value for the Nth column */ - struct row_buffer *row; int nCol = 1; int i; + char buf[4096]; + int type; + const char *value; VirtualTextCursorPtr cursor = (VirtualTextCursorPtr) pCursor; - struct text_buffer *text = cursor->pVtab->buffer; + gaiaTextReaderPtr text = cursor->pVtab->reader; if (column == 0) { /* the ROWNO column */ - sqlite3_result_int (pContext, cursor->current_row + 1); + sqlite3_result_int (pContext, cursor->current_row); return SQLITE_OK; } - row = *(text->rows + cursor->current_row); - for (i = 0; i < text->max_n_cells; i++) + if (text->current_line_ready == 0) + return SQLITE_ERROR; + for (i = 0; i < text->max_fields; i++) { if (nCol == column) { - if (i >= row->n_cells) + if (!gaiaTextReaderFetchField (text, i, &type, &value)) sqlite3_result_null (pContext); else { - if (*(row->cells + i)) + if (type == VRTTXT_INTEGER) { - if (*(text->types + i) == VRTTXT_INTEGER) - sqlite3_result_int64 (pContext, - atol (*(row->cells + i))); - else if (*(text->types + i) == VRTTXT_DOUBLE) - sqlite3_result_double (pContext, - atof (* - (row->cells + i))); - else - sqlite3_result_text (pContext, - *(row->cells + i), - strlen (*(row->cells + i)), - SQLITE_STATIC); + strcpy (buf, value); + text_clean_integer (buf); +#if defined(_WIN32) || defined(__MINGW32__) +/* CAVEAT - M$ runtime has non-standard functions for 64 bits */ + sqlite3_result_int64 (pContext, _atoi64 (buf)); +#else + sqlite3_result_int64 (pContext, atoll (buf)); +#endif } + else if (type == VRTTXT_DOUBLE) + { + strcpy (buf, value); + text_clean_double (buf); + sqlite3_result_double (pContext, atof (buf)); + } + else if (type == VRTTXT_TEXT) + sqlite3_result_text (pContext, value, strlen (value), + free); else sqlite3_result_null (pContext); } @@ -50970,12 +50498,834 @@ virtualtext_extension_init (sqlite3 * db) { return sqlite3VirtualTextInit (db); } + +/* +** +** TextReader implementation +** +*/ + +static struct vrttxt_row_block * +vrttxt_block_alloc () +{ +/* allocating a rows Block */ + struct vrttxt_row_block *p = malloc (sizeof (struct vrttxt_row_block)); + if (!p) + return NULL; + p->num_rows = 0; + p->min_line_no = -1; + p->max_line_no = -1; + p->next = NULL; + return p; +} + +static void +vrttxt_block_destroy (struct vrttxt_row_block *p) +{ +/* destroying a rows Block */ + if (p) + free (p); +} + +GAIAGEO_DECLARE void +gaiaTextReaderDestroy (gaiaTextReaderPtr reader) +{ +/* destroying the main TXT-Reader */ + int col; + struct vrttxt_row_block *blk; + struct vrttxt_row_block *blkN; + if (reader) + { + blk = reader->first; + while (blk) + { + /* destroying the row offset Blocks */ + blkN = blk->next; + vrttxt_block_destroy (blk); + blk = blkN; + } + /* freeing the input buffers */ + if (reader->line_buffer) + free (reader->line_buffer); + if (reader->field_buffer) + free (reader->field_buffer); + /* freeing the row offsets array */ + if (reader->rows) + free (reader->rows); + /* closing the input file */ + fclose (reader->text_file); + for (col = 0; col < VRTTXT_FIELDS_MAX; col++) + { + /* destroying column headers */ + if (reader->columns[col].name != NULL) + free (reader->columns[col].name); + } + gaiaFreeUTF8Converter (reader->toUtf8); + free (reader); + } +} + +GAIAGEO_DECLARE gaiaTextReaderPtr +gaiaTextReaderAlloc (const char *path, char field_separator, + char text_separator, char decimal_separator, + int first_line_titles, const char *encoding) +{ +/* allocating the main TXT-Reader */ + int col; + gaiaTextReaderPtr reader; + FILE *in = fopen (path, "rb"); /* opening the input file */ + if (in == NULL) + return NULL; + +/* allocating and initializing the struct */ + reader = malloc (sizeof (gaiaTextReader)); + if (!reader) + { + fclose (in); + return NULL; + } + reader->text_file = in; + reader->field_separator = field_separator; + reader->text_separator = text_separator; + reader->decimal_separator = decimal_separator; + reader->first_line_titles = first_line_titles; + reader->toUtf8 = gaiaCreateUTF8Converter (encoding); + if (reader->toUtf8 == (void *) 0) + { + fclose (in); + return NULL; + } + reader->error = 0; + reader->first = NULL; + reader->last = NULL; + reader->rows = NULL; + reader->num_rows = 0; + reader->line_no = 0; + reader->max_fields = 0; + reader->max_current_field = 0; + reader->current_line_ready = 0; + reader->current_buf_sz = 1024; + reader->line_buffer = malloc (1024); + reader->field_buffer = malloc (1024); + if (reader->line_buffer == NULL || reader->field_buffer == NULL) + { + /* insufficient memory: no input buffers */ + gaiaTextReaderDestroy (reader); + return NULL; + } + for (col = 0; col < VRTTXT_FIELDS_MAX; col++) + { + /* initializing column headers */ + reader->columns[col].name = NULL; + reader->columns[col].type = VRTTXT_NULL; + } + return reader; +} + +static void +vrttxt_line_init (struct vrttxt_line *line, off_t offset) +{ +/* initializing a LINE struct */ + line->offset = offset; + line->len = 0; + line->num_fields = 0; + line->error = 0; +} + +static void +vrttxt_line_end (struct vrttxt_line *line, off_t offset) +{ +/* completing a Line struct (EndOfLine encountered) */ + line->len = offset - line->offset; +} + +static void +vrttxt_add_field (struct vrttxt_line *line, off_t offset) +{ +/* adding a Field offset to the current Line */ + if (line->num_fields >= VRTTXT_FIELDS_MAX) + { + line->error = 1; + return; + } + line->field_offsets[line->num_fields] = offset - line->offset; + line->num_fields++; +} + +static int +vrttxt_is_integer (const char *value) +{ +/* checking if this value can be an INTEGER */ + int invalids = 0; + int digits = 0; + int signs = 0; + char last = '\0'; + const char *p = value; + while (*p != '\0') + { + last = *p; + if (*p >= '0' && *p <= '9') + digits++; + else if (*p == '+' || *p == '-') + signs++; + else + invalids++; + p++; + } + if (invalids) + return 0; /* invalid chars where found */ + if (signs > 1) + return 0; /* more than a single sign */ + if (signs) + { + if (*value == '+' || *value == '-' || last == '+' || last == '-') + ; + else + return 0; /* sign is not the first/last string char */ + } + return 1; /* ok, can be a valid INTEGER value */ +} + +static int +vrttxt_is_double (const char *value, char decimal_separator) +{ +/* checking if this value can be a DOUBLE */ + int invalids = 0; + int digits = 0; + int signs = 0; + int points = 0; + char last = '\0'; + const char *p = value; + while (*p != '\0') + { + last = *p; + if (*p >= '0' && *p <= '9') + digits++; + else if (*p == '+' || *p == '-') + signs++; + else + { + if (decimal_separator == ',') + { + if (*p == ',') + points++; + else + invalids++; + } + else + { + if (*p == '.') + points++; + else + invalids++; + } + } + p++; + } + if (invalids) + return 0; /* invalid chars where found */ + if (points > 1) + return 0; /* more than a single decimal separator */ + if (signs > 1) + return 0; /* more than a single sign */ + if (signs) + { + if (*value == '+' || *value == '-' || last == '+' || last == '-') + ; + else + return 0; /* sign is not the first/last string char */ + } + return 1; /* ok, can be a valid DOUBLE value */ +} + +static int +vrttxt_check_type (const char *value, char decimal_separator) +{ +/* checking the Field type */ + if (*value == '\0') + return VRTTXT_NULL; + if (vrttxt_is_integer (value)) + return VRTTXT_INTEGER; + if (vrttxt_is_double (value, decimal_separator)) + return VRTTXT_DOUBLE; + return VRTTXT_TEXT; +} + +static int +vrttxt_set_column_title (gaiaTextReaderPtr txt, int col_no, const char *name) +{ +/* setting a Column header name */ + int err; + int ind; + char *utf8text; + char *str = (char *) name; + int len = strlen (str); + if (str[0] == txt->text_separator && str[len - 1] == txt->text_separator) + { + /* cleaning the enclosing quotes */ + str[len - 1] = '\0'; + str = (char *) (name + 1); + len -= 2; + if (len <= 0) + return 0; + } + utf8text = gaiaConvertToUTF8 (txt->toUtf8, str, len, &err); + if (err) + { + if (utf8text) + free (utf8text); + return 0; + } + else + str = utf8text; + len = strlen (str); + for (ind = 0; ind < len; ind++) + { + /* masking spaces and so on within the column name */ + switch (str[ind]) + { + case ' ': + case '\t': + case '-': + case '+': + case '*': + case '/': + case '(': + case ')': + case '[': + case ']': + case '{': + case '}': + str[ind] = '_'; + break; + } + } + if (txt->columns[col_no].name) + free (txt->columns[col_no].name); + txt->columns[col_no].name = malloc (len + 1); + if (txt->columns[col_no].name == NULL) + return 0; + strcpy (txt->columns[col_no].name, utf8text); + free (utf8text); + return 1; +} + +static void +vrttxt_add_line (gaiaTextReaderPtr txt, struct vrttxt_line *line) +{ +/* appending a Line offset to the main TXT-Reader */ + struct vrttxt_row_block *p_block; + struct vrttxt_row *p_row; + int ind; + int off; + int len; + int value_type; + int column_type; + int first_line = 0; + if (txt->line_no == 0) + first_line = 1; + if (line->error) + { + txt->error = 1; + txt->line_no++; + return; + } + if (line->num_fields == 0) + { + txt->line_no++; + return; + } + p_block = txt->last; + if (p_block == NULL) + { + /* the offset Blocks list is empty: allocating the first Block */ + p_block = vrttxt_block_alloc (); + if (!p_block) + { + txt->error = 1; + txt->line_no++; + return; + } + if (txt->first == NULL) + txt->first = p_block; + if (txt->last != NULL) + txt->last->next = p_block; + txt->last = p_block; + } + else if (p_block->num_rows >= VRTTXT_BLOCK_MAX) + { + /* the currect offset Block is full: expanding the list */ + p_block = vrttxt_block_alloc (); + if (!p_block) + { + txt->error = 1; + txt->line_no++; + return; + } + if (txt->first == NULL) + txt->first = p_block; + if (txt->last != NULL) + txt->last->next = p_block; + txt->last = p_block; + } +/* inserting the Row offset into the offset Block */ + p_row = p_block->rows + p_block->num_rows; + p_block->num_rows++; + p_row->line_no = txt->line_no; + if (p_block->min_line_no < 0) + p_block->min_line_no = p_row->line_no; + if (p_block->max_line_no < p_row->line_no) + p_block->max_line_no = p_row->line_no; + txt->line_no++; + p_row->offset = line->offset; + p_row->len = line->len; + p_row->num_fields = line->num_fields; + if (line->num_fields > txt->max_fields) + txt->max_fields = line->num_fields; + off = 0; + for (ind = 0; ind < p_row->num_fields; ind++) + { + /* setting the corresponding Column (aka Field) header */ + len = line->field_offsets[ind] - off; + if (len == 0) + *(txt->field_buffer) = '\0'; + else + { + /* retrieving the current Field Value */ + memcpy (txt->field_buffer, txt->line_buffer + off, len); + *(txt->field_buffer + len) = '\0'; + } + if (txt->first_line_titles && first_line) + { + /* first line: the current value is the Column Name */ + if (!vrttxt_set_column_title (txt, ind, txt->field_buffer)) + txt->error = 1; + } + else + { + /* plain Field Value */ + value_type = + vrttxt_check_type (txt->field_buffer, + txt->decimal_separator); + column_type = txt->columns[ind].type; + switch (value_type) + { + /* checking the Column type */ + case VRTTXT_INTEGER: + if (column_type == VRTTXT_NULL) + txt->columns[ind].type = VRTTXT_INTEGER; + break; + case VRTTXT_DOUBLE: + if (column_type == VRTTXT_NULL + || column_type == VRTTXT_INTEGER) + txt->columns[ind].type = VRTTXT_DOUBLE; + break; + case VRTTXT_TEXT: + txt->columns[ind].type = VRTTXT_TEXT; + break; + default: + break; + }; + } + off = line->field_offsets[ind] + 1; + } +} + +static void +vrttxt_line_push (gaiaTextReaderPtr txt, char c) +{ +/* inserting a single char into the dynamically growing buffer */ + if (txt->error) + return; + if ((txt->current_buf_off + 1) >= txt->current_buf_sz) + { + /* expanding the input buffer */ + int new_sz; + char *new_buf; + /* + / allocation strategy: + / - the input buffer has an initial size of 1024 bytes + / (good for short lines) + / - the second step allocates 4196 bytes + / - the third step allocates 65536 bytes + / (good for medium sized lines) + / - after this the buffer allocation will be increased + / be 1MB at each step (good for huge sized lines) + */ + if (txt->current_buf_sz < 4196) + new_sz = 4196; + else if (txt->current_buf_sz < 65536) + new_sz = 65536; + else + new_sz = txt->current_buf_sz + (1024 * 1024); + new_buf = malloc (new_sz); + if (!new_buf) + { + txt->error = 1; + return; + } + txt->current_buf_sz = new_sz; + memcpy (new_buf, txt->line_buffer, txt->current_buf_off); + free (txt->line_buffer); + txt->line_buffer = new_buf; + free (txt->field_buffer); + txt->field_buffer = malloc (new_sz); + if (txt->field_buffer == NULL) + { + txt->error = 1; + return; + } + } + *(txt->line_buffer + txt->current_buf_off) = c; + txt->current_buf_off++; +/* ensuring that input buffer will bel null terminated anyway */ + *(txt->line_buffer + txt->current_buf_off) = '\0'; +} + +static void +vrttxt_build_line_array (gaiaTextReaderPtr txt) +{ +/* creating the final Line offsets array */ + struct vrttxt_row_block *p_block; + int i; + int cnt = 0; + int first_line = 1; + if (txt->rows) + free (txt->rows); + txt->rows = NULL; + txt->num_rows = 0; + p_block = txt->first; + while (p_block) + { + /* counting how many lines are there */ + if (p_block == txt->first && txt->first_line_titles) + txt->num_rows += p_block->num_rows - 1; + else + txt->num_rows += p_block->num_rows; + p_block = p_block->next; + } + txt->rows = malloc (sizeof (struct vrttxt_row *) * txt->num_rows); + if (txt->rows == NULL) + { + /* insufficient memory */ + txt->error = 1; + return; + } + p_block = txt->first; + while (p_block) + { + for (i = 0; i < p_block->num_rows; i++) + { + /* setting Line references into the array */ + if (first_line && txt->first_line_titles) + { + first_line = 0; + continue; /* skipping the first line (column names) */ + } + *(txt->rows + cnt++) = p_block->rows + i; + } + p_block = p_block->next; + } +} + +GAIAGEO_DECLARE int +gaiaTextReaderParse (gaiaTextReaderPtr txt) +{ +/* +/ preliminary parsing +/ - reading the input file until EOF +/ - then feeding the Row offsets structs +/ to be used for any subsequent access +*/ + char name[64]; + int ind; + int i2; + int c; + int masked = 0; + int token_start = 1; + int row_offset = 0; + off_t offset = 0; + struct vrttxt_line line; + vrttxt_line_init (&line, 0); + txt->current_buf_off = 0; + + while ((c = getc (txt->text_file)) != EOF) + { + if (c == txt->text_separator) + { + if (masked) + masked = 0; + else + { + if (token_start) + masked = 1; + } + vrttxt_line_push (txt, c); + if (txt->error) + return 0; + row_offset++; + offset++; + continue; + } + token_start = 0; + if (c == '\r') + { + if (masked) + { + vrttxt_line_push (txt, c); + if (txt->error) + return 0; + row_offset++; + } + offset++; + continue; + } + if (c == '\n') + { + if (masked) + { + vrttxt_line_push (txt, c); + if (txt->error) + return 0; + row_offset++; + offset++; + continue; + } + vrttxt_add_field (&line, offset); + vrttxt_line_end (&line, offset); + vrttxt_add_line (txt, &line); + if (txt->error) + return 0; + vrttxt_line_init (&line, offset + 1); + txt->current_buf_off = 0; + token_start = 1; + row_offset = 0; + offset++; + continue; + } + if (c == txt->field_separator) + { + if (masked) + { + vrttxt_line_push (txt, c); + if (txt->error) + return 0; + row_offset++; + offset++; + continue; + } + vrttxt_line_push (txt, c); + if (txt->error) + return 0; + row_offset++; + vrttxt_add_field (&line, offset); + token_start = 1; + offset++; + continue; + } + vrttxt_line_push (txt, c); + if (txt->error) + return 0; + row_offset++; + offset++; + } + if (txt->error) + return 0; + if (txt->first_line_titles) + { + /* checking for duplicate column names */ + for (ind = 0; ind < txt->max_fields; ind++) + { + for (i2 = 0; i2 < ind; i2++) + { + if (strcasecmp + (txt->columns[i2].name, txt->columns[ind].name) == 0) + { + sprintf (name, "COL%03d", ind + 1); + if (!vrttxt_set_column_title (txt, ind, name)) + { + txt->error = 1; + return 0; + } + } + } + } + } + else + { + /* setting convenience column names */ + for (ind = 0; ind < txt->max_fields; ind++) + { + sprintf (name, "COL%03d", ind + 1); + if (!vrttxt_set_column_title (txt, ind, name)) + { + txt->error = 1; + return 0; + } + } + } + if (txt->error) + return 0; + vrttxt_build_line_array (txt); + if (txt->error) + return 0; + return 1; +} + +GAIAGEO_DECLARE int +gaiaTextReaderGetRow (gaiaTextReaderPtr txt, int line_no) +{ +/* reading a Line (identified by relative number */ + int i; + char c; + int masked = 0; + int token_start = 1; + int fld = 0; + int offset = 0; + struct vrttxt_row *p_row; + txt->current_line_ready = 0; + txt->max_current_field = 0; + if (line_no < 0 || line_no >= txt->num_rows || txt->rows == NULL) + return 0; + p_row = *(txt->rows + line_no); + if (fseek (txt->text_file, p_row->offset, SEEK_SET) != 0) + return 0; + if (fread (txt->line_buffer, 1, p_row->len, txt->text_file) != + (unsigned int) (p_row->len)) + return 0; + txt->field_offsets[0] = 0; + for (i = 0; i < p_row->len; i++) + { + /* parsing Fields */ + c = *(txt->line_buffer + i); + if (c == txt->text_separator) + { + if (masked) + masked = 0; + else + { + if (token_start) + masked = 1; + } + offset++; + continue; + } + token_start = 0; + if (c == '\r') + { + offset++; + continue; + } + if (c == txt->field_separator) + { + if (masked) + { + offset++; + continue; + } + txt->field_offsets[fld + 1] = offset + 1; + txt->field_lens[fld] = -1; + txt->field_lens[fld] = offset - txt->field_offsets[fld]; + fld++; + txt->max_current_field = fld; + token_start = 1; + offset++; + continue; + } + offset++; + } + if (offset > 0) + { + txt->field_lens[fld] = offset - txt->field_offsets[fld]; + fld++; + txt->max_current_field = fld; + } + txt->current_line_ready = 1; + return 1; +} + +GAIAGEO_DECLARE int +gaiaTextReaderFetchField (gaiaTextReaderPtr txt, int field_idx, int *type, + const char **value) +{ +/* fetching a field value */ + char *utf8text = NULL; + int err; + int len; + char *str; + if (txt->current_line_ready == 0) + { + *type = VRTTXT_NULL; + *value = NULL; + return 0; + } + if (field_idx < 0 || field_idx >= txt->max_fields) + { + *type = VRTTXT_NULL; + *value = NULL; + return 0; + } + if (field_idx < 0 || field_idx >= txt->max_current_field) + { + *type = VRTTXT_NULL; + *value = NULL; + return 0; + } + *type = txt->columns[field_idx].type; + if (txt->field_lens[field_idx] == 0) + *(txt->field_buffer) = '\0'; + memcpy (txt->field_buffer, txt->line_buffer + txt->field_offsets[field_idx], + txt->field_lens[field_idx]); + *(txt->field_buffer + txt->field_lens[field_idx]) = '\0'; + *value = txt->field_buffer; + if (*value == '\0') + *type = VRTTXT_NULL; + else if (*type == VRTTXT_TEXT) + { + /* converting to UTF-8 */ + str = (char *) *value; + len = strlen (str); + if (str[0] == txt->text_separator + && str[len - 1] == txt->text_separator) + { + /* cleaning the enclosing quotes */ + str[len - 1] = '\0'; + str = (char *) (*value + 1); + len -= 2; + if (len <= 0) + { + *type = VRTTXT_NULL; + *value = NULL; + return 1; + } + } + utf8text = gaiaConvertToUTF8 (txt->toUtf8, str, len, &err); + if (err) + { + /* memory cleanup: Kashif Rasul 14 Jan 2010 */ + if (utf8text) + free (utf8text); + *type = VRTTXT_NULL; + *value = NULL; + return 0; + } + *value = utf8text; + } + return 1; +} + +#endif /* ICONV enabled/disabled */ /**************** End file: virtualtext.c **********/ /**************** Begin file: version.c **********/ +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ /* #include */ +#else +/* #include */ +#endif + /* #include */ const char spatialiteversion[] = "2.4.0"; @@ -50987,3 +51337,119177 @@ spatialite_version (void) } /**************** End file: version.c **********/ + +/**************** Begin file: gg_wkt.c **********/ + +#if defined(_WIN32) && !defined(__MINGW32__) +/* MSVC strictly requires this include [off_t] */ +/* #include */ +#endif + +/* #include */ +/* #include */ +/* #include */ + +/* #include */ + +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ +/* #include */ +#else +/* #include */ +#endif + +/* #include */ + +static int +checkValidity (gaiaGeomCollPtr geom) +{ +/* checks if this one is a degenerated geometry */ + gaiaPointPtr pt; + gaiaLinestringPtr ln; + gaiaPolygonPtr pg; + gaiaRingPtr rng; + int ib; + int entities = 0; + pt = geom->FirstPoint; + while (pt) + { + /* checking points */ + entities++; + pt = pt->Next; + } + ln = geom->FirstLinestring; + while (ln) + { + /* checking linestrings */ + if (ln->Points < 2) + return 0; + entities++; + ln = ln->Next; + } + pg = geom->FirstPolygon; + while (pg) + { + /* checking polygons */ + rng = pg->Exterior; + if (rng->Points < 4) + return 0; + for (ib = 0; ib < pg->NumInteriors; ib++) + { + rng = pg->Interiors + ib; + if (rng->Points < 4) + return 0; + } + entities++; + pg = pg->Next; + } + if (!entities) + return 0; + return 1; +} + +static void +gaiaOutClean (char *buffer) +{ +/* cleans unneeded trailing zeros */ + int i; + for (i = strlen (buffer) - 1; i > 0; i--) + { + if (buffer[i] == '0') + buffer[i] = '\0'; + else + break; + } + if (buffer[i] == '.') + buffer[i] = '\0'; +} + +GAIAGEO_DECLARE void +gaiaOutBufferInitialize (gaiaOutBufferPtr buf) +{ +/* initializing a dynamically growing output buffer */ + buf->Buffer = NULL; + buf->WriteOffset = 0; + buf->BufferSize = 0; + buf->Error = 0; +} + +GAIAGEO_DECLARE void +gaiaOutBufferReset (gaiaOutBufferPtr buf) +{ +/* cleaning a dynamically growing output buffer */ + if (buf->Buffer) + free (buf->Buffer); + buf->Buffer = NULL; + buf->WriteOffset = 0; + buf->BufferSize = 0; + buf->Error = 0; +} + +GAIAGEO_DECLARE void +gaiaAppendToOutBuffer (gaiaOutBufferPtr buf, const char *text) +{ +/* appending a text string */ + int len = strlen (text); + int free_size = buf->BufferSize - buf->WriteOffset; + if ((len + 1) > free_size) + { + /* we must allocate a bigger buffer */ + int new_size; + char *new_buf; + if (buf->BufferSize == 0) + new_size = 1024; + else if (buf->BufferSize <= 4196) + new_size = buf->BufferSize + (len + 1) + 4196; + else if (buf->BufferSize <= 65536) + new_size = buf->BufferSize + (len + 1) + 65536; + else + new_size = buf->BufferSize + (len + 1) + (1024 * 1024); + new_buf = malloc (new_size); + if (!new_buf) + { + buf->Error = 1; + return; + } + memcpy (new_buf, buf->Buffer, buf->WriteOffset); + if (buf->Buffer) + free (buf->Buffer); + buf->Buffer = new_buf; + buf->BufferSize = new_size; + } + strcpy (buf->Buffer + buf->WriteOffset, text); + buf->WriteOffset += len; +} + +static void +gaiaOutPoint (gaiaOutBufferPtr out_buf, gaiaPointPtr point) +{ +/* formats a WKT POINT */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + sprintf (buf_x, "%1.6f", point->X); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", point->Y); + gaiaOutClean (buf_y); + sprintf (buf, "%s %s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); +} + +static void +gaiaOutPointZ (gaiaOutBufferPtr out_buf, gaiaPointPtr point) +{ +/* formats a WKT POINTZ */ + char buf_x[128]; + char buf_y[128]; + char buf_z[128]; + char buf[512]; + sprintf (buf_x, "%1.6f", point->X); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", point->Y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%1.6f", point->Z); + gaiaOutClean (buf_z); + sprintf (buf, "%s %s %s", buf_x, buf_y, buf_z); + gaiaAppendToOutBuffer (out_buf, buf); +} + +static void +gaiaOutPointM (gaiaOutBufferPtr out_buf, gaiaPointPtr point) +{ +/* formats a WKT POINTM */ + char buf_x[128]; + char buf_y[128]; + char buf_m[128]; + char buf[512]; + sprintf (buf_x, "%1.6f", point->X); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", point->Y); + gaiaOutClean (buf_y); + sprintf (buf_m, "%1.6f", point->M); + gaiaOutClean (buf_m); + sprintf (buf, "%s %s %s", buf_x, buf_y, buf_m); + gaiaAppendToOutBuffer (out_buf, buf); +} + +static void +gaiaOutPointZM (gaiaOutBufferPtr out_buf, gaiaPointPtr point) +{ +/* formats a WKT POINTZM */ + char buf_x[128]; + char buf_y[128]; + char buf_z[128]; + char buf_m[128]; + char buf[1024]; + sprintf (buf_x, "%1.6f", point->X); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", point->Y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%1.6f", point->Z); + gaiaOutClean (buf_z); + sprintf (buf_m, "%1.6f", point->M); + gaiaOutClean (buf_m); + sprintf (buf, "%s %s %s %s", buf_x, buf_y, buf_z, buf_m); + gaiaAppendToOutBuffer (out_buf, buf); +} + +static void +gaiaOutLinestring (gaiaOutBufferPtr out_buf, gaiaLinestringPtr line) +{ +/* formats a WKT LINESTRING */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + double x; + double y; + int iv; + for (iv = 0; iv < line->Points; iv++) + { + gaiaGetPoint (line->Coords, iv, &x, &y); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + if (iv > 0) + sprintf (buf, ", %s %s", buf_x, buf_y); + else + sprintf (buf, "%s %s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + } +} + +static void +gaiaOutLinestringZ (gaiaOutBufferPtr out_buf, gaiaLinestringPtr line) +{ +/* formats a WKT LINESTRINGZ */ + char buf_x[128]; + char buf_y[128]; + char buf_z[128]; + char buf[512]; + double x; + double y; + double z; + int iv; + for (iv = 0; iv < line->Points; iv++) + { + gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%1.6f", z); + gaiaOutClean (buf_z); + if (iv > 0) + sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_z); + else + sprintf (buf, "%s %s %s", buf_x, buf_y, buf_z); + gaiaAppendToOutBuffer (out_buf, buf); + } +} + +static void +gaiaOutLinestringM (gaiaOutBufferPtr out_buf, gaiaLinestringPtr line) +{ +/* formats a WKT LINESTRINGM */ + char buf_x[128]; + char buf_y[128]; + char buf_m[128]; + char buf[512]; + double x; + double y; + double m; + int iv; + for (iv = 0; iv < line->Points; iv++) + { + gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + sprintf (buf_m, "%1.6f", m); + gaiaOutClean (buf_m); + if (iv > 0) + sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_m); + else + sprintf (buf, "%s %s %s", buf_x, buf_y, buf_m); + gaiaAppendToOutBuffer (out_buf, buf); + } +} + +static void +gaiaOutLinestringZM (gaiaOutBufferPtr out_buf, gaiaLinestringPtr line) +{ +/* formats a WKT LINESTRINGZM */ + char buf_x[128]; + char buf_y[128]; + char buf_z[128]; + char buf_m[128]; + char buf[1024]; + double x; + double y; + double z; + double m; + int iv; + for (iv = 0; iv < line->Points; iv++) + { + gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%1.6f", z); + gaiaOutClean (buf_z); + sprintf (buf_m, "%1.6f", m); + gaiaOutClean (buf_m); + if (iv > 0) + sprintf (buf, ", %s %s %s %s", buf_x, buf_y, buf_z, buf_m); + else + sprintf (buf, "%s %s %s %s", buf_x, buf_y, buf_z, buf_m); + gaiaAppendToOutBuffer (out_buf, buf); + } +} + +static void +gaiaOutPolygon (gaiaOutBufferPtr out_buf, gaiaPolygonPtr polyg) +{ +/* formats a WKT POLYGON */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + int ib; + int iv; + double x; + double y; + gaiaRingPtr ring = polyg->Exterior; + for (iv = 0; iv < ring->Points; iv++) + { + gaiaGetPoint (ring->Coords, iv, &x, &y); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + if (iv == 0) + sprintf (buf, "(%s %s", buf_x, buf_y); + else if (iv == (ring->Points - 1)) + sprintf (buf, ", %s %s)", buf_x, buf_y); + else + sprintf (buf, ", %s %s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + } + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + for (iv = 0; iv < ring->Points; iv++) + { + gaiaGetPoint (ring->Coords, iv, &x, &y); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + if (iv == 0) + sprintf (buf, ", (%s %s", buf_x, buf_y); + else if (iv == (ring->Points - 1)) + sprintf (buf, ", %s %s)", buf_x, buf_y); + else + sprintf (buf, ", %s %s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + } + } +} + +static void +gaiaOutPolygonZ (gaiaOutBufferPtr out_buf, gaiaPolygonPtr polyg) +{ +/* formats a WKT POLYGONZ */ + char buf_x[128]; + char buf_y[128]; + char buf_z[128]; + char buf[512]; + int ib; + int iv; + double x; + double y; + double z; + gaiaRingPtr ring = polyg->Exterior; + for (iv = 0; iv < ring->Points; iv++) + { + gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%1.6f", z); + gaiaOutClean (buf_z); + if (iv == 0) + sprintf (buf, "(%s %s %s", buf_x, buf_y, buf_z); + else if (iv == (ring->Points - 1)) + sprintf (buf, ", %s %s %s)", buf_x, buf_y, buf_z); + else + sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_z); + gaiaAppendToOutBuffer (out_buf, buf); + } + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + for (iv = 0; iv < ring->Points; iv++) + { + gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%1.6f", z); + gaiaOutClean (buf_z); + if (iv == 0) + sprintf (buf, ", (%s %s %s", buf_x, buf_y, buf_z); + else if (iv == (ring->Points - 1)) + sprintf (buf, ", %s %s %s)", buf_x, buf_y, buf_z); + else + sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_z); + gaiaAppendToOutBuffer (out_buf, buf); + } + } +} + +static void +gaiaOutPolygonM (gaiaOutBufferPtr out_buf, gaiaPolygonPtr polyg) +{ +/* formats a WKT POLYGONM */ + char buf_x[128]; + char buf_y[128]; + char buf_m[128]; + char buf[512]; + int ib; + int iv; + double x; + double y; + double m; + gaiaRingPtr ring = polyg->Exterior; + for (iv = 0; iv < ring->Points; iv++) + { + gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + sprintf (buf_m, "%1.6f", m); + gaiaOutClean (buf_m); + if (iv == 0) + sprintf (buf, "(%s %s %s", buf_x, buf_y, buf_m); + else if (iv == (ring->Points - 1)) + sprintf (buf, ", %s %s %s)", buf_x, buf_y, buf_m); + else + sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_m); + gaiaAppendToOutBuffer (out_buf, buf); + } + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + for (iv = 0; iv < ring->Points; iv++) + { + gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + sprintf (buf_m, "%1.6f", m); + gaiaOutClean (buf_m); + if (iv == 0) + sprintf (buf, ", (%s %s %s", buf_x, buf_y, buf_m); + else if (iv == (ring->Points - 1)) + sprintf (buf, ", %s %s %s)", buf_x, buf_y, buf_m); + else + sprintf (buf, ", %s %s %s", buf_x, buf_y, buf_m); + gaiaAppendToOutBuffer (out_buf, buf); + } + } +} + +static void +gaiaOutPolygonZM (gaiaOutBufferPtr out_buf, gaiaPolygonPtr polyg) +{ +/* formats a WKT POLYGONZM */ + char buf_x[128]; + char buf_y[128]; + char buf_z[128]; + char buf_m[128]; + char buf[1024]; + int ib; + int iv; + double x; + double y; + double z; + double m; + gaiaRingPtr ring = polyg->Exterior; + for (iv = 0; iv < ring->Points; iv++) + { + gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%1.6f", z); + gaiaOutClean (buf_z); + sprintf (buf_m, "%1.6f", m); + gaiaOutClean (buf_m); + if (iv == 0) + sprintf (buf, "(%s %s %s %s", buf_x, buf_y, buf_z, buf_m); + else if (iv == (ring->Points - 1)) + sprintf (buf, ", %s %s %s %s)", buf_x, buf_y, buf_z, buf_m); + else + sprintf (buf, ", %s %s %s %s", buf_x, buf_y, buf_z, buf_m); + gaiaAppendToOutBuffer (out_buf, buf); + } + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + for (iv = 0; iv < ring->Points; iv++) + { + gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); + sprintf (buf_x, "%1.6f", x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%1.6f", y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%1.6f", z); + gaiaOutClean (buf_z); + sprintf (buf_m, "%1.6f", m); + gaiaOutClean (buf_m); + if (iv == 0) + sprintf (buf, ", (%s %s %s %s", buf_x, buf_y, buf_z, buf_m); + else if (iv == (ring->Points - 1)) + sprintf (buf, ", %s %s %s %s)", buf_x, buf_y, buf_z, buf_m); + else + sprintf (buf, ", %s %s %s %s", buf_x, buf_y, buf_z, buf_m); + gaiaAppendToOutBuffer (out_buf, buf); + } + } +} + +GAIAGEO_DECLARE void +gaiaOutWkt (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom) +{ +/* prints the WKT representation of current geometry */ + int pts = 0; + int lns = 0; + int pgs = 0; + gaiaPointPtr point; + gaiaLinestringPtr line; + gaiaPolygonPtr polyg; + if (!geom) + return; + point = geom->FirstPoint; + while (point) + { + /* counting how many POINTs are there */ + pts++; + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + /* counting how many LINESTRINGs are there */ + lns++; + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + /* counting how many POLYGONs are there */ + pgs++; + polyg = polyg->Next; + } + if ((pts + lns + pgs) == 1 + && (geom->DeclaredType == GAIA_POINT + || geom->DeclaredType == GAIA_LINESTRING + || geom->DeclaredType == GAIA_POLYGON)) + { + /* we have only one elementary geometry */ + point = geom->FirstPoint; + while (point) + { + if (point->DimensionModel == GAIA_XY_Z) + { + /* processing POINTZ */ + gaiaAppendToOutBuffer (out_buf, "POINT Z("); + gaiaOutPointZ (out_buf, point); + } + else if (point->DimensionModel == GAIA_XY_M) + { + /* processing POINTM */ + gaiaAppendToOutBuffer (out_buf, "POINT M("); + gaiaOutPointM (out_buf, point); + } + else if (point->DimensionModel == GAIA_XY_Z_M) + { + /* processing POINTZM */ + gaiaAppendToOutBuffer (out_buf, "POINT ZM("); + gaiaOutPointZM (out_buf, point); + } + else + { + /* processing POINT */ + gaiaAppendToOutBuffer (out_buf, "POINT("); + gaiaOutPoint (out_buf, point); + } + gaiaAppendToOutBuffer (out_buf, ")"); + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + if (line->DimensionModel == GAIA_XY_Z) + { + /* processing LINESTRINGZ */ + gaiaAppendToOutBuffer (out_buf, "LINESTRING Z("); + gaiaOutLinestringZ (out_buf, line); + } + else if (line->DimensionModel == GAIA_XY_M) + { + /* processing LINESTRINGM */ + gaiaAppendToOutBuffer (out_buf, "LINESTRING M("); + gaiaOutLinestringM (out_buf, line); + } + else if (line->DimensionModel == GAIA_XY_Z_M) + { + /* processing LINESTRINGZM */ + gaiaAppendToOutBuffer (out_buf, "LINESTRING ZM("); + gaiaOutLinestringZM (out_buf, line); + } + else + { + /* processing LINESTRING */ + gaiaAppendToOutBuffer (out_buf, "LINESTRING("); + gaiaOutLinestring (out_buf, line); + } + gaiaAppendToOutBuffer (out_buf, ")"); + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + if (polyg->DimensionModel == GAIA_XY_Z) + { + /* processing POLYGONZ */ + gaiaAppendToOutBuffer (out_buf, "POLYGON Z("); + gaiaOutPolygonZ (out_buf, polyg); + } + else if (polyg->DimensionModel == GAIA_XY_M) + { + /* processing POLYGONM */ + gaiaAppendToOutBuffer (out_buf, "POLYGON M("); + gaiaOutPolygonM (out_buf, polyg); + } + else if (polyg->DimensionModel == GAIA_XY_Z_M) + { + /* processing POLYGONZM */ + gaiaAppendToOutBuffer (out_buf, "POLYGON ZM("); + gaiaOutPolygonZM (out_buf, polyg); + } + else + { + /* processing POLYGON */ + gaiaAppendToOutBuffer (out_buf, "POLYGON("); + gaiaOutPolygon (out_buf, polyg); + } + gaiaAppendToOutBuffer (out_buf, ")"); + polyg = polyg->Next; + } + } + else + { + /* we have some kind of complex geometry */ + if (pts > 0 && lns == 0 && pgs == 0 + && geom->DeclaredType == GAIA_MULTIPOINT) + { + /* some kind of MULTIPOINT */ + if (geom->DimensionModel == GAIA_XY_Z) + gaiaAppendToOutBuffer (out_buf, "MULTIPOINT Z("); + else if (geom->DimensionModel == GAIA_XY_M) + gaiaAppendToOutBuffer (out_buf, "MULTIPOINT M("); + else if (geom->DimensionModel == GAIA_XY_Z_M) + gaiaAppendToOutBuffer (out_buf, "MULTIPOINT ZM("); + else + gaiaAppendToOutBuffer (out_buf, "MULTIPOINT("); + point = geom->FirstPoint; + while (point) + { + if (point->DimensionModel == GAIA_XY_Z) + { + if (point != geom->FirstPoint) + gaiaAppendToOutBuffer (out_buf, ", "); + gaiaOutPointZ (out_buf, point); + } + else if (point->DimensionModel == GAIA_XY_M) + { + if (point != geom->FirstPoint) + gaiaAppendToOutBuffer (out_buf, ", "); + gaiaOutPointM (out_buf, point); + } + else if (point->DimensionModel == GAIA_XY_Z_M) + { + if (point != geom->FirstPoint) + gaiaAppendToOutBuffer (out_buf, ", "); + gaiaOutPointZM (out_buf, point); + } + else + { + if (point != geom->FirstPoint) + gaiaAppendToOutBuffer (out_buf, ", "); + gaiaOutPoint (out_buf, point); + } + point = point->Next; + } + gaiaAppendToOutBuffer (out_buf, ")"); + } + else if (pts == 0 && lns > 0 && pgs == 0 + && geom->DeclaredType == GAIA_MULTILINESTRING) + { + /* some kind of MULTILINESTRING */ + if (geom->DimensionModel == GAIA_XY_Z) + gaiaAppendToOutBuffer (out_buf, "MULTILINESTRING Z("); + else if (geom->DimensionModel == GAIA_XY_M) + gaiaAppendToOutBuffer (out_buf, "MULTILINESTRING M("); + else if (geom->DimensionModel == GAIA_XY_Z_M) + gaiaAppendToOutBuffer (out_buf, "MULTILINESTRING ZM("); + else + gaiaAppendToOutBuffer (out_buf, "MULTILINESTRING("); + line = geom->FirstLinestring; + while (line) + { + if (line != geom->FirstLinestring) + gaiaAppendToOutBuffer (out_buf, ", ("); + else + gaiaAppendToOutBuffer (out_buf, "("); + if (line->DimensionModel == GAIA_XY_Z) + { + gaiaOutLinestringZ (out_buf, line); + gaiaAppendToOutBuffer (out_buf, ")"); + } + else if (line->DimensionModel == GAIA_XY_M) + { + gaiaOutLinestringM (out_buf, line); + gaiaAppendToOutBuffer (out_buf, ")"); + } + else if (line->DimensionModel == GAIA_XY_Z_M) + { + gaiaOutLinestringZM (out_buf, line); + gaiaAppendToOutBuffer (out_buf, ")"); + } + else + { + gaiaOutLinestring (out_buf, line); + gaiaAppendToOutBuffer (out_buf, ")"); + } + line = line->Next; + } + gaiaAppendToOutBuffer (out_buf, ")"); + } + else if (pts == 0 && lns == 0 && pgs > 0 + && geom->DeclaredType == GAIA_MULTIPOLYGON) + { + /* some kind of MULTIPOLYGON */ + if (geom->DimensionModel == GAIA_XY_Z) + gaiaAppendToOutBuffer (out_buf, "MULTIPOLYGON Z("); + else if (geom->DimensionModel == GAIA_XY_M) + gaiaAppendToOutBuffer (out_buf, "MULTIPOLYGON M("); + else if (geom->DimensionModel == GAIA_XY_Z_M) + gaiaAppendToOutBuffer (out_buf, "MULTIPOLYGON ZM("); + else + gaiaAppendToOutBuffer (out_buf, "MULTIPOLYGON("); + polyg = geom->FirstPolygon; + while (polyg) + { + if (polyg != geom->FirstPolygon) + gaiaAppendToOutBuffer (out_buf, ", ("); + else + gaiaAppendToOutBuffer (out_buf, "("); + if (polyg->DimensionModel == GAIA_XY_Z) + { + gaiaOutPolygonZ (out_buf, polyg); + gaiaAppendToOutBuffer (out_buf, ")"); + } + else if (polyg->DimensionModel == GAIA_XY_M) + { + gaiaOutPolygonM (out_buf, polyg); + gaiaAppendToOutBuffer (out_buf, ")"); + } + else if (polyg->DimensionModel == GAIA_XY_Z_M) + { + gaiaOutPolygonZM (out_buf, polyg); + gaiaAppendToOutBuffer (out_buf, ")"); + } + else + { + gaiaOutPolygon (out_buf, polyg); + gaiaAppendToOutBuffer (out_buf, ")"); + } + polyg = polyg->Next; + } + gaiaAppendToOutBuffer (out_buf, ")"); + } + else + { + /* some kind of GEOMETRYCOLLECTION */ + int ie = 0; + if (geom->DimensionModel == GAIA_XY_Z) + gaiaAppendToOutBuffer (out_buf, "GEOMETRYCOLLECTION Z("); + else if (geom->DimensionModel == GAIA_XY_M) + gaiaAppendToOutBuffer (out_buf, "GEOMETRYCOLLECTION M("); + else if (geom->DimensionModel == GAIA_XY_Z_M) + gaiaAppendToOutBuffer (out_buf, "GEOMETRYCOLLECTION ZM("); + else + gaiaAppendToOutBuffer (out_buf, "GEOMETRYCOLLECTION("); + point = geom->FirstPoint; + while (point) + { + /* processing POINTs */ + if (ie > 0) + gaiaAppendToOutBuffer (out_buf, ", "); + ie++; + if (point->DimensionModel == GAIA_XY_Z) + { + gaiaAppendToOutBuffer (out_buf, "POINT Z("); + gaiaOutPointZ (out_buf, point); + } + else if (point->DimensionModel == GAIA_XY_M) + { + gaiaAppendToOutBuffer (out_buf, "POINT M("); + gaiaOutPointM (out_buf, point); + } + else if (point->DimensionModel == GAIA_XY_Z_M) + { + gaiaAppendToOutBuffer (out_buf, "POINT ZM("); + gaiaOutPointZM (out_buf, point); + } + else + { + gaiaAppendToOutBuffer (out_buf, "POINT("); + gaiaOutPoint (out_buf, point); + } + gaiaAppendToOutBuffer (out_buf, ")"); + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + /* processing LINESTRINGs */ + if (ie > 0) + gaiaAppendToOutBuffer (out_buf, ", "); + ie++; + if (line->DimensionModel == GAIA_XY_Z) + { + gaiaAppendToOutBuffer (out_buf, "LINESTRING Z("); + gaiaOutLinestringZ (out_buf, line); + } + else if (line->DimensionModel == GAIA_XY_M) + { + gaiaAppendToOutBuffer (out_buf, "LINESTRING M("); + gaiaOutLinestringM (out_buf, line); + } + else if (line->DimensionModel == GAIA_XY_Z_M) + { + gaiaAppendToOutBuffer (out_buf, "LINESTRING ZM("); + gaiaOutLinestringZM (out_buf, line); + } + else + { + gaiaAppendToOutBuffer (out_buf, "LINESTRING("); + gaiaOutLinestring (out_buf, line); + } + gaiaAppendToOutBuffer (out_buf, ")"); + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + /* processing POLYGONs */ + if (ie > 0) + gaiaAppendToOutBuffer (out_buf, ", "); + ie++; + if (polyg->DimensionModel == GAIA_XY_Z) + { + gaiaAppendToOutBuffer (out_buf, "POLYGON Z("); + gaiaOutPolygonZ (out_buf, polyg); + } + else if (polyg->DimensionModel == GAIA_XY_M) + { + gaiaAppendToOutBuffer (out_buf, "POLYGON M("); + gaiaOutPolygonM (out_buf, polyg); + } + else if (polyg->DimensionModel == GAIA_XY_Z_M) + { + gaiaAppendToOutBuffer (out_buf, "POLYGON ZM("); + gaiaOutPolygonZM (out_buf, polyg); + } + else + { + gaiaAppendToOutBuffer (out_buf, "POLYGON("); + gaiaOutPolygon (out_buf, polyg); + } + gaiaAppendToOutBuffer (out_buf, ")"); + polyg = polyg->Next; + } + gaiaAppendToOutBuffer (out_buf, ")"); + } + } +} + +/* +/ +/ Gaia common support for SVG encoded geometries +/ +//////////////////////////////////////////////////////////// +/ +/ Author: Klaus Foerster klaus.foerster@svg.cc +/ version 0.9. 2008 September 21 + / + */ + +static void +SvgCoords (gaiaOutBufferPtr out_buf, gaiaPointPtr point, int precision) +{ +/* formats POINT as SVG-attributes x,y */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + sprintf (buf_x, "%.*f", precision, point->X); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, point->Y * -1); + gaiaOutClean (buf_y); + sprintf (buf, "x=\"%s\" y=\"%s\"", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); +} + +static void +SvgCircle (gaiaOutBufferPtr out_buf, gaiaPointPtr point, int precision) +{ +/* formats POINT as SVG-attributes cx,cy */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + sprintf (buf_x, "%.*f", precision, point->X); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, point->Y * -1); + gaiaOutClean (buf_y); + sprintf (buf, "cx=\"%s\" cy=\"%s\"", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); +} + +static void +SvgPathRelative (gaiaOutBufferPtr out_buf, int dims, int points, double *coords, + int precision, int closePath) +{ +/* formats LINESTRING as SVG-path d-attribute with relative coordinate moves */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + double x; + double y; + double z; + double m; + double lastX = 0.0; + double lastY = 0.0; + int iv; + for (iv = 0; iv < points; iv++) + { + if (dims == GAIA_XY_Z) + { + gaiaGetPointXYZ (coords, iv, &x, &y, &z); + } + else if (dims == GAIA_XY_M) + { + gaiaGetPointXYM (coords, iv, &x, &y, &m); + } + else if (dims == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (coords, iv, &x, &y); + } + sprintf (buf_x, "%.*f", precision, x - lastX); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, (y - lastY) * -1); + gaiaOutClean (buf_y); + if (iv == 0) + sprintf (buf, "M %s %s l ", buf_x, buf_y); + else + sprintf (buf, "%s %s ", buf_x, buf_y); + lastX = x; + lastY = y; + if (iv == points - 1 && closePath == 1) + sprintf (buf, "z "); + gaiaAppendToOutBuffer (out_buf, buf); + } +} + +static void +SvgPathAbsolute (gaiaOutBufferPtr out_buf, int dims, int points, double *coords, + int precision, int closePath) +{ +/* formats LINESTRING as SVG-path d-attribute with relative coordinate moves */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + double x; + double y; + double z; + double m; + int iv; + for (iv = 0; iv < points; iv++) + { + if (dims == GAIA_XY_Z) + { + gaiaGetPointXYZ (coords, iv, &x, &y, &z); + } + else if (dims == GAIA_XY_M) + { + gaiaGetPointXYM (coords, iv, &x, &y, &m); + } + else if (dims == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (coords, iv, &x, &y); + } + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y * -1); + gaiaOutClean (buf_y); + if (iv == 0) + sprintf (buf, "M %s %s L ", buf_x, buf_y); + else + sprintf (buf, "%s %s ", buf_x, buf_y); + if (iv == points - 1 && closePath == 1) + sprintf (buf, "z "); + gaiaAppendToOutBuffer (out_buf, buf); + } +} + +GAIAGEO_DECLARE void +gaiaOutSvg (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int relative, + int precision) +{ +/* prints the SVG representation of current geometry */ + int pts = 0; + int lns = 0; + int pgs = 0; + int ib; + gaiaPointPtr point; + gaiaLinestringPtr line; + gaiaPolygonPtr polyg; + gaiaRingPtr ring; + if (!geom) + return; + point = geom->FirstPoint; + while (point) + { + /* counting how many POINTs are there */ + pts++; + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + /* counting how many LINESTRINGs are there */ + lns++; + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + /* counting how many POLYGONs are there */ + pgs++; + polyg = polyg->Next; + } + + if ((pts + lns + pgs) == 1) + { + /* we have only one elementary geometry */ + point = geom->FirstPoint; + while (point) + { + /* processing POINT */ + if (relative == 1) + SvgCoords (out_buf, point, precision); + else + SvgCircle (out_buf, point, precision); + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + /* processing LINESTRING */ + if (relative == 1) + SvgPathRelative (out_buf, line->DimensionModel, + line->Points, line->Coords, precision, 0); + else + SvgPathAbsolute (out_buf, line->DimensionModel, + line->Points, line->Coords, precision, 0); + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + /* process exterior and interior rings */ + ring = polyg->Exterior; + if (relative == 1) + { + SvgPathRelative (out_buf, ring->DimensionModel, + ring->Points, ring->Coords, precision, + 1); + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + SvgPathRelative (out_buf, ring->DimensionModel, + ring->Points, ring->Coords, + precision, 1); + } + } + else + { + SvgPathAbsolute (out_buf, ring->DimensionModel, + ring->Points, ring->Coords, precision, + 1); + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + SvgPathAbsolute (out_buf, ring->DimensionModel, + ring->Points, ring->Coords, + precision, 1); + } + } + polyg = polyg->Next; + } + } + else + { + /* we have some kind of complex geometry */ + if (pts > 0 && lns == 0 && pgs == 0) + { + /* this one is a MULTIPOINT */ + point = geom->FirstPoint; + while (point) + { + /* processing POINTs */ + if (point != geom->FirstPoint) + gaiaAppendToOutBuffer (out_buf, ","); + if (relative == 1) + SvgCoords (out_buf, point, precision); + else + SvgCircle (out_buf, point, precision); + point = point->Next; + } + } + else if (pts == 0 && lns > 0 && pgs == 0) + { + /* this one is a MULTILINESTRING */ + line = geom->FirstLinestring; + while (line) + { + /* processing LINESTRINGs */ + if (relative == 1) + SvgPathRelative (out_buf, line->DimensionModel, + line->Points, line->Coords, + precision, 0); + else + SvgPathAbsolute (out_buf, line->DimensionModel, + line->Points, line->Coords, + precision, 0); + line = line->Next; + } + } + else if (pts == 0 && lns == 0 && pgs > 0) + { + /* this one is a MULTIPOLYGON */ + polyg = geom->FirstPolygon; + while (polyg) + { + /* processing POLYGONs */ + ring = polyg->Exterior; + if (relative == 1) + { + SvgPathRelative (out_buf, ring->DimensionModel, + ring->Points, ring->Coords, + precision, 1); + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + SvgPathRelative (out_buf, + ring->DimensionModel, + ring->Points, ring->Coords, + precision, 1); + } + } + else + { + SvgPathAbsolute (out_buf, ring->DimensionModel, + ring->Points, ring->Coords, + precision, 1); + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + SvgPathAbsolute (out_buf, + ring->DimensionModel, + ring->Points, ring->Coords, + precision, 1); + } + } + polyg = polyg->Next; + } + } + else + { + /* this one is a GEOMETRYCOLLECTION */ + int ie = 0; + point = geom->FirstPoint; + while (point) + { + /* processing POINTs */ + if (ie > 0) + { + gaiaAppendToOutBuffer (out_buf, ";"); + } + ie++; + if (relative == 1) + SvgCoords (out_buf, point, precision); + else + SvgCircle (out_buf, point, precision); + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + /* processing LINESTRINGs */ + if (ie > 0) + gaiaAppendToOutBuffer (out_buf, ";"); + ie++; + if (relative == 1) + SvgPathRelative (out_buf, line->DimensionModel, + line->Points, line->Coords, + precision, 0); + else + SvgPathAbsolute (out_buf, line->DimensionModel, + line->Points, line->Coords, + precision, 0); + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + /* processing POLYGONs */ + ie++; + /* process exterior and interior rings */ + ring = polyg->Exterior; + if (relative == 1) + { + SvgPathRelative (out_buf, ring->DimensionModel, + ring->Points, ring->Coords, + precision, 1); + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + SvgPathRelative (out_buf, + ring->DimensionModel, + ring->Points, ring->Coords, + precision, 1); + } + } + else + { + SvgPathAbsolute (out_buf, ring->DimensionModel, + ring->Points, ring->Coords, + precision, 1); + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + ring = polyg->Interiors + ib; + SvgPathAbsolute (out_buf, + ring->DimensionModel, + ring->Points, ring->Coords, + precision, 1); + } + } + polyg = polyg->Next; + } + } + } +} + +/* END of Klaus Foerster SVG implementation */ + + +static char * +XmlClean (const char *string) +{ +/* well formatting a text string for XML */ + int ind; + char *clean; + char *p_out; + int len = strlen (string); + clean = malloc (len * 3); + if (!clean) + return NULL; + p_out = clean; + for (ind = 0; ind < len; ind++) + { + /* masking XML special chars */ + switch (string[ind]) + { + case '&': + *p_out++ = '&'; + *p_out++ = 'a'; + *p_out++ = 'm'; + *p_out++ = 'p'; + *p_out++ = ';'; + break; + case '<': + *p_out++ = '&'; + *p_out++ = 'l'; + *p_out++ = 't'; + *p_out++ = ';'; + break; + case '>': + *p_out++ = '&'; + *p_out++ = 'g'; + *p_out++ = 't'; + *p_out++ = ';'; + break; + case '"': + *p_out++ = '&'; + *p_out++ = 'q'; + *p_out++ = 'u'; + *p_out++ = 'o'; + *p_out++ = 't'; + *p_out++ = ';'; + break; + default: + *p_out++ = string[ind]; + break; + }; + } + *p_out = '\0'; + return clean; +} + +static void +out_bare_kml_point (gaiaOutBufferPtr out_buf, gaiaPointPtr point, int precision) +{ +/* formats POINT as 'bare' KML [x,y] */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + sprintf (buf_x, "%.*f", precision, point->X); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, point->Y); + gaiaOutClean (buf_y); + gaiaAppendToOutBuffer (out_buf, ""); + sprintf (buf, "%s,%s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + gaiaAppendToOutBuffer (out_buf, ""); +} + +static void +out_full_kml_point (gaiaOutBufferPtr out_buf, const char *name, + const char *desc, gaiaPointPtr point, int precision) +{ +/* formats POINT as 'full' KML [x,y] */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + char *xml_clean; + sprintf (buf_x, "%.*f", precision, point->X); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, point->Y); + gaiaOutClean (buf_y); + gaiaAppendToOutBuffer (out_buf, ""); + xml_clean = XmlClean (name); + if (xml_clean) + { + gaiaAppendToOutBuffer (out_buf, xml_clean); + free (xml_clean); + } + else + gaiaAppendToOutBuffer (out_buf, " "); + gaiaAppendToOutBuffer (out_buf, ""); + xml_clean = XmlClean (desc); + if (xml_clean) + { + gaiaAppendToOutBuffer (out_buf, xml_clean); + free (xml_clean); + } + else + gaiaAppendToOutBuffer (out_buf, " "); + gaiaAppendToOutBuffer (out_buf, ""); + sprintf (buf, "%s,%s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + gaiaAppendToOutBuffer (out_buf, ""); +} + +static void +out_bare_kml_linestring (gaiaOutBuffer * out_buf, int dims, int points, + double *coords, int precision) +{ +/* formats LINESTRING as 'bare' KML [x,y] */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + int iv; + double x; + double y; + double z; + double m; + gaiaAppendToOutBuffer (out_buf, ""); + for (iv = 0; iv < points; iv++) + { + /* exporting vertices */ + if (dims == GAIA_XY_Z) + { + gaiaGetPointXYZ (coords, iv, &x, &y, &z); + } + else if (dims == GAIA_XY_M) + { + gaiaGetPointXYM (coords, iv, &x, &y, &m); + } + else if (dims == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (coords, iv, &x, &y); + } + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + if (iv == 0) + sprintf (buf, "%s,%s", buf_x, buf_y); + else + sprintf (buf, " %s,%s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + } + gaiaAppendToOutBuffer (out_buf, ""); +} + +static void +out_full_kml_linestring (gaiaOutBufferPtr out_buf, const char *name, + const char *desc, int dims, int points, double *coords, + int precision) +{ +/* formats LINESTRING as 'full' KML [x,y] */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + char *xml_clean; + int iv; + double x; + double y; + double z; + double m; + gaiaAppendToOutBuffer (out_buf, ""); + xml_clean = XmlClean (name); + if (xml_clean) + { + gaiaAppendToOutBuffer (out_buf, xml_clean); + free (xml_clean); + } + else + gaiaAppendToOutBuffer (out_buf, " "); + gaiaAppendToOutBuffer (out_buf, ""); + xml_clean = XmlClean (desc); + if (xml_clean) + { + gaiaAppendToOutBuffer (out_buf, xml_clean); + free (xml_clean); + } + else + gaiaAppendToOutBuffer (out_buf, " "); + gaiaAppendToOutBuffer (out_buf, ""); + for (iv = 0; iv < points; iv++) + { + /* exporting vertices */ + if (dims == GAIA_XY_Z) + { + gaiaGetPointXYZ (coords, iv, &x, &y, &z); + } + else if (dims == GAIA_XY_M) + { + gaiaGetPointXYM (coords, iv, &x, &y, &m); + } + else if (dims == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (coords, iv, &x, &y); + } + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + if (iv == 0) + sprintf (buf, "%s,%s", buf_x, buf_y); + else + sprintf (buf, " %s,%s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + } + gaiaAppendToOutBuffer (out_buf, ""); +} + +static void +out_bare_kml_polygon (gaiaOutBufferPtr out_buf, gaiaPolygonPtr polygon, + int precision) +{ +/* formats POLYGON as 'bare' KML [x,y] */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + gaiaRingPtr ring; + int iv; + int ib; + double x; + double y; + double z; + double m; + gaiaAppendToOutBuffer (out_buf, ""); + gaiaAppendToOutBuffer (out_buf, + ""); + ring = polygon->Exterior; + for (iv = 0; iv < ring->Points; iv++) + { + /* exporting vertices [Exterior Ring] */ + if (ring->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z); + } + else if (ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); + } + else if (ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (ring->Coords, iv, &x, &y); + } + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + if (iv == 0) + sprintf (buf, "%s,%s", buf_x, buf_y); + else + sprintf (buf, " %s,%s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + } + gaiaAppendToOutBuffer (out_buf, + ""); + for (ib = 0; ib < polygon->NumInteriors; ib++) + { + /* interior rings */ + ring = polygon->Interiors + ib; + gaiaAppendToOutBuffer (out_buf, + ""); + for (iv = 0; iv < ring->Points; iv++) + { + /* exporting vertices [Interior Ring] */ + if (ring->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z); + } + else if (ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); + } + else if (ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (ring->Coords, iv, &x, &y); + } + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + if (iv == 0) + sprintf (buf, "%s,%s", buf_x, buf_y); + else + sprintf (buf, " %s,%s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + } + gaiaAppendToOutBuffer (out_buf, + ""); + } + strcpy (buf, ""); + gaiaAppendToOutBuffer (out_buf, buf); +} + +static void +out_full_kml_polygon (gaiaOutBufferPtr out_buf, const char *name, + const char *desc, gaiaPolygonPtr polygon, int precision) +{ +/* formats POLYGON as 'full' KML [x,y] */ + char buf_x[128]; + char buf_y[128]; + char buf[256]; + char *xml_clean; + gaiaRingPtr ring; + int iv; + int ib; + double x; + double y; + double z; + double m; + gaiaAppendToOutBuffer (out_buf, ""); + xml_clean = XmlClean (name); + if (xml_clean) + { + gaiaAppendToOutBuffer (out_buf, xml_clean); + free (xml_clean); + } + else + gaiaAppendToOutBuffer (out_buf, " "); + gaiaAppendToOutBuffer (out_buf, ""); + xml_clean = XmlClean (desc); + if (xml_clean) + { + gaiaAppendToOutBuffer (out_buf, xml_clean); + free (xml_clean); + } + else + gaiaAppendToOutBuffer (out_buf, " "); + gaiaAppendToOutBuffer (out_buf, ""); + gaiaAppendToOutBuffer (out_buf, + ""); + ring = polygon->Exterior; + for (iv = 0; iv < ring->Points; iv++) + { + /* exporting vertices [Exterior Ring] */ + if (ring->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z); + } + else if (ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); + } + else if (ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (ring->Coords, iv, &x, &y); + } + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + if (iv == 0) + sprintf (buf, "%s,%s", buf_x, buf_y); + else + sprintf (buf, " %s,%s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + } + gaiaAppendToOutBuffer (out_buf, + ""); + for (ib = 0; ib < polygon->NumInteriors; ib++) + { + /* interior rings */ + ring = polygon->Interiors + ib; + gaiaAppendToOutBuffer (out_buf, + ""); + for (iv = 0; iv < ring->Points; iv++) + { + /* exporting vertices [Interior Ring] */ + if (ring->DimensionModel == GAIA_XY_Z) + { + gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z); + } + else if (ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); + } + else if (ring->DimensionModel == GAIA_XY_Z_M) + { + gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (ring->Coords, iv, &x, &y); + } + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + if (iv == 0) + sprintf (buf, "%s,%s", buf_x, buf_y); + else + sprintf (buf, " %s,%s", buf_x, buf_y); + gaiaAppendToOutBuffer (out_buf, buf); + } + gaiaAppendToOutBuffer (out_buf, + ""); + } + gaiaAppendToOutBuffer (out_buf, ""); +} + +GAIAGEO_DECLARE void +gaiaOutFullKml (gaiaOutBufferPtr out_buf, const char *name, const char *desc, + gaiaGeomCollPtr geom, int precision) +{ +/* prints the 'full' KML representation of current geometry */ + gaiaPointPtr point; + gaiaLinestringPtr line; + gaiaPolygonPtr polyg; + if (!geom) + return; + if (precision > 18) + precision = 18; + point = geom->FirstPoint; + while (point) + { + /* processing POINT */ + out_full_kml_point (out_buf, name, desc, point, precision); + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + /* processing LINESTRING */ + out_full_kml_linestring (out_buf, name, desc, line->DimensionModel, + line->Points, line->Coords, precision); + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + /* processing POLYGON */ + out_full_kml_polygon (out_buf, name, desc, polyg, precision); + polyg = polyg->Next; + } +} + +GAIAGEO_DECLARE void +gaiaOutBareKml (gaiaOutBufferPtr out_buf, gaiaGeomCollPtr geom, int precision) +{ +/* prints the 'bare' KML representation of current geometry */ + gaiaPointPtr point; + gaiaLinestringPtr line; + gaiaPolygonPtr polyg; + if (!geom) + return; + if (precision > 18) + precision = 18; + point = geom->FirstPoint; + while (point) + { + /* processing POINT */ + out_bare_kml_point (out_buf, point, precision); + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + /* processing LINESTRING */ + out_bare_kml_linestring (out_buf, line->DimensionModel, line->Points, + line->Coords, precision); + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + /* processing POLYGON */ + out_bare_kml_polygon (out_buf, polyg, precision); + polyg = polyg->Next; + } +} + +GAIAGEO_DECLARE void +gaiaOutGml (gaiaOutBufferPtr out_buf, int version, int precision, + gaiaGeomCollPtr geom) +{ +/* +/ prints the GML representation of current geometry +/ *result* returns the encoded GML or NULL if any error is encountered +*/ + gaiaPointPtr point; + gaiaLinestringPtr line; + gaiaPolygonPtr polyg; + gaiaRingPtr ring; + int iv; + int ib; + double x; + double y; + double z; + double m; + int has_z; + int is_multi = 1; + char buf[1024]; + char buf_x[128]; + char buf_y[128]; + char buf_z[128]; + if (!geom) + return; + if (precision > 18) + precision = 18; + + switch (geom->DeclaredType) + { + case GAIA_POINT: + case GAIA_LINESTRING: + case GAIA_POLYGON: + *buf = '\0'; + is_multi = 0; + break; + case GAIA_MULTIPOINT: + sprintf (buf, "", geom->Srid); + break; + case GAIA_MULTILINESTRING: + if (version == 3) + sprintf (buf, "", + geom->Srid); + else + sprintf (buf, + "", + geom->Srid); + break; + case GAIA_MULTIPOLYGON: + if (version == 3) + sprintf (buf, "", + geom->Srid); + else + sprintf (buf, "", + geom->Srid); + break; + default: + sprintf (buf, "", geom->Srid); + break; + }; + gaiaAppendToOutBuffer (out_buf, buf); + point = geom->FirstPoint; + while (point) + { + /* processing POINT */ + if (is_multi) + { + strcpy (buf, ""); + strcat (buf, ""); + } + else + sprintf (buf, "", geom->Srid); + if (version == 3) + strcat (buf, ""); + else + strcat (buf, ""); + sprintf (buf_x, "%.*f", precision, point->X); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, point->Y); + gaiaOutClean (buf_y); + if (point->DimensionModel == GAIA_XY_Z + || point->DimensionModel == GAIA_XY_Z_M) + { + sprintf (buf_z, "%.*f", precision, point->Z); + gaiaOutClean (buf_z); + if (version == 3) + { + strcat (buf, buf_x); + strcat (buf, " "); + strcat (buf, buf_y); + strcat (buf, " "); + strcat (buf, buf_z); + } + else + { + strcat (buf, buf_x); + strcat (buf, ","); + strcat (buf, buf_y); + strcat (buf, ","); + strcat (buf, buf_z); + } + } + else + { + if (version == 3) + { + strcat (buf, buf_x); + strcat (buf, " "); + strcat (buf, buf_y); + } + else + { + strcat (buf, buf_x); + strcat (buf, ","); + strcat (buf, buf_y); + } + } + if (version == 3) + strcat (buf, ""); + else + strcat (buf, ""); + if (is_multi) + { + strcat (buf, ""); + strcat (buf, ""); + } + else + strcat (buf, ""); + gaiaAppendToOutBuffer (out_buf, buf); + point = point->Next; + } + line = geom->FirstLinestring; + while (line) + { + /* processing LINESTRING */ + if (is_multi) + { + if (version == 3) + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + else + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, + ""); + } + } + else + { + sprintf (buf, "", + geom->Srid); + if (version == 3) + strcat (buf, ""); + else + strcat (buf, + ""); + } + gaiaAppendToOutBuffer (out_buf, buf); + for (iv = 0; iv < line->Points; iv++) + { + /* exporting vertices */ + has_z = 0; + if (line->DimensionModel == GAIA_XY_Z) + { + has_z = 1; + gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); + } + else if (line->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); + } + else if (line->DimensionModel == GAIA_XY_Z_M) + { + has_z = 1; + gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (line->Coords, iv, &x, &y); + } + if (iv == 0) + *buf = '\0'; + else + strcpy (buf, " "); + if (has_z) + { + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%.*f", precision, z); + gaiaOutClean (buf_z); + if (version == 3) + { + strcat (buf, buf_x); + strcat (buf, " "); + strcat (buf, buf_y); + strcat (buf, " "); + strcat (buf, buf_z); + } + else + { + strcat (buf, buf_x); + strcat (buf, ","); + strcat (buf, buf_y); + strcat (buf, ","); + strcat (buf, buf_z); + } + } + else + { + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + if (version == 3) + { + strcat (buf, buf_x); + strcat (buf, " "); + strcat (buf, buf_y); + } + else + { + strcat (buf, buf_x); + strcat (buf, ","); + strcat (buf, buf_y); + } + } + gaiaAppendToOutBuffer (out_buf, buf); + } + if (is_multi) + { + if (version == 3) + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + else + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + } + else + { + if (version == 3) + strcpy (buf, ""); + else + strcpy (buf, ""); + strcat (buf, ""); + } + gaiaAppendToOutBuffer (out_buf, buf); + line = line->Next; + } + polyg = geom->FirstPolygon; + while (polyg) + { + /* processing POLYGON */ + if (is_multi) + { + if (version == 3) + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + else + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + strcat (buf, + ""); + } + } + else + { + sprintf (buf, "", geom->Srid); + if (version == 3) + { + strcat (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + else + { + strcat (buf, ""); + strcat (buf, ""); + strcat (buf, + ""); + } + } + gaiaAppendToOutBuffer (out_buf, buf); + ring = polyg->Exterior; + for (iv = 0; iv < ring->Points; iv++) + { + /* exporting vertices [Interior Ring] */ + has_z = 0; + if (ring->DimensionModel == GAIA_XY_Z) + { + has_z = 1; + gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z); + } + else if (ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); + } + else if (ring->DimensionModel == GAIA_XY_Z_M) + { + has_z = 1; + gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (ring->Coords, iv, &x, &y); + } + if (iv == 0) + *buf = '\0'; + else + strcpy (buf, " "); + if (has_z) + { + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%.*f", precision, z); + gaiaOutClean (buf_z); + if (version == 3) + { + strcat (buf, buf_x); + strcat (buf, " "); + strcat (buf, buf_y); + strcat (buf, " "); + strcat (buf, buf_z); + } + else + { + strcat (buf, buf_x); + strcat (buf, ","); + strcat (buf, buf_y); + strcat (buf, ","); + strcat (buf, buf_z); + } + } + else + { + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + if (version == 3) + { + strcat (buf, buf_x); + strcat (buf, " "); + strcat (buf, buf_y); + } + else + { + strcat (buf, buf_x); + strcat (buf, ","); + strcat (buf, buf_y); + } + } + gaiaAppendToOutBuffer (out_buf, buf); + } + /* closing the Exterior Ring */ + if (is_multi) + { + if (version == 3) + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + else + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + } + else + { + if (version == 3) + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + else + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + } + gaiaAppendToOutBuffer (out_buf, buf); + for (ib = 0; ib < polyg->NumInteriors; ib++) + { + /* interior rings */ + ring = polyg->Interiors + ib; + if (is_multi) + { + if (version == 3) + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + else + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, + ""); + } + } + else + { + if (version == 3) + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + else + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, + ""); + } + } + gaiaAppendToOutBuffer (out_buf, buf); + for (iv = 0; iv < ring->Points; iv++) + { + /* exporting vertices [Interior Ring] */ + has_z = 0; + if (ring->DimensionModel == GAIA_XY_Z) + { + has_z = 1; + gaiaGetPointXYZ (ring->Coords, iv, &x, &y, &z); + } + else if (ring->DimensionModel == GAIA_XY_M) + { + gaiaGetPointXYM (ring->Coords, iv, &x, &y, &m); + } + else if (ring->DimensionModel == GAIA_XY_Z_M) + { + has_z = 1; + gaiaGetPointXYZM (ring->Coords, iv, &x, &y, &z, &m); + } + else + { + gaiaGetPoint (ring->Coords, iv, &x, &y); + } + if (iv == 0) + *buf = '\0'; + else + strcpy (buf, " "); + if (has_z) + { + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + sprintf (buf_z, "%.*f", precision, z); + gaiaOutClean (buf_z); + if (version == 3) + { + strcat (buf, buf_x); + strcat (buf, " "); + strcat (buf, buf_y); + strcat (buf, " "); + strcat (buf, buf_z); + } + else + { + strcat (buf, buf_x); + strcat (buf, ","); + strcat (buf, buf_y); + strcat (buf, ","); + strcat (buf, buf_z); + } + } + else + { + sprintf (buf_x, "%.*f", precision, x); + gaiaOutClean (buf_x); + sprintf (buf_y, "%.*f", precision, y); + gaiaOutClean (buf_y); + if (version == 3) + { + strcat (buf, buf_x); + strcat (buf, " "); + strcat (buf, buf_y); + } + else + { + strcat (buf, buf_x); + strcat (buf, ","); + strcat (buf, buf_y); + } + } + gaiaAppendToOutBuffer (out_buf, buf); + } + /* closing the Interior Ring */ + if (is_multi) + { + if (version == 3) + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + else + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + } + else + { + if (version == 3) + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + else + { + strcpy (buf, ""); + strcat (buf, ""); + strcat (buf, ""); + } + } + gaiaAppendToOutBuffer (out_buf, buf); + } + /* closing the Polygon */ + if (is_multi) + { + if (version == 3) + { + strcpy (buf, ""); + strcat (buf, ""); + } + else + { + strcpy (buf, ""); + strcat (buf, ""); + } + } + else + strcpy (buf, ""); + gaiaAppendToOutBuffer (out_buf, buf); + polyg = polyg->Next; + } + switch (geom->DeclaredType) + { + case GAIA_POINT: + case GAIA_LINESTRING: + case GAIA_POLYGON: + *buf = '\0'; + break; + case GAIA_MULTIPOINT: + sprintf (buf, ""); + break; + case GAIA_MULTILINESTRING: + if (version == 3) + sprintf (buf, ""); + else + sprintf (buf, ""); + break; + case GAIA_MULTIPOLYGON: + if (version == 3) + sprintf (buf, ""); + else + sprintf (buf, ""); + break; + default: + sprintf (buf, ""); + break; + }; + gaiaAppendToOutBuffer (out_buf, buf); +} + + + +int vanuatu_parse_error; + +static gaiaGeomCollPtr +gaiaGeometryFromPoint (gaiaPointPtr point) +{ +/* builds a GEOMETRY containing a POINT */ + gaiaGeomCollPtr geom = NULL; + geom = gaiaAllocGeomColl (); + geom->DeclaredType = GAIA_POINT; + gaiaAddPointToGeomColl (geom, point->X, point->Y); + gaiaFreePoint (point); + return geom; +} + +static gaiaGeomCollPtr +gaiaGeometryFromPointZ (gaiaPointPtr point) +{ +/* builds a GEOMETRY containing a POINTZ */ + gaiaGeomCollPtr geom = NULL; + geom = gaiaAllocGeomCollXYZ (); + geom->DeclaredType = GAIA_POINTZ; + gaiaAddPointToGeomCollXYZ (geom, point->X, point->Y, point->Z); + gaiaFreePoint (point); + return geom; +} + +static gaiaGeomCollPtr +gaiaGeometryFromPointM (gaiaPointPtr point) +{ +/* builds a GEOMETRY containing a POINTM */ + gaiaGeomCollPtr geom = NULL; + geom = gaiaAllocGeomCollXYM (); + geom->DeclaredType = GAIA_POINTM; + gaiaAddPointToGeomCollXYM (geom, point->X, point->Y, point->M); + gaiaFreePoint (point); + return geom; +} + +static gaiaGeomCollPtr +gaiaGeometryFromPointZM (gaiaPointPtr point) +{ +/* builds a GEOMETRY containing a POINTZM */ + gaiaGeomCollPtr geom = NULL; + geom = gaiaAllocGeomCollXYZM (); + geom->DeclaredType = GAIA_POINTZM; + gaiaAddPointToGeomCollXYZM (geom, point->X, point->Y, point->Z, point->M); + gaiaFreePoint (point); + return geom; +} + +static gaiaGeomCollPtr +gaiaGeometryFromLinestring (gaiaLinestringPtr line) +{ +/* builds a GEOMETRY containing a LINESTRING */ + gaiaGeomCollPtr geom = NULL; + gaiaLinestringPtr line2; + int iv; + double x; + double y; + geom = gaiaAllocGeomColl (); + geom->DeclaredType = GAIA_LINESTRING; + line2 = gaiaAddLinestringToGeomColl (geom, line->Points); + for (iv = 0; iv < line2->Points; iv++) + { + /* sets the POINTS for the exterior ring */ + gaiaGetPoint (line->Coords, iv, &x, &y); + gaiaSetPoint (line2->Coords, iv, x, y); + } + gaiaFreeLinestring (line); + return geom; +} + +static gaiaGeomCollPtr +gaiaGeometryFromLinestringZ (gaiaLinestringPtr line) +{ +/* builds a GEOMETRY containing a LINESTRINGZ */ + gaiaGeomCollPtr geom = NULL; + gaiaLinestringPtr line2; + int iv; + double x; + double y; + double z; + geom = gaiaAllocGeomCollXYZ (); + geom->DeclaredType = GAIA_LINESTRING; + line2 = gaiaAddLinestringToGeomColl (geom, line->Points); + for (iv = 0; iv < line2->Points; iv++) + { + /* sets the POINTS for the exterior ring */ + gaiaGetPointXYZ (line->Coords, iv, &x, &y, &z); + gaiaSetPointXYZ (line2->Coords, iv, x, y, z); + } + gaiaFreeLinestring (line); + return geom; +} + + +static gaiaGeomCollPtr +gaiaGeometryFromLinestringM (gaiaLinestringPtr line) +{ +/* builds a GEOMETRY containing a LINESTRINGM */ + gaiaGeomCollPtr geom = NULL; + gaiaLinestringPtr line2; + int iv; + double x; + double y; + double m; + geom = gaiaAllocGeomCollXYM (); + geom->DeclaredType = GAIA_LINESTRING; + line2 = gaiaAddLinestringToGeomColl (geom, line->Points); + for (iv = 0; iv < line2->Points; iv++) + { + /* sets the POINTS for the exterior ring */ + gaiaGetPointXYM (line->Coords, iv, &x, &y, &m); + gaiaSetPointXYM (line2->Coords, iv, x, y, m); + } + gaiaFreeLinestring (line); + return geom; +} + +static gaiaGeomCollPtr +gaiaGeometryFromLinestringZM (gaiaLinestringPtr line) +{ +/* builds a GEOMETRY containing a LINESTRINGZM */ + gaiaGeomCollPtr geom = NULL; + gaiaLinestringPtr line2; + int iv; + double x; + double y; + double z; + double m; + geom = gaiaAllocGeomCollXYZM (); + geom->DeclaredType = GAIA_LINESTRING; + line2 = gaiaAddLinestringToGeomColl (geom, line->Points); + for (iv = 0; iv < line2->Points; iv++) + { + /* sets the POINTS for the exterior ring */ + gaiaGetPointXYZM (line->Coords, iv, &x, &y, &z, &m); + gaiaSetPointXYZM (line2->Coords, iv, x, y, z, m); + } + gaiaFreeLinestring (line); + return geom; +} + +/****************************************************************************** +** The following code was created by Team Vanuatu of The University of Toronto. +** It is responsible for handling the parsing of wkt expressions. The parser +** is built using LEMON and the cooresponding methods were written by the +** students. + +Authors: +Ruppi Rana ruppi.rana@gmail.com +Dev Tanna dev.tanna@gmail.com +Elias Adum elias.adum@gmail.com +Benton Hui benton.hui@gmail.com +Abhayan Sundararajan abhayan@gmail.com +Chee-Lun Michael Stephen Cho cheelun.cho@gmail.com +Nikola Banovic nikola.banovic@gmail.com +Yong Jian yong.jian@utoronto.ca + +Supervisor: +Greg Wilson gvwilson@cs.toronto.ca + +------------------------------------------------------------------------------- +*/ + +/* + * Creates a 2D (xy) point in SpatiaLite + * x and y are pointers to doubles which represent the x and y coordinates of the point to be created. + * Returns a gaiaPointPtr representing the created point. + * + * Creates a 2D (xy) point. This is a parser helper function which is called when 2D coordinates are encountered. + * Parameters x and y are pointers to doubles which represent the x and y coordinates of the point to be created. + * Returns a gaiaPointPtr pointing to the created 2D point. + */ +static gaiaPointPtr +vanuatu_point_xy (double *x, double *y) +{ + return gaiaAllocPoint (*x, *y); +} + +/* + * Creates a 3D (xyz) point in SpatiaLite + * x, y, and z are pointers to doubles which represent the x, y, and z coordinates of the point to be created. + * Returns a gaiaPointPtr representing the created point. + * + * Creates a 3D (xyz) point. This is a parser helper function which is called when 3D coordinates are encountered. + * Parameters x, y, and z are pointers to doubles which represent the x, y, and z coordinates of the point to be created. + * Returns a gaiaPointPtr pointing to the 3D created point. + */ +static gaiaPointPtr +vanuatu_point_xyz (double *x, double *y, double *z) +{ + return gaiaAllocPointXYZ (*x, *y, *z); +} + +/* + * Creates a 2D (xy) point with an m value which is a part of the linear reference system. This is a parser helper + * function which is called when 2D *coordinates with an m value are encountered. + * Parameters x and y are pointers to doubles which represent the x and y coordinates of the point to be created. + * Parameter m is a pointer to a double which represents the part of the linear reference system. + * Returns a gaiaPointPtr pointing to the created 2D point with an m value. + */ +static gaiaPointPtr +vanuatu_point_xym (double *x, double *y, double *m) +{ + return gaiaAllocPointXYM (*x, *y, *m); +} + +/* + * Creates a 4D (xyz) point with an m value which is a part of the linear reference system. This is a parser helper + * function which is called when *4Dcoordinates with an m value are encountered + * Parameters x, y, and z are pointers to doubles which represent the x, y, and z coordinates of the point to be created. + * Parameter m is a pointer to a double which represents the part of the linear reference system. + * Returns a gaiaPointPtr pointing the created 4D point with an m value. + */ +gaiaPointPtr +vanuatu_point_xyzm (double *x, double *y, double *z, double *m) +{ + return gaiaAllocPointXYZM (*x, *y, *z, *m); +} + +/* + * Builds a geometry collection from a point. The geometry collection should contain only one element ? the point. + * The correct geometry type must be *decided based on the point type. The parser should call this function when the + * ?POINT? WKT expression is encountered. + * Parameter point is a pointer to a 2D, 3D, 2D with an m value, or 4D with an m value point. + * Returns a geometry collection containing the point. The geometry must have FirstPoint and LastPoint pointing to the + * same place as point. *DimensionModel must be the same as the model of the point and DimensionType must be GAIA_TYPE_POINT. + */ +static gaiaGeomCollPtr +vanuatu_buildGeomFromPoint (gaiaPointPtr point) +{ + switch (point->DimensionModel) + { + case GAIA_XY: + return gaiaGeometryFromPoint (point); + break; + case GAIA_XY_Z: + return gaiaGeometryFromPointZ (point); + break; + case GAIA_XY_M: + return gaiaGeometryFromPointM (point); + break; + case GAIA_XY_Z_M: + return gaiaGeometryFromPointZM (point); + break; + } + return NULL; +} + +/* + * Creates a 2D (xy) linestring from a list of 2D points. + * + * Parameter first is a gaiaPointPtr to the first point in a linked list of points which define the linestring. + * All of the points in the list must be 2D (xy) points. There must be at least 2 points in the list. + * + * Returns a pointer to linestring containing all of the points in the list. + */ +static gaiaLinestringPtr +vanuatu_linestring_xy (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + int points = 0; + int i = 0; + gaiaLinestringPtr linestring; + + while (p != NULL) + { + p = p->Next; + points++; + } + + linestring = gaiaAllocLinestring (points); + + p = first; + while (p != NULL) + { + gaiaSetPoint (linestring->Coords, i, p->X, p->Y); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + i++; + } + + return linestring; +} + +/* + * Creates a 3D (xyz) linestring from a list of 3D points. + * + * Parameter first is a gaiaPointPtr to the first point in a linked list of points which define the linestring. + * All of the points in the list must be 3D (xyz) points. There must be at least 2 points in the list. + * + * Returns a pointer to linestring containing all of the points in the list. + */ +static gaiaLinestringPtr +vanuatu_linestring_xyz (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + int points = 0; + int i = 0; + gaiaLinestringPtr linestring; + + while (p != NULL) + { + p = p->Next; + points++; + } + + linestring = gaiaAllocLinestringXYZ (points); + + p = first; + while (p != NULL) + { + gaiaSetPointXYZ (linestring->Coords, i, p->X, p->Y, p->Z); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + i++; + } + + return linestring; +} + +/* + * Creates a 2D (xy) with m value linestring from a list of 2D with m value points. + * + * Parameter first is a gaiaPointPtr to the first point in a linked list of points which define the linestring. + * All of the points in the list must be 2D (xy) with m value points. There must be at least 2 points in the list. + * + * Returns a pointer to linestring containing all of the points in the list. + */ +static gaiaLinestringPtr +vanuatu_linestring_xym (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + int points = 0; + int i = 0; + gaiaLinestringPtr linestring; + + while (p != NULL) + { + p = p->Next; + points++; + } + + linestring = gaiaAllocLinestringXYM (points); + + p = first; + while (p != NULL) + { + gaiaSetPointXYM (linestring->Coords, i, p->X, p->Y, p->M); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + i++; + } + + return linestring; +} + +/* + * Creates a 4D (xyz) with m value linestring from a list of 4D with m value points. + * + * Parameter first is a gaiaPointPtr to the first point in a linked list of points which define the linestring. + * All of the points in the list must be 4D (xyz) with m value points. There must be at least 2 points in the list. + * + * Returns a pointer to linestring containing all of the points in the list. + */ +static gaiaLinestringPtr +vanuatu_linestring_xyzm (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + int points = 0; + int i = 0; + gaiaLinestringPtr linestring; + + while (p != NULL) + { + p = p->Next; + points++; + } + + linestring = gaiaAllocLinestringXYZM (points); + + p = first; + while (p != NULL) + { + gaiaSetPointXYZM (linestring->Coords, i, p->X, p->Y, p->Z, p->M); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + i++; + } + + return linestring; +} + +/* + * Builds a geometry collection from a linestring. + */ +static gaiaGeomCollPtr +vanuatu_buildGeomFromLinestring (gaiaLinestringPtr line) +{ + switch (line->DimensionModel) + { + case GAIA_XY: + return gaiaGeometryFromLinestring (line); + break; + case GAIA_XY_Z: + return gaiaGeometryFromLinestringZ (line); + break; + case GAIA_XY_M: + return gaiaGeometryFromLinestringM (line); + break; + case GAIA_XY_Z_M: + return gaiaGeometryFromLinestringZM (line); + break; + } + return NULL; +} + +/* + * Helper function that determines the number of points in the linked list. + */ +static int +count_points (gaiaPointPtr first) +{ + /* Counts the number of points in the ring. */ + gaiaPointPtr p = first; + int numpoints = 0; + while (p != NULL) + { + numpoints++; + p = p->Next; + } + return numpoints; +} + +/* + * Creates a 2D (xy) ring in SpatiaLite + * + * first is a gaiaPointPtr to the first point in a linked list of points which define the polygon. + * All of the points given to the function are 2D (xy) points. There will be at least 4 points in the list. + * + * Returns the ring defined by the points given to the function. + */ +static gaiaRingPtr +vanuatu_ring_xy (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + gaiaRingPtr ring = NULL; + int numpoints; + int index; + + /* If no pointers are given, return. */ + if (first == NULL) + return NULL; + + /* Counts the number of points in the ring. */ + numpoints = count_points (first); + if (numpoints < 4) + return NULL; + + /* Creates and allocates a ring structure. */ + ring = gaiaAllocRing (numpoints); + if (ring == NULL) + return NULL; + + /* Adds every point into the ring structure. */ + p = first; + for (index = 0; index < numpoints; index++) + { + gaiaSetPoint (ring->Coords, index, p->X, p->Y); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + } + + return ring; +} + +/* + * Creates a 3D (xyz) ring in SpatiaLite + * + * first is a gaiaPointPtr to the first point in a linked list of points which define the polygon. + * All of the points given to the function are 3D (xyz) points. There will be at least 4 points in the list. + * + * Returns the ring defined by the points given to the function. + */ +static gaiaRingPtr +vanuatu_ring_xyz (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + gaiaRingPtr ring = NULL; + int numpoints; + int index; + + /* If no pointers are given, return. */ + if (first == NULL) + return NULL; + + /* Counts the number of points in the ring. */ + numpoints = count_points (first); + if (numpoints < 4) + return NULL; + + /* Creates and allocates a ring structure. */ + ring = gaiaAllocRingXYZ (numpoints); + if (ring == NULL) + return NULL; + + /* Adds every point into the ring structure. */ + p = first; + for (index = 0; index < numpoints; index++) + { + gaiaSetPointXYZ (ring->Coords, index, p->X, p->Y, p->Z); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + } + + return ring; +} + +/* + * Creates a 2D (xym) ring in SpatiaLite + * + * first is a gaiaPointPtr to the first point in a linked list of points which define the polygon. + * All of the points given to the function are 2D (xym) points. There will be at least 4 points in the list. + * + * Returns the ring defined by the points given to the function. + */ +static gaiaRingPtr +vanuatu_ring_xym (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + gaiaRingPtr ring = NULL; + int numpoints; + int index; + + /* If no pointers are given, return. */ + if (first == NULL) + return NULL; + + /* Counts the number of points in the ring. */ + numpoints = count_points (first); + if (numpoints < 4) + return NULL; + + /* Creates and allocates a ring structure. */ + ring = gaiaAllocRingXYM (numpoints); + if (ring == NULL) + return NULL; + + /* Adds every point into the ring structure. */ + p = first; + for (index = 0; index < numpoints; index++) + { + gaiaSetPointXYM (ring->Coords, index, p->X, p->Y, p->M); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + } + + return ring; +} + +/* + * Creates a 3D (xyzm) ring in SpatiaLite + * + * first is a gaiaPointPtr to the first point in a linked list of points which define the polygon. + * All of the points given to the function are 3D (xyzm) points. There will be at least 4 points in the list. + * + * Returns the ring defined by the points given to the function. + */ +static gaiaRingPtr +vanuatu_ring_xyzm (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + gaiaRingPtr ring = NULL; + int numpoints; + int index; + + /* If no pointers are given, return. */ + if (first == NULL) + return NULL; + + /* Counts the number of points in the ring. */ + numpoints = count_points (first); + if (numpoints < 4) + return NULL; + + /* Creates and allocates a ring structure. */ + ring = gaiaAllocRingXYZM (numpoints); + if (ring == NULL) + return NULL; + + /* Adds every point into the ring structure. */ + p = first; + for (index = 0; index < numpoints; index++) + { + gaiaSetPointXYZM (ring->Coords, index, p->X, p->Y, p->Z, p->M); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + } + + return ring; +} + +/* + * Helper function that will create any type of polygon (xy, xym, xyz, xyzm) in SpatiaLite. + * + * first is a gaiaRingPtr to the first ring in a linked list of rings which define the polygon. + * The first ring in the linked list is the external ring while the rest (if any) are internal rings. + * All of the rings given to the function are of the same type. There will be at least 1 ring in the list. + * + * Returns the polygon defined by the rings given to the function. + */ +static gaiaPolygonPtr +polygon_any_type (gaiaRingPtr first) +{ + gaiaRingPtr p; + gaiaRingPtr p_n; + gaiaPolygonPtr polygon; + /* If no pointers are given, return. */ + if (first == NULL) + return NULL; + + /* Creates and allocates a polygon structure with the exterior ring. */ + polygon = gaiaCreatePolygon (first); + if (polygon == NULL) + return NULL; + + /* Adds all interior rings into the polygon structure. */ + p = first; + while (p != NULL) + { + p_n = p->Next; + if (p == first) + gaiaFreeRing (p); + else + gaiaAddRingToPolyg (polygon, p); + p = p_n; + } + + return polygon; +} + +/* + * Creates a 2D (xy) polygon in SpatiaLite + * + * first is a gaiaRingPtr to the first ring in a linked list of rings which define the polygon. + * The first ring in the linked list is the external ring while the rest (if any) are internal rings. + * All of the rings given to the function are 2D (xy) rings. There will be at least 1 ring in the list. + * + * Returns the polygon defined by the rings given to the function. + */ +static gaiaPolygonPtr +vanuatu_polygon_xy (gaiaRingPtr first) +{ + return polygon_any_type (first); +} + +/* + * Creates a 3D (xyz) polygon in SpatiaLite + * + * first is a gaiaRingPtr to the first ring in a linked list of rings which define the polygon. + * The first ring in the linked list is the external ring while the rest (if any) are internal rings. + * All of the rings given to the function are 3D (xyz) rings. There will be at least 1 ring in the list. + * + * Returns the polygon defined by the rings given to the function. + */ +static gaiaPolygonPtr +vanuatu_polygon_xyz (gaiaRingPtr first) +{ + return polygon_any_type (first); +} + +/* + * Creates a 2D (xym) polygon in SpatiaLite + * + * first is a gaiaRingPtr to the first ring in a linked list of rings which define the polygon. + * The first ring in the linked list is the external ring while the rest (if any) are internal rings. + * All of the rings given to the function are 2D (xym) rings. There will be at least 1 ring in the list. + * + * Returns the polygon defined by the rings given to the function. + */ +static gaiaPolygonPtr +vanuatu_polygon_xym (gaiaRingPtr first) +{ + return polygon_any_type (first); +} + +/* + * Creates a 3D (xyzm) polygon in SpatiaLite + * + * first is a gaiaRingPtr to the first ring in a linked list of rings which define the polygon. + * The first ring in the linked list is the external ring while the rest (if any) are internal rings. + * All of the rings given to the function are 3D (xyzm) rings. There will be at least 1 ring in the list. + * + * Returns the polygon defined by the rings given to the function. + */ +static gaiaPolygonPtr +vanuatu_polygon_xyzm (gaiaRingPtr first) +{ + return polygon_any_type (first); +} + +/* + * Builds a geometry collection from a polygon. + * NOTE: This function may already be implemented in the SpatiaLite code base. If it is, make sure that we + * can use it (ie. it doesn't use any other variables or anything else set by Sandro's parser). If you find + * that we can use an existing function then ignore this one. + */ +static gaiaGeomCollPtr +buildGeomFromPolygon (gaiaPolygonPtr polygon) +{ + gaiaGeomCollPtr geom = NULL; + + /* If no pointers are given, return. */ + if (polygon == NULL) + { + return NULL; + } + + /* Creates and allocates a geometry collection containing a multipoint. */ + switch (polygon->DimensionModel) + { + case GAIA_XY: + geom = gaiaAllocGeomColl (); + break; + case GAIA_XY_Z: + geom = gaiaAllocGeomCollXYZ (); + break; + case GAIA_XY_M: + geom = gaiaAllocGeomCollXYM (); + break; + case GAIA_XY_Z_M: + geom = gaiaAllocGeomCollXYZM (); + break; + } + if (geom == NULL) + { + return NULL; + } + geom->DeclaredType = GAIA_POLYGON; + + /* Stores the location of the first and last polygons in the linked list. */ + geom->FirstPolygon = polygon; + while (polygon != NULL) + { + geom->LastPolygon = polygon; + polygon = polygon->Next; + } + return geom; +} + +/* + * Creates a 2D (xy) multipoint object in SpatiaLite + * + * first is a gaiaPointPtr to the first point in a linked list of points. + * All of the points given to the function are 2D (xy) points. There will be at least 1 point in the list. + * + * Returns a geometry collection containing the created multipoint object. + */ +static gaiaGeomCollPtr +vanuatu_multipoint_xy (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + gaiaGeomCollPtr geom = NULL; + + /* If no pointers are given, return. */ + if (first == NULL) + return NULL; + + /* Creates and allocates a geometry collection containing a multipoint. */ + geom = gaiaAllocGeomColl (); + if (geom == NULL) + return NULL; + geom->DeclaredType = GAIA_MULTIPOINT; + + /* For every 2D (xy) point, add it to the geometry collection. */ + while (p != NULL) + { + gaiaAddPointToGeomColl (geom, p->X, p->Y); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + } + return geom; +} + +/* + * Creates a 3D (xyz) multipoint object in SpatiaLite + * + * first is a gaiaPointPtr to the first point in a linked list of points. + * All of the points given to the function are 3D (xyz) points. There will be at least 1 point in the list. + * + * Returns a geometry collection containing the created multipoint object. + */ +static gaiaGeomCollPtr +vanuatu_multipoint_xyz (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + gaiaGeomCollPtr geom = NULL; + + /* If no pointers are given, return. */ + if (first == NULL) + return NULL; + + /* Creates and allocates a geometry collection containing a multipoint. */ + geom = gaiaAllocGeomCollXYZ (); + if (geom == NULL) + return NULL; + geom->DeclaredType = GAIA_MULTIPOINT; + + /* For every 3D (xyz) point, add it to the geometry collection. */ + while (p != NULL) + { + gaiaAddPointToGeomCollXYZ (geom, p->X, p->Y, p->Z); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + } + return geom; +} + +/* + * Creates a 2D (xym) multipoint object in SpatiaLite + * + * first is a gaiaPointPtr to the first point in a linked list of points. + * All of the points given to the function are 2D (xym) points. There will be at least 1 point in the list. + * + * Returns a geometry collection containing the created multipoint object. + */ +static gaiaGeomCollPtr +vanuatu_multipoint_xym (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + gaiaGeomCollPtr geom = NULL; + + /* If no pointers are given, return. */ + if (first == NULL) + return NULL; + + /* Creates and allocates a geometry collection containing a multipoint. */ + geom = gaiaAllocGeomCollXYM (); + if (geom == NULL) + return NULL; + geom->DeclaredType = GAIA_MULTIPOINT; + + /* For every 2D (xym) point, add it to the geometry collection. */ + while (p != NULL) + { + gaiaAddPointToGeomCollXYM (geom, p->X, p->Y, p->M); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + } + return geom; +} + +/* + * Creates a 3D (xyzm) multipoint object in SpatiaLite + * + * first is a gaiaPointPtr to the first point in a linked list of points which define the linestring. + * All of the points given to the function are 3D (xyzm) points. There will be at least 1 point in the list. + * + * Returns a geometry collection containing the created multipoint object. + */ +static gaiaGeomCollPtr +vanuatu_multipoint_xyzm (gaiaPointPtr first) +{ + gaiaPointPtr p = first; + gaiaPointPtr p_n; + gaiaGeomCollPtr geom = NULL; + + /* If no pointers are given, return. */ + if (first == NULL) + return NULL; + + /* Creates and allocates a geometry collection containing a multipoint. */ + geom = gaiaAllocGeomCollXYZM (); + if (geom == NULL) + return NULL; + geom->DeclaredType = GAIA_MULTIPOINT; + + /* For every 3D (xyzm) point, add it to the geometry collection. */ + while (p != NULL) + { + gaiaAddPointToGeomCollXYZM (geom, p->X, p->Y, p->Z, p->M); + p_n = p->Next; + gaiaFreePoint (p); + p = p_n; + } + return geom; +} + +/* + * Creates a geometry collection containing 2D (xy) linestrings. + * Parameter first is a gaiaLinestringPtr to the first linestring in a linked list of linestrings which should be added to the + * collection. All of the *linestrings in the list must be 2D (xy) linestrings. There must be at least 1 linestring in the list. + * Returns a pointer to the created geometry collection of 2D linestrings. The geometry must have FirstLinestring pointing to the + * first linestring in the list pointed by first and LastLinestring pointing to the last element of the same list. DimensionModel + * must be GAIA_XY and DimensionType must be *GAIA_TYPE_LINESTRING. + */ + +static gaiaGeomCollPtr +vanuatu_multilinestring_xy (gaiaLinestringPtr first) +{ + gaiaLinestringPtr p = first; + gaiaLinestringPtr p_n; + gaiaLinestringPtr new_line; + gaiaGeomCollPtr a = gaiaAllocGeomColl (); + a->DeclaredType = GAIA_MULTILINESTRING; + a->DimensionModel = GAIA_XY; + + while (p) + { + new_line = gaiaAddLinestringToGeomColl (a, p->Points); + gaiaCopyLinestringCoords (new_line, p); + p_n = p->Next; + gaiaFreeLinestring (p); + p = p_n; + } + + return a; +} + +/* + * Returns a geometry collection containing the created multilinestring object (?). + * Creates a geometry collection containing 3D (xyz) linestrings. + * Parameter first is a gaiaLinestringPtr to the first linestring in a linked list of linestrings which should be added to the + * collection. All of the *linestrings in the list must be 3D (xyz) linestrings. There must be at least 1 linestring in the list. + * Returns a pointer to the created geometry collection of 3D linestrings. The geometry must have FirstLinestring pointing to the + * first linestring in the *list pointed by first and LastLinestring pointing to the last element of the same list. DimensionModel + * must be GAIA_XYZ and DimensionType must be *GAIA_TYPE_LINESTRING. + */ +static gaiaGeomCollPtr +vanuatu_multilinestring_xyz (gaiaLinestringPtr first) +{ + gaiaLinestringPtr p = first; + gaiaLinestringPtr p_n; + gaiaLinestringPtr new_line; + gaiaGeomCollPtr a = gaiaAllocGeomCollXYZ (); + a->DeclaredType = GAIA_MULTILINESTRING; + a->DimensionModel = GAIA_XY_Z; + + while (p) + { + new_line = gaiaAddLinestringToGeomColl (a, p->Points); + gaiaCopyLinestringCoords (new_line, p); + p_n = p->Next; + gaiaFreeLinestring (p); + p = p_n; + } + return a; +} + +/* + * Creates a geometry collection containing 2D (xy) with m value linestrings. + * Parameter first is a gaiaLinestringPtr to the first linestring in a linked list of linestrings which should be added to the + * collection. All of the *linestrings in the list must be 2D (xy) with m value linestrings. There must be at least 1 linestring + * in the list. + * Returns a pointer to the created geometry collection of 2D with m value linestrings. The geometry must have FirstLinestring + * pointing to the first *linestring in the list pointed by first and LastLinestring pointing to the last element of the same list. + * DimensionModel must be GAIA_XYM and *DimensionType must be GAIA_TYPE_LINESTRING. + */ +static gaiaGeomCollPtr +vanuatu_multilinestring_xym (gaiaLinestringPtr first) +{ + gaiaLinestringPtr p = first; + gaiaLinestringPtr p_n; + gaiaLinestringPtr new_line; + gaiaGeomCollPtr a = gaiaAllocGeomCollXYM (); + a->DeclaredType = GAIA_MULTILINESTRING; + a->DimensionModel = GAIA_XY_M; + + while (p) + { + new_line = gaiaAddLinestringToGeomColl (a, p->Points); + gaiaCopyLinestringCoords (new_line, p); + p_n = p->Next; + gaiaFreeLinestring (p); + p = p_n; + } + + return a; +} + +/* + * Creates a geometry collection containing 4D (xyz) with m value linestrings. + * Parameter first is a gaiaLinestringPtr to the first linestring in a linked list of linestrings which should be added to the + * collection. All of the *linestrings in the list must be 4D (xyz) with m value linestrings. There must be at least 1 linestring + * in the list. + * Returns a pointer to the created geometry collection of 4D with m value linestrings. The geometry must have FirstLinestring + * pointing to the first *linestring in the list pointed by first and LastLinestring pointing to the last element of the same list. + * DimensionModel must be GAIA_XYZM and *DimensionType must be GAIA_TYPE_LINESTRING. + */ +static gaiaGeomCollPtr +vanuatu_multilinestring_xyzm (gaiaLinestringPtr first) +{ + gaiaLinestringPtr p = first; + gaiaLinestringPtr p_n; + gaiaLinestringPtr new_line; + gaiaGeomCollPtr a = gaiaAllocGeomCollXYZM (); + a->DeclaredType = GAIA_MULTILINESTRING; + a->DimensionModel = GAIA_XY_Z_M; + + while (p) + { + new_line = gaiaAddLinestringToGeomColl (a, p->Points); + gaiaCopyLinestringCoords (new_line, p); + p_n = p->Next; + gaiaFreeLinestring (p); + p = p_n; + } + return a; +} + +/* + * Creates a geometry collection containing 2D (xy) polygons. + * + * Parameter first is a gaiaPolygonPtr to the first polygon in a linked list of polygons which should + * be added to the collection. All of the polygons in the list must be 2D (xy) polygons. There must be + * at least 1 polygon in the list. + * + * Returns a pointer to the created geometry collection of 2D polygons. The geometry must have + * FirstPolygon pointing to the first polygon in the list pointed by first and LastPolygon pointing + * to the last element of the same list. DimensionModel must be GAIA_XY and DimensionType must + * be GAIA_TYPE_POLYGON. + * + */ +static gaiaGeomCollPtr +vanuatu_multipolygon_xy (gaiaPolygonPtr first) +{ + gaiaPolygonPtr p = first; + gaiaPolygonPtr p_n; + int i = 0; + gaiaPolygonPtr new_polyg; + gaiaRingPtr i_ring; + gaiaRingPtr o_ring; + gaiaGeomCollPtr geom = gaiaAllocGeomColl (); + + geom->DeclaredType = GAIA_MULTIPOLYGON; + + while (p) + { + i_ring = p->Exterior; + new_polyg = + gaiaAddPolygonToGeomColl (geom, i_ring->Points, p->NumInteriors); + o_ring = new_polyg->Exterior; + gaiaCopyRingCoords (o_ring, i_ring); + + for (i = 0; i < new_polyg->NumInteriors; i++) + { + i_ring = p->Interiors + i; + o_ring = gaiaAddInteriorRing (new_polyg, i, i_ring->Points); + gaiaCopyRingCoords (o_ring, i_ring); + } + + p_n = p->Next; + gaiaFreePolygon (p); + p = p_n; + } + + return geom; +} + +/* + * Creates a geometry collection containing 3D (xyz) polygons. + * + * Parameter first is a gaiaPolygonPtr to the first polygon in a linked list of polygons which should be + * added to the collection. All of the polygons in the list must be 3D (xyz) polygons. There must be at + * least 1 polygon in the list. + * + * Returns a pointer to the created geometry collection of 3D polygons. The geometry must have + * FirstPolygon pointing to the first polygon in the list pointed by first and LastPolygon pointing to + * the last element of the same list. DimensionModel must be GAIA_XYZ and DimensionType must + * be GAIA_TYPE_POLYGON. + * + */ +static gaiaGeomCollPtr +vanuatu_multipolygon_xyz (gaiaPolygonPtr first) +{ + gaiaPolygonPtr p = first; + gaiaPolygonPtr p_n; + int i = 0; + gaiaPolygonPtr new_polyg; + gaiaRingPtr i_ring; + gaiaRingPtr o_ring; + gaiaGeomCollPtr geom = gaiaAllocGeomCollXYZ (); + + geom->DeclaredType = GAIA_MULTIPOLYGON; + + while (p) + { + i_ring = p->Exterior; + new_polyg = + gaiaAddPolygonToGeomColl (geom, i_ring->Points, p->NumInteriors); + o_ring = new_polyg->Exterior; + gaiaCopyRingCoords (o_ring, i_ring); + + for (i = 0; i < new_polyg->NumInteriors; i++) + { + i_ring = p->Interiors + i; + o_ring = gaiaAddInteriorRing (new_polyg, i, i_ring->Points); + gaiaCopyRingCoords (o_ring, i_ring); + } + + p_n = p->Next; + gaiaFreePolygon (p); + p = p_n; + } + + return geom; +} + +/* + * Creates a geometry collection containing 2D (xy) with m value polygons. + * + * Parameter first is a gaiaPolygonPtr to the first polygon in a linked list of polygons which should + * be added to the collection. All of the polygons in the list must be 2D (xy) with m value polygons. + * There must be at least 1 polygon in the list. + * + * Returns a pointer to the created geometry collection of 2D with m value polygons. The geometry + * must have FirstPolygon pointing to the first polygon in the list pointed by first and LastPolygon + * pointing to the last element of the same list. DimensionModel must be GAIA_XYM and DimensionType + * must be GAIA_TYPE_POLYGON. + * + */ +static gaiaGeomCollPtr +vanuatu_multipolygon_xym (gaiaPolygonPtr first) +{ + gaiaPolygonPtr p = first; + gaiaPolygonPtr p_n; + int i = 0; + gaiaPolygonPtr new_polyg; + gaiaRingPtr i_ring; + gaiaRingPtr o_ring; + gaiaGeomCollPtr geom = gaiaAllocGeomCollXYM (); + + geom->DeclaredType = GAIA_MULTIPOLYGON; + + while (p) + { + i_ring = p->Exterior; + new_polyg = + gaiaAddPolygonToGeomColl (geom, i_ring->Points, p->NumInteriors); + o_ring = new_polyg->Exterior; + gaiaCopyRingCoords (o_ring, i_ring); + + for (i = 0; i < new_polyg->NumInteriors; i++) + { + i_ring = p->Interiors + i; + o_ring = gaiaAddInteriorRing (new_polyg, i, i_ring->Points); + gaiaCopyRingCoords (o_ring, i_ring); + } + + p_n = p->Next; + gaiaFreePolygon (p); + p = p_n; + } + + return geom; +} + +/* + * Creates a geometry collection containing 4D (xyz) with m value polygons. + * + * Parameter first is a gaiaPolygonPtr to the first polygon in a linked list of polygons which should be + * added to the collection. All of the polygons in the list must be 4D (xyz) with m value polygons. + * There must be at least 1 polygon in the list. + * + * Returns a pointer to the created geometry collection of 4D with m value polygons. The geometry must + * have FirstPolygon pointing to the first polygon in the list pointed by first and LastPolygon pointing +// * to the last element of the same list. DimensionModel must be GAIA_XYZM and DimensionType must + * be GAIA_TYPE_POLYGON. + * + */ +static gaiaGeomCollPtr +vanuatu_multipolygon_xyzm (gaiaPolygonPtr first) +{ + gaiaPolygonPtr p = first; + gaiaPolygonPtr p_n; + int i = 0; + gaiaPolygonPtr new_polyg; + gaiaRingPtr i_ring; + gaiaRingPtr o_ring; + gaiaGeomCollPtr geom = gaiaAllocGeomCollXYZM (); + + geom->DeclaredType = GAIA_MULTIPOLYGON; + + while (p) + { + i_ring = p->Exterior; + new_polyg = + gaiaAddPolygonToGeomColl (geom, i_ring->Points, p->NumInteriors); + o_ring = new_polyg->Exterior; + gaiaCopyRingCoords (o_ring, i_ring); + + for (i = 0; i < new_polyg->NumInteriors; i++) + { + i_ring = p->Interiors + i; + o_ring = gaiaAddInteriorRing (new_polyg, i, i_ring->Points); + gaiaCopyRingCoords (o_ring, i_ring); + } + + p_n = p->Next; + gaiaFreePolygon (p); + p = p_n; + } + + return geom; +} + +static void +vanuatu_geomColl_common (gaiaGeomCollPtr org, gaiaGeomCollPtr dst) +{ +/* +/ helper function: xfers entities between the Origin and Destination +/ Sandro Furieri: 2010 October 12 +*/ + gaiaGeomCollPtr p = org; + gaiaGeomCollPtr p_n; + gaiaPointPtr pt; + gaiaPointPtr pt_n; + gaiaLinestringPtr ln; + gaiaLinestringPtr ln_n; + gaiaPolygonPtr pg; + gaiaPolygonPtr pg_n; + while (p) + { + pt = p->FirstPoint; + while (pt) + { + pt_n = pt->Next; + pt->Next = NULL; + if (dst->FirstPoint == NULL) + dst->FirstPoint = pt; + if (dst->LastPoint != NULL) + dst->LastPoint->Next = pt; + dst->LastPoint = pt; + pt = pt_n; + } + ln = p->FirstLinestring; + while (ln) + { + ln_n = ln->Next; + ln->Next = NULL; + if (dst->FirstLinestring == NULL) + dst->FirstLinestring = ln; + if (dst->LastLinestring != NULL) + dst->LastLinestring->Next = ln; + dst->LastLinestring = ln; + ln = ln_n; + } + pg = p->FirstPolygon; + while (pg) + { + pg_n = pg->Next; + pg->Next = NULL; + if (dst->FirstPolygon == NULL) + dst->FirstPolygon = pg; + if (dst->LastPolygon != NULL) + dst->LastPolygon->Next = pg; + dst->LastPolygon = pg; + pg = pg_n; + } + p_n = p->Next; + p->FirstPoint = NULL; + p->LastPoint = NULL; + p->FirstLinestring = NULL; + p->LastLinestring = NULL; + p->FirstPolygon = NULL; + p->LastPolygon = NULL; + gaiaFreeGeomColl (p); + p = p_n; + } +} + +/* Creates a 2D (xy) geometry collection in SpatiaLite + * + * first is the first geometry collection in a linked list of geometry collections. + * Each geometry collection represents a single type of object (eg. one could be a POINT, + * another could be a LINESTRING, another could be a MULTILINESTRING, etc.). + * + * The type of object represented by any geometry collection is stored in the declaredType + * field of its struct. For example, if first->declaredType = GAIA_POINT, then first represents a point. + * If first->declaredType = GAIA_MULTIPOINT, then first represents a multipoint. + * + * NOTE: geometry collections cannot contain other geometry collections (have to confirm this + * with Sandro). + * + * The goal of this function is to take the information from all of the structs in the linked list and + * return one geomColl struct containing all of that information. + * + * The integers used for 'declaredType' are defined in gaiageo.h. In this function, the only values + * contained in 'declaredType' that will be encountered will be: + * + * GAIA_POINT, GAIA_LINESTRING, GAIA_POLYGON, + * GAIA_MULTIPOINT, GAIA_MULTILINESTRING, GAIA_MULTIPOLYGON + */ +static gaiaGeomCollPtr +vanuatu_geomColl_xy (gaiaGeomCollPtr first) +{ + gaiaGeomCollPtr geom = gaiaAllocGeomColl (); + if (geom == NULL) + return NULL; + geom->DeclaredType = GAIA_GEOMETRYCOLLECTION; + geom->DimensionModel = GAIA_XY; + vanuatu_geomColl_common (first, geom); + return geom; +} + +/* + * See geomColl_xy for description. + * + * The only difference between this function and geomColl_xy is that the 'declaredType' field of the structs + * in the linked list for this function will only contain the following types: + * + * GAIA_POINTZ, GAIA_LINESTRINGZ, GAIA_POLYGONZ, + * GAIA_MULTIPOINTZ, GAIA_MULTILINESTRINGZ, GAIA_MULTIPOLYGONZ + */ +static gaiaGeomCollPtr +vanuatu_geomColl_xyz (gaiaGeomCollPtr first) +{ + gaiaGeomCollPtr geom = gaiaAllocGeomColl (); + if (geom == NULL) + return NULL; + geom->DeclaredType = GAIA_GEOMETRYCOLLECTION; + geom->DimensionModel = GAIA_XY_Z; + vanuatu_geomColl_common (first, geom); + return geom; +} + +/* + * See geomColl_xy for description. + * + * The only difference between this function and geomColl_xy is that the 'declaredType' field of the structs + * in the linked list for this function will only contain the following types: + * + * GAIA_POINTM, GAIA_LINESTRINGM, GAIA_POLYGONM, + * GAIA_MULTIPOINTM, GAIA_MULTILINESTRINGM, GAIA_MULTIPOLYGONM + */ +static gaiaGeomCollPtr +vanuatu_geomColl_xym (gaiaGeomCollPtr first) +{ + gaiaGeomCollPtr geom = gaiaAllocGeomColl (); + if (geom == NULL) + return NULL; + geom->DeclaredType = GAIA_GEOMETRYCOLLECTION; + geom->DimensionModel = GAIA_XY_M; + vanuatu_geomColl_common (first, geom); + return geom; +} + +/* + * See geomColl_xy for description. + * + * The only difference between this function and geomColl_xy is that the 'declaredType' field of the structs + * in the linked list for this function will only contain the following types: + * + * GAIA_POINTZM, GAIA_LINESTRINGZM, GAIA_POLYGONZM, + * GAIA_MULTIPOINTZM, GAIA_MULTILINESTRINGZM, GAIA_MULTIPOLYGONZM + */ +static gaiaGeomCollPtr +vanuatu_geomColl_xyzm (gaiaGeomCollPtr first) +{ + gaiaGeomCollPtr geom = gaiaAllocGeomColl (); + if (geom == NULL) + return NULL; + geom->DeclaredType = GAIA_GEOMETRYCOLLECTION; + geom->DimensionModel = GAIA_XY_Z_M; + vanuatu_geomColl_common (first, geom); + return geom; +} + + + + + + + + +/* + VANUATU_LEMON_H_START - LEMON generated header starts here +*/ + +#define VANUATU_NEWLINE 1 +#define VANUATU_POINT 2 +#define VANUATU_OPEN_BRACKET 3 +#define VANUATU_CLOSE_BRACKET 4 +#define VANUATU_POINT_M 5 +#define VANUATU_POINT_Z 6 +#define VANUATU_POINT_ZM 7 +#define VANUATU_NUM 8 +#define VANUATU_COMMA 9 +#define VANUATU_LINESTRING 10 +#define VANUATU_LINESTRING_M 11 +#define VANUATU_LINESTRING_Z 12 +#define VANUATU_LINESTRING_ZM 13 +#define VANUATU_POLYGON 14 +#define VANUATU_POLYGON_M 15 +#define VANUATU_POLYGON_Z 16 +#define VANUATU_POLYGON_ZM 17 +#define VANUATU_MULTIPOINT 18 +#define VANUATU_MULTIPOINT_M 19 +#define VANUATU_MULTIPOINT_Z 20 +#define VANUATU_MULTIPOINT_ZM 21 +#define VANUATU_MULTILINESTRING 22 +#define VANUATU_MULTILINESTRING_M 23 +#define VANUATU_MULTILINESTRING_Z 24 +#define VANUATU_MULTILINESTRING_ZM 25 +#define VANUATU_MULTIPOLYGON 26 +#define VANUATU_MULTIPOLYGON_M 27 +#define VANUATU_MULTIPOLYGON_Z 28 +#define VANUATU_MULTIPOLYGON_ZM 29 +#define VANUATU_GEOMETRYCOLLECTION 30 +#define VANUATU_GEOMETRYCOLLECTION_M 31 +#define VANUATU_GEOMETRYCOLLECTION_Z 32 +#define VANUATU_GEOMETRYCOLLECTION_ZM 33 + +/* + VANUATU_LEMON_H_END - LEMON generated header ends here +*/ + + + + + + + + + +#ifndef YYSTYPE +typedef union +{ + double dval; + struct symtab *symp; +} yystype; +# define YYSTYPE yystype +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + +/* extern YYSTYPE yylval; */ +YYSTYPE VanuatuWktlval; + +/* +** CAVEAT: there is an incompatibility between LEMON and FLEX +** this macro resolves the issue +*/ +#define yy_accept yy_lemon_accept + + + + + + + + + + +/* + VANUATU_LEMON_START - LEMON generated header starts here +*/ + +/* Driver template for the LEMON parser generator. +** The author disclaims copyright to this source code. +*/ +/* First off, code is included that follows the "include" declaration +** in the input grammar file. */ +/* #include */ + +/* Next is all token values, in a form suitable for use by makeheaders. +** This section will be null unless lemon is run with the -m switch. +*/ +/* +** These constants (all generated automatically by the parser generator) +** specify the various kinds of tokens (terminals) that the parser +** understands. +** +** Each symbol here is a terminal symbol in the grammar. +*/ +/* Make sure the INTERFACE macro is defined. +*/ +#ifndef INTERFACE +# define INTERFACE 1 +#endif +/* The next thing included is series of defines which control +** various aspects of the generated parser. +** YYCODETYPE is the data type used for storing terminal +** and nonterminal numbers. "unsigned char" is +** used if there are fewer than 250 terminals +** and nonterminals. "int" is used otherwise. +** YYNOCODE is a number of type YYCODETYPE which corresponds +** to no legal terminal or nonterminal number. This +** number is used to fill in empty slots of the hash +** table. +** YYFALLBACK If defined, this indicates that one or more tokens +** have fall-back values which should be used if the +** original value of the token will not parse. +** YYACTIONTYPE is the data type used for storing terminal +** and nonterminal numbers. "unsigned char" is +** used if there are fewer than 250 rules and +** states combined. "int" is used otherwise. +** ParseTOKENTYPE is the data type used for minor tokens given +** directly to the parser from the tokenizer. +** YYMINORTYPE is the data type used for all minor tokens. +** This is typically a union of many types, one of +** which is ParseTOKENTYPE. The entry in the union +** for base tokens is called "yy0". +** YYSTACKDEPTH is the maximum depth of the parser's stack. If +** zero the stack is dynamically sized using realloc() +** ParseARG_SDECL A static variable declaration for the %extra_argument +** ParseARG_PDECL A parameter declaration for the %extra_argument +** ParseARG_STORE Code to store %extra_argument into yypParser +** ParseARG_FETCH Code to extract %extra_argument from yypParser +** YYNSTATE the combined number of states. +** YYNRULE the number of rules in the grammar +** YYERRORSYMBOL is the code number of the error symbol. If not +** defined, then do no error processing. +*/ +#define YYCODETYPE unsigned char +#define YYNOCODE 125 +#define YYACTIONTYPE unsigned short int +#define ParseTOKENTYPE void * +typedef union +{ + int yyinit; + ParseTOKENTYPE yy0; +} YYMINORTYPE; +#ifndef YYSTACKDEPTH +#define YYSTACKDEPTH 1000000 +#endif +#define ParseARG_SDECL gaiaGeomCollPtr *result ; +#define ParseARG_PDECL , gaiaGeomCollPtr *result +#define ParseARG_FETCH gaiaGeomCollPtr *result = yypParser->result +#define ParseARG_STORE yypParser->result = result +#define YYNSTATE 358 +#define YYNRULE 153 +#define YY_NO_ACTION (YYNSTATE+YYNRULE+2) +#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) +#define YY_ERROR_ACTION (YYNSTATE+YYNRULE) + +/* The yyzerominor constant is used to initialize instances of +** YYMINORTYPE objects to zero. */ +static const YYMINORTYPE yyzerominor = { 0 }; + +/* Define the yytestcase() macro to be a no-op if is not already defined +** otherwise. +** +** Applications can choose to define yytestcase() in the %include section +** to a macro that can assist in verifying code coverage. For production +** code the yytestcase() macro should be turned off. But it is useful +** for testing. +*/ +#ifndef yytestcase +# define yytestcase(X) +#endif + + +/* Next are the tables used to determine what action to take based on the +** current state and lookahead token. These tables are used to implement +** functions that take a state number and lookahead value and return an +** action integer. +** +** Suppose the action integer is N. Then the action is determined as +** follows +** +** 0 <= N < YYNSTATE Shift N. That is, push the lookahead +** token onto the stack and goto state N. +** +** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE. +** +** N == YYNSTATE+YYNRULE A syntax error has occurred. +** +** N == YYNSTATE+YYNRULE+1 The parser accepts its input. +** +** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused +** slots in the yy_action[] table. +** +** The action table is constructed as a single large table named yy_action[]. +** Given state S and lookahead X, the action is computed as +** +** yy_action[ yy_shift_ofst[S] + X ] +** +** If the index value yy_shift_ofst[S]+X is out of range or if the value +** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S] +** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table +** and that yy_default[S] should be used instead. +** +** The formula above is for computing the action when the lookahead is +** a terminal symbol. If the lookahead is a non-terminal (as occurs after +** a reduce action) then the yy_reduce_ofst[] array is used in place of +** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of +** YY_SHIFT_USE_DFLT. +** +** The following are the tables generated in this section: +** +** yy_action[] A single table containing all actions. +** yy_lookahead[] A table containing the lookahead for each entry in +** yy_action. Used to detect hash collisions. +** yy_shift_ofst[] For each state, the offset into yy_action for +** shifting terminals. +** yy_reduce_ofst[] For each state, the offset into yy_action for +** shifting non-terminals after a reduce. +** yy_default[] Default action for each state. +*/ +static const YYACTIONTYPE yy_action[] = { + /* 0 */ 166, 228, 229, 230, 231, 232, 233, 234, 235, 236, + /* 10 */ 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + /* 20 */ 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + /* 30 */ 257, 258, 259, 260, 358, 263, 167, 512, 1, 169, + /* 40 */ 171, 173, 174, 51, 54, 57, 60, 63, 66, 72, + /* 50 */ 78, 84, 90, 92, 94, 96, 98, 103, 108, 113, + /* 60 */ 118, 123, 128, 133, 138, 145, 152, 159, 167, 139, + /* 70 */ 143, 144, 140, 141, 142, 169, 54, 146, 150, 151, + /* 80 */ 66, 57, 147, 148, 149, 72, 171, 153, 157, 158, + /* 90 */ 170, 262, 60, 47, 173, 270, 78, 154, 155, 156, + /* 100 */ 63, 172, 273, 49, 84, 160, 164, 165, 48, 161, + /* 110 */ 162, 163, 14, 168, 175, 55, 176, 46, 46, 46, + /* 120 */ 56, 265, 177, 58, 46, 47, 47, 59, 50, 179, + /* 130 */ 47, 49, 61, 62, 49, 49, 181, 51, 64, 51, + /* 140 */ 184, 65, 51, 185, 46, 186, 70, 46, 189, 46, + /* 150 */ 46, 47, 267, 190, 191, 76, 47, 47, 47, 194, + /* 160 */ 52, 49, 195, 196, 49, 49, 82, 53, 49, 199, + /* 170 */ 51, 200, 51, 201, 51, 88, 51, 91, 95, 93, + /* 180 */ 49, 46, 47, 269, 97, 51, 16, 271, 17, 19, + /* 190 */ 178, 274, 20, 22, 276, 180, 277, 23, 279, 25, + /* 200 */ 182, 280, 67, 282, 26, 69, 187, 73, 68, 286, + /* 210 */ 30, 75, 183, 71, 192, 285, 79, 74, 290, 188, + /* 220 */ 289, 77, 34, 81, 197, 80, 85, 193, 83, 294, + /* 230 */ 38, 293, 202, 86, 87, 198, 297, 89, 42, 203, + /* 240 */ 298, 43, 300, 204, 44, 302, 205, 45, 304, 206, + /* 250 */ 99, 306, 100, 102, 101, 104, 207, 309, 308, 105, + /* 260 */ 106, 109, 208, 107, 311, 110, 312, 209, 111, 112, + /* 270 */ 114, 314, 315, 116, 115, 117, 119, 120, 210, 121, + /* 280 */ 124, 317, 122, 318, 126, 125, 129, 131, 211, 130, + /* 290 */ 321, 320, 132, 127, 134, 136, 2, 135, 3, 212, + /* 300 */ 4, 323, 137, 5, 6, 324, 8, 7, 9, 227, + /* 310 */ 10, 213, 513, 261, 11, 15, 264, 12, 13, 326, + /* 320 */ 327, 266, 268, 272, 275, 18, 214, 329, 278, 281, + /* 330 */ 21, 24, 330, 283, 513, 27, 28, 215, 332, 29, + /* 340 */ 333, 334, 216, 337, 217, 284, 287, 31, 32, 218, + /* 350 */ 339, 340, 341, 219, 220, 344, 221, 33, 346, 288, + /* 360 */ 291, 347, 348, 35, 222, 223, 36, 351, 37, 224, + /* 370 */ 292, 295, 353, 354, 39, 513, 355, 225, 226, 40, + /* 380 */ 41, 296, 299, 301, 303, 305, 307, 310, 313, 316, + /* 390 */ 319, 322, 325, 328, 331, 335, 336, 338, 342, 343, + /* 400 */ 345, 349, 350, 352, 356, 357, +}; + +static const YYCODETYPE yy_lookahead[] = { + /* 0 */ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + /* 10 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + /* 20 */ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + /* 30 */ 67, 68, 69, 70, 0, 8, 2, 35, 36, 5, + /* 40 */ 6, 7, 74, 75, 10, 11, 12, 13, 14, 15, + /* 50 */ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + /* 60 */ 26, 27, 28, 29, 30, 31, 32, 33, 2, 43, + /* 70 */ 44, 45, 43, 44, 45, 5, 10, 57, 58, 59, + /* 80 */ 14, 11, 57, 58, 59, 15, 6, 50, 51, 52, + /* 90 */ 72, 75, 12, 75, 7, 80, 16, 50, 51, 52, + /* 100 */ 13, 73, 81, 75, 17, 64, 65, 66, 75, 64, + /* 110 */ 65, 66, 3, 71, 71, 71, 76, 75, 75, 75, + /* 120 */ 71, 75, 72, 72, 75, 75, 75, 72, 75, 73, + /* 130 */ 75, 75, 73, 73, 75, 75, 74, 75, 74, 75, + /* 140 */ 71, 74, 75, 71, 75, 71, 71, 75, 72, 75, + /* 150 */ 75, 75, 75, 72, 72, 72, 75, 75, 75, 73, + /* 160 */ 75, 75, 73, 73, 75, 75, 73, 75, 75, 74, + /* 170 */ 75, 74, 75, 74, 75, 74, 75, 71, 73, 72, + /* 180 */ 75, 75, 75, 75, 74, 75, 9, 76, 3, 9, + /* 190 */ 77, 77, 3, 9, 82, 78, 78, 3, 83, 9, + /* 200 */ 79, 79, 3, 84, 3, 9, 76, 3, 88, 85, + /* 210 */ 3, 9, 89, 88, 77, 89, 3, 90, 86, 91, + /* 220 */ 91, 90, 3, 9, 78, 92, 3, 93, 92, 87, + /* 230 */ 3, 93, 79, 94, 9, 95, 95, 94, 3, 76, + /* 240 */ 96, 3, 97, 77, 3, 98, 78, 3, 99, 79, + /* 250 */ 3, 100, 80, 80, 9, 3, 104, 101, 104, 81, + /* 260 */ 9, 3, 105, 81, 105, 82, 102, 106, 9, 82, + /* 270 */ 3, 106, 103, 9, 83, 83, 3, 84, 107, 9, + /* 280 */ 3, 107, 84, 108, 9, 85, 3, 9, 112, 86, + /* 290 */ 109, 112, 86, 85, 3, 9, 3, 87, 9, 113, + /* 300 */ 3, 113, 87, 9, 3, 110, 3, 9, 9, 1, + /* 310 */ 3, 114, 124, 4, 3, 9, 4, 3, 3, 114, + /* 320 */ 111, 4, 4, 4, 4, 9, 115, 115, 4, 4, + /* 330 */ 9, 9, 116, 4, 124, 9, 9, 120, 120, 9, + /* 340 */ 120, 120, 120, 117, 120, 4, 4, 9, 9, 121, + /* 350 */ 121, 121, 121, 121, 121, 118, 122, 9, 122, 4, + /* 360 */ 4, 122, 122, 9, 122, 122, 9, 119, 9, 123, + /* 370 */ 4, 4, 123, 123, 9, 124, 123, 123, 123, 9, + /* 380 */ 9, 4, 4, 4, 4, 4, 4, 4, 4, 4, + /* 390 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + /* 400 */ 4, 4, 4, 4, 4, 4, +}; + +#define YY_SHIFT_USE_DFLT (-1) +#define YY_SHIFT_MAX 226 +static const short yy_shift_ofst[] = { + /* 0 */ -1, 34, 66, 66, 70, 70, 80, 80, 87, 87, + /* 10 */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + /* 20 */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + /* 30 */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + /* 40 */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + /* 50 */ 27, 27, 27, 27, 109, 177, 177, 185, 180, 180, + /* 60 */ 189, 184, 184, 194, 190, 190, 199, 201, 196, 201, + /* 70 */ 177, 196, 204, 207, 202, 207, 180, 202, 213, 219, + /* 80 */ 214, 219, 184, 214, 223, 227, 225, 227, 190, 225, + /* 90 */ 235, 177, 238, 180, 241, 184, 244, 190, 247, 109, + /* 100 */ 245, 109, 245, 252, 185, 251, 185, 251, 258, 189, + /* 110 */ 259, 189, 259, 267, 194, 264, 194, 264, 273, 199, + /* 120 */ 270, 199, 270, 277, 204, 275, 204, 275, 283, 213, + /* 130 */ 278, 213, 278, 291, 223, 286, 223, 286, 293, 289, + /* 140 */ 289, 289, 289, 289, 289, 297, 294, 294, 294, 294, + /* 150 */ 294, 294, 301, 298, 298, 298, 298, 298, 298, 303, + /* 160 */ 299, 299, 299, 299, 299, 299, 308, 307, 309, 311, + /* 170 */ 312, 314, 317, 315, 318, 306, 319, 316, 320, 321, + /* 180 */ 324, 322, 325, 329, 326, 327, 330, 341, 342, 338, + /* 190 */ 339, 348, 355, 356, 354, 357, 359, 366, 367, 365, + /* 200 */ 370, 371, 377, 378, 379, 380, 381, 382, 383, 384, + /* 210 */ 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + /* 220 */ 395, 396, 397, 398, 399, 400, 401, +}; + +#define YY_REDUCE_USE_DFLT (-38) +#define YY_REDUCE_MAX 165 +static const short yy_reduce_ofst[] = { + /* 0 */ 2, -37, 26, 29, 20, 25, 37, 47, 41, 45, + /* 10 */ 42, 18, 28, -32, 43, 44, 49, 50, 51, 55, + /* 20 */ 56, 59, 60, 62, 64, 67, 69, 72, 74, 75, + /* 30 */ 76, 81, 82, 83, 86, 89, 90, 93, 95, 97, + /* 40 */ 99, 101, 106, 107, 105, 110, 16, 33, 46, 53, + /* 50 */ 77, 85, 92, 108, 15, 40, 111, 21, 113, 114, + /* 60 */ 112, 117, 118, 115, 121, 122, 119, 120, 123, 125, + /* 70 */ 130, 126, 124, 127, 128, 131, 137, 129, 132, 133, + /* 80 */ 134, 136, 146, 138, 142, 139, 140, 143, 153, 141, + /* 90 */ 144, 163, 145, 166, 147, 168, 149, 170, 151, 172, + /* 100 */ 152, 173, 154, 156, 178, 157, 182, 159, 164, 183, + /* 110 */ 161, 187, 165, 169, 191, 171, 192, 174, 175, 193, + /* 120 */ 176, 198, 179, 181, 200, 186, 208, 188, 195, 203, + /* 130 */ 197, 206, 205, 209, 210, 211, 215, 212, 216, 217, + /* 140 */ 218, 220, 221, 222, 224, 226, 228, 229, 230, 231, + /* 150 */ 232, 233, 237, 234, 236, 239, 240, 242, 243, 248, + /* 160 */ 246, 249, 250, 253, 254, 255, +}; + +static const YYACTIONTYPE yy_default[] = { + /* 0 */ 359, 511, 511, 511, 511, 511, 511, 511, 511, 511, + /* 10 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + /* 20 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + /* 30 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + /* 40 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + /* 50 */ 511, 511, 511, 511, 511, 403, 403, 511, 405, 405, + /* 60 */ 511, 407, 407, 511, 409, 409, 511, 511, 428, 511, + /* 70 */ 403, 428, 511, 511, 431, 511, 405, 431, 511, 511, + /* 80 */ 434, 511, 407, 434, 511, 511, 437, 511, 409, 437, + /* 90 */ 511, 403, 511, 405, 511, 407, 511, 409, 511, 511, + /* 100 */ 452, 511, 452, 511, 511, 455, 511, 455, 511, 511, + /* 110 */ 458, 511, 458, 511, 511, 461, 511, 461, 511, 511, + /* 120 */ 468, 511, 468, 511, 511, 471, 511, 471, 511, 511, + /* 130 */ 474, 511, 474, 511, 511, 477, 511, 477, 511, 486, + /* 140 */ 486, 486, 486, 486, 486, 511, 493, 493, 493, 493, + /* 150 */ 493, 493, 511, 500, 500, 500, 500, 500, 500, 511, + /* 160 */ 507, 507, 507, 507, 507, 507, 511, 511, 511, 511, + /* 170 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + /* 180 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + /* 190 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + /* 200 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + /* 210 */ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, + /* 220 */ 511, 511, 511, 511, 511, 511, 511, 360, 361, 362, + /* 230 */ 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + /* 240 */ 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + /* 250 */ 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + /* 260 */ 393, 394, 398, 402, 395, 399, 396, 400, 397, 401, + /* 270 */ 411, 404, 415, 412, 406, 416, 413, 408, 417, 414, + /* 280 */ 410, 418, 419, 423, 427, 429, 420, 424, 430, 432, + /* 290 */ 421, 425, 433, 435, 422, 426, 436, 438, 439, 443, + /* 300 */ 440, 444, 441, 445, 442, 446, 447, 451, 453, 448, + /* 310 */ 454, 456, 449, 457, 459, 450, 460, 462, 463, 467, + /* 320 */ 469, 464, 470, 472, 465, 473, 475, 466, 476, 478, + /* 330 */ 479, 483, 487, 488, 489, 484, 485, 480, 490, 494, + /* 340 */ 495, 496, 491, 492, 481, 497, 501, 502, 503, 498, + /* 350 */ 499, 482, 504, 508, 509, 510, 505, 506, +}; + +#define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0])) + +/* The next table maps tokens into fallback tokens. If a construct +** like the following: +** +** %fallback ID X Y Z. +** +** appears in the grammar, then ID becomes a fallback token for X, Y, +** and Z. Whenever one of the tokens X, Y, or Z is input to the parser +** but it does not parse, the type of the token is changed to ID and +** the parse is retried before an error is thrown. +*/ +#ifdef YYFALLBACK +static const YYCODETYPE yyFallback[] = { +}; +#endif /* YYFALLBACK */ + +/* The following structure represents a single element of the +** parser's stack. Information stored includes: +** +** + The state number for the parser at this level of the stack. +** +** + The value of the token stored at this level of the stack. +** (In other words, the "major" token.) +** +** + The semantic value stored at this level of the stack. This is +** the information used by the action routines in the grammar. +** It is sometimes called the "minor" token. +*/ +struct yyStackEntry +{ + YYACTIONTYPE stateno; /* The state-number */ + YYCODETYPE major; /* The major token value. This is the code + ** number for the token at this stack level */ + YYMINORTYPE minor; /* The user-supplied minor token value. This + ** is the value of the token */ +}; +typedef struct yyStackEntry yyStackEntry; + +/* The state of the parser is completely contained in an instance of +** the following structure */ +struct yyParser +{ + int yyidx; /* Index of top element in stack */ +#ifdef YYTRACKMAXSTACKDEPTH + int yyidxMax; /* Maximum value of yyidx */ +#endif + int yyerrcnt; /* Shifts left before out of the error */ + ParseARG_SDECL /* A place to hold %extra_argument */ +#if YYSTACKDEPTH<=0 + int yystksz; /* Current side of the stack */ + yyStackEntry *yystack; /* The parser's stack */ +#else + yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ +#endif +}; +typedef struct yyParser yyParser; + +#ifndef NDEBUG +/* #include */ +static FILE *yyTraceFILE = 0; +static char *yyTracePrompt = 0; +#endif /* NDEBUG */ + +#ifndef NDEBUG +/* +** Turn parser tracing on by giving a stream to which to write the trace +** and a prompt to preface each trace message. Tracing is turned off +** by making either argument NULL +** +** Inputs: +**
      +**
    • A FILE* to which trace output should be written. +** If NULL, then tracing is turned off. +**
    • A prefix string written at the beginning of every +** line of trace output. If NULL, then tracing is +** turned off. +**
    +** +** Outputs: +** None. +*/ +void +ParseTrace (FILE * TraceFILE, char *zTracePrompt) +{ + yyTraceFILE = TraceFILE; + yyTracePrompt = zTracePrompt; + if (yyTraceFILE == 0) + yyTracePrompt = 0; + else if (yyTracePrompt == 0) + yyTraceFILE = 0; +} +#endif /* NDEBUG */ + +#ifndef NDEBUG +/* For tracing shifts, the names of all terminals and nonterminals +** are required. The following table supplies these names */ +static const char *const yyTokenName[] = { + "$", "VANUATU_NEWLINE", "VANUATU_POINT", "VANUATU_OPEN_BRACKET", + "VANUATU_CLOSE_BRACKET", "VANUATU_POINT_M", "VANUATU_POINT_Z", + "VANUATU_POINT_ZM", + "VANUATU_NUM", "VANUATU_COMMA", "VANUATU_LINESTRING", + "VANUATU_LINESTRING_M", + "VANUATU_LINESTRING_Z", "VANUATU_LINESTRING_ZM", "VANUATU_POLYGON", + "VANUATU_POLYGON_M", + "VANUATU_POLYGON_Z", "VANUATU_POLYGON_ZM", "VANUATU_MULTIPOINT", + "VANUATU_MULTIPOINT_M", + "VANUATU_MULTIPOINT_Z", "VANUATU_MULTIPOINT_ZM", "VANUATU_MULTILINESTRING", + "VANUATU_MULTILINESTRING_M", + "VANUATU_MULTILINESTRING_Z", "VANUATU_MULTILINESTRING_ZM", + "VANUATU_MULTIPOLYGON", "VANUATU_MULTIPOLYGON_M", + "VANUATU_MULTIPOLYGON_Z", "VANUATU_MULTIPOLYGON_ZM", + "VANUATU_GEOMETRYCOLLECTION", "VANUATU_GEOMETRYCOLLECTION_M", + "VANUATU_GEOMETRYCOLLECTION_Z", "VANUATU_GEOMETRYCOLLECTION_ZM", "error", + "main", + "in", "state", "program", "geo_text", + "geo_textz", "geo_textm", "geo_textzm", "point", + "linestring", "polygon", "multipoint", "multilinestring", + "multipolygon", "geocoll", "pointz", "linestringz", + "polygonz", "multipointz", "multilinestringz", "multipolygonz", + "geocollz", "pointm", "linestringm", "polygonm", + "multipointm", "multilinestringm", "multipolygonm", "geocollm", + "pointzm", "linestringzm", "polygonzm", "multipointzm", + "multilinestringzm", "multipolygonzm", "geocollzm", "point_coordxy", + "point_coordxym", "point_coordxyz", "point_coordxyzm", "coord", + "extra_pointsxy", "extra_pointsxym", "extra_pointsxyz", "extra_pointsxyzm", + "linestring_text", "linestring_textm", "linestring_textz", + "linestring_textzm", + "polygon_text", "polygon_textm", "polygon_textz", "polygon_textzm", + "ring", "extra_rings", "ringm", "extra_ringsm", + "ringz", "extra_ringsz", "ringzm", "extra_ringszm", + "multipoint_text", "multipoint_textm", "multipoint_textz", + "multipoint_textzm", + "multilinestring_text", "multilinestring_textm", "multilinestring_textz", + "multilinestring_textzm", + "multilinestring_text2", "multilinestring_textm2", "multilinestring_textz2", + "multilinestring_textzm2", + "multipolygon_text", "multipolygon_textm", "multipolygon_textz", + "multipolygon_textzm", + "multipolygon_text2", "multipolygon_textm2", "multipolygon_textz2", + "multipolygon_textzm2", + "geocoll_text", "geocoll_textm", "geocoll_textz", "geocoll_textzm", + "geocoll_text2", "geocoll_textm2", "geocoll_textz2", "geocoll_textzm2", +}; +#endif /* NDEBUG */ + +#ifndef NDEBUG +/* For tracing reduce actions, the names of all rules are required. +*/ +static const char *const yyRuleName[] = { + /* 0 */ "main ::= in", + /* 1 */ "in ::=", + /* 2 */ "in ::= in state VANUATU_NEWLINE", + /* 3 */ "state ::= program", + /* 4 */ "program ::= geo_text", + /* 5 */ "program ::= geo_textz", + /* 6 */ "program ::= geo_textm", + /* 7 */ "program ::= geo_textzm", + /* 8 */ "geo_text ::= point", + /* 9 */ "geo_text ::= linestring", + /* 10 */ "geo_text ::= polygon", + /* 11 */ "geo_text ::= multipoint", + /* 12 */ "geo_text ::= multilinestring", + /* 13 */ "geo_text ::= multipolygon", + /* 14 */ "geo_text ::= geocoll", + /* 15 */ "geo_textz ::= pointz", + /* 16 */ "geo_textz ::= linestringz", + /* 17 */ "geo_textz ::= polygonz", + /* 18 */ "geo_textz ::= multipointz", + /* 19 */ "geo_textz ::= multilinestringz", + /* 20 */ "geo_textz ::= multipolygonz", + /* 21 */ "geo_textz ::= geocollz", + /* 22 */ "geo_textm ::= pointm", + /* 23 */ "geo_textm ::= linestringm", + /* 24 */ "geo_textm ::= polygonm", + /* 25 */ "geo_textm ::= multipointm", + /* 26 */ "geo_textm ::= multilinestringm", + /* 27 */ "geo_textm ::= multipolygonm", + /* 28 */ "geo_textm ::= geocollm", + /* 29 */ "geo_textzm ::= pointzm", + /* 30 */ "geo_textzm ::= linestringzm", + /* 31 */ "geo_textzm ::= polygonzm", + /* 32 */ "geo_textzm ::= multipointzm", + /* 33 */ "geo_textzm ::= multilinestringzm", + /* 34 */ "geo_textzm ::= multipolygonzm", + /* 35 */ "geo_textzm ::= geocollzm", + /* 36 */ + "point ::= VANUATU_POINT VANUATU_OPEN_BRACKET point_coordxy VANUATU_CLOSE_BRACKET", + /* 37 */ + "pointm ::= VANUATU_POINT_M VANUATU_OPEN_BRACKET point_coordxym VANUATU_CLOSE_BRACKET", + /* 38 */ + "pointz ::= VANUATU_POINT_Z VANUATU_OPEN_BRACKET point_coordxyz VANUATU_CLOSE_BRACKET", + /* 39 */ + "pointzm ::= VANUATU_POINT_ZM VANUATU_OPEN_BRACKET point_coordxyzm VANUATU_CLOSE_BRACKET", + /* 40 */ "point_coordxy ::= coord coord", + /* 41 */ "point_coordxym ::= coord coord coord", + /* 42 */ "point_coordxyz ::= coord coord coord", + /* 43 */ "point_coordxyzm ::= coord coord coord coord", + /* 44 */ "coord ::= VANUATU_NUM", + /* 45 */ "extra_pointsxy ::=", + /* 46 */ "extra_pointsxy ::= VANUATU_COMMA point_coordxy extra_pointsxy", + /* 47 */ "extra_pointsxym ::=", + /* 48 */ + "extra_pointsxym ::= VANUATU_COMMA point_coordxym extra_pointsxym", + /* 49 */ "extra_pointsxyz ::=", + /* 50 */ + "extra_pointsxyz ::= VANUATU_COMMA point_coordxyz extra_pointsxyz", + /* 51 */ "extra_pointsxyzm ::=", + /* 52 */ + "extra_pointsxyzm ::= VANUATU_COMMA point_coordxyzm extra_pointsxyzm", + /* 53 */ "linestring ::= VANUATU_LINESTRING linestring_text", + /* 54 */ "linestringm ::= VANUATU_LINESTRING_M linestring_textm", + /* 55 */ "linestringz ::= VANUATU_LINESTRING_Z linestring_textz", + /* 56 */ "linestringzm ::= VANUATU_LINESTRING_ZM linestring_textzm", + /* 57 */ + "linestring_text ::= VANUATU_OPEN_BRACKET point_coordxy VANUATU_COMMA point_coordxy extra_pointsxy VANUATU_CLOSE_BRACKET", + /* 58 */ + "linestring_textm ::= VANUATU_OPEN_BRACKET point_coordxym VANUATU_COMMA point_coordxym extra_pointsxym VANUATU_CLOSE_BRACKET", + /* 59 */ + "linestring_textz ::= VANUATU_OPEN_BRACKET point_coordxyz VANUATU_COMMA point_coordxyz extra_pointsxyz VANUATU_CLOSE_BRACKET", + /* 60 */ + "linestring_textzm ::= VANUATU_OPEN_BRACKET point_coordxyzm VANUATU_COMMA point_coordxyzm extra_pointsxyzm VANUATU_CLOSE_BRACKET", + /* 61 */ "polygon ::= VANUATU_POLYGON polygon_text", + /* 62 */ "polygonm ::= VANUATU_POLYGON_M polygon_textm", + /* 63 */ "polygonz ::= VANUATU_POLYGON_Z polygon_textz", + /* 64 */ "polygonzm ::= VANUATU_POLYGON_ZM polygon_textzm", + /* 65 */ + "polygon_text ::= VANUATU_OPEN_BRACKET ring extra_rings VANUATU_CLOSE_BRACKET", + /* 66 */ + "polygon_textm ::= VANUATU_OPEN_BRACKET ringm extra_ringsm VANUATU_CLOSE_BRACKET", + /* 67 */ + "polygon_textz ::= VANUATU_OPEN_BRACKET ringz extra_ringsz VANUATU_CLOSE_BRACKET", + /* 68 */ + "polygon_textzm ::= VANUATU_OPEN_BRACKET ringzm extra_ringszm VANUATU_CLOSE_BRACKET", + /* 69 */ + "ring ::= VANUATU_OPEN_BRACKET point_coordxy VANUATU_COMMA point_coordxy VANUATU_COMMA point_coordxy VANUATU_COMMA point_coordxy extra_pointsxy VANUATU_CLOSE_BRACKET", + /* 70 */ "extra_rings ::=", + /* 71 */ "extra_rings ::= VANUATU_COMMA ring extra_rings", + /* 72 */ + "ringm ::= VANUATU_OPEN_BRACKET point_coordxym VANUATU_COMMA point_coordxym VANUATU_COMMA point_coordxym VANUATU_COMMA point_coordxym extra_pointsxym VANUATU_CLOSE_BRACKET", + /* 73 */ "extra_ringsm ::=", + /* 74 */ "extra_ringsm ::= VANUATU_COMMA ringm extra_ringsm", + /* 75 */ + "ringz ::= VANUATU_OPEN_BRACKET point_coordxyz VANUATU_COMMA point_coordxyz VANUATU_COMMA point_coordxyz VANUATU_COMMA point_coordxyz extra_pointsxyz VANUATU_CLOSE_BRACKET", + /* 76 */ "extra_ringsz ::=", + /* 77 */ "extra_ringsz ::= VANUATU_COMMA ringz extra_ringsz", + /* 78 */ + "ringzm ::= VANUATU_OPEN_BRACKET point_coordxyzm VANUATU_COMMA point_coordxyzm VANUATU_COMMA point_coordxyzm VANUATU_COMMA point_coordxyzm extra_pointsxyzm VANUATU_CLOSE_BRACKET", + /* 79 */ "extra_ringszm ::=", + /* 80 */ "extra_ringszm ::= VANUATU_COMMA ringzm extra_ringszm", + /* 81 */ "multipoint ::= VANUATU_MULTIPOINT multipoint_text", + /* 82 */ "multipointm ::= VANUATU_MULTIPOINT_M multipoint_textm", + /* 83 */ "multipointz ::= VANUATU_MULTIPOINT_Z multipoint_textz", + /* 84 */ "multipointzm ::= VANUATU_MULTIPOINT_ZM multipoint_textzm", + /* 85 */ + "multipoint_text ::= VANUATU_OPEN_BRACKET point_coordxy extra_pointsxy VANUATU_CLOSE_BRACKET", + /* 86 */ + "multipoint_textm ::= VANUATU_OPEN_BRACKET point_coordxym extra_pointsxym VANUATU_CLOSE_BRACKET", + /* 87 */ + "multipoint_textz ::= VANUATU_OPEN_BRACKET point_coordxyz extra_pointsxyz VANUATU_CLOSE_BRACKET", + /* 88 */ + "multipoint_textzm ::= VANUATU_OPEN_BRACKET point_coordxyzm extra_pointsxyzm VANUATU_CLOSE_BRACKET", + /* 89 */ + "multilinestring ::= VANUATU_MULTILINESTRING multilinestring_text", + /* 90 */ + "multilinestringm ::= VANUATU_MULTILINESTRING_M multilinestring_textm", + /* 91 */ + "multilinestringz ::= VANUATU_MULTILINESTRING_Z multilinestring_textz", + /* 92 */ + "multilinestringzm ::= VANUATU_MULTILINESTRING_ZM multilinestring_textzm", + /* 93 */ + "multilinestring_text ::= VANUATU_OPEN_BRACKET linestring_text multilinestring_text2 VANUATU_CLOSE_BRACKET", + /* 94 */ "multilinestring_text2 ::=", + /* 95 */ + "multilinestring_text2 ::= VANUATU_COMMA linestring_text multilinestring_text2", + /* 96 */ + "multilinestring_textm ::= VANUATU_OPEN_BRACKET linestring_textm multilinestring_textm2 VANUATU_CLOSE_BRACKET", + /* 97 */ "multilinestring_textm2 ::=", + /* 98 */ + "multilinestring_textm2 ::= VANUATU_COMMA linestring_textm multilinestring_textm2", + /* 99 */ + "multilinestring_textz ::= VANUATU_OPEN_BRACKET linestring_textz multilinestring_textz2 VANUATU_CLOSE_BRACKET", + /* 100 */ "multilinestring_textz2 ::=", + /* 101 */ + "multilinestring_textz2 ::= VANUATU_COMMA linestring_textz multilinestring_textz2", + /* 102 */ + "multilinestring_textzm ::= VANUATU_OPEN_BRACKET linestring_textzm multilinestring_textzm2 VANUATU_CLOSE_BRACKET", + /* 103 */ "multilinestring_textzm2 ::=", + /* 104 */ + "multilinestring_textzm2 ::= VANUATU_COMMA linestring_textzm multilinestring_textzm2", + /* 105 */ "multipolygon ::= VANUATU_MULTIPOLYGON multipolygon_text", + /* 106 */ "multipolygonm ::= VANUATU_MULTIPOLYGON_M multipolygon_textm", + /* 107 */ "multipolygonz ::= VANUATU_MULTIPOLYGON_Z multipolygon_textz", + /* 108 */ "multipolygonzm ::= VANUATU_MULTIPOLYGON_ZM multipolygon_textzm", + /* 109 */ + "multipolygon_text ::= VANUATU_OPEN_BRACKET polygon_text multipolygon_text2 VANUATU_CLOSE_BRACKET", + /* 110 */ "multipolygon_text2 ::=", + /* 111 */ + "multipolygon_text2 ::= VANUATU_COMMA polygon_text multipolygon_text2", + /* 112 */ + "multipolygon_textm ::= VANUATU_OPEN_BRACKET polygon_textm multipolygon_textm2 VANUATU_CLOSE_BRACKET", + /* 113 */ "multipolygon_textm2 ::=", + /* 114 */ + "multipolygon_textm2 ::= VANUATU_COMMA polygon_textm multipolygon_textm2", + /* 115 */ + "multipolygon_textz ::= VANUATU_OPEN_BRACKET polygon_textz multipolygon_textz2 VANUATU_CLOSE_BRACKET", + /* 116 */ "multipolygon_textz2 ::=", + /* 117 */ + "multipolygon_textz2 ::= VANUATU_COMMA polygon_textz multipolygon_textz2", + /* 118 */ + "multipolygon_textzm ::= VANUATU_OPEN_BRACKET polygon_textzm multipolygon_textzm2 VANUATU_CLOSE_BRACKET", + /* 119 */ "multipolygon_textzm2 ::=", + /* 120 */ + "multipolygon_textzm2 ::= VANUATU_COMMA polygon_textzm multipolygon_textzm2", + /* 121 */ "geocoll ::= VANUATU_GEOMETRYCOLLECTION geocoll_text", + /* 122 */ "geocollm ::= VANUATU_GEOMETRYCOLLECTION_M geocoll_textm", + /* 123 */ "geocollz ::= VANUATU_GEOMETRYCOLLECTION_Z geocoll_textz", + /* 124 */ "geocollzm ::= VANUATU_GEOMETRYCOLLECTION_ZM geocoll_textzm", + /* 125 */ + "geocoll_text ::= VANUATU_OPEN_BRACKET point geocoll_text2 VANUATU_CLOSE_BRACKET", + /* 126 */ + "geocoll_text ::= VANUATU_OPEN_BRACKET linestring geocoll_text2 VANUATU_CLOSE_BRACKET", + /* 127 */ + "geocoll_text ::= VANUATU_OPEN_BRACKET polygon geocoll_text2 VANUATU_CLOSE_BRACKET", + /* 128 */ "geocoll_text2 ::=", + /* 129 */ "geocoll_text2 ::= VANUATU_COMMA point geocoll_text2", + /* 130 */ "geocoll_text2 ::= VANUATU_COMMA linestring geocoll_text2", + /* 131 */ "geocoll_text2 ::= VANUATU_COMMA polygon geocoll_text2", + /* 132 */ + "geocoll_textm ::= VANUATU_OPEN_BRACKET pointm geocoll_textm2 VANUATU_CLOSE_BRACKET", + /* 133 */ + "geocoll_textm ::= VANUATU_OPEN_BRACKET linestringm geocoll_textm2 VANUATU_CLOSE_BRACKET", + /* 134 */ + "geocoll_textm ::= VANUATU_OPEN_BRACKET polygonm geocoll_textm2 VANUATU_CLOSE_BRACKET", + /* 135 */ "geocoll_textm2 ::=", + /* 136 */ "geocoll_textm2 ::= VANUATU_COMMA pointm geocoll_textm2", + /* 137 */ "geocoll_textm2 ::= VANUATU_COMMA linestringm geocoll_textm2", + /* 138 */ "geocoll_textm2 ::= VANUATU_COMMA polygonm geocoll_textm2", + /* 139 */ + "geocoll_textz ::= VANUATU_OPEN_BRACKET pointz geocoll_textz2 VANUATU_CLOSE_BRACKET", + /* 140 */ + "geocoll_textz ::= VANUATU_OPEN_BRACKET linestringz geocoll_textz2 VANUATU_CLOSE_BRACKET", + /* 141 */ + "geocoll_textz ::= VANUATU_OPEN_BRACKET polygonz geocoll_textz2 VANUATU_CLOSE_BRACKET", + /* 142 */ "geocoll_textz2 ::=", + /* 143 */ "geocoll_textz2 ::= VANUATU_COMMA pointz geocoll_textz2", + /* 144 */ "geocoll_textz2 ::= VANUATU_COMMA linestringz geocoll_textz2", + /* 145 */ "geocoll_textz2 ::= VANUATU_COMMA polygonz geocoll_textz2", + /* 146 */ + "geocoll_textzm ::= VANUATU_OPEN_BRACKET pointzm geocoll_textzm2 VANUATU_CLOSE_BRACKET", + /* 147 */ + "geocoll_textzm ::= VANUATU_OPEN_BRACKET linestringzm geocoll_textzm2 VANUATU_CLOSE_BRACKET", + /* 148 */ + "geocoll_textzm ::= VANUATU_OPEN_BRACKET polygonzm geocoll_textzm2 VANUATU_CLOSE_BRACKET", + /* 149 */ "geocoll_textzm2 ::=", + /* 150 */ "geocoll_textzm2 ::= VANUATU_COMMA pointzm geocoll_textzm2", + /* 151 */ "geocoll_textzm2 ::= VANUATU_COMMA linestringzm geocoll_textzm2", + /* 152 */ "geocoll_textzm2 ::= VANUATU_COMMA polygonzm geocoll_textzm2", +}; +#endif /* NDEBUG */ + + +#if YYSTACKDEPTH<=0 +/* +** Try to increase the size of the parser stack. +*/ +static void +yyGrowStack (yyParser * p) +{ + int newSize; + yyStackEntry *pNew; + + newSize = p->yystksz * 2 + 100; + pNew = realloc (p->yystack, newSize * sizeof (pNew[0])); + if (pNew) + { + p->yystack = pNew; + p->yystksz = newSize; +#ifndef NDEBUG + if (yyTraceFILE) + { + fprintf (yyTraceFILE, "%sStack grows to %d entries!\n", + yyTracePrompt, p->yystksz); + } +#endif + } +} +#endif + +/* +** This function allocates a new parser. +** The only argument is a pointer to a function which works like +** malloc. +** +** Inputs: +** A pointer to the function used to allocate memory. +** +** Outputs: +** A pointer to a parser. This pointer is used in subsequent calls +** to Parse and ParseFree. +*/ +void * +ParseAlloc (void *(*mallocProc) (size_t)) +{ + yyParser *pParser; + pParser = (yyParser *) (*mallocProc) ((size_t) sizeof (yyParser)); + if (pParser) + { + pParser->yyidx = -1; +#ifdef YYTRACKMAXSTACKDEPTH + pParser->yyidxMax = 0; +#endif +#if YYSTACKDEPTH<=0 + pParser->yystack = NULL; + pParser->yystksz = 0; + yyGrowStack (pParser); +#endif + } + return pParser; +} + +/* The following function deletes the value associated with a +** symbol. The symbol can be either a terminal or nonterminal. +** "yymajor" is the symbol code, and "yypminor" is a pointer to +** the value. +*/ +static void +yy_destructor (yyParser * yypParser, /* The parser */ + YYCODETYPE yymajor, /* Type code for object to destroy */ + YYMINORTYPE * yypminor /* The object to be destroyed */ + ) +{ + ParseARG_FETCH; + switch (yymajor) + { + /* Here is inserted the actions which take place when a + ** terminal or non-terminal is destroyed. This can happen + ** when the symbol is popped from the stack during a + ** reduce or during error processing or when a parser is + ** being destroyed before it is finished parsing. + ** + ** Note: during a reduce, the only symbols destroyed are those + ** which appear on the RHS of the rule, but which are not used + ** inside the C code. + */ + default: + break; /* If no destructor action specified: do nothing */ + } +} + +/* +** Pop the parser's stack once. +** +** If there is a destructor routine associated with the token which +** is popped from the stack, then call it. +** +** Return the major token number for the symbol popped. +*/ +static int +yy_pop_parser_stack (yyParser * pParser) +{ + YYCODETYPE yymajor; + yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; + + if (pParser->yyidx < 0) + return 0; +#ifndef NDEBUG + if (yyTraceFILE && pParser->yyidx >= 0) + { + fprintf (yyTraceFILE, "%sPopping %s\n", + yyTracePrompt, yyTokenName[yytos->major]); + } +#endif + yymajor = yytos->major; + yy_destructor (pParser, yymajor, &yytos->minor); + pParser->yyidx--; + return yymajor; +} + +/* +** Return the peak depth of the stack for a parser. +*/ +#ifdef YYTRACKMAXSTACKDEPTH +int +ParseStackPeak (void *p) +{ + yyParser *pParser = (yyParser *) p; + return pParser->yyidxMax; +} +#endif + +/* +** Find the appropriate action for a parser given the terminal +** look-ahead token iLookAhead. +** +** If the look-ahead token is YYNOCODE, then check to see if the action is +** independent of the look-ahead. If it is, return the action, otherwise +** return YY_NO_ACTION. +*/ +static int +yy_find_shift_action (yyParser * pParser, /* The parser */ + YYCODETYPE iLookAhead /* The look-ahead token */ + ) +{ + int i; + int stateno = pParser->yystack[pParser->yyidx].stateno; + + if (stateno > YY_SHIFT_MAX + || (i = yy_shift_ofst[stateno]) == YY_SHIFT_USE_DFLT) + { + return yy_default[stateno]; + } + assert (iLookAhead != YYNOCODE); + i += iLookAhead; + if (i < 0 || i >= YY_SZ_ACTTAB || yy_lookahead[i] != iLookAhead) + { + if (iLookAhead > 0) + { +#ifdef YYFALLBACK + YYCODETYPE iFallback; /* Fallback token */ + if (iLookAhead < sizeof (yyFallback) / sizeof (yyFallback[0]) + && (iFallback = yyFallback[iLookAhead]) != 0) + { +#ifndef NDEBUG + if (yyTraceFILE) + { + fprintf (yyTraceFILE, "%sFALLBACK %s => %s\n", + yyTracePrompt, yyTokenName[iLookAhead], + yyTokenName[iFallback]); + } +#endif + return yy_find_shift_action (pParser, iFallback); + } +#endif +#ifdef YYWILDCARD + { + int j = i - iLookAhead + YYWILDCARD; + if (j >= 0 && j < YY_SZ_ACTTAB + && yy_lookahead[j] == YYWILDCARD) + { +#ifndef NDEBUG + if (yyTraceFILE) + { + fprintf (yyTraceFILE, "%sWILDCARD %s => %s\n", + yyTracePrompt, yyTokenName[iLookAhead], + yyTokenName[YYWILDCARD]); + } +#endif /* NDEBUG */ + return yy_action[j]; + } + } +#endif /* YYWILDCARD */ + } + return yy_default[stateno]; + } + else + { + return yy_action[i]; + } +} + +/* +** Find the appropriate action for a parser given the non-terminal +** look-ahead token iLookAhead. +** +** If the look-ahead token is YYNOCODE, then check to see if the action is +** independent of the look-ahead. If it is, return the action, otherwise +** return YY_NO_ACTION. +*/ +static int +yy_find_reduce_action (int stateno, /* Current state number */ + YYCODETYPE iLookAhead /* The look-ahead token */ + ) +{ + int i; +#ifdef YYERRORSYMBOL + if (stateno > YY_REDUCE_MAX) + { + return yy_default[stateno]; + } +#else + assert (stateno <= YY_REDUCE_MAX); +#endif + i = yy_reduce_ofst[stateno]; + assert (i != YY_REDUCE_USE_DFLT); + assert (iLookAhead != YYNOCODE); + i += iLookAhead; +#ifdef YYERRORSYMBOL + if (i < 0 || i >= YY_SZ_ACTTAB || yy_lookahead[i] != iLookAhead) + { + return yy_default[stateno]; + } +#else + assert (i >= 0 && i < YY_SZ_ACTTAB); + assert (yy_lookahead[i] == iLookAhead); +#endif + return yy_action[i]; +} + +/* +** The following routine is called if the stack overflows. +*/ +static void +yyStackOverflow (yyParser * yypParser, YYMINORTYPE * yypMinor) +{ + ParseARG_FETCH; + yypParser->yyidx--; +#ifndef NDEBUG + if (yyTraceFILE) + { + fprintf (yyTraceFILE, "%sStack Overflow!\n", yyTracePrompt); + } +#endif + while (yypParser->yyidx >= 0) + yy_pop_parser_stack (yypParser); + /* Here code is inserted which will execute if the parser + ** stack every overflows */ + + fprintf (stderr, "Giving up. Parser stack overflow\n"); + ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ +} + +/* +** Perform a shift action. +*/ +static void +yy_shift (yyParser * yypParser, /* The parser to be shifted */ + int yyNewState, /* The new state to shift in */ + int yyMajor, /* The major token to shift in */ + YYMINORTYPE * yypMinor /* Pointer to the minor token to shift in */ + ) +{ + yyStackEntry *yytos; + yypParser->yyidx++; +#ifdef YYTRACKMAXSTACKDEPTH + if (yypParser->yyidx > yypParser->yyidxMax) + { + yypParser->yyidxMax = yypParser->yyidx; + } +#endif +#if YYSTACKDEPTH>0 + if (yypParser->yyidx >= YYSTACKDEPTH) + { + yyStackOverflow (yypParser, yypMinor); + return; + } +#else + if (yypParser->yyidx >= yypParser->yystksz) + { + yyGrowStack (yypParser); + if (yypParser->yyidx >= yypParser->yystksz) + { + yyStackOverflow (yypParser, yypMinor); + return; + } + } +#endif + yytos = &yypParser->yystack[yypParser->yyidx]; + yytos->stateno = (YYACTIONTYPE) yyNewState; + yytos->major = (YYCODETYPE) yyMajor; + yytos->minor = *yypMinor; +#ifndef NDEBUG + if (yyTraceFILE && yypParser->yyidx > 0) + { + int i; + fprintf (yyTraceFILE, "%sShift %d\n", yyTracePrompt, yyNewState); + fprintf (yyTraceFILE, "%sStack:", yyTracePrompt); + for (i = 1; i <= yypParser->yyidx; i++) + fprintf (yyTraceFILE, " %s", + yyTokenName[yypParser->yystack[i].major]); + fprintf (yyTraceFILE, "\n"); + } +#endif +} + +/* The following table contains information about every rule that +** is used during the reduce. +*/ +static const struct +{ + YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ + unsigned char nrhs; /* Number of right-hand side symbols in the rule */ +} yyRuleInfo[] = +{ + { + 35, 1}, + { + 36, 0}, + { + 36, 3}, + { + 37, 1}, + { + 38, 1}, + { + 38, 1}, + { + 38, 1}, + { + 38, 1}, + { + 39, 1}, + { + 39, 1}, + { + 39, 1}, + { + 39, 1}, + { + 39, 1}, + { + 39, 1}, + { + 39, 1}, + { + 40, 1}, + { + 40, 1}, + { + 40, 1}, + { + 40, 1}, + { + 40, 1}, + { + 40, 1}, + { + 40, 1}, + { + 41, 1}, + { + 41, 1}, + { + 41, 1}, + { + 41, 1}, + { + 41, 1}, + { + 41, 1}, + { + 41, 1}, + { + 42, 1}, + { + 42, 1}, + { + 42, 1}, + { + 42, 1}, + { + 42, 1}, + { + 42, 1}, + { + 42, 1}, + { + 43, 4}, + { + 57, 4}, + { + 50, 4}, + { + 64, 4}, + { + 71, 2}, + { + 72, 3}, + { + 73, 3}, + { + 74, 4}, + { + 75, 1}, + { + 76, 0}, + { + 76, 3}, + { + 77, 0}, + { + 77, 3}, + { + 78, 0}, + { + 78, 3}, + { + 79, 0}, + { + 79, 3}, + { + 44, 2}, + { + 58, 2}, + { + 51, 2}, + { + 65, 2}, + { + 80, 6}, + { + 81, 6}, + { + 82, 6}, + { + 83, 6}, + { + 45, 2}, + { + 59, 2}, + { + 52, 2}, + { + 66, 2}, + { + 84, 4}, + { + 85, 4}, + { + 86, 4}, + { + 87, 4}, + { + 88, 10}, + { + 89, 0}, + { + 89, 3}, + { + 90, 10}, + { + 91, 0}, + { + 91, 3}, + { + 92, 10}, + { + 93, 0}, + { + 93, 3}, + { + 94, 10}, + { + 95, 0}, + { + 95, 3}, + { + 46, 2}, + { + 60, 2}, + { + 53, 2}, + { + 67, 2}, + { + 96, 4}, + { + 97, 4}, + { + 98, 4}, + { + 99, 4}, + { + 47, 2}, + { + 61, 2}, + { + 54, 2}, + { + 68, 2}, + { + 100, 4}, + { + 104, 0}, + { + 104, 3}, + { + 101, 4}, + { + 105, 0}, + { + 105, 3}, + { + 102, 4}, + { + 106, 0}, + { + 106, 3}, + { + 103, 4}, + { + 107, 0}, + { + 107, 3}, + { + 48, 2}, + { + 62, 2}, + { + 55, 2}, + { + 69, 2}, + { + 108, 4}, + { + 112, 0}, + { + 112, 3}, + { + 109, 4}, + { + 113, 0}, + { + 113, 3}, + { + 110, 4}, + { + 114, 0}, + { + 114, 3}, + { + 111, 4}, + { + 115, 0}, + { + 115, 3}, + { + 49, 2}, + { + 63, 2}, + { + 56, 2}, + { + 70, 2}, + { + 116, 4}, + { + 116, 4}, + { + 116, 4}, + { + 120, 0}, + { + 120, 3}, + { + 120, 3}, + { + 120, 3}, + { + 117, 4}, + { + 117, 4}, + { + 117, 4}, + { + 121, 0}, + { + 121, 3}, + { + 121, 3}, + { + 121, 3}, + { + 118, 4}, + { + 118, 4}, + { + 118, 4}, + { + 122, 0}, + { + 122, 3}, + { + 122, 3}, + { + 122, 3}, + { + 119, 4}, + { + 119, 4}, + { + 119, 4}, + { + 123, 0}, + { + 123, 3}, + { + 123, 3}, + { +123, 3},}; + +static void yy_accept (yyParser *); /* Forward Declaration */ + +/* +** Perform a reduce action and the shift that must immediately +** follow the reduce. +*/ +static void +yy_reduce (yyParser * yypParser, /* The parser */ + int yyruleno /* Number of the rule by which to reduce */ + ) +{ + int yygoto; /* The next state */ + int yyact; /* The next action */ + YYMINORTYPE yygotominor; /* The LHS of the rule reduced */ + yyStackEntry *yymsp; /* The top of the parser's stack */ + int yysize; /* Amount to pop the stack */ + ParseARG_FETCH; + yymsp = &yypParser->yystack[yypParser->yyidx]; +#ifndef NDEBUG + if (yyTraceFILE && yyruleno >= 0 + && yyruleno < (int) (sizeof (yyRuleName) / sizeof (yyRuleName[0]))) + { + fprintf (yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, + yyRuleName[yyruleno]); + } +#endif /* NDEBUG */ + + /* Silence complaints from purify about yygotominor being uninitialized + ** in some cases when it is copied into the stack after the following + ** switch. yygotominor is uninitialized when a rule reduces that does + ** not set the value of its left-hand side nonterminal. Leaving the + ** value of the nonterminal uninitialized is utterly harmless as long + ** as the value is never used. So really the only thing this code + ** accomplishes is to quieten purify. + ** + ** 2007-01-16: The wireshark project (www.wireshark.org) reports that + ** without this code, their parser segfaults. I'm not sure what there + ** parser is doing to make this happen. This is the second bug report + ** from wireshark this week. Clearly they are stressing Lemon in ways + ** that it has not been previously stressed... (SQLite ticket #2172) + */ + /*memset(&yygotominor, 0, sizeof(yygotominor)); */ + yygotominor = yyzerominor; + + + switch (yyruleno) + { + /* Beginning here are the reduction cases. A typical example + ** follows: + ** case 0: + ** #line + ** { ... } // User supplied code + ** #line + ** break; + */ + case 8: /* geo_text ::= point */ + case 9: /* geo_text ::= linestring */ + yytestcase (yyruleno == 9); + case 10: /* geo_text ::= polygon */ + yytestcase (yyruleno == 10); + case 11: /* geo_text ::= multipoint */ + yytestcase (yyruleno == 11); + case 12: /* geo_text ::= multilinestring */ + yytestcase (yyruleno == 12); + case 13: /* geo_text ::= multipolygon */ + yytestcase (yyruleno == 13); + case 14: /* geo_text ::= geocoll */ + yytestcase (yyruleno == 14); + case 15: /* geo_textz ::= pointz */ + yytestcase (yyruleno == 15); + case 16: /* geo_textz ::= linestringz */ + yytestcase (yyruleno == 16); + case 17: /* geo_textz ::= polygonz */ + yytestcase (yyruleno == 17); + case 18: /* geo_textz ::= multipointz */ + yytestcase (yyruleno == 18); + case 19: /* geo_textz ::= multilinestringz */ + yytestcase (yyruleno == 19); + case 20: /* geo_textz ::= multipolygonz */ + yytestcase (yyruleno == 20); + case 21: /* geo_textz ::= geocollz */ + yytestcase (yyruleno == 21); + case 22: /* geo_textm ::= pointm */ + yytestcase (yyruleno == 22); + case 23: /* geo_textm ::= linestringm */ + yytestcase (yyruleno == 23); + case 24: /* geo_textm ::= polygonm */ + yytestcase (yyruleno == 24); + case 25: /* geo_textm ::= multipointm */ + yytestcase (yyruleno == 25); + case 26: /* geo_textm ::= multilinestringm */ + yytestcase (yyruleno == 26); + case 27: /* geo_textm ::= multipolygonm */ + yytestcase (yyruleno == 27); + case 28: /* geo_textm ::= geocollm */ + yytestcase (yyruleno == 28); + case 29: /* geo_textzm ::= pointzm */ + yytestcase (yyruleno == 29); + case 30: /* geo_textzm ::= linestringzm */ + yytestcase (yyruleno == 30); + case 31: /* geo_textzm ::= polygonzm */ + yytestcase (yyruleno == 31); + case 32: /* geo_textzm ::= multipointzm */ + yytestcase (yyruleno == 32); + case 33: /* geo_textzm ::= multilinestringzm */ + yytestcase (yyruleno == 33); + case 34: /* geo_textzm ::= multipolygonzm */ + yytestcase (yyruleno == 34); + case 35: /* geo_textzm ::= geocollzm */ + yytestcase (yyruleno == 35); + { + *result = yymsp[0].minor.yy0; + } + break; + case 36: /* point ::= VANUATU_POINT VANUATU_OPEN_BRACKET point_coordxy VANUATU_CLOSE_BRACKET */ + { + yygotominor.yy0 = + vanuatu_buildGeomFromPoint ((gaiaPointPtr) yymsp[-1].minor. + yy0); + } + break; + case 37: /* pointm ::= VANUATU_POINT_M VANUATU_OPEN_BRACKET point_coordxym VANUATU_CLOSE_BRACKET */ + case 38: /* pointz ::= VANUATU_POINT_Z VANUATU_OPEN_BRACKET point_coordxyz VANUATU_CLOSE_BRACKET */ + yytestcase (yyruleno == 38); + case 39: /* pointzm ::= VANUATU_POINT_ZM VANUATU_OPEN_BRACKET point_coordxyzm VANUATU_CLOSE_BRACKET */ + yytestcase (yyruleno == 39); + { + yygotominor.yy0 = + vanuatu_buildGeomFromPoint ((gaiaPointPtr) yymsp[-1].minor. + yy0); + } + break; + case 40: /* point_coordxy ::= coord coord */ + { + yygotominor.yy0 = + (void *) vanuatu_point_xy ((double *) yymsp[-1].minor.yy0, + (double *) yymsp[0].minor.yy0); + } + break; + case 41: /* point_coordxym ::= coord coord coord */ + { + yygotominor.yy0 = + (void *) vanuatu_point_xym ((double *) yymsp[-2].minor.yy0, + (double *) yymsp[-1].minor.yy0, + (double *) yymsp[0].minor.yy0); + } + break; + case 42: /* point_coordxyz ::= coord coord coord */ + { + yygotominor.yy0 = + (void *) vanuatu_point_xyz ((double *) yymsp[-2].minor.yy0, + (double *) yymsp[-1].minor.yy0, + (double *) yymsp[0].minor.yy0); + } + break; + case 43: /* point_coordxyzm ::= coord coord coord coord */ + { + yygotominor.yy0 = + (void *) vanuatu_point_xyzm ((double *) yymsp[-3].minor.yy0, + (double *) yymsp[-2].minor.yy0, + (double *) yymsp[-1].minor.yy0, + (double *) yymsp[0].minor.yy0); + } + break; + case 44: /* coord ::= VANUATU_NUM */ + case 81: /* multipoint ::= VANUATU_MULTIPOINT multipoint_text */ + yytestcase (yyruleno == 81); + case 82: /* multipointm ::= VANUATU_MULTIPOINT_M multipoint_textm */ + yytestcase (yyruleno == 82); + case 83: /* multipointz ::= VANUATU_MULTIPOINT_Z multipoint_textz */ + yytestcase (yyruleno == 83); + case 84: /* multipointzm ::= VANUATU_MULTIPOINT_ZM multipoint_textzm */ + yytestcase (yyruleno == 84); + case 89: /* multilinestring ::= VANUATU_MULTILINESTRING multilinestring_text */ + yytestcase (yyruleno == 89); + case 90: /* multilinestringm ::= VANUATU_MULTILINESTRING_M multilinestring_textm */ + yytestcase (yyruleno == 90); + case 91: /* multilinestringz ::= VANUATU_MULTILINESTRING_Z multilinestring_textz */ + yytestcase (yyruleno == 91); + case 92: /* multilinestringzm ::= VANUATU_MULTILINESTRING_ZM multilinestring_textzm */ + yytestcase (yyruleno == 92); + case 105: /* multipolygon ::= VANUATU_MULTIPOLYGON multipolygon_text */ + yytestcase (yyruleno == 105); + case 106: /* multipolygonm ::= VANUATU_MULTIPOLYGON_M multipolygon_textm */ + yytestcase (yyruleno == 106); + case 107: /* multipolygonz ::= VANUATU_MULTIPOLYGON_Z multipolygon_textz */ + yytestcase (yyruleno == 107); + case 108: /* multipolygonzm ::= VANUATU_MULTIPOLYGON_ZM multipolygon_textzm */ + yytestcase (yyruleno == 108); + case 121: /* geocoll ::= VANUATU_GEOMETRYCOLLECTION geocoll_text */ + yytestcase (yyruleno == 121); + case 122: /* geocollm ::= VANUATU_GEOMETRYCOLLECTION_M geocoll_textm */ + yytestcase (yyruleno == 122); + case 123: /* geocollz ::= VANUATU_GEOMETRYCOLLECTION_Z geocoll_textz */ + yytestcase (yyruleno == 123); + case 124: /* geocollzm ::= VANUATU_GEOMETRYCOLLECTION_ZM geocoll_textzm */ + yytestcase (yyruleno == 124); + { + yygotominor.yy0 = yymsp[0].minor.yy0; + } + break; + case 45: /* extra_pointsxy ::= */ + case 47: /* extra_pointsxym ::= */ + yytestcase (yyruleno == 47); + case 49: /* extra_pointsxyz ::= */ + yytestcase (yyruleno == 49); + case 51: /* extra_pointsxyzm ::= */ + yytestcase (yyruleno == 51); + case 70: /* extra_rings ::= */ + yytestcase (yyruleno == 70); + case 73: /* extra_ringsm ::= */ + yytestcase (yyruleno == 73); + case 76: /* extra_ringsz ::= */ + yytestcase (yyruleno == 76); + case 79: /* extra_ringszm ::= */ + yytestcase (yyruleno == 79); + case 94: /* multilinestring_text2 ::= */ + yytestcase (yyruleno == 94); + case 97: /* multilinestring_textm2 ::= */ + yytestcase (yyruleno == 97); + case 100: /* multilinestring_textz2 ::= */ + yytestcase (yyruleno == 100); + case 103: /* multilinestring_textzm2 ::= */ + yytestcase (yyruleno == 103); + case 110: /* multipolygon_text2 ::= */ + yytestcase (yyruleno == 110); + case 113: /* multipolygon_textm2 ::= */ + yytestcase (yyruleno == 113); + case 116: /* multipolygon_textz2 ::= */ + yytestcase (yyruleno == 116); + case 119: /* multipolygon_textzm2 ::= */ + yytestcase (yyruleno == 119); + case 128: /* geocoll_text2 ::= */ + yytestcase (yyruleno == 128); + case 135: /* geocoll_textm2 ::= */ + yytestcase (yyruleno == 135); + case 142: /* geocoll_textz2 ::= */ + yytestcase (yyruleno == 142); + case 149: /* geocoll_textzm2 ::= */ + yytestcase (yyruleno == 149); + { + yygotominor.yy0 = NULL; + } + break; + case 46: /* extra_pointsxy ::= VANUATU_COMMA point_coordxy extra_pointsxy */ + case 48: /* extra_pointsxym ::= VANUATU_COMMA point_coordxym extra_pointsxym */ + yytestcase (yyruleno == 48); + case 50: /* extra_pointsxyz ::= VANUATU_COMMA point_coordxyz extra_pointsxyz */ + yytestcase (yyruleno == 50); + case 52: /* extra_pointsxyzm ::= VANUATU_COMMA point_coordxyzm extra_pointsxyzm */ + yytestcase (yyruleno == 52); + { + ((gaiaPointPtr) yymsp[-1].minor.yy0)->Next = + (gaiaPointPtr) yymsp[0].minor.yy0; + yygotominor.yy0 = yymsp[-1].minor.yy0; + } + break; + case 53: /* linestring ::= VANUATU_LINESTRING linestring_text */ + case 54: /* linestringm ::= VANUATU_LINESTRING_M linestring_textm */ + yytestcase (yyruleno == 54); + case 55: /* linestringz ::= VANUATU_LINESTRING_Z linestring_textz */ + yytestcase (yyruleno == 55); + case 56: /* linestringzm ::= VANUATU_LINESTRING_ZM linestring_textzm */ + yytestcase (yyruleno == 56); + { + yygotominor.yy0 = + vanuatu_buildGeomFromLinestring ((gaiaLinestringPtr) + yymsp[0].minor.yy0); + } + break; + case 57: /* linestring_text ::= VANUATU_OPEN_BRACKET point_coordxy VANUATU_COMMA point_coordxy extra_pointsxy VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + ((gaiaPointPtr) yymsp[-4].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-2].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_linestring_xy ((gaiaPointPtr) + yymsp[-4].minor.yy0); + } + break; + case 58: /* linestring_textm ::= VANUATU_OPEN_BRACKET point_coordxym VANUATU_COMMA point_coordxym extra_pointsxym VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + ((gaiaPointPtr) yymsp[-4].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-2].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_linestring_xym ((gaiaPointPtr) + yymsp[-4].minor.yy0); + } + break; + case 59: /* linestring_textz ::= VANUATU_OPEN_BRACKET point_coordxyz VANUATU_COMMA point_coordxyz extra_pointsxyz VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + ((gaiaPointPtr) yymsp[-4].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-2].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_linestring_xyz ((gaiaPointPtr) + yymsp[-4].minor.yy0); + } + break; + case 60: /* linestring_textzm ::= VANUATU_OPEN_BRACKET point_coordxyzm VANUATU_COMMA point_coordxyzm extra_pointsxyzm VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + ((gaiaPointPtr) yymsp[-4].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-2].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_linestring_xyzm ((gaiaPointPtr) + yymsp[-4].minor.yy0); + } + break; + case 61: /* polygon ::= VANUATU_POLYGON polygon_text */ + case 62: /* polygonm ::= VANUATU_POLYGON_M polygon_textm */ + yytestcase (yyruleno == 62); + case 63: /* polygonz ::= VANUATU_POLYGON_Z polygon_textz */ + yytestcase (yyruleno == 63); + case 64: /* polygonzm ::= VANUATU_POLYGON_ZM polygon_textzm */ + yytestcase (yyruleno == 64); + { + yygotominor.yy0 = + buildGeomFromPolygon ((gaiaPolygonPtr) yymsp[0].minor.yy0); + } + break; + case 65: /* polygon_text ::= VANUATU_OPEN_BRACKET ring extra_rings VANUATU_CLOSE_BRACKET */ + { + ((gaiaRingPtr) yymsp[-2].minor.yy0)->Next = + (gaiaRingPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_polygon_xy ((gaiaRingPtr) yymsp[-2].minor. + yy0); + } + break; + case 66: /* polygon_textm ::= VANUATU_OPEN_BRACKET ringm extra_ringsm VANUATU_CLOSE_BRACKET */ + { + ((gaiaRingPtr) yymsp[-2].minor.yy0)->Next = + (gaiaRingPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_polygon_xym ((gaiaRingPtr) yymsp[-2].minor. + yy0); + } + break; + case 67: /* polygon_textz ::= VANUATU_OPEN_BRACKET ringz extra_ringsz VANUATU_CLOSE_BRACKET */ + { + ((gaiaRingPtr) yymsp[-2].minor.yy0)->Next = + (gaiaRingPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_polygon_xyz ((gaiaRingPtr) yymsp[-2].minor. + yy0); + } + break; + case 68: /* polygon_textzm ::= VANUATU_OPEN_BRACKET ringzm extra_ringszm VANUATU_CLOSE_BRACKET */ + { + ((gaiaRingPtr) yymsp[-2].minor.yy0)->Next = + (gaiaRingPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_polygon_xyzm ((gaiaRingPtr) yymsp[-2].minor. + yy0); + } + break; + case 69: /* ring ::= VANUATU_OPEN_BRACKET point_coordxy VANUATU_COMMA point_coordxy VANUATU_COMMA point_coordxy VANUATU_COMMA point_coordxy extra_pointsxy VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-8].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-6].minor.yy0; + ((gaiaPointPtr) yymsp[-6].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-4].minor.yy0; + ((gaiaPointPtr) yymsp[-4].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-2].minor.yy0; + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_ring_xy ((gaiaPointPtr) yymsp[-8].minor.yy0); + } + break; + case 71: /* extra_rings ::= VANUATU_COMMA ring extra_rings */ + case 74: /* extra_ringsm ::= VANUATU_COMMA ringm extra_ringsm */ + yytestcase (yyruleno == 74); + case 77: /* extra_ringsz ::= VANUATU_COMMA ringz extra_ringsz */ + yytestcase (yyruleno == 77); + case 80: /* extra_ringszm ::= VANUATU_COMMA ringzm extra_ringszm */ + yytestcase (yyruleno == 80); + { + ((gaiaRingPtr) yymsp[-1].minor.yy0)->Next = + (gaiaRingPtr) yymsp[0].minor.yy0; + yygotominor.yy0 = yymsp[-1].minor.yy0; + } + break; + case 72: /* ringm ::= VANUATU_OPEN_BRACKET point_coordxym VANUATU_COMMA point_coordxym VANUATU_COMMA point_coordxym VANUATU_COMMA point_coordxym extra_pointsxym VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-8].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-6].minor.yy0; + ((gaiaPointPtr) yymsp[-6].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-4].minor.yy0; + ((gaiaPointPtr) yymsp[-4].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-2].minor.yy0; + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_ring_xym ((gaiaPointPtr) yymsp[-8].minor. + yy0); + } + break; + case 75: /* ringz ::= VANUATU_OPEN_BRACKET point_coordxyz VANUATU_COMMA point_coordxyz VANUATU_COMMA point_coordxyz VANUATU_COMMA point_coordxyz extra_pointsxyz VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-8].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-6].minor.yy0; + ((gaiaPointPtr) yymsp[-6].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-4].minor.yy0; + ((gaiaPointPtr) yymsp[-4].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-2].minor.yy0; + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_ring_xyz ((gaiaPointPtr) yymsp[-8].minor. + yy0); + } + break; + case 78: /* ringzm ::= VANUATU_OPEN_BRACKET point_coordxyzm VANUATU_COMMA point_coordxyzm VANUATU_COMMA point_coordxyzm VANUATU_COMMA point_coordxyzm extra_pointsxyzm VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-8].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-6].minor.yy0; + ((gaiaPointPtr) yymsp[-6].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-4].minor.yy0; + ((gaiaPointPtr) yymsp[-4].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-2].minor.yy0; + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_ring_xyzm ((gaiaPointPtr) yymsp[-8].minor. + yy0); + } + break; + case 85: /* multipoint_text ::= VANUATU_OPEN_BRACKET point_coordxy extra_pointsxy VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multipoint_xy ((gaiaPointPtr) + yymsp[-2].minor.yy0); + } + break; + case 86: /* multipoint_textm ::= VANUATU_OPEN_BRACKET point_coordxym extra_pointsxym VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multipoint_xym ((gaiaPointPtr) + yymsp[-2].minor.yy0); + } + break; + case 87: /* multipoint_textz ::= VANUATU_OPEN_BRACKET point_coordxyz extra_pointsxyz VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multipoint_xyz ((gaiaPointPtr) + yymsp[-2].minor.yy0); + } + break; + case 88: /* multipoint_textzm ::= VANUATU_OPEN_BRACKET point_coordxyzm extra_pointsxyzm VANUATU_CLOSE_BRACKET */ + { + ((gaiaPointPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPointPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multipoint_xyzm ((gaiaPointPtr) + yymsp[-2].minor.yy0); + } + break; + case 93: /* multilinestring_text ::= VANUATU_OPEN_BRACKET linestring_text multilinestring_text2 VANUATU_CLOSE_BRACKET */ + { + ((gaiaLinestringPtr) yymsp[-2].minor.yy0)->Next = + (gaiaLinestringPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multilinestring_xy ((gaiaLinestringPtr) + yymsp[-2].minor.yy0); + } + break; + case 95: /* multilinestring_text2 ::= VANUATU_COMMA linestring_text multilinestring_text2 */ + case 98: /* multilinestring_textm2 ::= VANUATU_COMMA linestring_textm multilinestring_textm2 */ + yytestcase (yyruleno == 98); + case 101: /* multilinestring_textz2 ::= VANUATU_COMMA linestring_textz multilinestring_textz2 */ + yytestcase (yyruleno == 101); + case 104: /* multilinestring_textzm2 ::= VANUATU_COMMA linestring_textzm multilinestring_textzm2 */ + yytestcase (yyruleno == 104); + { + ((gaiaLinestringPtr) yymsp[-1].minor.yy0)->Next = + (gaiaLinestringPtr) yymsp[0].minor.yy0; + yygotominor.yy0 = yymsp[-1].minor.yy0; + } + break; + case 96: /* multilinestring_textm ::= VANUATU_OPEN_BRACKET linestring_textm multilinestring_textm2 VANUATU_CLOSE_BRACKET */ + { + ((gaiaLinestringPtr) yymsp[-2].minor.yy0)->Next = + (gaiaLinestringPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multilinestring_xym ((gaiaLinestringPtr) + yymsp[-2].minor.yy0); + } + break; + case 99: /* multilinestring_textz ::= VANUATU_OPEN_BRACKET linestring_textz multilinestring_textz2 VANUATU_CLOSE_BRACKET */ + { + ((gaiaLinestringPtr) yymsp[-2].minor.yy0)->Next = + (gaiaLinestringPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multilinestring_xyz ((gaiaLinestringPtr) + yymsp[-2].minor.yy0); + } + break; + case 102: /* multilinestring_textzm ::= VANUATU_OPEN_BRACKET linestring_textzm multilinestring_textzm2 VANUATU_CLOSE_BRACKET */ + { + ((gaiaLinestringPtr) yymsp[-2].minor.yy0)->Next = + (gaiaLinestringPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multilinestring_xyzm ((gaiaLinestringPtr) + yymsp[-2].minor.yy0); + } + break; + case 109: /* multipolygon_text ::= VANUATU_OPEN_BRACKET polygon_text multipolygon_text2 VANUATU_CLOSE_BRACKET */ + { + ((gaiaPolygonPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPolygonPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multipolygon_xy ((gaiaPolygonPtr) + yymsp[-2].minor.yy0); + } + break; + case 111: /* multipolygon_text2 ::= VANUATU_COMMA polygon_text multipolygon_text2 */ + case 114: /* multipolygon_textm2 ::= VANUATU_COMMA polygon_textm multipolygon_textm2 */ + yytestcase (yyruleno == 114); + case 117: /* multipolygon_textz2 ::= VANUATU_COMMA polygon_textz multipolygon_textz2 */ + yytestcase (yyruleno == 117); + case 120: /* multipolygon_textzm2 ::= VANUATU_COMMA polygon_textzm multipolygon_textzm2 */ + yytestcase (yyruleno == 120); + { + ((gaiaPolygonPtr) yymsp[-1].minor.yy0)->Next = + (gaiaPolygonPtr) yymsp[0].minor.yy0; + yygotominor.yy0 = yymsp[-1].minor.yy0; + } + break; + case 112: /* multipolygon_textm ::= VANUATU_OPEN_BRACKET polygon_textm multipolygon_textm2 VANUATU_CLOSE_BRACKET */ + { + ((gaiaPolygonPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPolygonPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multipolygon_xym ((gaiaPolygonPtr) + yymsp[-2].minor.yy0); + } + break; + case 115: /* multipolygon_textz ::= VANUATU_OPEN_BRACKET polygon_textz multipolygon_textz2 VANUATU_CLOSE_BRACKET */ + { + ((gaiaPolygonPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPolygonPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multipolygon_xyz ((gaiaPolygonPtr) + yymsp[-2].minor.yy0); + } + break; + case 118: /* multipolygon_textzm ::= VANUATU_OPEN_BRACKET polygon_textzm multipolygon_textzm2 VANUATU_CLOSE_BRACKET */ + { + ((gaiaPolygonPtr) yymsp[-2].minor.yy0)->Next = + (gaiaPolygonPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_multipolygon_xyzm ((gaiaPolygonPtr) + yymsp[-2].minor.yy0); + } + break; + case 125: /* geocoll_text ::= VANUATU_OPEN_BRACKET point geocoll_text2 VANUATU_CLOSE_BRACKET */ + case 126: /* geocoll_text ::= VANUATU_OPEN_BRACKET linestring geocoll_text2 VANUATU_CLOSE_BRACKET */ + yytestcase (yyruleno == 126); + case 127: /* geocoll_text ::= VANUATU_OPEN_BRACKET polygon geocoll_text2 VANUATU_CLOSE_BRACKET */ + yytestcase (yyruleno == 127); + { + ((gaiaGeomCollPtr) yymsp[-2].minor.yy0)->Next = + (gaiaGeomCollPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_geomColl_xy ((gaiaGeomCollPtr) + yymsp[-2].minor.yy0); + } + break; + case 129: /* geocoll_text2 ::= VANUATU_COMMA point geocoll_text2 */ + case 130: /* geocoll_text2 ::= VANUATU_COMMA linestring geocoll_text2 */ + yytestcase (yyruleno == 130); + case 131: /* geocoll_text2 ::= VANUATU_COMMA polygon geocoll_text2 */ + yytestcase (yyruleno == 131); + case 136: /* geocoll_textm2 ::= VANUATU_COMMA pointm geocoll_textm2 */ + yytestcase (yyruleno == 136); + case 137: /* geocoll_textm2 ::= VANUATU_COMMA linestringm geocoll_textm2 */ + yytestcase (yyruleno == 137); + case 138: /* geocoll_textm2 ::= VANUATU_COMMA polygonm geocoll_textm2 */ + yytestcase (yyruleno == 138); + case 143: /* geocoll_textz2 ::= VANUATU_COMMA pointz geocoll_textz2 */ + yytestcase (yyruleno == 143); + case 144: /* geocoll_textz2 ::= VANUATU_COMMA linestringz geocoll_textz2 */ + yytestcase (yyruleno == 144); + case 145: /* geocoll_textz2 ::= VANUATU_COMMA polygonz geocoll_textz2 */ + yytestcase (yyruleno == 145); + case 150: /* geocoll_textzm2 ::= VANUATU_COMMA pointzm geocoll_textzm2 */ + yytestcase (yyruleno == 150); + case 151: /* geocoll_textzm2 ::= VANUATU_COMMA linestringzm geocoll_textzm2 */ + yytestcase (yyruleno == 151); + case 152: /* geocoll_textzm2 ::= VANUATU_COMMA polygonzm geocoll_textzm2 */ + yytestcase (yyruleno == 152); + { + ((gaiaGeomCollPtr) yymsp[-1].minor.yy0)->Next = + (gaiaGeomCollPtr) yymsp[0].minor.yy0; + yygotominor.yy0 = yymsp[-1].minor.yy0; + } + break; + case 132: /* geocoll_textm ::= VANUATU_OPEN_BRACKET pointm geocoll_textm2 VANUATU_CLOSE_BRACKET */ + case 133: /* geocoll_textm ::= VANUATU_OPEN_BRACKET linestringm geocoll_textm2 VANUATU_CLOSE_BRACKET */ + yytestcase (yyruleno == 133); + case 134: /* geocoll_textm ::= VANUATU_OPEN_BRACKET polygonm geocoll_textm2 VANUATU_CLOSE_BRACKET */ + yytestcase (yyruleno == 134); + { + ((gaiaGeomCollPtr) yymsp[-2].minor.yy0)->Next = + (gaiaGeomCollPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_geomColl_xym ((gaiaGeomCollPtr) + yymsp[-2].minor.yy0); + } + break; + case 139: /* geocoll_textz ::= VANUATU_OPEN_BRACKET pointz geocoll_textz2 VANUATU_CLOSE_BRACKET */ + case 140: /* geocoll_textz ::= VANUATU_OPEN_BRACKET linestringz geocoll_textz2 VANUATU_CLOSE_BRACKET */ + yytestcase (yyruleno == 140); + case 141: /* geocoll_textz ::= VANUATU_OPEN_BRACKET polygonz geocoll_textz2 VANUATU_CLOSE_BRACKET */ + yytestcase (yyruleno == 141); + { + ((gaiaGeomCollPtr) yymsp[-2].minor.yy0)->Next = + (gaiaGeomCollPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_geomColl_xyz ((gaiaGeomCollPtr) + yymsp[-2].minor.yy0); + } + break; + case 146: /* geocoll_textzm ::= VANUATU_OPEN_BRACKET pointzm geocoll_textzm2 VANUATU_CLOSE_BRACKET */ + case 147: /* geocoll_textzm ::= VANUATU_OPEN_BRACKET linestringzm geocoll_textzm2 VANUATU_CLOSE_BRACKET */ + yytestcase (yyruleno == 147); + case 148: /* geocoll_textzm ::= VANUATU_OPEN_BRACKET polygonzm geocoll_textzm2 VANUATU_CLOSE_BRACKET */ + yytestcase (yyruleno == 148); + { + ((gaiaGeomCollPtr) yymsp[-2].minor.yy0)->Next = + (gaiaGeomCollPtr) yymsp[-1].minor.yy0; + yygotominor.yy0 = + (void *) vanuatu_geomColl_xyzm ((gaiaGeomCollPtr) + yymsp[-2].minor.yy0); + } + break; + default: + /* (0) main ::= in */ yytestcase (yyruleno == 0); + /* (1) in ::= */ yytestcase (yyruleno == 1); + /* (2) in ::= in state VANUATU_NEWLINE */ yytestcase (yyruleno == 2); + /* (3) state ::= program */ yytestcase (yyruleno == 3); + /* (4) program ::= geo_text */ yytestcase (yyruleno == 4); + /* (5) program ::= geo_textz */ yytestcase (yyruleno == 5); + /* (6) program ::= geo_textm */ yytestcase (yyruleno == 6); + /* (7) program ::= geo_textzm */ yytestcase (yyruleno == 7); + break; + }; + yygoto = yyRuleInfo[yyruleno].lhs; + yysize = yyRuleInfo[yyruleno].nrhs; + yypParser->yyidx -= yysize; + yyact = yy_find_reduce_action (yymsp[-yysize].stateno, (YYCODETYPE) yygoto); + if (yyact < YYNSTATE) + { +#ifdef NDEBUG + /* If we are not debugging and the reduce action popped at least + ** one element off the stack, then we can push the new element back + ** onto the stack here, and skip the stack overflow test in yy_shift(). + ** That gives a significant speed improvement. */ + if (yysize) + { + yypParser->yyidx++; + yymsp -= yysize - 1; + yymsp->stateno = (YYACTIONTYPE) yyact; + yymsp->major = (YYCODETYPE) yygoto; + yymsp->minor = yygotominor; + } + else +#endif + { + yy_shift (yypParser, yyact, yygoto, &yygotominor); + } + } + else + { + assert (yyact == YYNSTATE + YYNRULE + 1); + yy_accept (yypParser); + } +} + +/* +** The following code executes when the parse fails +*/ +#ifndef YYNOERRORRECOVERY +static void +yy_parse_failed (yyParser * yypParser /* The parser */ + ) +{ + ParseARG_FETCH; +#ifndef NDEBUG + if (yyTraceFILE) + { + fprintf (yyTraceFILE, "%sFail!\n", yyTracePrompt); + } +#endif + while (yypParser->yyidx >= 0) + yy_pop_parser_stack (yypParser); + /* Here code is inserted which will be executed whenever the + ** parser fails */ + ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ +} +#endif /* YYNOERRORRECOVERY */ + +/* +** The following code executes when a syntax error first occurs. +*/ +static void +yy_syntax_error (yyParser * yypParser, /* The parser */ + int yymajor, /* The major type of the error token */ + YYMINORTYPE yyminor /* The minor type of the error token */ + ) +{ + ParseARG_FETCH; +#define TOKEN (yyminor.yy0) + +/* +** Sandro Furieri 2010 Apr 4 +** when the LEMON parser encounters an error +** then this global variable is set +*/ + vanuatu_parse_error = 1; + *result = NULL; + ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ +} + +/* +** The following is executed when the parser accepts +*/ +static void +yy_accept (yyParser * yypParser /* The parser */ + ) +{ + ParseARG_FETCH; +#ifndef NDEBUG + if (yyTraceFILE) + { + fprintf (yyTraceFILE, "%sAccept!\n", yyTracePrompt); + } +#endif + while (yypParser->yyidx >= 0) + yy_pop_parser_stack (yypParser); + /* Here code is inserted which will be executed whenever the + ** parser accepts */ + ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ +} + +/* The main parser program. +** The first argument is a pointer to a structure obtained from +** "ParseAlloc" which describes the current state of the parser. +** The second argument is the major token number. The third is +** the minor token. The fourth optional argument is whatever the +** user wants (and specified in the grammar) and is available for +** use by the action routines. +** +** Inputs: +**
      +**
    • A pointer to the parser (an opaque structure.) +**
    • The major token number. +**
    • The minor token number. +**
    • An option argument of a grammar-specified type. +**
    +** +** Outputs: +** None. +*/ +void +Parse (void *yyp, /* The parser */ + int yymajor, /* The major token code number */ + ParseTOKENTYPE yyminor /* The value for the token */ + ParseARG_PDECL /* Optional %extra_argument parameter */ + ) +{ + YYMINORTYPE yyminorunion; + int yyact; /* The parser action. */ + int yyendofinput; /* True if we are at the end of input */ +#ifdef YYERRORSYMBOL + int yyerrorhit = 0; /* True if yymajor has invoked an error */ +#endif + yyParser *yypParser; /* The parser */ + + /* (re)initialize the parser, if necessary */ + yypParser = (yyParser *) yyp; + if (yypParser->yyidx < 0) + { +#if YYSTACKDEPTH<=0 + if (yypParser->yystksz <= 0) + { + /*memset(&yyminorunion, 0, sizeof(yyminorunion)); */ + yyminorunion = yyzerominor; + yyStackOverflow (yypParser, &yyminorunion); + return; + } +#endif + yypParser->yyidx = 0; + yypParser->yyerrcnt = -1; + yypParser->yystack[0].stateno = 0; + yypParser->yystack[0].major = 0; + } + yyminorunion.yy0 = yyminor; + yyendofinput = (yymajor == 0); + ParseARG_STORE; + +#ifndef NDEBUG + if (yyTraceFILE) + { + fprintf (yyTraceFILE, "%sInput %s\n", yyTracePrompt, + yyTokenName[yymajor]); + } +#endif + + do + { + yyact = yy_find_shift_action (yypParser, (YYCODETYPE) yymajor); + if (yyact < YYNSTATE) + { + assert (!yyendofinput); /* Impossible to shift the $ token */ + yy_shift (yypParser, yyact, yymajor, &yyminorunion); + yypParser->yyerrcnt--; + yymajor = YYNOCODE; + } + else if (yyact < YYNSTATE + YYNRULE) + { + yy_reduce (yypParser, yyact - YYNSTATE); + } + else + { + assert (yyact == YY_ERROR_ACTION); +#ifdef YYERRORSYMBOL + int yymx; +#endif +#ifndef NDEBUG + if (yyTraceFILE) + { + fprintf (yyTraceFILE, "%sSyntax Error!\n", yyTracePrompt); + } +#endif +#ifdef YYERRORSYMBOL + /* A syntax error has occurred. + ** The response to an error depends upon whether or not the + ** grammar defines an error token "ERROR". + ** + ** This is what we do if the grammar does define ERROR: + ** + ** * Call the %syntax_error function. + ** + ** * Begin popping the stack until we enter a state where + ** it is legal to shift the error symbol, then shift + ** the error symbol. + ** + ** * Set the error count to three. + ** + ** * Begin accepting and shifting new tokens. No new error + ** processing will occur until three tokens have been + ** shifted successfully. + ** + */ + if (yypParser->yyerrcnt < 0) + { + yy_syntax_error (yypParser, yymajor, yyminorunion); + } + yymx = yypParser->yystack[yypParser->yyidx].major; + if (yymx == YYERRORSYMBOL || yyerrorhit) + { +#ifndef NDEBUG + if (yyTraceFILE) + { + fprintf (yyTraceFILE, "%sDiscard input token %s\n", + yyTracePrompt, yyTokenName[yymajor]); + } +#endif + yy_destructor (yypParser, (YYCODETYPE) yymajor, + &yyminorunion); + yymajor = YYNOCODE; + } + else + { + while (yypParser->yyidx >= 0 && + yymx != YYERRORSYMBOL && + (yyact = + yy_find_reduce_action (yypParser->yystack + [yypParser->yyidx].stateno, + YYERRORSYMBOL)) >= + YYNSTATE) + { + yy_pop_parser_stack (yypParser); + } + if (yypParser->yyidx < 0 || yymajor == 0) + { + yy_destructor (yypParser, (YYCODETYPE) yymajor, + &yyminorunion); + yy_parse_failed (yypParser); + yymajor = YYNOCODE; + } + else if (yymx != YYERRORSYMBOL) + { + YYMINORTYPE u2; + u2.YYERRSYMDT = 0; + yy_shift (yypParser, yyact, YYERRORSYMBOL, &u2); + } + } + yypParser->yyerrcnt = 3; + yyerrorhit = 1; +#elif defined(YYNOERRORRECOVERY) + /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to + ** do any kind of error recovery. Instead, simply invoke the syntax + ** error routine and continue going as if nothing had happened. + ** + ** Applications can set this macro (for example inside %include) if + ** they intend to abandon the parse upon the first syntax error seen. + */ + yy_syntax_error (yypParser, yymajor, yyminorunion); + yy_destructor (yypParser, (YYCODETYPE) yymajor, &yyminorunion); + yymajor = YYNOCODE; + +#else /* YYERRORSYMBOL is not defined */ + /* This is what we do if the grammar does not define ERROR: + ** + ** * Report an error message, and throw away the input token. + ** + ** * If the input token is $, then fail the parse. + ** + ** As before, subsequent error messages are suppressed until + ** three input tokens have been successfully shifted. + */ + if (yypParser->yyerrcnt <= 0) + { + yy_syntax_error (yypParser, yymajor, yyminorunion); + } + yypParser->yyerrcnt = 3; + yy_destructor (yypParser, (YYCODETYPE) yymajor, &yyminorunion); + if (yyendofinput) + { + yy_parse_failed (yypParser); + } + yymajor = YYNOCODE; +#endif + } + } + while (yymajor != YYNOCODE && yypParser->yyidx >= 0); + return; +} + +/* + VANUATU_LEMON_END - LEMON generated code ends here +*/ + + + + + + + + + + + + + + + + + +/* +** CAVEAT: there is an incompatibility between LEMON and FLEX +** this macro resolves the issue +*/ +#undef yy_accept + + + + + + + + + + + + + + + + +/* + VANUATU_FLEX_START - FLEX generated code starts here +*/ + + +#line 3 "lex.VanuatuWkt.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer VanuatuWkt_create_buffer +#define yy_delete_buffer VanuatuWkt_delete_buffer +#define yy_flex_debug VanuatuWkt_flex_debug +#define yy_init_buffer VanuatuWkt_init_buffer +#define yy_flush_buffer VanuatuWkt_flush_buffer +#define yy_load_buffer_state VanuatuWkt_load_buffer_state +#define yy_switch_to_buffer VanuatuWkt_switch_to_buffer +#define yyin VanuatuWktin +#define yyleng VanuatuWktleng +#define yylex VanuatuWktlex +#define yylineno VanuatuWktlineno +#define yyout VanuatuWktout +#define yyrestart VanuatuWktrestart +#define yytext VanuatuWkttext +#define yywrap VanuatuWktwrap +#define yyalloc VanuatuWktalloc +#define yyrealloc VanuatuWktrealloc +#define yyfree VanuatuWktfree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +/* #include */ +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE VanuatuWktrestart(VanuatuWktin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int VanuatuWktleng; + +extern FILE *VanuatuWktin, *VanuatuWktout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up VanuatuWkttext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up VanuatuWkttext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via VanuatuWktrestart()), so that the user can continue scanning by + * just pointing VanuatuWktin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when VanuatuWkttext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int VanuatuWktleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow VanuatuWktwrap()'s to do buffer switches + * instead of setting up a fresh VanuatuWktin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void VanuatuWktrestart (FILE *input_file ); +void VanuatuWkt_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE VanuatuWkt_create_buffer (FILE *file,int size ); +void VanuatuWkt_delete_buffer (YY_BUFFER_STATE b ); +void VanuatuWkt_flush_buffer (YY_BUFFER_STATE b ); +void VanuatuWktpush_buffer_state (YY_BUFFER_STATE new_buffer ); +void VanuatuWktpop_buffer_state (void ); + +static void VanuatuWktensure_buffer_stack (void ); +static void VanuatuWkt_load_buffer_state (void ); +static void VanuatuWkt_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER VanuatuWkt_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE VanuatuWkt_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE VanuatuWkt_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE VanuatuWkt_scan_bytes (yyconst char *bytes,int len ); + +void *VanuatuWktalloc (yy_size_t ); +void *VanuatuWktrealloc (void *,yy_size_t ); +void VanuatuWktfree (void * ); + +#define yy_new_buffer VanuatuWkt_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + VanuatuWktensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + VanuatuWkt_create_buffer(VanuatuWktin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + VanuatuWktensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + VanuatuWkt_create_buffer(VanuatuWktin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +typedef unsigned char YY_CHAR; + +FILE *VanuatuWktin = (FILE *) 0, *VanuatuWktout = (FILE *) 0; + +typedef int yy_state_type; + +extern int VanuatuWktlineno; + +int VanuatuWktlineno = 1; + +extern char *VanuatuWkttext; +#define yytext_ptr VanuatuWkttext + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up VanuatuWkttext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + VanuatuWktleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 36 +#define YY_END_OF_BUFFER 37 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[114] = + { 0, + 0, 0, 37, 35, 33, 34, 3, 4, 35, 2, + 35, 1, 35, 35, 35, 35, 1, 1, 1, 1, + 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 5, 0, 0, 0, 0, 0, 0, 7, + 6, 0, 0, 0, 0, 0, 8, 13, 0, 0, + 0, 0, 0, 0, 15, 14, 0, 0, 0, 0, + 0, 16, 0, 9, 0, 17, 0, 0, 0, 11, + 10, 0, 0, 19, 18, 0, 0, 12, 0, 20, + 25, 0, 0, 0, 27, 26, 0, 0, 28, 0, + + 21, 0, 0, 23, 22, 0, 24, 29, 0, 31, + 30, 32, 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 1, 1, 1, 1, 1, 1, 1, 5, + 6, 1, 7, 8, 9, 10, 1, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 12, 1, 13, 1, + 14, 1, 15, 1, 1, 16, 17, 18, 19, 20, + 1, 21, 22, 23, 24, 1, 1, 1, 25, 26, + 1, 1, 1, 1, 1, 1, 1, 1, 27, 1, + + 28, 1, 29, 1, 30, 1, 1, 31, 32, 33, + 34, 35, 1, 36, 37, 38, 39, 1, 1, 1, + 40, 41, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[42] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1 + } ; + +static yyconst flex_int16_t yy_base[114] = + { 0, + 0, 0, 246, 270, 270, 270, 270, 270, 230, 270, + 228, 32, 31, 30, 22, 28, 38, 40, 227, 42, + 35, 37, 40, 42, 226, 159, 123, 46, 51, 42, + 48, 42, 84, 75, 55, 52, 60, 53, 63, 61, + 62, 77, 84, 68, 73, 75, 83, 84, 88, 270, + 87, 88, 82, 100, 99, 108, 270, 123, 114, 110, + 118, 115, 110, 119, 270, 120, 123, 130, 125, 130, + 140, 270, 140, 157, 135, 159, 146, 150, 158, 270, + 150, 151, 160, 270, 161, 161, 175, 270, 180, 270, + 192, 185, 184, 187, 270, 188, 183, 193, 270, 193, + + 210, 192, 199, 270, 198, 211, 270, 228, 217, 270, + 218, 270, 270 + } ; + +static yyconst flex_int16_t yy_def[114] = + { 0, + 113, 1, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 0 + } ; + +static yyconst flex_int16_t yy_nxt[312] = + { 0, + 4, 5, 6, 5, 7, 8, 9, 10, 11, 4, + 12, 4, 4, 13, 4, 14, 15, 4, 4, 16, + 4, 4, 4, 4, 4, 4, 4, 4, 13, 4, + 14, 15, 4, 4, 16, 4, 4, 4, 4, 4, + 4, 19, 20, 21, 22, 23, 24, 25, 17, 26, + 18, 19, 20, 28, 29, 30, 31, 32, 21, 22, + 23, 24, 35, 36, 37, 38, 39, 40, 28, 29, + 30, 31, 32, 41, 42, 43, 44, 35, 36, 37, + 38, 39, 40, 45, 46, 34, 52, 49, 41, 42, + 43, 44, 47, 53, 33, 54, 48, 55, 45, 46, + + 50, 52, 56, 57, 50, 58, 59, 47, 53, 51, + 54, 48, 55, 51, 60, 50, 61, 56, 57, 50, + 58, 59, 62, 63, 51, 67, 64, 68, 51, 60, + 69, 61, 70, 27, 71, 65, 72, 62, 63, 65, + 67, 73, 68, 74, 66, 69, 75, 70, 66, 71, + 65, 72, 76, 77, 65, 78, 73, 82, 74, 66, + 79, 75, 83, 66, 86, 87, 88, 76, 77, 34, + 78, 89, 82, 80, 80, 84, 84, 90, 91, 86, + 87, 88, 81, 81, 85, 85, 89, 92, 80, 80, + 84, 84, 90, 91, 93, 94, 97, 81, 81, 85, + + 85, 98, 92, 95, 99, 100, 101, 102, 95, 93, + 106, 97, 96, 103, 107, 104, 98, 96, 95, 99, + 100, 101, 102, 95, 105, 106, 104, 96, 108, 107, + 104, 109, 96, 110, 112, 105, 33, 27, 18, 105, + 17, 104, 111, 108, 110, 113, 113, 113, 110, 112, + 105, 113, 113, 111, 113, 113, 113, 111, 113, 110, + 113, 113, 113, 113, 113, 113, 113, 113, 111, 3, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113 + } ; + +static yyconst flex_int16_t yy_chk[312] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 12, 12, 13, 14, 15, 16, 17, 17, 18, + 18, 20, 20, 21, 22, 23, 24, 24, 13, 14, + 15, 16, 28, 29, 30, 31, 32, 35, 21, 22, + 23, 24, 24, 36, 37, 38, 39, 28, 29, 30, + 31, 32, 35, 40, 41, 34, 44, 43, 36, 37, + 38, 39, 42, 45, 33, 46, 42, 47, 40, 41, + + 43, 44, 48, 51, 49, 52, 53, 42, 45, 43, + 46, 42, 47, 49, 54, 43, 55, 48, 51, 49, + 52, 53, 56, 56, 43, 59, 58, 60, 49, 54, + 61, 55, 62, 27, 63, 64, 66, 56, 56, 58, + 59, 67, 60, 68, 64, 61, 69, 62, 58, 63, + 64, 66, 70, 71, 58, 73, 67, 75, 68, 64, + 74, 69, 76, 58, 77, 78, 81, 70, 71, 26, + 73, 82, 75, 74, 79, 76, 83, 85, 86, 77, + 78, 81, 74, 79, 76, 83, 82, 87, 74, 79, + 76, 83, 85, 86, 89, 91, 92, 74, 79, 76, + + 83, 93, 87, 94, 96, 97, 98, 100, 91, 89, + 102, 92, 94, 101, 105, 103, 93, 91, 94, 96, + 97, 98, 100, 91, 103, 102, 101, 94, 106, 105, + 103, 108, 91, 109, 111, 101, 25, 19, 11, 103, + 9, 101, 109, 106, 108, 3, 0, 0, 109, 111, + 101, 0, 0, 108, 0, 0, 0, 109, 0, 108, + 0, 0, 0, 0, 0, 0, 0, 0, 108, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int VanuatuWkt_flex_debug; +int VanuatuWkt_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *VanuatuWkttext; +/* + vanuatuLexer.l -- Vanuatu WKT parser - FLEX config + + version 2.4, 2010 April 2 + + Author: Sandro Furieri a.furieri@lqt.it + + ------------------------------------------------------------------------------ + + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + + The contents of this file are subject to the Mozilla Public License Version + 1.1 (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +for the specific language governing rights and limitations under the +License. + +The Original Code is the SpatiaLite library + +The Initial Developer of the Original Code is Alessandro Furieri + +Portions created by the Initial Developer are Copyright (C) 2008 +the Initial Developer. All Rights Reserved. + +Contributor(s): +The Vanuatu Team - University of Toronto + +Alternatively, the contents of this file may be used under the terms of +either the GNU General Public License Version 2 or later (the "GPL"), or +the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +in which case the provisions of the GPL or the LGPL are applicable instead +of those above. If you wish to allow use of your version of this file only +under the terms of either the GPL or the LGPL, and not to allow others to +use your version of this file under the terms of the MPL, indicate your +decision by deleting the provisions above and replace them with the notice +and other provisions required by the GPL or the LGPL. If you do not delete +the provisions above, a recipient may use your version of this file under +the terms of any one of the MPL, the GPL or the LGPL. + +*/ +/****************************************************************************** +** The following code was created by Team Vanuatu of The University of Toronto. + +Authors: +Ruppi Rana ruppi.rana@gmail.com +Dev Tanna dev.tanna@gmail.com +Elias Adum elias.adum@gmail.com +Benton Hui benton.hui@gmail.com +Abhayan Sundararajan abhayan@gmail.com +Chee-Lun Michael Stephen Cho cheelun.cho@gmail.com +Nikola Banovic nikola.banovic@gmail.com +Yong Jian yong.jian@utoronto.ca + +Supervisor: +Greg Wilson gvwilson@cs.toronto.ca + +------------------------------------------------------------------------------- +*/ + +/* For debugging purposes */ +int line = 1, col = 1; + +/** +* The main string-token matcher. +* The lower case part is probably not needed. We should really be converting +* The string to all uppercase/lowercase to make it case iNsEnSiTiVe. +* What Flex will do is, For the input string, beginning from the front, Flex +* will try to match with any of the defined tokens from below. Flex will +* then match the string of longest length. Suppose the string is: POINT ZM, +* Flex would match both POINT Z and POINT ZM, but since POINT ZM is the longer +* of the two tokens, FLEX will match POINT ZM. +*/ + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +/* #include */ +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int VanuatuWktlex_destroy (void ); + +int VanuatuWktget_debug (void ); + +void VanuatuWktset_debug (int debug_flag ); + +YY_EXTRA_TYPE VanuatuWktget_extra (void ); + +void VanuatuWktset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *VanuatuWktget_in (void ); + +void VanuatuWktset_in (FILE * in_str ); + +FILE *VanuatuWktget_out (void ); + +void VanuatuWktset_out (FILE * out_str ); + +int VanuatuWktget_leng (void ); + +char *VanuatuWktget_text (void ); + +int VanuatuWktget_lineno (void ); + +void VanuatuWktset_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int VanuatuWktwrap (void ); +#else +extern int VanuatuWktwrap (void ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( VanuatuWkttext, VanuatuWktleng, 1, VanuatuWktout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( VanuatuWktin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( VanuatuWktin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, VanuatuWktin))==0 && ferror(VanuatuWktin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(VanuatuWktin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int VanuatuWktlex (void); + +#define YY_DECL int VanuatuWktlex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after VanuatuWkttext and VanuatuWktleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! VanuatuWktin ) + VanuatuWktin = stdin; + + if ( ! VanuatuWktout ) + VanuatuWktout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + VanuatuWktensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + VanuatuWkt_create_buffer(VanuatuWktin,YY_BUF_SIZE ); + } + + VanuatuWkt_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of VanuatuWkttext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 114 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 270 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +YY_RULE_SETUP +{ col += (int) strlen(VanuatuWkttext); VanuatuWktlval.dval = atof(VanuatuWkttext); return VANUATU_NUM; } + YY_BREAK +case 2: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_COMMA; } + YY_BREAK +case 3: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_OPEN_BRACKET; } + YY_BREAK +case 4: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_CLOSE_BRACKET; } + YY_BREAK +case 5: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_POINT; } + YY_BREAK +case 6: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_POINT_Z; } + YY_BREAK +case 7: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_POINT_M; } + YY_BREAK +case 8: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_POINT_ZM; } + YY_BREAK +case 9: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_LINESTRING; } + YY_BREAK +case 10: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_LINESTRING_Z; } + YY_BREAK +case 11: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_LINESTRING_M; } + YY_BREAK +case 12: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_LINESTRING_ZM; } + YY_BREAK +case 13: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_POLYGON; } + YY_BREAK +case 14: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_POLYGON_Z; } + YY_BREAK +case 15: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_POLYGON_M; } + YY_BREAK +case 16: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_POLYGON_ZM; } + YY_BREAK +case 17: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTIPOINT; } + YY_BREAK +case 18: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTIPOINT_Z; } + YY_BREAK +case 19: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTIPOINT_M; } + YY_BREAK +case 20: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTIPOINT_ZM; } + YY_BREAK +case 21: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTILINESTRING; } + YY_BREAK +case 22: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTILINESTRING_Z; } + YY_BREAK +case 23: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTILINESTRING_M; } + YY_BREAK +case 24: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTILINESTRING_ZM; } + YY_BREAK +case 25: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTIPOLYGON; } + YY_BREAK +case 26: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTIPOLYGON_Z; } + YY_BREAK +case 27: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTIPOLYGON_M; } + YY_BREAK +case 28: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_MULTIPOLYGON_ZM; } + YY_BREAK +case 29: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_GEOMETRYCOLLECTION; } + YY_BREAK +case 30: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_GEOMETRYCOLLECTION_Z; } + YY_BREAK +case 31: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_GEOMETRYCOLLECTION_M; } + YY_BREAK +case 32: +YY_RULE_SETUP +{ VanuatuWktlval.dval = 0; return VANUATU_GEOMETRYCOLLECTION_ZM; } + YY_BREAK +case 33: +YY_RULE_SETUP +{ col += (int) strlen(VanuatuWkttext); } /* ignore but count white space */ + YY_BREAK +case 34: +/* rule 34 can match eol */ +YY_RULE_SETUP +{ col = 0; ++line; return VANUATU_NEWLINE; } + YY_BREAK +case 35: +YY_RULE_SETUP +{ col += (int) strlen(VanuatuWkttext); return -1; } + YY_BREAK +case 36: +YY_RULE_SETUP +ECHO; + YY_BREAK +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed VanuatuWktin at a new source and called + * VanuatuWktlex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = VanuatuWktin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( VanuatuWktwrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * VanuatuWkttext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of VanuatuWktlex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + VanuatuWktrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + VanuatuWktrestart(VanuatuWktin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) VanuatuWktrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 114 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 114 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 113); + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up VanuatuWkttext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + VanuatuWktrestart(VanuatuWktin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( VanuatuWktwrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve VanuatuWkttext */ + (yy_hold_char) = *++(yy_c_buf_p); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void VanuatuWktrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + VanuatuWktensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + VanuatuWkt_create_buffer(VanuatuWktin,YY_BUF_SIZE ); + } + + VanuatuWkt_init_buffer(YY_CURRENT_BUFFER,input_file ); + VanuatuWkt_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void VanuatuWkt_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * VanuatuWktpop_buffer_state(); + * VanuatuWktpush_buffer_state(new_buffer); + */ + VanuatuWktensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + VanuatuWkt_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (VanuatuWktwrap()) processing, but the only time this flag + * is looked at is after VanuatuWktwrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void VanuatuWkt_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + VanuatuWktin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE VanuatuWkt_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) VanuatuWktalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in VanuatuWkt_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) VanuatuWktalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in VanuatuWkt_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + VanuatuWkt_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with VanuatuWkt_create_buffer() + * + */ + void VanuatuWkt_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + VanuatuWktfree((void *) b->yy_ch_buf ); + + VanuatuWktfree((void *) b ); +} + +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a VanuatuWktrestart() or at EOF. + */ + static void VanuatuWkt_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + VanuatuWkt_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then VanuatuWkt_init_buffer was _probably_ + * called from VanuatuWktrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void VanuatuWkt_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + VanuatuWkt_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void VanuatuWktpush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + VanuatuWktensure_buffer_stack(); + + /* This block is copied from VanuatuWkt_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from VanuatuWkt_switch_to_buffer. */ + VanuatuWkt_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void VanuatuWktpop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + VanuatuWkt_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + VanuatuWkt_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void VanuatuWktensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)VanuatuWktalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in VanuatuWktensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)VanuatuWktrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in VanuatuWktensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE VanuatuWkt_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) VanuatuWktalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in VanuatuWkt_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + VanuatuWkt_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to VanuatuWktlex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * VanuatuWkt_scan_bytes() instead. + */ +YY_BUFFER_STATE VanuatuWkt_scan_string (yyconst char * yystr ) +{ + + return VanuatuWkt_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to VanuatuWktlex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE VanuatuWkt_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) VanuatuWktalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in VanuatuWkt_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = VanuatuWkt_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in VanuatuWkt_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up VanuatuWkttext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + VanuatuWkttext[VanuatuWktleng] = (yy_hold_char); \ + (yy_c_buf_p) = VanuatuWkttext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + VanuatuWktleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int VanuatuWktget_lineno (void) +{ + + return VanuatuWktlineno; +} + +/** Get the input stream. + * + */ +FILE *VanuatuWktget_in (void) +{ + return VanuatuWktin; +} + +/** Get the output stream. + * + */ +FILE *VanuatuWktget_out (void) +{ + return VanuatuWktout; +} + +/** Get the length of the current token. + * + */ +int VanuatuWktget_leng (void) +{ + return VanuatuWktleng; +} + +/** Get the current token. + * + */ + +char *VanuatuWktget_text (void) +{ + return VanuatuWkttext; +} + +/** Set the current line number. + * @param line_number + * + */ +void VanuatuWktset_lineno (int line_number ) +{ + + VanuatuWktlineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see VanuatuWkt_switch_to_buffer + */ +void VanuatuWktset_in (FILE * in_str ) +{ + VanuatuWktin = in_str ; +} + +void VanuatuWktset_out (FILE * out_str ) +{ + VanuatuWktout = out_str ; +} + +int VanuatuWktget_debug (void) +{ + return VanuatuWkt_flex_debug; +} + +void VanuatuWktset_debug (int bdebug ) +{ + VanuatuWkt_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from VanuatuWktlex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + VanuatuWktin = stdin; + VanuatuWktout = stdout; +#else + VanuatuWktin = (FILE *) 0; + VanuatuWktout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * VanuatuWktlex_init() + */ + return 0; +} + +/* VanuatuWktlex_destroy is for both reentrant and non-reentrant scanners. */ +int VanuatuWktlex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + VanuatuWkt_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + VanuatuWktpop_buffer_state(); + } + + /* Destroy the stack itself. */ + VanuatuWktfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * VanuatuWktlex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *VanuatuWktalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *VanuatuWktrealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void VanuatuWktfree (void * ptr ) +{ + free( (char *) ptr ); /* see VanuatuWktrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +/** + * reset the line and column count + * + * + */ +void reset_lexer(void) +{ + + line = 1; + col = 1; + +} + +/** + * VanuatuWkterror() is invoked when the lexer or the parser encounter + * an error. The error message is passed via *s + * + * + */ +void VanuatuWkterror(char *s) +{ + printf("error: %s at line: %d col: %d\n",s,line,col); + +} + +int VanuatuWktwrap(void) +{ + return 1; +} + +/****************************************************************************** +** This is the end of the code that was created by Team Vanuatu +** of The University of Toronto. + +Authors: +Ruppi Rana ruppi.rana@gmail.com +Dev Tanna dev.tanna@gmail.com +Elias Adum elias.adum@gmail.com +Benton Hui benton.hui@gmail.com +Abhayan Sundararajan abhayan@gmail.com +Chee-Lun Michael Stephen Cho cheelun.cho@gmail.com +Nikola Banovic nikola.banovic@gmail.com +Yong Jian yong.jian@utoronto.ca + +Supervisor: +Greg Wilson gvwilson@cs.toronto.ca + +------------------------------------------------------------------------------- +*/ + + +/* + VANUATU_FLEX_END - FLEX generated code ends here +*/ + + + + + + + + + +/* +** This is a linked-list struct to store all the values for each token. +** All tokens will have a value of 0, except tokens denoted as NUM. +** NUM tokens are geometry coordinates and will contain the floating +** point number. +*/ +typedef struct gaiaFlexTokenStruct +{ + double value; + struct gaiaFlexTokenStruct *Next; +} gaiaFlexToken; + +/* +** Function to clean up the linked-list of token values. +*/ +static int +vanuatu_cleanup (gaiaFlexToken * token) +{ + gaiaFlexToken *ptok; + gaiaFlexToken *ptok_n; + if (token == NULL) + return 0; + ptok = token; + while (ptok) + { + ptok_n = ptok->Next; + free (ptok); + ptok = ptok_n; + } + return 0; +} + +/* +** Deallocate and destroy a parser. Destructors are all called for +** all stack elements before shutting the parser down. +** +** Inputs: +**
      +**
    • A pointer to the parser. This should be a pointer +** obtained from ParseAlloc. +**
    • A pointer to a function used to reclaim memory obtained +** from malloc. +**
    +*/ +void +ParseFree (void *p, /* The parser to be deleted */ + void (*freeProc) (void *) /* Function used to reclaim memory */ + ) +{ + yyParser *pParser = (yyParser *) p; + if (pParser == 0) + return; + while (pParser->yyidx >= 0) + yy_pop_parser_stack (pParser); +#if YYSTACKDEPTH<=0 + free (pParser->yystack); +#endif + VanuatuWktlex_destroy (); + (*freeProc) ((void *) pParser); +} + +gaiaGeomCollPtr +gaiaParseWkt (const unsigned char *dirty_buffer, short type) +{ + void *pParser = ParseAlloc (malloc); + /* Linked-list of token values */ + gaiaFlexToken *tokens = malloc (sizeof (gaiaFlexToken)); + /* Pointer to the head of the list */ + gaiaFlexToken *head = tokens; + int yv; + gaiaGeomCollPtr result = NULL; + + /* + ** Sandro Furieri 2010 Apr 4 + ** unsetting the parser error flag + */ + vanuatu_parse_error = 0; + + VanuatuWkt_scan_string ((char *) dirty_buffer); + + /* + / Keep tokenizing until we reach the end + / yylex() will return the next matching Token for us. + */ + while ((yv = yylex ()) != 0) + { + if (yv == -1) + { + return NULL; + } + tokens->Next = malloc (sizeof (gaiaFlexToken)); + /* + /VanuatuWktlval is a global variable from FLEX. + /VanuatuWktlval is defined in vanuatuLexglobal.h + */ + tokens->Next->value = VanuatuWktlval.dval; + /* Pass the token to the wkt parser created from lemon */ + Parse (pParser, yv, &(tokens->Next->value), &result); + tokens = tokens->Next; + } + /* This denotes the end of a line as well as the end of the parser */ + Parse (pParser, VANUATU_NEWLINE, 0, &result); + ParseFree (pParser, free); + + /* Assigning the token as the end to avoid seg faults while cleaning */ + tokens->Next = NULL; + vanuatu_cleanup (head); + + /* + ** Sandro Furieri 2010 Apr 4 + ** checking if any parsing error was encountered + */ + if (vanuatu_parse_error) + { + if (result) + gaiaFreeGeomColl (result); + return NULL; + } + + /* + ** Sandro Furieri 2010 Apr 4 + ** final checkup for validity + */ + if (!result) + return NULL; + if (!checkValidity (result)) + { + gaiaFreeGeomColl (result); + return NULL; + } + if (type < 0) + ; /* no restrinction about GEOMETRY CLASS TYPE */ + else + { + if (result->DeclaredType != type) + { + /* invalid CLASS TYPE for request */ + gaiaFreeGeomColl (result); + return NULL; + } + } + + gaiaMbrGeometry (result); + + return result; +} + +/****************************************************************************** +** This is the end of the code that was created by Team Vanuatu +** of The University of Toronto. + +Authors: +Ruppi Rana ruppi.rana@gmail.com +Dev Tanna dev.tanna@gmail.com +Elias Adum elias.adum@gmail.com +Benton Hui benton.hui@gmail.com +Abhayan Sundararajan abhayan@gmail.com +Chee-Lun Michael Stephen Cho cheelun.cho@gmail.com +Nikola Banovic nikola.banovic@gmail.com +Yong Jian yong.jian@utoronto.ca + +Supervisor: +Greg Wilson gvwilson@cs.toronto.ca + +------------------------------------------------------------------------------- +*/ +/**************** End file: gg_wkt.c **********/ + + +/**************** Begin file: srs_init.c **********/ + +/* #include */ +/* #include */ +/* #include */ + +#ifdef SPL_AMALGAMATION /* spatialite-amalgamation */ +/* #include */ +#else +/* #include */ +#endif + +#ifdef _WIN32 +#define strcasecmp _stricmp +#endif /* not WIN32 */ + +/* #include */ + +struct epsg_defs +{ + int srid; + char *auth_name; + int auth_srid; + char *ref_sys_name; + char *proj4text; + char *srs_wkt; + struct epsg_defs *next; +}; + +static void +free_epsg_def (struct epsg_defs *ptr) +{ +/* memory cleanup - destroying an EPSG def item */ + if (ptr->auth_name) + free (ptr->auth_name); + if (ptr->ref_sys_name) + free (ptr->ref_sys_name); + if (ptr->proj4text) + free (ptr->proj4text); + if (ptr->srs_wkt) + free (ptr->srs_wkt); + free (ptr); +} + +static struct epsg_defs * +add_epsg_def (struct epsg_defs **first, struct epsg_defs **last, int srid, + const char *auth_name, int auth_srid, const char *ref_sys_name) +{ +/* appending an EPSG def to the list */ + int len; + struct epsg_defs *p = malloc (sizeof (struct epsg_defs)); + if (!p) + return NULL; + p->srid = srid; + p->auth_name = NULL; + p->auth_srid = auth_srid; + p->ref_sys_name = NULL; + p->proj4text = NULL; + p->srs_wkt = NULL; + p->next = NULL; + if (auth_name) + { + len = strlen (auth_name); + if (len > 0) + { + p->auth_name = malloc (len + 1); + if (p->auth_name == NULL) + goto error; + strcpy (p->auth_name, auth_name); + } + } + if (ref_sys_name) + { + len = strlen (ref_sys_name); + if (len > 0) + { + p->ref_sys_name = malloc (len + 1); + if (p->ref_sys_name == NULL) + goto error; + strcpy (p->ref_sys_name, ref_sys_name); + } + } + if (*first == NULL) + *first = p; + if (*last != NULL) + (*last)->next = p; + *last = p; + return p; + error: + free_epsg_def (p); + return NULL; +} + +static void +add_proj4text (struct epsg_defs *p, int count, const char *text) +{ +/* creating the PROJ4TEXT string */ + int len; + int olen; + char *string; + if (text == NULL) + return; + len = strlen (text); + if (!count) + { + p->proj4text = malloc (len + 1); + if (p->proj4text == NULL) + return; + strcpy (p->proj4text, text); + return; + } + if (p->proj4text == NULL) + return; + olen = strlen (p->proj4text); + string = malloc (len + olen + 1); + if (string == NULL) + return; + strcpy (string, p->proj4text); + free (p->proj4text); + p->proj4text = string; + strcat (p->proj4text, text); +} + +static void +add_srs_wkt (struct epsg_defs *p, int count, const char *text) +{ +/* creating the SRS_WKT string */ + int len; + int olen; + char *string; + if (text == NULL) + return; + len = strlen (text); + if (!count) + { + p->srs_wkt = malloc (len + 1); + if (p->srs_wkt == NULL) + return; + strcpy (p->srs_wkt, text); + return; + } + if (p->srs_wkt == NULL) + return; + olen = strlen (p->srs_wkt); + string = malloc (len + olen + 1); + if (string == NULL) + return; + strcpy (string, p->srs_wkt); + free (p->srs_wkt); + p->srs_wkt = string; + strcat (p->srs_wkt, text); +} + +static void +initialize_epsg_00 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 2000, "epsg", 2000, + "Anguilla 1957 / British West Indies Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x"); + add_proj4text (p, 1, "_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Anguilla 1957 / British West Indies Grid\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Anguilla 1957\",DATUM[\"Anguilla_1957\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7012\"]],AUTHORITY[\"EPSG\",\"6600\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4600\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-62],PARAMETER[\"scale_factor\",0.9995],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",400000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"2000\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2001, "epsg", 2001, + "Antigua 1943 / British West Indies Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x"); + add_proj4text (p, 1, "_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Antigua 1943 / British West Indies Grid\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Antigua 1943\",DATUM[\"Antigua_1943\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7012\"]],AUTHORITY[\"EPSG\",\"6601\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4601\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",-62],PARAMETER[\"scale_factor\",0.9995],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",400000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"2001\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2002, "epsg", 2002, + "Dominica 1945 / British West Indies Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x"); + add_proj4text (p, 1, + "_0=400000 +y_0=0 +ellps=clrk80 +towgs84=725,685,536,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Dominica 1945 / British West Indies Grid\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Dominica 1945\",DATUM[\"Dominica_1945\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7012\"]],TOWGS84[725,685,536,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"6602\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4602\"]],UN"); + add_srs_wkt (p, 7, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",0],PARAMETER[\"central_meridian\",-62],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",0.9995],PARAMETER[\"false_easting\",400000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2002"); + add_srs_wkt (p, 12, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2003, "epsg", 2003, + "Grenada 1953 / British West Indies Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x"); + add_proj4text (p, 1, + "_0=400000 +y_0=0 +ellps=clrk80 +towgs84=72,213.7,93,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Grenada 1953 / British West Indies Grid\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Grenada 1953\",DATUM[\"Grenada_1953\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7012\"]],TOWGS84[72,213.7,93,0,0,0,0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6603\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4603\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-62],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9995],PARAMETER[\"false_easting\",400000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2003\""); + add_srs_wkt (p, 12, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2004, "epsg", 2004, + "Montserrat 1958 / British West Indies Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x"); + add_proj4text (p, 1, + "_0=400000 +y_0=0 +ellps=clrk80 +towgs84=174,359,365,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Montserrat 1958 / British West Indies Grid\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"Montserrat 1958\",DATUM[\"Montserrat_1958\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7012\"]],TOWGS84[174,359,365,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"6604\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 5, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4604\""); + add_srs_wkt (p, 7, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",0],PARAMETER[\"central_meridian\",-62],PARAMETER["); + add_srs_wkt (p, 10, + "\"scale_factor\",0.9995],PARAMETER[\"false_easting\",400"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, + "\"2004\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 2005, "epsg", 2005, + "St. Kitts 1955 / British West Indies Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x"); + add_proj4text (p, 1, "_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"St. Kitts 1955 / British West Indies Grid\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"St. Kitts 1955\",DATUM[\"St_Kitts_1955\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6605\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4605\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-62],PARAMETER[\"scale_factor\",0.9995],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",400000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2005\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2006, "epsg", 2006, + "St. Lucia 1955 / British West Indies Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x"); + add_proj4text (p, 1, + "_0=400000 +y_0=0 +ellps=clrk80 +towgs84=-149,128,296,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"St. Lucia 1955 / British West Indies Grid\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"St. Lucia 1955\",DATUM[\"St_Lucia_1955\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7012\"]],TOWGS84[-149,128,296,0,0,0,0],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6606\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4606\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",-62],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.9995],PARAMETER[\"false_easting\",40000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "2006\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 2007, "epsg", 2007, + "St. Vincent 45 / British West Indies Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x"); + add_proj4text (p, 1, + "_0=400000 +y_0=0 +ellps=clrk80 +towgs84=195.671,332.517,"); + add_proj4text (p, 2, "274.607,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"St. Vincent 45 / British West Indies Grid\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"St. Vincent 1945\",DATUM[\"St_Vincent_1945\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7012\"]],TOWGS84[195.671,332.517,274.607,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6607\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4607\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-6"); + add_srs_wkt (p, 10, + "2],PARAMETER[\"scale_factor\",0.9995],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",400000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 12, + "ITY[\"EPSG\",\"2007\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 2008, "epsg", 2008, + "NAD27(CGQ77) / SCoPQ zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / SCoPQ zone 2\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-55.5],PARAMETER[\"scale_factor\",0.9999],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",304800],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2008\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2009, "epsg", 2009, + "NAD27(CGQ77) / SCoPQ zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / SCoPQ zone 3\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-58.5],PARAMETER[\"scale_factor\",0.9999],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",304800],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2009\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2010, "epsg", 2010, + "NAD27(CGQ77) / SCoPQ zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / SCoPQ zone 4\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-61.5],PARAMETER[\"scale_factor\",0.9999],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",304800],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2010\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2011, "epsg", 2011, + "NAD27(CGQ77) / SCoPQ zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / SCoPQ zone 5\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-64.5],PARAMETER[\"scale_factor\",0.9999],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",304800],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2011\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2012, "epsg", 2012, + "NAD27(CGQ77) / SCoPQ zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / SCoPQ zone 6\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-67.5],PARAMETER[\"scale_factor\",0.9999],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",304800],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2012\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2013, "epsg", 2013, + "NAD27(CGQ77) / SCoPQ zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / SCoPQ zone 7\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-70.5],PARAMETER[\"scale_factor\",0.9999],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",304800],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2013\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2014, "epsg", 2014, + "NAD27(CGQ77) / SCoPQ zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / SCoPQ zone 8\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-73.5],PARAMETER[\"scale_factor\",0.9999],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",304800],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2014\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2015, "epsg", 2015, + "NAD27(CGQ77) / SCoPQ zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / SCoPQ zone 9\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-76.5],PARAMETER[\"scale_factor\",0.9999],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",304800],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2015\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2016, "epsg", 2016, + "NAD27(CGQ77) / SCoPQ zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / SCoPQ zone 10\",GEOGCS[\"NAD27(C"); + add_srs_wkt (p, 1, + "GQ77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-79.5],PARAMETER[\"scale_factor\",0.9999],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",304800],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2016\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2017, "epsg", 2017, + "NAD27(76) / MTM zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / MTM zone 8\",GEOGCS[\"NAD27(76)\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Clark"); + add_srs_wkt (p, 2, + "e 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",-73.5],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",304800],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2017\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 2018, "epsg", 2018, + "NAD27(76) / MTM zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / MTM zone 9\",GEOGCS[\"NAD27(76)\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Clark"); + add_srs_wkt (p, 2, + "e 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",-76.5],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",304800],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2018\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 2019, "epsg", 2019, + "NAD27(76) / MTM zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / MTM zone 10\",GEOGCS[\"NAD27(76)\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Clar"); + add_srs_wkt (p, 2, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-79.5],PARAMETER[\"scale_factor\",0.9999],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",304800],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"2019\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2020, "epsg", 2020, + "NAD27(76) / MTM zone 11"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-82.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / MTM zone 11\",GEOGCS[\"NAD27(76)\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Clar"); + add_srs_wkt (p, 2, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-82.5],PARAMETER[\"scale_factor\",0.9999],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",304800],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"2020\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2021, "epsg", 2021, + "NAD27(76) / MTM zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / MTM zone 12\",GEOGCS[\"NAD27(76)\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Clar"); + add_srs_wkt (p, 2, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-81],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",304800],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2021\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2022, "epsg", 2022, + "NAD27(76) / MTM zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / MTM zone 13\",GEOGCS[\"NAD27(76)\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Clar"); + add_srs_wkt (p, 2, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-84],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",304800],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2022\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2023, "epsg", 2023, + "NAD27(76) / MTM zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / MTM zone 14\",GEOGCS[\"NAD27(76)\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Clar"); + add_srs_wkt (p, 2, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-87],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",304800],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2023\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2024, "epsg", 2024, + "NAD27(76) / MTM zone 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / MTM zone 15\",GEOGCS[\"NAD27(76)\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Clar"); + add_srs_wkt (p, 2, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-90],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",304800],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2024\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2025, "epsg", 2025, + "NAD27(76) / MTM zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / MTM zone 16\",GEOGCS[\"NAD27(76)\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Clar"); + add_srs_wkt (p, 2, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-93],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",304800],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2025\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2026, "epsg", 2026, + "NAD27(76) / MTM zone 17"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-96 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / MTM zone 17\",GEOGCS[\"NAD27(76)\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Clar"); + add_srs_wkt (p, 2, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-96],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",304800],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2026\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2027, "epsg", 2027, + "NAD27(76) / UTM zone 15N"); + add_proj4text (p, 0, "+proj=utm +zone=15 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / UTM zone 15N\",GEOGCS[\"NAD27(76)\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-93],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2027\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2028, "epsg", 2028, + "NAD27(76) / UTM zone 16N"); + add_proj4text (p, 0, "+proj=utm +zone=16 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / UTM zone 16N\",GEOGCS[\"NAD27(76)\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-87],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2028\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2029, "epsg", 2029, + "NAD27(76) / UTM zone 17N"); + add_proj4text (p, 0, "+proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / UTM zone 17N\",GEOGCS[\"NAD27(76)\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-81],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2029\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2030, "epsg", 2030, + "NAD27(76) / UTM zone 18N"); + add_proj4text (p, 0, "+proj=utm +zone=18 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(76) / UTM zone 18N\",GEOGCS[\"NAD27(76)\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927_1976\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6608\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4608\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-75],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2030\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2031, "epsg", 2031, + "NAD27(CGQ77) / UTM zone 17N"); + add_proj4text (p, 0, "+proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / UTM zone 17N\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-81],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"2031\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2032, "epsg", 2032, + "NAD27(CGQ77) / UTM zone 18N"); + add_proj4text (p, 0, "+proj=utm +zone=18 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / UTM zone 18N\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-75],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"2032\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2033, "epsg", 2033, + "NAD27(CGQ77) / UTM zone 19N"); + add_proj4text (p, 0, "+proj=utm +zone=19 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / UTM zone 19N\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-69],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"2033\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2034, "epsg", 2034, + "NAD27(CGQ77) / UTM zone 20N"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / UTM zone 20N\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-63],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"2034\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2035, "epsg", 2035, + "NAD27(CGQ77) / UTM zone 21N"); + add_proj4text (p, 0, "+proj=utm +zone=21 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / UTM zone 21N\",GEOGCS[\"NAD27(CG"); + add_srs_wkt (p, 1, + "Q77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-57],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"2035\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2036, "epsg", 2036, + "NAD83(CSRS98) / New Brunswick Stereo (deprecated)"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2"); + add_proj4text (p, 1, + "500000 +y_0=7500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / New Brunswick Stereo (deprecate"); + add_srs_wkt (p, 1, + "d)\",GEOGCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spa"); + add_srs_wkt (p, 2, + "tial_Reference_System\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 3, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 5, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "74532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9001\"]],PROJECTION[\"Oblique_Stereographic\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"latitude_of_origin\",46.5],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",-66.5],PARAMETER[\"scale_factor\",0.999912],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",2500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 12, + "\",7500000],AUTHORITY[\"EPSG\",\"2036\"],AXIS[\"Northing"); + add_srs_wkt (p, 13, "\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 2037, "epsg", 2037, + "NAD83(CSRS98) / UTM zone 19N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / UTM zone 19N (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-69],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2037\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 2038, "epsg", 2038, + "NAD83(CSRS98) / UTM zone 20N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / UTM zone 20N (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-63],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2038\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 2039, "epsg", 2039, + "Israel / Israeli TM Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31.73439361111111 +lon_0=35.204516944"); + add_proj4text (p, 1, + "44445 +k=1.0000067 +x_0=219529.584 +y_0=626907.39 +ellps"); + add_proj4text (p, 2, "=GRS80 +towgs84=-48,55,52,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Israel / Israeli TM Grid\",GEOGCS[\"Israel\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Israel\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 2, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[-48,55,52,0,0,0"); + add_srs_wkt (p, 3, + ",0],AUTHORITY[\"EPSG\",\"6141\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 5, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"4141\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 7, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 8, + "titude_of_origin\",31.73439361111111],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",35.20451694444445],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",1.0000067],PARAMETER[\"false_easting\",219529.584],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",626907.39],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"2039\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORT"); + add_srs_wkt (p, 13, "H]]"); + p = add_epsg_def (first, last, 2040, "epsg", 2040, + "Locodjo 1965 / UTM zone 30N"); + add_proj4text (p, 0, + "+proj=utm +zone=30 +ellps=clrk80 +towgs84=-125,53,467,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Locodjo 1965 / UTM zone 30N\",GEOGCS[\"Locodjo "); + add_srs_wkt (p, 1, + "1965\",DATUM[\"Locodjo_1965\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-125,53,467,0,0,0,0],AUTHORITY[\"EPSG\",\"6142\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4142\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-3],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"2040\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2041, "epsg", 2041, + "Abidjan 1987 / UTM zone 30N"); + add_proj4text (p, 0, + "+proj=utm +zone=30 +ellps=clrk80 +towgs84=-124.76,53,466"); + add_proj4text (p, 1, ".79,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Abidjan 1987 / UTM zone 30N\",GEOGCS[\"Abidjan "); + add_srs_wkt (p, 1, + "1987\",DATUM[\"Abidjan_1987\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-124.76,53,466.79,0,0,0,0],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 4, + "143\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 5, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4143\"]],UNIT[\"metr"); + add_srs_wkt (p, 7, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 8, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 9, + "METER[\"central_meridian\",-3],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2041\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2042, "epsg", 2042, + "Locodjo 1965 / UTM zone 29N"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +ellps=clrk80 +towgs84=-125,53,467,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Locodjo 1965 / UTM zone 29N\",GEOGCS[\"Locodjo "); + add_srs_wkt (p, 1, + "1965\",DATUM[\"Locodjo_1965\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-125,53,467,0,0,0,0],AUTHORITY[\"EPSG\",\"6142\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4142\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"2042\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2043, "epsg", 2043, + "Abidjan 1987 / UTM zone 29N"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +ellps=clrk80 +towgs84=-124.76,53,466"); + add_proj4text (p, 1, ".79,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Abidjan 1987 / UTM zone 29N\",GEOGCS[\"Abidjan "); + add_srs_wkt (p, 1, + "1987\",DATUM[\"Abidjan_1987\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-124.76,53,466.79,0,0,0,0],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 4, + "143\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 5, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4143\"]],UNIT[\"metr"); + add_srs_wkt (p, 7, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 8, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 9, + "METER[\"central_meridian\",-9],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2043\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2044, "epsg", 2044, + "Hanoi 1972 / Gauss-Kruger zone 18"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hanoi 1972 / Gauss-Kruger zone 18\",GEOGCS[\"Ha"); + add_srs_wkt (p, 1, + "noi 1972\",DATUM[\"Hanoi_1972\",SPHEROID[\"Krassowsky 19"); + add_srs_wkt (p, 2, + "40\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[-17.51,-108.32,-62.39,0,0,0,0],AUTHORITY[\"EPSG\",\"614"); + add_srs_wkt (p, 4, + "7\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4147\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",105],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "1],PARAMETER[\"false_easting\",18500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"2044\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2045, "epsg", 2045, + "Hanoi 1972 / Gauss-Kruger zone 19"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hanoi 1972 / Gauss-Kruger zone 19\",GEOGCS[\"Ha"); + add_srs_wkt (p, 1, + "noi 1972\",DATUM[\"Hanoi_1972\",SPHEROID[\"Krassowsky 19"); + add_srs_wkt (p, 2, + "40\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[-17.51,-108.32,-62.39,0,0,0,0],AUTHORITY[\"EPSG\",\"614"); + add_srs_wkt (p, 4, + "7\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4147\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",111],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "1],PARAMETER[\"false_easting\",19500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"2045\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2056, "epsg", 2056, "CH1903+ / LV95"); + add_proj4text (p, 0, + "+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333"); + add_proj4text (p, 1, + "333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +t"); + add_proj4text (p, 2, + "owgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1"); + add_srs_wkt (p, 1, + "903\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405."); + add_srs_wkt (p, 3, + "346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4150\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"latitude_of_center\",46.95240555555556],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"longitude_of_center\",7.439583333333333],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting"); + add_srs_wkt (p, 12, + "\",2600000],PARAMETER[\"false_northing\",1200000],AUTHOR"); + add_srs_wkt (p, 13, + "ITY[\"EPSG\",\"2056\"],AXIS[\"Y\",EAST],AXIS[\"X\",NORTH"); + add_srs_wkt (p, 14, "]]"); + p = add_epsg_def (first, last, 2057, "epsg", 2057, + "Rassadiran / Nakhl e Taqi"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=27.51882880555555 +lonc=52.6035391666"); + add_proj4text (p, 1, + "6667 +alpha=0.5716611944444444 +k=0.999895934 +x_0=65837"); + add_proj4text (p, 2, + "7.437 +y_0=3044969.194 +ellps=intl +towgs84=-133.63,-157"); + add_proj4text (p, 3, ".5,-158.62,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Rassadiran / Nakhl e Taqi\",GEOGCS[\"Rassadiran"); + add_srs_wkt (p, 1, + "\",DATUM[\"Rassadiran\",SPHEROID[\"International 1924\","); + add_srs_wkt (p, 2, + "6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-133.6"); + add_srs_wkt (p, 3, + "3,-157.5,-158.62,0,0,0,0],AUTHORITY[\"EPSG\",\"6153\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4153\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Hotine_Oblique_"); + add_srs_wkt (p, 8, + "Mercator\"],PARAMETER[\"latitude_of_center\",27.51882880"); + add_srs_wkt (p, 9, + "555555],PARAMETER[\"longitude_of_center\",52.60353916666"); + add_srs_wkt (p, 10, + "667],PARAMETER[\"azimuth\",0.5716611944444444],PARAMETER"); + add_srs_wkt (p, 11, + "[\"rectified_grid_angle\",0.5716611944444444],PARAMETER["); + add_srs_wkt (p, 12, + "\"scale_factor\",0.999895934],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 13, + ",658377.437],PARAMETER[\"false_northing\",3044969.194],A"); + add_srs_wkt (p, 14, + "UTHORITY[\"EPSG\",\"2057\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 15, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2058, "epsg", 2058, + "ED50(ED77) / UTM zone 38N"); + add_proj4text (p, 0, "+proj=utm +zone=38 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50(ED77) / UTM zone 38N\",GEOGCS[\"ED50(ED77)"); + add_srs_wkt (p, 1, + "\",DATUM[\"European_Datum_1950_1977\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6154\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4154\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",0],PARAMETER[\"central_meridian\",45],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"2058\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 2059, "epsg", 2059, + "ED50(ED77) / UTM zone 39N"); + add_proj4text (p, 0, "+proj=utm +zone=39 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50(ED77) / UTM zone 39N\",GEOGCS[\"ED50(ED77)"); + add_srs_wkt (p, 1, + "\",DATUM[\"European_Datum_1950_1977\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6154\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4154\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",0],PARAMETER[\"central_meridian\",51],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"2059\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 2060, "epsg", 2060, + "ED50(ED77) / UTM zone 40N"); + add_proj4text (p, 0, "+proj=utm +zone=40 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50(ED77) / UTM zone 40N\",GEOGCS[\"ED50(ED77)"); + add_srs_wkt (p, 1, + "\",DATUM[\"European_Datum_1950_1977\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6154\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4154\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",0],PARAMETER[\"central_meridian\",57],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"2060\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 2061, "epsg", 2061, + "ED50(ED77) / UTM zone 41N"); + add_proj4text (p, 0, "+proj=utm +zone=41 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50(ED77) / UTM zone 41N\",GEOGCS[\"ED50(ED77)"); + add_srs_wkt (p, 1, + "\",DATUM[\"European_Datum_1950_1977\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6154\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4154\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",0],PARAMETER[\"central_meridian\",63],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"2061\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 2062, "epsg", 2062, + "Madrid 1870 (Madrid) / Spain"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40 +lat_0=40 +lon_0=0 +k_0=0.9988085293"); + add_proj4text (p, 1, + " +x_0=600000 +y_0=600000 +a=6378298.3 +b=6356657.1426695"); + add_proj4text (p, 2, "61 +pm=madrid +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Madrid 1870 (Madrid) / Spain\",GEOGCS[\"Madrid "); + add_srs_wkt (p, 1, + "1870 (Madrid)\",DATUM[\"Madrid_1870_Madrid\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Struve 1860\",6378298.3,294.73,AUTHORITY[\"EPSG\",\"7028"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6903\"]],PRIMEM[\"Madrid\",-3."); + add_srs_wkt (p, 4, + "687938888888889,AUTHORITY[\"EPSG\",\"8905\"]],UNIT[\"deg"); + add_srs_wkt (p, 5, + "ree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"4903\"]],UNIT[\"metre\",1,AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Coni"); + add_srs_wkt (p, 8, + "c_1SP\"],PARAMETER[\"latitude_of_origin\",40],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",0],PARAMETER[\"scale_factor\",0.998"); + add_srs_wkt (p, 10, + "8085293],PARAMETER[\"false_easting\",600000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",600000],AUTHORITY[\"EPSG\",\"2062\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2063, "epsg", 2063, + "Dabola 1981 / UTM zone 28N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-23,"); + add_proj4text (p, 1, "259,-9,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Dabola 1981 / UTM zone 28N (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Conakry 1905\",DATUM[\"Conakry_1905\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7011\"]],TOWGS84[-23,259,-9,0,0,0,0],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6315\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4315\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",-15],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "2063\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 2064, "epsg", 2064, + "Dabola 1981 / UTM zone 29N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-23,"); + add_proj4text (p, 1, "259,-9,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Dabola 1981 / UTM zone 29N (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Conakry 1905\",DATUM[\"Conakry_1905\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7011\"]],TOWGS84[-23,259,-9,0,0,0,0],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6315\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4315\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.9996],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 12, + "064\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2065, "epsg", 2065, + "S-JTSK (Ferro) / Krovak"); + add_proj4text (p, 0, + "+proj=krovak +lat_0=49.5 +lon_0=42.5 +alpha=30.288139722"); + add_proj4text (p, 1, + "22222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +pm=ferro +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"S-JTSK (Ferro) / Krovak\",GEOGCS[\"S-JTSK (Ferr"); + add_srs_wkt (p, 1, + "o)\",DATUM[\"S_JTSK_Ferro\",SPHEROID[\"Bessel 1841\",637"); + add_srs_wkt (p, 2, + "7397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6818\"]],PRIMEM[\"Ferro\",-17.6666666666"); + add_srs_wkt (p, 4, + "6667,AUTHORITY[\"EPSG\",\"8909\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4818\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Krovak\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "center\",49.5],PARAMETER[\"longitude_of_center\",42.5],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"azimuth\",30.28813972222222],PARAMETER[\"pseu"); + add_srs_wkt (p, 10, + "do_standard_parallel_1\",78.5],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 11, + ",0.9999],PARAMETER[\"false_easting\",0],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",0],AUTHORITY[\"EPSG\",\"2065\"],AXIS[\"X\","); + add_srs_wkt (p, 13, "SOUTH],AXIS[\"Y\",WEST]]"); + p = add_epsg_def (first, last, 2066, "epsg", 2066, + "Mount Dillon / Tobago Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=11.25217861111111 +lon_0=-60.686008888"); + add_proj4text (p, 1, + "88889 +x_0=37718.66159325 +y_0=36209.91512952 +a=6378293"); + add_proj4text (p, 2, + ".645208759 +b=6356617.987679838 +to_meter=0.201166195164"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Mount Dillon / Tobago Grid\",GEOGCS[\"Mount Dil"); + add_srs_wkt (p, 1, + "lon\",DATUM[\"Mount_Dillon\",SPHEROID[\"Clarke 1858\",63"); + add_srs_wkt (p, 2, + "78293.645208759,294.2606763692569,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "007\"]],AUTHORITY[\"EPSG\",\"6157\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4157\"]],UNIT[\"Clarke's link\",0.201166195164,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9039\"]],PROJECTION[\"Cassini_Soldn"); + add_srs_wkt (p, 8, + "er\"],PARAMETER[\"latitude_of_origin\",11.25217861111111"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-60.68600888888889],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",187500],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",180000],AUTHORITY[\"EPSG\",\"2066\"],AXIS[\"Eastin"); + add_srs_wkt (p, 12, "g\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2067, "epsg", 2067, + "Naparima 1955 / UTM zone 20N"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Naparima 1955 / UTM zone 20N\",GEOGCS[\"Naparim"); + add_srs_wkt (p, 1, + "a 1955\",DATUM[\"Naparima_1955\",SPHEROID[\"Internationa"); + add_srs_wkt (p, 2, + "l 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6158\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"415"); + add_srs_wkt (p, 6, + "8\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",-63],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, + "\",\"2067\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NO"); + add_srs_wkt (p, 12, "RTH]]"); + p = add_epsg_def (first, last, 2068, "epsg", 2068, "ELD79 / Libya zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9999 +x_0=200000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / Libya zone 5\",GEOGCS[\"ELD79\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Libyan_Datum_1979\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "cale_factor\",0.9999],PARAMETER[\"false_easting\",200000"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 11, "068\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2069, "epsg", 2069, "ELD79 / Libya zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=11 +k=0.9999 +x_0=200000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / Libya zone 6\",GEOGCS[\"ELD79\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Libyan_Datum_1979\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",11],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",20000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2069\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2070, "epsg", 2070, "ELD79 / Libya zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13 +k=0.9999 +x_0=200000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / Libya zone 7\",GEOGCS[\"ELD79\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Libyan_Datum_1979\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",13],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",20000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2070\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2071, "epsg", 2071, "ELD79 / Libya zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=200000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / Libya zone 8\",GEOGCS[\"ELD79\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Libyan_Datum_1979\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",15],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",20000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2071\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2072, "epsg", 2072, "ELD79 / Libya zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=17 +k=0.9999 +x_0=200000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / Libya zone 9\",GEOGCS[\"ELD79\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Libyan_Datum_1979\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",17],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",20000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2072\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2073, "epsg", 2073, "ELD79 / Libya zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=19 +k=0.9999 +x_0=200000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / Libya zone 10\",GEOGCS[\"ELD79\",DATUM["); + add_srs_wkt (p, 1, + "\"European_Libyan_Datum_1979\",SPHEROID[\"International "); + add_srs_wkt (p, 2, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",0],PARAMETER[\"central_meridian\",19],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",20000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2073\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2074, "epsg", 2074, "ELD79 / Libya zone 11"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=200000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / Libya zone 11\",GEOGCS[\"ELD79\",DATUM["); + add_srs_wkt (p, 1, + "\"European_Libyan_Datum_1979\",SPHEROID[\"International "); + add_srs_wkt (p, 2, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",0],PARAMETER[\"central_meridian\",21],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",20000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2074\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2075, "epsg", 2075, "ELD79 / Libya zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=23 +k=0.9999 +x_0=200000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / Libya zone 12\",GEOGCS[\"ELD79\",DATUM["); + add_srs_wkt (p, 1, + "\"European_Libyan_Datum_1979\",SPHEROID[\"International "); + add_srs_wkt (p, 2, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",0],PARAMETER[\"central_meridian\",23],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",20000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2075\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2076, "epsg", 2076, "ELD79 / Libya zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=25 +k=0.9999 +x_0=200000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / Libya zone 13\",GEOGCS[\"ELD79\",DATUM["); + add_srs_wkt (p, 1, + "\"European_Libyan_Datum_1979\",SPHEROID[\"International "); + add_srs_wkt (p, 2, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",0],PARAMETER[\"central_meridian\",25],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",20000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2076\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2077, "epsg", 2077, "ELD79 / UTM zone 32N"); + add_proj4text (p, 0, "+proj=utm +zone=32 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / UTM zone 32N\",GEOGCS[\"ELD79\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Libyan_Datum_1979\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "cale_factor\",0.9996],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 11, + "077\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2078, "epsg", 2078, "ELD79 / UTM zone 33N"); + add_proj4text (p, 0, "+proj=utm +zone=33 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / UTM zone 33N\",GEOGCS[\"ELD79\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Libyan_Datum_1979\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",15],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "2078\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2079, "epsg", 2079, "ELD79 / UTM zone 34N"); + add_proj4text (p, 0, "+proj=utm +zone=34 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / UTM zone 34N\",GEOGCS[\"ELD79\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Libyan_Datum_1979\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",21],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "2079\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2080, "epsg", 2080, "ELD79 / UTM zone 35N"); + add_proj4text (p, 0, "+proj=utm +zone=35 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / UTM zone 35N\",GEOGCS[\"ELD79\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Libyan_Datum_1979\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",27],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "2080\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2081, "epsg", 2081, + "Chos Malal 1914 / Argentina zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Chos Malal 1914 / Argentina zone 2\",GEOGCS[\"C"); + add_srs_wkt (p, 1, + "hos Malal 1914\",DATUM[\"Chos_Malal_1914\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6160\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4160\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",-90],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-69],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",2500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2081\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2082, "epsg", 2082, + "Pampa del Castillo / Argentina zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=intl +towgs84=27.5,14,186.4,0,0,0,0 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pampa del Castillo / Argentina zone 2\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Pampa del Castillo\",DATUM[\"Pampa_del_Castillo\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"International 1924\",6378388,297,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7022\"]],TOWGS84[27.5,14,186.4,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6161\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4161\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",-90],PARAMETER[\"central_meridian\",-69],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",2500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2082"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2083, "epsg", 2083, + "Hito XVIII 1963 / Argentina zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hito XVIII 1963 / Argentina zone 2\",GEOGCS[\"H"); + add_srs_wkt (p, 1, + "ito XVIII 1963\",DATUM[\"Hito_XVIII_1963\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6254\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4254\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",-90],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-69],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",2500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2083\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2084, "epsg", 2084, + "Hito XVIII 1963 / UTM zone 19S"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hito XVIII 1963 / UTM zone 19S\",GEOGCS[\"Hito "); + add_srs_wkt (p, 1, + "XVIII 1963\",DATUM[\"Hito_XVIII_1963\",SPHEROID[\"Intern"); + add_srs_wkt (p, 2, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6254\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4254\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-69],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"2084\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2085, "epsg", 2085, + "NAD27 / Cuba Norte (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=22.35 +lat_0=22.35 +lon_0=-81 +k_0=0.99"); + add_proj4text (p, 1, + "993602 +x_0=500000 +y_0=280296.016 +ellps=clrk66 +datum="); + add_proj4text (p, 2, "NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Cuba Norte (deprecated)\",GEOGCS[\"NAD2"); + add_srs_wkt (p, 1, + "7\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clark"); + add_srs_wkt (p, 2, + "e 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],"); + add_srs_wkt (p, 8, + "PARAMETER[\"latitude_of_origin\",22.35],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",-81],PARAMETER[\"scale_factor\",0.9999360"); + add_srs_wkt (p, 10, + "2],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",280296.016],AUTHORITY[\"EPSG\",\"2085\"],AXI"); + add_srs_wkt (p, 12, "S[\"Y\",NORTH],AXIS[\"X\",EAST]]"); + p = add_epsg_def (first, last, 2086, "epsg", 2086, + "NAD27 / Cuba Sur (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=20.71666666666667 +lat_0=20.71666666666"); + add_proj4text (p, 1, + "667 +lon_0=-76.83333333333333 +k_0=0.99994848 +x_0=50000"); + add_proj4text (p, 2, + "0 +y_0=229126.939 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Cuba Sur (deprecated)\",GEOGCS[\"NAD27\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1"); + add_srs_wkt (p, 2, + "866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"latitude_of_origin\",20.71666666666667],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-76.83333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.99994848],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",229126.939],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"2086\"],AXIS[\"Y\",NORTH],AXIS[\"X\",EAST]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 2087, "epsg", 2087, "ELD79 / TM 12 NE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ELD79 / TM 12 NE\",GEOGCS[\"ELD79\",DATUM[\"Eur"); + add_srs_wkt (p, 1, + "opean_Libyan_Datum_1979\",SPHEROID[\"International 1924\""); + add_srs_wkt (p, 2, + ",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6159\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4159\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",12],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2087\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2088, "epsg", 2088, "Carthage / TM 11 NE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=11 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=0 +a=6378249.2 +b=6356515 +datum=carthage +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Carthage / TM 11 NE\",GEOGCS[\"Carthage\",DATUM"); + add_srs_wkt (p, 1, + "[\"Carthage\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,2"); + add_srs_wkt (p, 2, + "93.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6223\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4223\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",11],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "2088\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2089, "epsg", 2089, + "Yemen NGN96 / UTM zone 38N"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Yemen NGN96 / UTM zone 38N\",GEOGCS[\"Yemen NGN"); + add_srs_wkt (p, 1, + "96\",DATUM[\"Yemen_National_Geodetic_Network_1996\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6163\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4163\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",45],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2089\"],AXIS"); + add_srs_wkt (p, 12, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2090, "epsg", 2090, + "Yemen NGN96 / UTM zone 39N"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Yemen NGN96 / UTM zone 39N\",GEOGCS[\"Yemen NGN"); + add_srs_wkt (p, 1, + "96\",DATUM[\"Yemen_National_Geodetic_Network_1996\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6163\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4163\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",51],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2090\"],AXIS"); + add_srs_wkt (p, 12, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2091, "epsg", 2091, + "South Yemen / Gauss Kruger zone 8 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"South Yemen / Gauss Kruger zone 8 (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"South Yemen\",DATUM[\"South_Yemen\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[-76,-138,67,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6164\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4164\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",45],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",1],PARAMETER[\"false_easting\",8500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"2091\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2092, "epsg", 2092, + "South Yemen / Gauss Kruger zone 9 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"South Yemen / Gauss Kruger zone 9 (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"South Yemen\",DATUM[\"South_Yemen\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[-76,-138,67,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6164\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4164\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",51],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",1],PARAMETER[\"false_easting\",9500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"2092\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2093, "epsg", 2093, + "Hanoi 1972 / GK 106 NE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=106 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hanoi 1972 / GK 106 NE\",GEOGCS[\"Hanoi 1972\","); + add_srs_wkt (p, 1, + "DATUM[\"Hanoi_1972\",SPHEROID[\"Krassowsky 1940\",637824"); + add_srs_wkt (p, 2, + "5,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[-17.51,-10"); + add_srs_wkt (p, 3, + "8.32,-62.39,0,0,0,0],AUTHORITY[\"EPSG\",\"6147\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4147\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",106],PARAMETER[\"scale_factor\",1],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2093\"],AXIS[\"X\",NORTH],AXIS["); + add_srs_wkt (p, 12, "\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2094, "epsg", 2094, "WGS 72BE / TM 106 NE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=106 +k=0.9996 +x_0=500000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / TM 106 NE\",GEOGCS[\"WGS 72BE\",DATU"); + add_srs_wkt (p, 1, + "M[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TOWG"); + add_srs_wkt (p, 3, + "S84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",106],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"2094\"],AXIS[\"Eas"); + add_srs_wkt (p, 12, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2095, "epsg", 2095, "Bissau / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +ellps=intl +towgs84=-173,253,27,0,0,"); + add_proj4text (p, 1, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bissau / UTM zone 28N\",GEOGCS[\"Bissau\",DATUM"); + add_srs_wkt (p, 1, + "[\"Bissau\",SPHEROID[\"International 1924\",6378388,297,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-173,253,27,0,0,0,"); + add_srs_wkt (p, 3, + "0],AUTHORITY[\"EPSG\",\"6165\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4165\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",-15]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_ea"); + add_srs_wkt (p, 10, + "sting\",500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2095\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 12, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 2096, "epsg", 2096, + "Korean 1985 / Korea East Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38 +lon_0=129 +k=1 +x_0=200000 +y_0=5"); + add_proj4text (p, 1, "00000 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Korean 1985 / Korea East Belt\",GEOGCS[\"Korean"); + add_srs_wkt (p, 1, + " 1985\",DATUM[\"Korean_Datum_1985\",SPHEROID[\"Bessel 18"); + add_srs_wkt (p, 2, + "41\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6162\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4162\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",38],PARAMETER[\"central_meridian\",129"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",200000],PARAMETER[\"false_northing\",500000],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"2096\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 2097, "epsg", 2097, + "Korean 1985 / Korea Central Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=5"); + add_proj4text (p, 1, "00000 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Korean 1985 / Korea Central Belt\",GEOGCS[\"Kor"); + add_srs_wkt (p, 1, + "ean 1985\",DATUM[\"Korean_Datum_1985\",SPHEROID[\"Bessel"); + add_srs_wkt (p, 2, + " 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "4\"]],AUTHORITY[\"EPSG\",\"6162\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4162\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",38],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "127],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",200000],PARAMETER[\"false_northing\",500000],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"2097\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EA"); + add_srs_wkt (p, 12, "ST]]"); + p = add_epsg_def (first, last, 2098, "epsg", 2098, + "Korean 1985 / Korea West Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38 +lon_0=125 +k=1 +x_0=200000 +y_0=5"); + add_proj4text (p, 1, "00000 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Korean 1985 / Korea West Belt\",GEOGCS[\"Korean"); + add_srs_wkt (p, 1, + " 1985\",DATUM[\"Korean_Datum_1985\",SPHEROID[\"Bessel 18"); + add_srs_wkt (p, 2, + "41\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6162\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4162\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",38],PARAMETER[\"central_meridian\",125"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",200000],PARAMETER[\"false_northing\",500000],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"2098\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 2099, "epsg", 2099, + "Qatar 1948 / Qatar Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=25.38236111111111 +lon_0=50.7613888888"); + add_proj4text (p, 1, + "8889 +x_0=100000 +y_0=100000 +ellps=helmert +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Qatar 1948 / Qatar Grid\",GEOGCS[\"Qatar 1948\""); + add_srs_wkt (p, 1, + ",DATUM[\"Qatar_1948\",SPHEROID[\"Helmert 1906\",6378200,"); + add_srs_wkt (p, 2, + "298.3,AUTHORITY[\"EPSG\",\"7020\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6286\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4286\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Cassin"); + add_srs_wkt (p, 7, + "i_Soldner\"],PARAMETER[\"latitude_of_origin\",25.3823611"); + add_srs_wkt (p, 8, + "1111111],PARAMETER[\"central_meridian\",50.7613888888888"); + add_srs_wkt (p, 9, + "9],PARAMETER[\"false_easting\",100000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",100000],AUTHORITY[\"EPSG\",\"2099\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2100, "epsg", 2100, "GGRS87 / Greek Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=GRS80 +datum=GGRS87 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GGRS87 / Greek Grid\",GEOGCS[\"GGRS87\",DATUM[\""); + add_srs_wkt (p, 1, + "Greek_Geodetic_Reference_System_1987\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[-199.87,74.79,246.62,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6121\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4121\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",24],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2100\"],AX"); + add_srs_wkt (p, 12, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2101, "epsg", 2101, + "Lake / Maracaibo Grid M1"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666"); + add_proj4text (p, 1, + "667 +lon_0=-71.60561777777777 +k_0=1 +x_0=0 +y_0=-52684."); + add_proj4text (p, 2, "972 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Lake / Maracaibo Grid M1\",GEOGCS[\"Lake\",DATU"); + add_srs_wkt (p, 1, + "M[\"Lake\",SPHEROID[\"International 1924\",6378388,297,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6249\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4249\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Confo"); + add_srs_wkt (p, 7, + "rmal_Conic_1SP\"],PARAMETER[\"latitude_of_origin\",10.16"); + add_srs_wkt (p, 8, + "666666666667],PARAMETER[\"central_meridian\",-71.6056177"); + add_srs_wkt (p, 9, + "7777777],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",0],PARAMETER[\"false_northing\",-52684.972],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"2101\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 2102, "epsg", 2102, "Lake / Maracaibo Grid"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666"); + add_proj4text (p, 1, + "667 +lon_0=-71.60561777777777 +k_0=1 +x_0=200000 +y_0=14"); + add_proj4text (p, 2, "7315.028 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Lake / Maracaibo Grid\",GEOGCS[\"Lake\",DATUM[\""); + add_srs_wkt (p, 1, + "Lake\",SPHEROID[\"International 1924\",6378388,297,AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6249\"]],P"); + add_srs_wkt (p, 3, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 4, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 5, + "2\"]],AUTHORITY[\"EPSG\",\"4249\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conforma"); + add_srs_wkt (p, 7, + "l_Conic_1SP\"],PARAMETER[\"latitude_of_origin\",10.16666"); + add_srs_wkt (p, 8, + "666666667],PARAMETER[\"central_meridian\",-71.6056177777"); + add_srs_wkt (p, 9, + "7777],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_ea"); + add_srs_wkt (p, 10, + "sting\",200000],PARAMETER[\"false_northing\",147315.028]"); + add_srs_wkt (p, 11, + ",AUTHORITY[\"EPSG\",\"2102\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 2103, "epsg", 2103, + "Lake / Maracaibo Grid M3"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666"); + add_proj4text (p, 1, + "667 +lon_0=-71.60561777777777 +k_0=1 +x_0=500000 +y_0=44"); + add_proj4text (p, 2, "7315.028 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Lake / Maracaibo Grid M3\",GEOGCS[\"Lake\",DATU"); + add_srs_wkt (p, 1, + "M[\"Lake\",SPHEROID[\"International 1924\",6378388,297,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6249\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4249\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Confo"); + add_srs_wkt (p, 7, + "rmal_Conic_1SP\"],PARAMETER[\"latitude_of_origin\",10.16"); + add_srs_wkt (p, 8, + "666666666667],PARAMETER[\"central_meridian\",-71.6056177"); + add_srs_wkt (p, 9, + "7777777],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",447315.0"); + add_srs_wkt (p, 11, + "28],AUTHORITY[\"EPSG\",\"2103\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2104, "epsg", 2104, + "Lake / Maracaibo La Rosa Grid"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=10.16666666666667 +lat_0=10.16666666666"); + add_proj4text (p, 1, + "667 +lon_0=-71.60561777777777 +k_0=1 +x_0=-17044 +y_0=-2"); + add_proj4text (p, 2, "3139.97 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Lake / Maracaibo La Rosa Grid\",GEOGCS[\"Lake\""); + add_srs_wkt (p, 1, + ",DATUM[\"Lake\",SPHEROID[\"International 1924\",6378388,"); + add_srs_wkt (p, 2, + "297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "249\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4249\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_1SP\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",10.16666666666667],PARAMETER[\"central_meridian\",-71.6"); + add_srs_wkt (p, 9, + "0561777777777],PARAMETER[\"scale_factor\",1],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",-17044],PARAMETER[\"false_northing\",-23"); + add_srs_wkt (p, 11, + "139.97],AUTHORITY[\"EPSG\",\"2104\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2105, "epsg", 2105, + "NZGD2000 / Mount Eden 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-36.87972222222222 +lon_0=174.7641666"); + add_proj4text (p, 1, + "666667 +k=0.9999 +x_0=400000 +y_0=800000 +ellps=GRS80 +t"); + add_proj4text (p, 2, "owgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Mount Eden 2000\",GEOGCS[\"NZGD2000\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-36.879722222"); + add_srs_wkt (p, 9, + "22222],PARAMETER[\"central_meridian\",174.7641666666667]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",400000],PARAMETER[\"false_northing\",800000],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"2105\"],AXIS[\"Northing\",NORTH],AXIS["); + add_srs_wkt (p, 13, "\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 2106, "epsg", 2106, + "NZGD2000 / Bay of Plenty 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-37.76111111111111 +lon_0=176.4661111"); + add_proj4text (p, 1, + "111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Bay of Plenty 2000\",GEOGCS[\"NZGD20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID["); + add_srs_wkt (p, 2, + "\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"616"); + add_srs_wkt (p, 4, + "7\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",-37.761111"); + add_srs_wkt (p, 9, + "11111111],PARAMETER[\"central_meridian\",176.46611111111"); + add_srs_wkt (p, 10, + "11],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",400000],PARAMETER[\"false_northing\",800000],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"2106\"],AXIS[\"Northing\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Easting\",EAST]]"); + p = add_epsg_def (first, last, 2107, "epsg", 2107, + "NZGD2000 / Poverty Bay 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-38.62444444444444 +lon_0=177.8855555"); + add_proj4text (p, 1, + "555556 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Poverty Bay 2000\",GEOGCS[\"NZGD2000"); + add_srs_wkt (p, 1, + "\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-38.624444444"); + add_srs_wkt (p, 9, + "44444],PARAMETER[\"central_meridian\",177.8855555555556]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",400000],PARAMETER[\"false_northing\",800000],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"2107\"],AXIS[\"Northing\",NORTH],AXIS[\"Eas"); + add_srs_wkt (p, 13, "ting\",EAST]]"); + p = add_epsg_def (first, last, 2108, "epsg", 2108, + "NZGD2000 / Hawkes Bay 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-39.65083333333333 +lon_0=176.6736111"); + add_proj4text (p, 1, + "111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Hawkes Bay 2000\",GEOGCS[\"NZGD2000\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-39.650833333"); + add_srs_wkt (p, 9, + "33333],PARAMETER[\"central_meridian\",176.6736111111111]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",400000],PARAMETER[\"false_northing\",800000],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"2108\"],AXIS[\"Northing\",NORTH],AXIS[\"Eas"); + add_srs_wkt (p, 13, "ting\",EAST]]"); + p = add_epsg_def (first, last, 2109, "epsg", 2109, + "NZGD2000 / Taranaki 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-39.13555555555556 +lon_0=174.2277777"); + add_proj4text (p, 1, + "777778 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Taranaki 2000\",GEOGCS[\"NZGD2000\","); + add_srs_wkt (p, 1, + "DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",-39.13555555555"); + add_srs_wkt (p, 9, + "556],PARAMETER[\"central_meridian\",174.2277777777778],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",400000],PARAMETER[\"false_northing\",800000],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2109\"],AXIS[\"Northing\",NORTH],AXIS[\"Easti"); + add_srs_wkt (p, 13, "ng\",EAST]]"); + p = add_epsg_def (first, last, 2110, "epsg", 2110, + "NZGD2000 / Tuhirangi 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-39.51222222222222 +lon_0=175.64 +k=1"); + add_proj4text (p, 1, + " +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Tuhirangi 2000\",GEOGCS[\"NZGD2000\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-39.512222222"); + add_srs_wkt (p, 9, + "22222],PARAMETER[\"central_meridian\",175.64],PARAMETER["); + add_srs_wkt (p, 10, + "\"scale_factor\",1],PARAMETER[\"false_easting\",400000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",800000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, + "\"2110\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 2111, "epsg", 2111, + "NZGD2000 / Wanganui 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-40.24194444444444 +lon_0=175.4880555"); + add_proj4text (p, 1, + "555555 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Wanganui 2000\",GEOGCS[\"NZGD2000\","); + add_srs_wkt (p, 1, + "DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",-40.24194444444"); + add_srs_wkt (p, 9, + "444],PARAMETER[\"central_meridian\",175.4880555555555],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",400000],PARAMETER[\"false_northing\",800000],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2111\"],AXIS[\"Northing\",NORTH],AXIS[\"Easti"); + add_srs_wkt (p, 13, "ng\",EAST]]"); + p = add_epsg_def (first, last, 2112, "epsg", 2112, + "NZGD2000 / Wairarapa 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-40.92527777777777 +lon_0=175.6472222"); + add_proj4text (p, 1, + "222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Wairarapa 2000\",GEOGCS[\"NZGD2000\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-40.925277777"); + add_srs_wkt (p, 9, + "77777],PARAMETER[\"central_meridian\",175.6472222222222]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",400000],PARAMETER[\"false_northing\",800000],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"2112\"],AXIS[\"Northing\",NORTH],AXIS[\"Eas"); + add_srs_wkt (p, 13, "ting\",EAST]]"); + p = add_epsg_def (first, last, 2113, "epsg", 2113, + "NZGD2000 / Wellington 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-41.3011111111111 +lon_0=174.77638888"); + add_proj4text (p, 1, + "88889 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84"); + add_proj4text (p, 2, "=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Wellington 2000\",GEOGCS[\"NZGD2000\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-41.301111111"); + add_srs_wkt (p, 9, + "1111],PARAMETER[\"central_meridian\",174.7763888888889],"); + add_srs_wkt (p, 10, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",400000],PARAMETER[\"false_northing\",800000],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2113\"],AXIS[\"Northing\",NORTH],AXIS[\"Easti"); + add_srs_wkt (p, 13, "ng\",EAST]]"); + p = add_epsg_def (first, last, 2114, "epsg", 2114, + "NZGD2000 / Collingwood 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-40.71472222222223 +lon_0=172.6719444"); + add_proj4text (p, 1, + "444444 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Collingwood 2000\",GEOGCS[\"NZGD2000"); + add_srs_wkt (p, 1, + "\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-40.714722222"); + add_srs_wkt (p, 9, + "22223],PARAMETER[\"central_meridian\",172.6719444444444]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",400000],PARAMETER[\"false_northing\",800000],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"2114\"],AXIS[\"Northing\",NORTH],AXIS[\"Eas"); + add_srs_wkt (p, 13, "ting\",EAST]]"); + p = add_epsg_def (first, last, 2115, "epsg", 2115, + "NZGD2000 / Nelson 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-41.27444444444444 +lon_0=173.2991666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Nelson 2000\",GEOGCS[\"NZGD2000\",DA"); + add_srs_wkt (p, 1, + "TUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 8, + "tor\"],PARAMETER[\"latitude_of_origin\",-41.274444444444"); + add_srs_wkt (p, 9, + "44],PARAMETER[\"central_meridian\",173.2991666666667],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "400000],PARAMETER[\"false_northing\",800000],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2115\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting"); + add_srs_wkt (p, 13, "\",EAST]]"); + p = add_epsg_def (first, last, 2116, "epsg", 2116, + "NZGD2000 / Karamea 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-41.28972222222222 +lon_0=172.1088888"); + add_proj4text (p, 1, + "888889 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Karamea 2000\",GEOGCS[\"NZGD2000\",D"); + add_srs_wkt (p, 1, + "ATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",-41.28972222222"); + add_srs_wkt (p, 9, + "222],PARAMETER[\"central_meridian\",172.1088888888889],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",400000],PARAMETER[\"false_northing\",800000],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2116\"],AXIS[\"Northing\",NORTH],AXIS[\"Easti"); + add_srs_wkt (p, 13, "ng\",EAST]]"); + p = add_epsg_def (first, last, 2117, "epsg", 2117, + "NZGD2000 / Buller 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-41.81055555555555 +lon_0=171.5811111"); + add_proj4text (p, 1, + "111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Buller 2000\",GEOGCS[\"NZGD2000\",DA"); + add_srs_wkt (p, 1, + "TUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 8, + "tor\"],PARAMETER[\"latitude_of_origin\",-41.810555555555"); + add_srs_wkt (p, 9, + "55],PARAMETER[\"central_meridian\",171.5811111111111],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "400000],PARAMETER[\"false_northing\",800000],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2117\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting"); + add_srs_wkt (p, 13, "\",EAST]]"); + p = add_epsg_def (first, last, 2118, "epsg", 2118, "NZGD2000 / Grey 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-42.33361111111111 +lon_0=171.5497222"); + add_proj4text (p, 1, + "222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Grey 2000\",GEOGCS[\"NZGD2000\",DATU"); + add_srs_wkt (p, 1, + "M[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS 198"); + add_srs_wkt (p, 2, + "0\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],"); + add_srs_wkt (p, 3, + "TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",-42.33361111111111]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"central_meridian\",171.5497222222222],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",400"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",800000],AUTHORITY[\"EP"); + add_srs_wkt (p, 12, + "SG\",\"2118\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\""); + add_srs_wkt (p, 13, ",EAST]]"); + p = add_epsg_def (first, last, 2119, "epsg", 2119, "NZGD2000 / Amuri 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-42.68888888888888 +lon_0=173.01 +k=1"); + add_proj4text (p, 1, + " +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Amuri 2000\",GEOGCS[\"NZGD2000\",DAT"); + add_srs_wkt (p, 1, + "UM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",-42.6888888888888"); + add_srs_wkt (p, 9, + "8],PARAMETER[\"central_meridian\",173.01],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",400000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",800000],AUTHORITY[\"EPSG\",\"21"); + add_srs_wkt (p, 12, + "19\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 2120, "epsg", 2120, + "NZGD2000 / Marlborough 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-41.54444444444444 +lon_0=173.8019444"); + add_proj4text (p, 1, + "444444 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Marlborough 2000\",GEOGCS[\"NZGD2000"); + add_srs_wkt (p, 1, + "\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-41.544444444"); + add_srs_wkt (p, 9, + "44444],PARAMETER[\"central_meridian\",173.8019444444444]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",400000],PARAMETER[\"false_northing\",800000],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"2120\"],AXIS[\"Northing\",NORTH],AXIS[\"Eas"); + add_srs_wkt (p, 13, "ting\",EAST]]"); + p = add_epsg_def (first, last, 2121, "epsg", 2121, + "NZGD2000 / Hokitika 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-42.88611111111111 +lon_0=170.9797222"); + add_proj4text (p, 1, + "222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Hokitika 2000\",GEOGCS[\"NZGD2000\","); + add_srs_wkt (p, 1, + "DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",-42.88611111111"); + add_srs_wkt (p, 9, + "111],PARAMETER[\"central_meridian\",170.9797222222222],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",400000],PARAMETER[\"false_northing\",800000],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2121\"],AXIS[\"Northing\",NORTH],AXIS[\"Easti"); + add_srs_wkt (p, 13, "ng\",EAST]]"); + p = add_epsg_def (first, last, 2122, "epsg", 2122, + "NZGD2000 / Okarito 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-43.11 +lon_0=170.2608333333333 +k=1 "); + add_proj4text (p, 1, + "+x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Okarito 2000\",GEOGCS[\"NZGD2000\",D"); + add_srs_wkt (p, 1, + "ATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",-43.11],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",170.2608333333333],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",400000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",800000],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 12, + "122\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 2123, "epsg", 2123, + "NZGD2000 / Jacksons Bay 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-43.97777777777778 +lon_0=168.6061111"); + add_proj4text (p, 1, + "111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Jacksons Bay 2000\",GEOGCS[\"NZGD200"); + add_srs_wkt (p, 1, + "0\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-43.977777777"); + add_srs_wkt (p, 9, + "77778],PARAMETER[\"central_meridian\",168.6061111111111]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",400000],PARAMETER[\"false_northing\",800000],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"2123\"],AXIS[\"Northing\",NORTH],AXIS[\"Eas"); + add_srs_wkt (p, 13, "ting\",EAST]]"); + p = add_epsg_def (first, last, 2124, "epsg", 2124, + "NZGD2000 / Mount Pleasant 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-43.59055555555556 +lon_0=172.7269444"); + add_proj4text (p, 1, + "444445 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Mount Pleasant 2000\",GEOGCS[\"NZGD2"); + add_srs_wkt (p, 1, + "000\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"616"); + add_srs_wkt (p, 4, + "7\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",-43.590555"); + add_srs_wkt (p, 9, + "55555556],PARAMETER[\"central_meridian\",172.72694444444"); + add_srs_wkt (p, 10, + "45],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",400000],PARAMETER[\"false_northing\",800000],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"2124\"],AXIS[\"Northing\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Easting\",EAST]]"); + p = add_epsg_def (first, last, 2125, "epsg", 2125, + "NZGD2000 / Gawler 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-43.74861111111111 +lon_0=171.3605555"); + add_proj4text (p, 1, + "555555 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Gawler 2000\",GEOGCS[\"NZGD2000\",DA"); + add_srs_wkt (p, 1, + "TUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 8, + "tor\"],PARAMETER[\"latitude_of_origin\",-43.748611111111"); + add_srs_wkt (p, 9, + "11],PARAMETER[\"central_meridian\",171.3605555555555],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "400000],PARAMETER[\"false_northing\",800000],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2125\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting"); + add_srs_wkt (p, 13, "\",EAST]]"); + p = add_epsg_def (first, last, 2126, "epsg", 2126, + "NZGD2000 / Timaru 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-44.40194444444445 +lon_0=171.0572222"); + add_proj4text (p, 1, + "222222 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Timaru 2000\",GEOGCS[\"NZGD2000\",DA"); + add_srs_wkt (p, 1, + "TUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 8, + "tor\"],PARAMETER[\"latitude_of_origin\",-44.401944444444"); + add_srs_wkt (p, 9, + "45],PARAMETER[\"central_meridian\",171.0572222222222],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "400000],PARAMETER[\"false_northing\",800000],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2126\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting"); + add_srs_wkt (p, 13, "\",EAST]]"); + p = add_epsg_def (first, last, 2127, "epsg", 2127, + "NZGD2000 / Lindis Peak 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-44.735 +lon_0=169.4675 +k=1 +x_0=400"); + add_proj4text (p, 1, + "000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Lindis Peak 2000\",GEOGCS[\"NZGD2000"); + add_srs_wkt (p, 1, + "\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-44.735],PARA"); + add_srs_wkt (p, 9, + "METER[\"central_meridian\",169.4675],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",1],PARAMETER[\"false_easting\",400000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",800000],AUTHORITY[\"EPSG\",\"2127\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 2128, "epsg", 2128, + "NZGD2000 / Mount Nicholas 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-45.13277777777778 +lon_0=168.3986111"); + add_proj4text (p, 1, + "111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Mount Nicholas 2000\",GEOGCS[\"NZGD2"); + add_srs_wkt (p, 1, + "000\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"616"); + add_srs_wkt (p, 4, + "7\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",-45.132777"); + add_srs_wkt (p, 9, + "77777778],PARAMETER[\"central_meridian\",168.39861111111"); + add_srs_wkt (p, 10, + "11],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",400000],PARAMETER[\"false_northing\",800000],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"2128\"],AXIS[\"Northing\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Easting\",EAST]]"); + p = add_epsg_def (first, last, 2129, "epsg", 2129, + "NZGD2000 / Mount York 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-45.56361111111111 +lon_0=167.7386111"); + add_proj4text (p, 1, + "111111 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Mount York 2000\",GEOGCS[\"NZGD2000\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-45.563611111"); + add_srs_wkt (p, 9, + "11111],PARAMETER[\"central_meridian\",167.7386111111111]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",400000],PARAMETER[\"false_northing\",800000],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"2129\"],AXIS[\"Northing\",NORTH],AXIS[\"Eas"); + add_srs_wkt (p, 13, "ting\",EAST]]"); + p = add_epsg_def (first, last, 2130, "epsg", 2130, + "NZGD2000 / Observation Point 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-45.81611111111111 +lon_0=170.6283333"); + add_proj4text (p, 1, + "333333 +k=1 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Observation Point 2000\",GEOGCS[\"NZ"); + add_srs_wkt (p, 1, + "GD2000\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6167\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",-45.81"); + add_srs_wkt (p, 9, + "611111111111],PARAMETER[\"central_meridian\",170.6283333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",400000],PARAMETER[\"false_northing\",800000],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"2130\"],AXIS[\"Northing\",NORTH],AXI"); + add_srs_wkt (p, 13, "S[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 2131, "epsg", 2131, + "NZGD2000 / North Taieri 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-45.86138888888889 +lon_0=170.2825 +k"); + add_proj4text (p, 1, + "=0.99996 +x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0"); + add_proj4text (p, 2, ",0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / North Taieri 2000\",GEOGCS[\"NZGD200"); + add_srs_wkt (p, 1, + "0\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",-45.861388888"); + add_srs_wkt (p, 9, + "88889],PARAMETER[\"central_meridian\",170.2825],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.99996],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "400000],PARAMETER[\"false_northing\",800000],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2131\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting"); + add_srs_wkt (p, 13, "\",EAST]]"); + p = add_epsg_def (first, last, 2132, "epsg", 2132, "NZGD2000 / Bluff 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-46.6 +lon_0=168.3427777777778 +k=1 +"); + add_proj4text (p, 1, + "x_0=400000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0"); + add_proj4text (p, 2, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Bluff 2000\",GEOGCS[\"NZGD2000\",DAT"); + add_srs_wkt (p, 1, + "UM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",-46.6],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",168.3427777777778],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",1],PARAMETER[\"false_easting\",400000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",800000],AUTHORITY[\"EPSG\",\"2132"); + add_srs_wkt (p, 12, "\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 2133, "epsg", 2133, + "NZGD2000 / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / UTM zone 58S\",GEOGCS[\"NZGD2000\",D"); + add_srs_wkt (p, 1, + "ATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",165],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"2133\"],AXIS["); + add_srs_wkt (p, 12, "\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2134, "epsg", 2134, + "NZGD2000 / UTM zone 59S"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / UTM zone 59S\",GEOGCS[\"NZGD2000\",D"); + add_srs_wkt (p, 1, + "ATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",171],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"2134\"],AXIS["); + add_srs_wkt (p, 12, "\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2135, "epsg", 2135, + "NZGD2000 / UTM zone 60S"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / UTM zone 60S\",GEOGCS[\"NZGD2000\",D"); + add_srs_wkt (p, 1, + "ATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",177],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"2135\"],AXIS["); + add_srs_wkt (p, 12, "\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2136, "epsg", 2136, + "Accra / Ghana National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.666666666666667 +lon_0=-1 +k=0.9997"); + add_proj4text (p, 1, + "5 +x_0=274319.7391633579 +y_0=0 +a=6378300 +b=6356751.68"); + add_proj4text (p, 2, "9189189 +to_meter=0.3047997101815088 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Accra / Ghana National Grid\",GEOGCS[\"Accra\","); + add_srs_wkt (p, 1, + "DATUM[\"Accra\",SPHEROID[\"War Office\",6378300,296,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7029\"]],AUTHORITY[\"EPSG\",\"6168\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, + "22\"]],AUTHORITY[\"EPSG\",\"4168\"]],UNIT[\"Gold Coast f"); + add_srs_wkt (p, 6, + "oot\",0.3047997101815088,AUTHORITY[\"EPSG\",\"9094\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 8, + "of_origin\",4.666666666666667],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",-1],PARAMETER[\"scale_factor\",0.99975],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",900000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"2136\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_01 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 2137, "epsg", 2137, "Accra / TM 1 NW"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-1 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=0 +a=6378300 +b=6356751.689189189 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Accra / TM 1 NW\",GEOGCS[\"Accra\",DATUM[\"Accr"); + add_srs_wkt (p, 1, + "a\",SPHEROID[\"War Office\",6378300,296,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 2, + "\",\"7029\"]],AUTHORITY[\"EPSG\",\"6168\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 3, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"4168\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 7, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 8, + "dian\",-1],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 9, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 10, + "],AUTHORITY[\"EPSG\",\"2137\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 11, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2138, "epsg", 2138, + "NAD27(CGQ77) / Quebec Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_"); + add_proj4text (p, 1, "0=0 +y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27(CGQ77) / Quebec Lambert\",GEOGCS[\"NAD27("); + add_srs_wkt (p, 1, + "CGQ77)\",DATUM[\"North_American_Datum_1927_CGQ77\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6609\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4609\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",60],PARAME"); + add_srs_wkt (p, 9, + "TER[\"standard_parallel_2\",46],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",44],PARAMETER[\"central_meridian\",-68.5],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",0],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"2138\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 2139, "epsg", 2139, + "NAD83(CSRS98) / SCoPQ zone 2 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / SCoPQ zone 2 (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-55.5],"); + add_srs_wkt (p, 10, + "PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",304800],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"2139\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2140, "epsg", 2140, + "NAD83(CSRS98) / MTM zone 3 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / MTM zone 3 (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "9433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-58.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2140\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 2141, "epsg", 2141, + "NAD83(CSRS98) / MTM zone 4 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / MTM zone 4 (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "9433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-61.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2141\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 2142, "epsg", 2142, + "NAD83(CSRS98) / MTM zone 5 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / MTM zone 5 (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "9433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-64.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2142\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 2143, "epsg", 2143, + "NAD83(CSRS98) / MTM zone 6 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / MTM zone 6 (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "9433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-67.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2143\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 2144, "epsg", 2144, + "NAD83(CSRS98) / MTM zone 7 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / MTM zone 7 (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "9433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-70.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2144\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 2145, "epsg", 2145, + "NAD83(CSRS98) / MTM zone 8 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / MTM zone 8 (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "9433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-73.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2145\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 2146, "epsg", 2146, + "NAD83(CSRS98) / MTM zone 9 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / MTM zone 9 (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "9433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-76.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2146\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 2147, "epsg", 2147, + "NAD83(CSRS98) / MTM zone 10 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / MTM zone 10 (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "99433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-79.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2147\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 2148, "epsg", 2148, + "NAD83(CSRS98) / UTM zone 21N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / UTM zone 21N (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-57],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2148\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 2149, "epsg", 2149, + "NAD83(CSRS98) / UTM zone 18N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / UTM zone 18N (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-75],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2149\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 2150, "epsg", 2150, + "NAD83(CSRS98) / UTM zone 17N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / UTM zone 17N (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-81],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2150\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 2151, "epsg", 2151, + "NAD83(CSRS98) / UTM zone 13N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / UTM zone 13N (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-105],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2151\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 13, "g\",NORTH]]"); + p = add_epsg_def (first, last, 2152, "epsg", 2152, + "NAD83(CSRS98) / UTM zone 12N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / UTM zone 12N (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-111],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2152\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 13, "g\",NORTH]]"); + p = add_epsg_def (first, last, 2153, "epsg", 2153, + "NAD83(CSRS98) / UTM zone 11N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / UTM zone 11N (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4140\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-117],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2153\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 13, "g\",NORTH]]"); + p = add_epsg_def (first, last, 2154, "epsg", 2154, "RGF93 / Lambert-93"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0="); + add_proj4text (p, 1, + "700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGF93 / Lambert-93\",GEOGCS[\"RGF93\",DATUM[\"R"); + add_srs_wkt (p, 1, + "eseau_Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS"); + add_srs_wkt (p, 3, + "84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",49],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",44],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 10, + "\",46.5],PARAMETER[\"central_meridian\",3],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",700000],PARAMETER[\"false_northing\",6600"); + add_srs_wkt (p, 12, + "000],AUTHORITY[\"EPSG\",\"2154\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2155, "epsg", 2155, + "American Samoa 1962 / American Samoa Lambert (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.266666666"); + add_proj4text (p, 1, + "66667 +lon_0=170 +k_0=1 +x_0=152400.3048006096 +y_0=0 +e"); + add_proj4text (p, 2, + "llps=clrk66 +towgs84=-115,118,426,0,0,0,0 +units=us-ft +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"American Samoa 1962 / American Samoa Lambert (d"); + add_srs_wkt (p, 1, + "eprecated)\",GEOGCS[\"American Samoa 1962\",DATUM[\"Amer"); + add_srs_wkt (p, 2, + "ican_Samoa_1962\",SPHEROID[\"Clarke 1866\",6378206.4,294"); + add_srs_wkt (p, 3, + ".9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],TOWGS84[-11"); + add_srs_wkt (p, 4, + "5,118,426,0,0,0,0],AUTHORITY[\"EPSG\",\"6169\"]],PRIMEM["); + add_srs_wkt (p, 5, + "\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"deg"); + add_srs_wkt (p, 6, + "ree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"4169\"]],UNIT[\"US survey foot\",0."); + add_srs_wkt (p, 8, + "3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTIO"); + add_srs_wkt (p, 9, + "N[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 10, + "of_origin\",-14.26666666666667],PARAMETER[\"central_meri"); + add_srs_wkt (p, 11, + "dian\",170],PARAMETER[\"scale_factor\",1],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_easting\",500000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 13, + "THORITY[\"EPSG\",\"2155\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 14, "ORTH]]"); + p = add_epsg_def (first, last, 2156, "epsg", 2156, + "NAD83(HARN) / UTM zone 59S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +south +ellps=GRS80 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 59S (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_N"); + add_srs_wkt (p, 2, + "etwork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",171],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"2156\"],AXIS["); + add_srs_wkt (p, 12, "\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2157, "epsg", 2157, + "IRENET95 / Irish Transverse Mercator"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=0.99982 +x_0=600000"); + add_proj4text (p, 1, + " +y_0=750000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IRENET95 / Irish Transverse Mercator\",GEOGCS[\""); + add_srs_wkt (p, 1, + "IRENET95\",DATUM[\"IRENET95\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 3, + "0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6173\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4173\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",53.5],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-8],PARAMETER[\"scale_factor\",0.99982],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",600000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",750000],AUTHORITY[\"EPSG\",\"2157\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2158, "epsg", 2158, + "IRENET95 / UTM zone 29N"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IRENET95 / UTM zone 29N\",GEOGCS[\"IRENET95\",D"); + add_srs_wkt (p, 1, + "ATUM[\"IRENET95\",SPHEROID[\"GRS 1980\",6378137,298.2572"); + add_srs_wkt (p, 2, + "22101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,"); + add_srs_wkt (p, 3, + "0],AUTHORITY[\"EPSG\",\"6173\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4173\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",-9],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"2158\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 2159, "epsg", 2159, + "Sierra Leone 1924 / New Colony Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=6.666666666666667 +lon_0=-12 +k=1 +x_"); + add_proj4text (p, 1, + "0=152399.8550907544 +y_0=0 +a=6378300 +b=6356751.6891891"); + add_proj4text (p, 2, "89 +to_meter=0.3047997101815088 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Sierra Leone 1924 / New Colony Grid\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Sierra Leone 1924\",DATUM[\"Sierra_Leone_Colony_1924\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"War Office\",6378300,296,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7029\"]],AUTHORITY[\"EPSG\",\"6174\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4174\"]],UNIT[\"Gold Coast foot\",0.304799710"); + add_srs_wkt (p, 7, + "1815088,AUTHORITY[\"EPSG\",\"9094\"]],PROJECTION[\"Trans"); + add_srs_wkt (p, 8, + "verse_Mercator\"],PARAMETER[\"latitude_of_origin\",6.666"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"central_meridian\",-12],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "2159\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 2160, "epsg", 2160, + "Sierra Leone 1924 / New War Office Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=6.666666666666667 +lon_0=-12 +k=1 +x_"); + add_proj4text (p, 1, + "0=243839.7681452071 +y_0=182879.8261089053 +a=6378300 +b"); + add_proj4text (p, 2, + "=6356751.689189189 +to_meter=0.3047997101815088 +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"Sierra Leone 1924 / New War Office Grid\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Sierra Leone 1924\",DATUM[\"Sierra_Leone_Colony_1924"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"War Office\",6378300,296,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7029\"]],AUTHORITY[\"EPSG\",\"6174\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4174\"]],UNIT[\"Gold Coast foot\",0.304799"); + add_srs_wkt (p, 7, + "7101815088,AUTHORITY[\"EPSG\",\"9094\"]],PROJECTION[\"Tr"); + add_srs_wkt (p, 8, + "ansverse_Mercator\"],PARAMETER[\"latitude_of_origin\",6."); + add_srs_wkt (p, 9, + "666666666666667],PARAMETER[\"central_meridian\",-12],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",8"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",600000],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"2160\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 2161, "epsg", 2161, + "Sierra Leone 1968 / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +ellps=clrk80 +towgs84=-88,4,101,0,0,"); + add_proj4text (p, 1, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Sierra Leone 1968 / UTM zone 28N\",GEOGCS[\"Sie"); + add_srs_wkt (p, 1, + "rra Leone 1968\",DATUM[\"Sierra_Leone_1968\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7012\"]],TOWGS84[-88,4,101,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"6175\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4175\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",-15],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2161\""); + add_srs_wkt (p, 12, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2162, "epsg", 2162, + "Sierra Leone 1968 / UTM zone 29N"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +ellps=clrk80 +towgs84=-88,4,101,0,0,"); + add_proj4text (p, 1, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Sierra Leone 1968 / UTM zone 29N\",GEOGCS[\"Sie"); + add_srs_wkt (p, 1, + "rra Leone 1968\",DATUM[\"Sierra_Leone_1968\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7012\"]],TOWGS84[-88,4,101,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"6175\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4175\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9996],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2162\""); + add_srs_wkt (p, 12, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2163, "epsg", 2163, "unnamed"); + add_proj4text (p, 0, + "+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=637099"); + add_proj4text (p, 1, "7 +b=6370997 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"unnamed\",GEOGCS[\"unnamed ellipse\",DATUM[\"un"); + add_srs_wkt (p, 1, + "known\",SPHEROID[\"unnamed\",6370997,0]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 2, + "ich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION"); + add_srs_wkt (p, 3, + "[\"Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 4, + "of_center\",45],PARAMETER[\"longitude_of_center\",-100],"); + add_srs_wkt (p, 5, + "PARAMETER[\"false_easting\",0],PARAMETER[\"false_northin"); + add_srs_wkt (p, 6, + "g\",0],UNIT[\"Meter\",1],AUTHORITY[\"EPSG\",\"2163\"]]"); + p = add_epsg_def (first, last, 2164, "epsg", 2164, + "Locodjo 1965 / TM 5 NW"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-5 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=0 +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Locodjo 1965 / TM 5 NW\",GEOGCS[\"Locodjo 1965\""); + add_srs_wkt (p, 1, + ",DATUM[\"Locodjo_1965\",SPHEROID[\"Clarke 1880 (RGS)\",6"); + add_srs_wkt (p, 2, + "378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[-125,53,467,0,0,0,0],AUTHORITY[\"EPSG\",\"6142\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4142\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",-5],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 11, + "hing\",0],AUTHORITY[\"EPSG\",\"2164\"],AXIS[\"Easting\","); + add_srs_wkt (p, 12, "EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2165, "epsg", 2165, + "Abidjan 1987 / TM 5 NW"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-5 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=0 +ellps=clrk80 +towgs84=-124.76,53,466.79,0,0,0,0 +un"); + add_proj4text (p, 2, "its=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Abidjan 1987 / TM 5 NW\",GEOGCS[\"Abidjan 1987\""); + add_srs_wkt (p, 1, + ",DATUM[\"Abidjan_1987\",SPHEROID[\"Clarke 1880 (RGS)\",6"); + add_srs_wkt (p, 2, + "378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[-124.76,53,466.79,0,0,0,0],AUTHORITY[\"EPSG\",\"6143\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4143\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-5],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"2165\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2166, "epsg", 2166, + "Pulkovo 1942(83) / Gauss Kruger zone 3 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / Gauss Kruger zone 3 (depreca"); + add_srs_wkt (p, 1, + "ted)\",GEOGCS[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_"); + add_srs_wkt (p, 2, + "83\",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",9],PARAMETER[\"scale_factor\",1],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",3500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2166\"],AXIS[\"X\",NORTH],AXIS["); + add_srs_wkt (p, 12, "\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2167, "epsg", 2167, + "Pulkovo 1942(83) / Gauss Kruger zone 4 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / Gauss Kruger zone 4 (depreca"); + add_srs_wkt (p, 1, + "ted)\",GEOGCS[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_"); + add_srs_wkt (p, 2, + "83\",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",12],PARAMETER[\"scale_factor\",1],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",4500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"2167\"],AXIS[\"X\",NORTH],AXI"); + add_srs_wkt (p, 12, "S[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2168, "epsg", 2168, + "Pulkovo 1942(83) / Gauss Kruger zone 5 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / Gauss Kruger zone 5 (depreca"); + add_srs_wkt (p, 1, + "ted)\",GEOGCS[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_"); + add_srs_wkt (p, 2, + "83\",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",15],PARAMETER[\"scale_factor\",1],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",5500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"2168\"],AXIS[\"X\",NORTH],AXI"); + add_srs_wkt (p, 12, "S[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2169, "epsg", 2169, + "Luxembourg 1930 / Gauss"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=49.83333333333334 +lon_0=6.1666666666"); + add_proj4text (p, 1, + "66667 +k=1 +x_0=80000 +y_0=100000 +ellps=intl +towgs84=-"); + add_proj4text (p, 2, + "193,13.7,-39.3,-0.41,-2.933,2.688,0.43 +units=m +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"Luxembourg 1930 / Gauss\",GEOGCS[\"Luxembourg 1"); + add_srs_wkt (p, 1, + "930\",DATUM[\"Luxembourg_1930\",SPHEROID[\"International"); + add_srs_wkt (p, 2, + " 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS8"); + add_srs_wkt (p, 3, + "4[-193,13.7,-39.3,-0.41,-2.933,2.688,0.43],AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"6181\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4181\"]],UN"); + add_srs_wkt (p, 7, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",49.83333333333334],PARAMETER[\"central_meridian\",6.166"); + add_srs_wkt (p, 10, + "666666666667],PARAMETER[\"scale_factor\",1],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",80000],PARAMETER[\"false_northing\",1000"); + add_srs_wkt (p, 12, + "00],AUTHORITY[\"EPSG\",\"2169\"],AXIS[\"X\",NORTH],AXIS["); + add_srs_wkt (p, 13, "\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2170, "epsg", 2170, + "MGI / Slovenia Grid (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=0 +ellps=bessel +datum=hermannskogel +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Slovenia Grid (deprecated)\",GEOGCS[\"MGI"); + add_srs_wkt (p, 1, + "\",DATUM[\"Militar_Geographische_Institute\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137,1.474,5"); + add_srs_wkt (p, 4, + ".297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 5, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 6, + "0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",15],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"2170\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",EAST]]"); + p = add_epsg_def (first, last, 2171, "epsg", 2171, + "Pulkovo 1942(58) / Poland zone I (deprecated)"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=50.625 +lon_0=21.08333333333333 +k=0"); + add_proj4text (p, 1, + ".9998 +x_0=4637000 +y_0=5647000 +ellps=krass +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Poland zone I (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Oblique_Stereographic\"],"); + add_srs_wkt (p, 8, + "PARAMETER[\"latitude_of_origin\",50.625],PARAMETER[\"cen"); + add_srs_wkt (p, 9, + "tral_meridian\",21.08333333333333],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 10, + "tor\",0.9998],PARAMETER[\"false_easting\",4637000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",5647000],AUTHORITY[\"EPSG\",\"21"); + add_srs_wkt (p, 12, "71\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2172, "epsg", 2172, + "Pulkovo 1942(58) / Poland zone II"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=53.00194444444445 +lon_0=21.50277777"); + add_proj4text (p, 1, + "777778 +k=0.9998 +x_0=4603000 +y_0=5806000 +ellps=krass "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Poland zone II\",GEOGCS[\"Pu"); + add_srs_wkt (p, 1, + "lkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID[\"Kr"); + add_srs_wkt (p, 2, + "assowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Oblique_Stereographic\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",53.00194444444445],PARAMETER[\"centr"); + add_srs_wkt (p, 9, + "al_meridian\",21.50277777777778],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 10, + "r\",0.9998],PARAMETER[\"false_easting\",4603000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",5806000],AUTHORITY[\"EPSG\",\"2172"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2173, "epsg", 2173, + "Pulkovo 1942(58) / Poland zone III"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=53.58333333333334 +lon_0=17.00833333"); + add_proj4text (p, 1, + "333333 +k=0.9998 +x_0=3501000 +y_0=5999000 +ellps=krass "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Poland zone III\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID[\"K"); + add_srs_wkt (p, 2, + "rassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Oblique_Stereographic\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",53.58333333333334],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",17.00833333333333],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.9998],PARAMETER[\"false_easting\",3501000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",5999000],AUTHORITY[\"EPSG\",\"217"); + add_srs_wkt (p, 12, "3\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2174, "epsg", 2174, + "Pulkovo 1942(58) / Poland zone IV"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=51.67083333333333 +lon_0=16.67222222"); + add_proj4text (p, 1, + "222222 +k=0.9998 +x_0=3703000 +y_0=5627000 +ellps=krass "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Poland zone IV\",GEOGCS[\"Pu"); + add_srs_wkt (p, 1, + "lkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID[\"Kr"); + add_srs_wkt (p, 2, + "assowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Oblique_Stereographic\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",51.67083333333333],PARAMETER[\"centr"); + add_srs_wkt (p, 9, + "al_meridian\",16.67222222222222],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 10, + "r\",0.9998],PARAMETER[\"false_easting\",3703000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",5627000],AUTHORITY[\"EPSG\",\"2174"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2175, "epsg", 2175, + "Pulkovo 1942(58) / Poland zone V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18.95833333333333 +k=0.99998"); + add_proj4text (p, 1, + "3 +x_0=237000 +y_0=-4700000 +ellps=krass +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Poland zone V\",GEOGCS[\"Pul"); + add_srs_wkt (p, 1, + "kovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID[\"Kra"); + add_srs_wkt (p, 2, + "ssowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",18.9"); + add_srs_wkt (p, 9, + "5833333333333],PARAMETER[\"scale_factor\",0.999983],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",237000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",-4700000],AUTHORITY[\"EPSG\",\"2175\"],AXIS[\"X\",N"); + add_srs_wkt (p, 12, "ORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2176, "epsg", 2176, + "ETRS89 / Poland CS2000 zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.999923 +x_0=5500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Poland CS2000 zone 5\",GEOGCS[\"ETRS89"); + add_srs_wkt (p, 1, + "\",DATUM[\"European_Terrestrial_Reference_System_1989\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",15],PARAMETER[\"scale_factor\",0.999923],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",5500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",0],AUTHORITY[\"EPSG\",\"2176\"],AXIS[\"x\",NORTH],AX"); + add_srs_wkt (p, 12, "IS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 2177, "epsg", 2177, + "ETRS89 / Poland CS2000 zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=0.999923 +x_0=6500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Poland CS2000 zone 6\",GEOGCS[\"ETRS89"); + add_srs_wkt (p, 1, + "\",DATUM[\"European_Terrestrial_Reference_System_1989\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",18],PARAMETER[\"scale_factor\",0.999923],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",6500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",0],AUTHORITY[\"EPSG\",\"2177\"],AXIS[\"x\",NORTH],AX"); + add_srs_wkt (p, 12, "IS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 2178, "epsg", 2178, + "ETRS89 / Poland CS2000 zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.999923 +x_0=7500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Poland CS2000 zone 7\",GEOGCS[\"ETRS89"); + add_srs_wkt (p, 1, + "\",DATUM[\"European_Terrestrial_Reference_System_1989\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",21],PARAMETER[\"scale_factor\",0.999923],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",7500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",0],AUTHORITY[\"EPSG\",\"2178\"],AXIS[\"x\",NORTH],AX"); + add_srs_wkt (p, 12, "IS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 2179, "epsg", 2179, + "ETRS89 / Poland CS2000 zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.999923 +x_0=8500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Poland CS2000 zone 8\",GEOGCS[\"ETRS89"); + add_srs_wkt (p, 1, + "\",DATUM[\"European_Terrestrial_Reference_System_1989\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",24],PARAMETER[\"scale_factor\",0.999923],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",8500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",0],AUTHORITY[\"EPSG\",\"2179\"],AXIS[\"x\",NORTH],AX"); + add_srs_wkt (p, 12, "IS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 2180, "epsg", 2180, "ETRS89 / Poland CS92"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=19 +k=0.9993 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=-5300000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Poland CS92\",GEOGCS[\"ETRS89\",DATUM["); + add_srs_wkt (p, 1, + "\"European_Terrestrial_Reference_System_1989\",SPHEROID["); + add_srs_wkt (p, 2, + "\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",19],PARAMETER[\"scale_factor\",0.9993],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",-530000"); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"2180\"],AXIS[\"x\",NORTH],AXIS[\""); + add_srs_wkt (p, 12, "y\",EAST]]"); + p = add_epsg_def (first, last, 2188, "epsg", 2188, + "Azores Occidental 1939 / UTM zone 25N"); + add_proj4text (p, 0, "+proj=utm +zone=25 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Azores Occidental 1939 / UTM zone 25N\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Azores Occidental 1939\",DATUM[\"Azores_Occidental_Isl"); + add_srs_wkt (p, 2, + "ands_1939\",SPHEROID[\"International 1924\",6378388,297,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6182\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4182\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-33],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"2188\"],AXIS[\"Eas"); + add_srs_wkt (p, 12, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2189, "epsg", 2189, + "Azores Central 1948 / UTM zone 26N"); + add_proj4text (p, 0, + "+proj=utm +zone=26 +ellps=intl +towgs84=-104,167,-38,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Azores Central 1948 / UTM zone 26N\",GEOGCS[\"A"); + add_srs_wkt (p, 1, + "zores Central 1948\",DATUM[\"Azores_Central_Islands_1948"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7022\"]],TOWGS84[-104,167,-38,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6183\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"418"); + add_srs_wkt (p, 7, + "3\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",-27],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, + "\",\"2189\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NO"); + add_srs_wkt (p, 13, "RTH]]"); + p = add_epsg_def (first, last, 2190, "epsg", 2190, + "Azores Oriental 1940 / UTM zone 26N"); + add_proj4text (p, 0, + "+proj=utm +zone=26 +ellps=intl +towgs84=-203,141,53,0,0,"); + add_proj4text (p, 1, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Azores Oriental 1940 / UTM zone 26N\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Azores Oriental 1940\",DATUM[\"Azores_Oriental_Islands_1"); + add_srs_wkt (p, 2, + "940\",SPHEROID[\"International 1924\",6378388,297,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7022\"]],TOWGS84[-203,141,53,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6184\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "184\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-27],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"2190\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 2191, "epsg", 2191, + "Madeira 1936 / UTM zone 28N (deprecated)"); + add_proj4text (p, 0, "+proj=utm +zone=28 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Madeira 1936 / UTM zone 28N (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Madeira 1936\",DATUM[\"Madeira_1936\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6185\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "2925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"4185\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 7, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 8, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-15"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"2191\"],AXIS[\"Easting\",EAST],AXIS[\"Nort"); + add_srs_wkt (p, 12, "hing\",NORTH]]"); + p = add_epsg_def (first, last, 2192, "epsg", 2192, + "ED50 / France EuroLambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.3372291666666"); + add_proj4text (p, 1, + "67 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +ellps=intl "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / France EuroLambert\",GEOGCS[\"ED50\",DAT"); + add_srs_wkt (p, 1, + "UM[\"European_Datum_1950\",SPHEROID[\"International 1924"); + add_srs_wkt (p, 2, + "\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 8, + "f_origin\",46.8],PARAMETER[\"central_meridian\",2.337229"); + add_srs_wkt (p, 9, + "166666667],PARAMETER[\"scale_factor\",0.99987742],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",600000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",2200000],AUTHORITY[\"EPSG\",\"2192\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2193, "epsg", 2193, + "NZGD2000 / New Zealand Transverse Mercator 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=173 +k=0.9996 +x_0=1600000 +"); + add_proj4text (p, 1, + "y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / New Zealand Transverse Mercator 2000"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"NZGD2000\",DATUM[\"New_Zealand_Geodetic_Datu"); + add_srs_wkt (p, 2, + "m_2000\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"6167\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4167"); + add_srs_wkt (p, 7, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 9, + "origin\",0],PARAMETER[\"central_meridian\",173],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",1"); + add_srs_wkt (p, 11, + "600000],PARAMETER[\"false_northing\",10000000],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"2193\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 13, "ing\",EAST]]"); + p = add_epsg_def (first, last, 2194, "epsg", 2194, + "American Samoa 1962 / American Samoa Lambert (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.266666666"); + add_proj4text (p, 1, + "66667 +lon_0=-170 +k_0=1 +x_0=152400.3048006096 +y_0=0 +"); + add_proj4text (p, 2, + "ellps=clrk66 +towgs84=-115,118,426,0,0,0,0 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"American Samoa 1962 / American Samoa Lambert (d"); + add_srs_wkt (p, 1, + "eprecated)\",GEOGCS[\"American Samoa 1962\",DATUM[\"Amer"); + add_srs_wkt (p, 2, + "ican_Samoa_1962\",SPHEROID[\"Clarke 1866\",6378206.4,294"); + add_srs_wkt (p, 3, + ".9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],TOWGS84[-11"); + add_srs_wkt (p, 4, + "5,118,426,0,0,0,0],AUTHORITY[\"EPSG\",\"6169\"]],PRIMEM["); + add_srs_wkt (p, 5, + "\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"deg"); + add_srs_wkt (p, 6, + "ree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"4169\"]],UNIT[\"US survey foot\",0."); + add_srs_wkt (p, 8, + "3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTIO"); + add_srs_wkt (p, 9, + "N[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 10, + "of_origin\",-14.26666666666667],PARAMETER[\"central_meri"); + add_srs_wkt (p, 11, + "dian\",-170],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_easting\",500000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 13, + "UTHORITY[\"EPSG\",\"2194\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 14, "NORTH]]"); + p = add_epsg_def (first, last, 2195, "epsg", 2195, + "NAD83(HARN) / UTM zone 2S"); + add_proj4text (p, 0, + "+proj=utm +zone=2 +south +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 2S\",GEOGCS[\"NAD83(HARN"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-171],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",1"); + add_srs_wkt (p, 11, + "0000000],AUTHORITY[\"EPSG\",\"2195\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2196, "epsg", 2196, + "ETRS89 / Kp2000 Jutland"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9.5 +k=0.99995 +x_0=200000 +"); + add_proj4text (p, 1, "y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Kp2000 Jutland\",GEOGCS[\"ETRS89\",DAT"); + add_srs_wkt (p, 1, + "UM[\"European_Terrestrial_Reference_System_1989\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",9.5],PARAMETER[\"scale_factor\",0.99995],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",200000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"2196\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2197, "epsg", 2197, + "ETRS89 / Kp2000 Zealand"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.99995 +x_0=500000 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Kp2000 Zealand\",GEOGCS[\"ETRS89\",DAT"); + add_srs_wkt (p, 1, + "UM[\"European_Terrestrial_Reference_System_1989\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",12],PARAMETER[\"scale_factor\",0.99995],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2197\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2198, "epsg", 2198, + "ETRS89 / Kp2000 Bornholm"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=900000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Kp2000 Bornholm\",GEOGCS[\"ETRS89\",DA"); + add_srs_wkt (p, 1, + "TUM[\"European_Terrestrial_Reference_System_1989\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",15],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",900000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"2198\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 2199, "epsg", 2199, + "Albanian 1987 / Gauss Kruger zone 4 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Albanian 1987 / Gauss Kruger zone 4 (deprecated"); + add_srs_wkt (p, 1, + ")\",GEOGCS[\"Albanian 1987\",DATUM[\"Albanian_1987\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7024\"]],AUTHORITY[\"EPSG\",\"6191\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4191\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",21],PARAMETER[\"scale_factor\",1],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_easting\",4500000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 11, + "THORITY[\"EPSG\",\"2199\"],AXIS[\"X\",NORTH],AXIS[\"Y\","); + add_srs_wkt (p, 12, "EAST]]"); + p = add_epsg_def (first, last, 2200, "epsg", 2200, + "ATS77 / New Brunswick Stereographic (ATS77)"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=3"); + add_proj4text (p, 1, + "00000 +y_0=800000 +a=6378135 +b=6356750.304921594 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ATS77 / New Brunswick Stereographic (ATS77)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"ATS77\",DATUM[\"Average_Terrestrial_System_1977\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Average Terrestrial System 1977\",6378135,29"); + add_srs_wkt (p, 3, + "8.257,AUTHORITY[\"EPSG\",\"7041\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6122\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4122\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Obliqu"); + add_srs_wkt (p, 8, + "e_Stereographic\"],PARAMETER[\"latitude_of_origin\",46.5"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-66.5],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",0.999912],PARAMETER[\"false_easting\",300000]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_northing\",800000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"2200\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAS"); + add_srs_wkt (p, 13, "T]]"); + p = add_epsg_def (first, last, 2201, "epsg", 2201, "REGVEN / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"REGVEN / UTM zone 18N\",GEOGCS[\"REGVEN\",DATUM"); + add_srs_wkt (p, 1, + "[\"Red_Geodesica_Venezolana\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 3, + "0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6189\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4189\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-75],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"2201\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2202, "epsg", 2202, "REGVEN / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"REGVEN / UTM zone 19N\",GEOGCS[\"REGVEN\",DATUM"); + add_srs_wkt (p, 1, + "[\"Red_Geodesica_Venezolana\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 3, + "0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6189\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4189\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-69],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"2202\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2203, "epsg", 2203, "REGVEN / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"REGVEN / UTM zone 20N\",GEOGCS[\"REGVEN\",DATUM"); + add_srs_wkt (p, 1, + "[\"Red_Geodesica_Venezolana\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 3, + "0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6189\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4189\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-63],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"2203\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2204, "epsg", 2204, "NAD27 / Tennessee"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.25 +lat_2=36.41666666666666 +lat_0=3"); + add_proj4text (p, 1, + "4.66666666666666 +lon_0=-86 +x_0=609601.2192024384 +y_0="); + add_proj4text (p, 2, + "30480.06096012192 +ellps=clrk66 +datum=NAD27 +units=us-f"); + add_proj4text (p, 3, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Tennessee\",GEOGCS[\"NAD27\",DATUM[\"No"); + add_srs_wkt (p, 1, + "rth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",63782"); + add_srs_wkt (p, 2, + "06.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_"); + add_srs_wkt (p, 8, + "Conic_2SP\"],PARAMETER[\"standard_parallel_1\",35.25],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"standard_parallel_2\",36.41666666666666],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"latitude_of_origin\",34.66666666666666],PARAMETER"); + add_srs_wkt (p, 11, + "[\"central_meridian\",-86],PARAMETER[\"false_easting\",2"); + add_srs_wkt (p, 12, + "000000],PARAMETER[\"false_northing\",100000],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"2204\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2205, "epsg", 2205, + "NAD83 / Kentucky North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps="); + add_proj4text (p, 2, "GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kentucky North\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",37.96666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",38.96666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",37.5],PARAMETER[\"central_meridian\",-84.25],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",0],AUTHORITY[\"EPSG\",\"2205\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2206, "epsg", 2206, + "ED50 / 3-degree Gauss-Kruger zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / 3-degree Gauss-Kruger zone 9\",GEOGCS[\""); + add_srs_wkt (p, 1, + "ED50\",DATUM[\"European_Datum_1950\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4230\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",27],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",950"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"2206\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2207, "epsg", 2207, + "ED50 / 3-degree Gauss-Kruger zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / 3-degree Gauss-Kruger zone 10\",GEOGCS[\""); + add_srs_wkt (p, 1, + "ED50\",DATUM[\"European_Datum_1950\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4230\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",30],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",105"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"2207\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2208, "epsg", 2208, + "ED50 / 3-degree Gauss-Kruger zone 11"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / 3-degree Gauss-Kruger zone 11\",GEOGCS[\""); + add_srs_wkt (p, 1, + "ED50\",DATUM[\"European_Datum_1950\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4230\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",33],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",115"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"2208\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2209, "epsg", 2209, + "ED50 / 3-degree Gauss-Kruger zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / 3-degree Gauss-Kruger zone 12\",GEOGCS[\""); + add_srs_wkt (p, 1, + "ED50\",DATUM[\"European_Datum_1950\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4230\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",36],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",125"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"2209\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2210, "epsg", 2210, + "ED50 / 3-degree Gauss-Kruger zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / 3-degree Gauss-Kruger zone 13\",GEOGCS[\""); + add_srs_wkt (p, 1, + "ED50\",DATUM[\"European_Datum_1950\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4230\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",39],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",135"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"2210\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2211, "epsg", 2211, + "ED50 / 3-degree Gauss-Kruger zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=14500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / 3-degree Gauss-Kruger zone 14\",GEOGCS[\""); + add_srs_wkt (p, 1, + "ED50\",DATUM[\"European_Datum_1950\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4230\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",42],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",145"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"2211\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2212, "epsg", 2212, + "ED50 / 3-degree Gauss-Kruger zone 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=15500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / 3-degree Gauss-Kruger zone 15\",GEOGCS[\""); + add_srs_wkt (p, 1, + "ED50\",DATUM[\"European_Datum_1950\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4230\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",45],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",155"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"2212\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2213, "epsg", 2213, "ETRS89 / TM 30 NE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / TM 30 NE\",GEOGCS[\"ETRS89\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Terrestrial_Reference_System_1989\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",3"); + add_srs_wkt (p, 9, + "0],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"2213\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 12, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 2214, "epsg", 2214, + "Douala 1948 / AOF west (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=10.5 +k=0.999 +x_0=1000000 +"); + add_proj4text (p, 1, + "y_0=1000000 +ellps=intl +towgs84=-206.1,-174.7,-87.7,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Douala 1948 / AOF west (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Douala 1948\",DATUM[\"Douala_1948\",SPHEROID[\"Internati"); + add_srs_wkt (p, 2, + "onal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[-206.1,-174.7,-87.7,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6192\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4192\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",10.5],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.999],PARAMETER[\"false_easting\",1000000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",1000000],AUTHORITY[\"EPSG\",\"2214"); + add_srs_wkt (p, 12, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2215, "epsg", 2215, + "Manoca 1962 / UTM zone 32N"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +a=6378249.2 +b=6356515 +towgs84=-70."); + add_proj4text (p, 1, "9,-151.8,-41.4,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Manoca 1962 / UTM zone 32N\",GEOGCS[\"Manoca 19"); + add_srs_wkt (p, 1, + "62\",DATUM[\"Manoca_1962\",SPHEROID[\"Clarke 1880 (IGN)\""); + add_srs_wkt (p, 2, + ",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\""); + add_srs_wkt (p, 3, + "]],TOWGS84[-70.9,-151.8,-41.4,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6193\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4193\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",9],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 10, + "r\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2215\"],AXI"); + add_srs_wkt (p, 12, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2216, "epsg", 2216, + "Qornoq 1927 / UTM zone 22N"); + add_proj4text (p, 0, "+proj=utm +zone=22 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Qornoq 1927 / UTM zone 22N\",GEOGCS[\"Qornoq 19"); + add_srs_wkt (p, 1, + "27\",DATUM[\"Qornoq_1927\",SPHEROID[\"International 1924"); + add_srs_wkt (p, 2, + "\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6194\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4194\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-51],PARAMETER[\"sc"); + add_srs_wkt (p, 9, + "ale_factor\",0.9996],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"22"); + add_srs_wkt (p, 11, + "16\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2217, "epsg", 2217, + "Qornoq 1927 / UTM zone 23N"); + add_proj4text (p, 0, "+proj=utm +zone=23 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Qornoq 1927 / UTM zone 23N\",GEOGCS[\"Qornoq 19"); + add_srs_wkt (p, 1, + "27\",DATUM[\"Qornoq_1927\",SPHEROID[\"International 1924"); + add_srs_wkt (p, 2, + "\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6194\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4194\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-45],PARAMETER[\"sc"); + add_srs_wkt (p, 9, + "ale_factor\",0.9996],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"22"); + add_srs_wkt (p, 11, + "17\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2219, "epsg", 2219, "ATS77 / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +a=6378135 +b=6356750.304921594 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ATS77 / UTM zone 19N\",GEOGCS[\"ATS77\",DATUM[\""); + add_srs_wkt (p, 1, + "Average_Terrestrial_System_1977\",SPHEROID[\"Average Ter"); + add_srs_wkt (p, 2, + "restrial System 1977\",6378135,298.257,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7041\"]],AUTHORITY[\"EPSG\",\"6122\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4122\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-69],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2219\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2220, "epsg", 2220, "ATS77 / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +a=6378135 +b=6356750.304921594 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ATS77 / UTM zone 20N\",GEOGCS[\"ATS77\",DATUM[\""); + add_srs_wkt (p, 1, + "Average_Terrestrial_System_1977\",SPHEROID[\"Average Ter"); + add_srs_wkt (p, 2, + "restrial System 1977\",6378135,298.257,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7041\"]],AUTHORITY[\"EPSG\",\"6122\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4122\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-63],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2220\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2222, "epsg", 2222, + "NAD83 / Arizona East (ft)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=ft"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Arizona East (ft)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",31],PARAMETER[\"central_meridian\",-110.1"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",700000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2222\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2223, "epsg", 2223, + "NAD83 / Arizona Central (ft)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=ft"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Arizona Central (ft)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",31],PARAMETER[\"central_meridian\",-111."); + add_srs_wkt (p, 9, + "9166666666667],PARAMETER[\"scale_factor\",0.9999],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",700000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"2223\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2224, "epsg", 2224, + "NAD83 / Arizona West (ft)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0"); + add_proj4text (p, 1, + "=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=ft +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Arizona West (ft)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",31],PARAMETER[\"central_meridian\",-113.7"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",0.999933333],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",700000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"2224\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 2225, "epsg", 2225, + "NAD83 / California zone 1 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.3"); + add_proj4text (p, 1, + "3333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=5000"); + add_proj4text (p, 2, + "00.0001016001 +ellps=GRS80 +datum=NAD83 +units=us-ft +no"); + add_proj4text (p, 3, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 1 (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41."); + add_srs_wkt (p, 9, + "66666666666666],PARAMETER[\"standard_parallel_2\",40],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",39.33333333333334],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-122],PARAMETER[\"false_easting"); + add_srs_wkt (p, 12, + "\",6561666.667],PARAMETER[\"false_northing\",1640416.667"); + add_srs_wkt (p, 13, + "],AUTHORITY[\"EPSG\",\"2225\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 14, "\",NORTH]]"); + p = add_epsg_def (first, last, 2226, "epsg", 2226, + "NAD83 / California zone 2 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.00"); + add_proj4text (p, 2, + "01016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD83 +"); + add_proj4text (p, 3, "units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 2 (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",39."); + add_srs_wkt (p, 9, + "83333333333334],PARAMETER[\"standard_parallel_2\",38.333"); + add_srs_wkt (p, 10, + "33333333334],PARAMETER[\"latitude_of_origin\",37.6666666"); + add_srs_wkt (p, 11, + "6666666],PARAMETER[\"central_meridian\",-122],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_easting\",6561666.667],PARAMETER[\"false_northin"); + add_srs_wkt (p, 13, + "g\",1640416.667],AUTHORITY[\"EPSG\",\"2226\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2227, "epsg", 2227, + "NAD83 / California zone 3 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0="); + add_proj4text (p, 2, + "500000.0001016001 +ellps=GRS80 +datum=NAD83 +units=us-ft"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 3 (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",38."); + add_srs_wkt (p, 9, + "43333333333333],PARAMETER[\"standard_parallel_2\",37.066"); + add_srs_wkt (p, 10, + "66666666667],PARAMETER[\"latitude_of_origin\",36.5],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-120.5],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",6561666.667],PARAMETER[\"false_northing\",1640416"); + add_srs_wkt (p, 13, + ".667],AUTHORITY[\"EPSG\",\"2227\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 14, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2228, "epsg", 2228, + "NAD83 / California zone 4 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.3333333333333"); + add_proj4text (p, 1, + "4 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.000101600"); + add_proj4text (p, 2, "1 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 4 (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",37."); + add_srs_wkt (p, 9, + "25],PARAMETER[\"standard_parallel_2\",36],PARAMETER[\"la"); + add_srs_wkt (p, 10, + "titude_of_origin\",35.33333333333334],PARAMETER[\"centra"); + add_srs_wkt (p, 11, + "l_meridian\",-119],PARAMETER[\"false_easting\",6561666.6"); + add_srs_wkt (p, 12, + "67],PARAMETER[\"false_northing\",1640416.667],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"2228\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2229, "epsg", 2229, + "NAD83 / California zone 5 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=50"); + add_proj4text (p, 2, + "0000.0001016001 +ellps=GRS80 +datum=NAD83 +units=us-ft +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 5 (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",35."); + add_srs_wkt (p, 9, + "46666666666667],PARAMETER[\"standard_parallel_2\",34.033"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"latitude_of_origin\",33.5],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-118],PARAMETER[\"false_easti"); + add_srs_wkt (p, 12, + "ng\",6561666.667],PARAMETER[\"false_northing\",1640416.6"); + add_srs_wkt (p, 13, + "67],AUTHORITY[\"EPSG\",\"2229\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2230, "epsg", 2230, + "NAD83 / California zone 6 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000"); + add_proj4text (p, 2, + ".0001016 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD8"); + add_proj4text (p, 3, "3 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 6 (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",33."); + add_srs_wkt (p, 9, + "88333333333333],PARAMETER[\"standard_parallel_2\",32.783"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"latitude_of_origin\",32.1666666"); + add_srs_wkt (p, 11, + "6666666],PARAMETER[\"central_meridian\",-116.25],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_easting\",6561666.667],PARAMETER[\"false_nort"); + add_srs_wkt (p, 13, + "hing\",1640416.667],AUTHORITY[\"EPSG\",\"2230\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2231, "epsg", 2231, + "NAD83 / Colorado North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, + "288036576 +y_0=304800.6096012192 +ellps=GRS80 +datum=NAD"); + add_proj4text (p, 3, "83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Colorado North (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",40.78333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",39.71666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",39.333333333333"); + add_srs_wkt (p, 11, + "34],PARAMETER[\"central_meridian\",-105.5],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_easting\",3000000],PARAMETER[\"false_northing\",100"); + add_srs_wkt (p, 13, + "0000],AUTHORITY[\"EPSG\",\"2231\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 14, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2232, "epsg", 2232, + "NAD83 / Colorado Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.8333333333"); + add_proj4text (p, 1, + "3334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.60"); + add_proj4text (p, 2, + "96012192 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Colorado Central (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",39.75"); + add_srs_wkt (p, 9, + "],PARAMETER[\"standard_parallel_2\",38.45],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",37.83333333333334],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-105.5],PARAMETER[\"false_easting\",300000"); + add_srs_wkt (p, 12, + "0],PARAMETER[\"false_northing\",1000000],AUTHORITY[\"EPS"); + add_srs_wkt (p, 13, "G\",\"2232\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2233, "epsg", 2233, + "NAD83 / Colorado South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, + "288036576 +y_0=304800.6096012192 +ellps=GRS80 +datum=NAD"); + add_proj4text (p, 3, "83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Colorado South (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",38.43333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",37.23333333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"latitude_of_origin\",36.666666666666"); + add_srs_wkt (p, 11, + "66],PARAMETER[\"central_meridian\",-105.5],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_easting\",3000000],PARAMETER[\"false_northing\",100"); + add_srs_wkt (p, 13, + "0000],AUTHORITY[\"EPSG\",\"2233\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 14, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2234, "epsg", 2234, + "NAD83 / Connecticut (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40"); + add_proj4text (p, 1, + ".83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_"); + add_proj4text (p, 2, + "0=152400.3048006096 +ellps=GRS80 +datum=NAD83 +units=us-"); + add_proj4text (p, 3, "ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Connecticut (ftUS)\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_"); + add_srs_wkt (p, 8, + "Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41.866666"); + add_srs_wkt (p, 9, + "66666667],PARAMETER[\"standard_parallel_2\",41.2],PARAME"); + add_srs_wkt (p, 10, + "TER[\"latitude_of_origin\",40.83333333333334],PARAMETER["); + add_srs_wkt (p, 11, + "\"central_meridian\",-72.75],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",1000000],PARAMETER[\"false_northing\",500000],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"2234\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2235, "epsg", 2235, + "NAD83 / Delaware (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999"); + add_proj4text (p, 1, + "995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NA"); + add_proj4text (p, 2, "D83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Delaware (ftUS)\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",38],PARAMETER[\"centr"); + add_srs_wkt (p, 9, + "al_meridian\",-75.41666666666667],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.999995],PARAMETER[\"false_easting\",656166.667],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2235"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2236, "epsg", 2236, + "NAD83 / Florida East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum"); + add_proj4text (p, 2, "=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Florida East (ftUS)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",24.33333333333333]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"central_meridian\",-81],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.999941177],PARAMETER[\"false_easting\",656166."); + add_srs_wkt (p, 11, + "667],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"2236\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2237, "epsg", 2237, + "NAD83 / Florida West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum"); + add_proj4text (p, 2, "=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Florida West (ftUS)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",24.33333333333333]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"central_meridian\",-82],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.999941177],PARAMETER[\"false_easting\",656166."); + add_srs_wkt (p, 11, + "667],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"2237\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2238, "epsg", 2238, + "NAD83 / Florida North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=2"); + add_proj4text (p, 1, + "9 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NA"); + add_proj4text (p, 2, "D83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Florida North (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",30.75],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"standard_parallel_2\",29.58333333333333],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",29],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-84.5],PARAMETER[\"false_easting\",1968500],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2238\"]"); + add_srs_wkt (p, 13, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2239, "epsg", 2239, + "NAD83 / Georgia East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +datum=NAD8"); + add_proj4text (p, 2, "3 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Georgia East (ftUS)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",30],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",-82.16666666666667],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",656166.667],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"223"); + add_srs_wkt (p, 12, "9\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2240, "epsg", 2240, + "NAD83 / Georgia West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +datum=NAD8"); + add_proj4text (p, 2, "3 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Georgia West (ftUS)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",30],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",-84.16666666666667],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",2296583.333]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"22"); + add_srs_wkt (p, 12, "40\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2241, "epsg", 2241, + "NAD83 / Idaho East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666"); + add_proj4text (p, 1, + "666667 +k=0.9999473679999999 +x_0=200000.0001016002 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Idaho East (ftUS)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",41.66666666666666],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",-112.1666666666667],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.999947368],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",656166.667],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"2241\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 13, "H]]"); + p = add_epsg_def (first, last, 2242, "epsg", 2242, + "NAD83 / Idaho Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.99"); + add_proj4text (p, 1, + "99473679999999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS8"); + add_proj4text (p, 2, "0 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Idaho Central (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",41.66666666666666"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-114],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.999947368],PARAMETER[\"false_easting\",16404"); + add_srs_wkt (p, 11, + "16.667],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2242\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2243, "epsg", 2243, + "NAD83 / Idaho West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0"); + add_proj4text (p, 1, + ".999933333 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +d"); + add_proj4text (p, 2, "atum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Idaho West (ftUS)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",41.66666666666666],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",-115.75],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",0.999933333],PARAMETER[\"false_easting\",2624"); + add_srs_wkt (p, 11, + "666.667],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"2243\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2244, "epsg", 2244, + "NAD83 / Indiana East (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=99999.99989839978 +y_0=249364.9987299975 +"); + add_proj4text (p, 2, "ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Indiana East (ftUS) (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4269\"]],UNIT[\"US survey foot\",0.30480060"); + add_srs_wkt (p, 7, + "96012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",37.5"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-85.66666666666667],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",0.999966667],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",328083.333],PARAMETER[\"false_northing\",818125"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"2244\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 2245, "epsg", 2245, + "NAD83 / Indiana West (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=900000 +y_0=249364.9987299975 +ellps=GRS80"); + add_proj4text (p, 2, " +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Indiana West (ftUS) (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4269\"]],UNIT[\"US survey foot\",0.30480060"); + add_srs_wkt (p, 7, + "96012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",37.5"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-87.08333333333333],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",0.999966667],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",2952750],PARAMETER[\"false_northing\",818125],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"2245\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 2246, "epsg", 2246, + "NAD83 / Kentucky North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_"); + add_proj4text (p, 2, "0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kentucky North (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",37.96666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",38.96666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",37.5],PARAMETER"); + add_srs_wkt (p, 11, + "[\"central_meridian\",-84.25],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",1640416.667],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"2246\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2247, "epsg", 2247, + "NAD83 / Kentucky South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0"); + add_proj4text (p, 2, + "001016001 +y_0=500000.0001016001 +ellps=GRS80 +datum=NAD"); + add_proj4text (p, 3, "83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kentucky South (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",37.93333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",36.73333333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"latitude_of_origin\",36.333333333333"); + add_srs_wkt (p, 11, + "34],PARAMETER[\"central_meridian\",-85.75],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_easting\",1640416.667],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",1640416.667],AUTHORITY[\"EPSG\",\"2247\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 14, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2248, "epsg", 2248, + "NAD83 / Maryland (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666"); + add_proj4text (p, 1, + "666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS8"); + add_proj4text (p, 2, "0 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maryland (ftUS)\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_Con"); + add_srs_wkt (p, 8, + "ic_2SP\"],PARAMETER[\"standard_parallel_1\",39.45],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"standard_parallel_2\",38.3],PARAMETER[\"latitude_"); + add_srs_wkt (p, 10, + "of_origin\",37.66666666666666],PARAMETER[\"central_merid"); + add_srs_wkt (p, 11, + "ian\",-77],PARAMETER[\"false_easting\",1312333.333],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2248\"]"); + add_srs_wkt (p, 13, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2249, "epsg", 2249, + "NAD83 / Massachusetts Mainland (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=7"); + add_proj4text (p, 2, + "50000 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Massachusetts Mainland (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "42.68333333333333],PARAMETER[\"standard_parallel_2\",41."); + add_srs_wkt (p, 10, + "71666666666667],PARAMETER[\"latitude_of_origin\",41],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"central_meridian\",-71.5],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",656166.667],PARAMETER[\"false_northing\",2460625]"); + add_srs_wkt (p, 13, + ",AUTHORITY[\"EPSG\",\"2249\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 2250, "epsg", 2250, + "NAD83 / Massachusetts Island (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333"); + add_proj4text (p, 1, + "333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0"); + add_proj4text (p, 2, " +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Massachusetts Island (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "41.48333333333333],PARAMETER[\"standard_parallel_2\",41."); + add_srs_wkt (p, 10, + "28333333333333],PARAMETER[\"latitude_of_origin\",41],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"central_meridian\",-70.5],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",1640416.667],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 13, + "ORITY[\"EPSG\",\"2250\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 14, "TH]]"); + p = add_epsg_def (first, last, 2251, "epsg", 2251, + "NAD83 / Michigan North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999"); + add_proj4text (p, 2, + "968001 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=ft +no_de"); + add_proj4text (p, 3, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Michigan North (ft)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"standard_parallel_1\",47.08333333333334],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",45.48333333333333],PARAMETER[\"lat"); + add_srs_wkt (p, 10, + "itude_of_origin\",44.78333333333333],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-87],PARAMETER[\"false_easting\",26246719.16"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 13, "251\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2252, "epsg", 2252, + "NAD83 / Michigan Central (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43"); + add_proj4text (p, 1, + ".31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.9"); + add_proj4text (p, 2, + "99976001 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=ft +no_"); + add_proj4text (p, 3, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Michigan Central (ft)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"standard_parallel_1\",45.7],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_2\",44.18333333333333],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",43.31666666666667],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 11, + "84.36666666666666],PARAMETER[\"false_easting\",19685039."); + add_srs_wkt (p, 12, + "37],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "2252\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2253, "epsg", 2253, + "NAD83 / Michigan South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41"); + add_proj4text (p, 1, + ".5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 "); + add_proj4text (p, 2, "+ellps=GRS80 +datum=NAD83 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Michigan South (ft)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"standard_parallel_1\",43.66666666666666],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",42.1],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",41.5],PARAMETER[\"central_meridian\",-84.3666666666"); + add_srs_wkt (p, 11, + "6666],PARAMETER[\"false_easting\",13123359.58],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2253\"],AXIS"); + add_srs_wkt (p, 13, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2254, "epsg", 2254, + "NAD83 / Mississippi East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +datum=N"); + add_proj4text (p, 2, "AD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Mississippi East (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",29.5],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-88.83333333333333],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.99995],PARAMETER[\"false_easting\",98425"); + add_srs_wkt (p, 11, + "0.0000000002],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2254\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2255, "epsg", 2255, + "NAD83 / Mississippi West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +datum=N"); + add_proj4text (p, 2, "AD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Mississippi West (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",29.5],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-90.33333333333333],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.99995],PARAMETER[\"false_easting\",22965"); + add_srs_wkt (p, 11, + "83.333],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2255\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2256, "epsg", 2256, "NAD83 / Montana (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5"); + add_proj4text (p, 1, + " +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +datum=NAD83 +u"); + add_proj4text (p, 2, "nits=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Montana (ft)\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 8, + "dard_parallel_1\",49],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 9, + "45],PARAMETER[\"latitude_of_origin\",44.25],PARAMETER[\""); + add_srs_wkt (p, 10, + "central_meridian\",-109.5],PARAMETER[\"false_easting\",1"); + add_srs_wkt (p, 11, + "968503.937],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, "EPSG\",\"2256\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2257, "epsg", 2257, + "NAD83 / New Mexico East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999"); + add_proj4text (p, 1, + "909091 +x_0=165000 +y_0=0 +ellps=GRS80 +datum=NAD83 +uni"); + add_proj4text (p, 2, "ts=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New Mexico East (ftUS)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",31],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-104.3333333333333],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",0.999909091],PARAMETER[\"false_easting\",541"); + add_srs_wkt (p, 11, + "337.5],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2257\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2258, "epsg", 2258, + "NAD83 / New Mexico Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=5000"); + add_proj4text (p, 1, + "00.0001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us"); + add_proj4text (p, 2, "-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New Mexico Central (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_M"); + add_srs_wkt (p, 8, + "ercator\"],PARAMETER[\"latitude_of_origin\",31],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-106.25],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9999],PARAMETER[\"false_easting\",1640416.667],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2258\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2259, "epsg", 2259, + "NAD83 / New Mexico West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999"); + add_proj4text (p, 1, + "916667 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +datum"); + add_proj4text (p, 2, "=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New Mexico West (ftUS)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",31],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-107.8333333333333],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",0.999916667],PARAMETER[\"false_easting\",272"); + add_srs_wkt (p, 11, + "3091.667],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 12, "SG\",\"2259\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2260, "epsg", 2260, + "NAD83 / New York East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 2, "us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New York East (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",38.83333333333334"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-74.5],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",0.9999],PARAMETER[\"false_easting\",492125],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2260"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2261, "epsg", 2261, + "NAD83 / New York Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +datum=N"); + add_proj4text (p, 2, "AD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New York Central (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",40],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-76.58333333333333],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",0.9999375],PARAMETER[\"false_easting\",82020"); + add_srs_wkt (p, 11, + "8.3330000002],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2261\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2262, "epsg", 2262, + "NAD83 / New York West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +datum=N"); + add_proj4text (p, 2, "AD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New York West (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",40],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-78.58333333333333],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9999375],PARAMETER[\"false_easting\",1148291."); + add_srs_wkt (p, 11, + "667],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"2262\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2263, "epsg", 2263, + "NAD83 / New York Long Island (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000"); + add_proj4text (p, 2, + "000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no"); + add_proj4text (p, 3, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New York Long Island (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "41.03333333333333],PARAMETER[\"standard_parallel_2\",40."); + add_srs_wkt (p, 10, + "66666666666666],PARAMETER[\"latitude_of_origin\",40.1666"); + add_srs_wkt (p, 11, + "6666666666],PARAMETER[\"central_meridian\",-74],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_easting\",984250.0000000002],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",0],AUTHORITY[\"EPSG\",\"2263\"],AXIS[\"X\",E"); + add_srs_wkt (p, 14, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2264, "epsg", 2264, + "NAD83 / North Carolina (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0="); + add_proj4text (p, 2, "0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / North Carolina (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",36.16666"); + add_srs_wkt (p, 9, + "666666666],PARAMETER[\"standard_parallel_2\",34.33333333"); + add_srs_wkt (p, 10, + "333334],PARAMETER[\"latitude_of_origin\",33.75],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"central_meridian\",-79],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 13, "G\",\"2264\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2265, "epsg", 2265, + "NAD83 / North Dakota North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333"); + add_proj4text (p, 1, + "333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +"); + add_proj4text (p, 2, "ellps=GRS80 +datum=NAD83 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / North Dakota North (ft)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "02\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"standard_parallel_1\",48.73333333333333],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"standard_parallel_2\",47.43333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",47],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 11, + "-100.5],PARAMETER[\"false_easting\",1968503.937],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2265\"],AX"); + add_srs_wkt (p, 13, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2266, "epsg", 2266, + "NAD83 / North Dakota South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333"); + add_proj4text (p, 1, + "333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9"); + add_proj4text (p, 2, + "999976 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=ft +no_de"); + add_proj4text (p, 3, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / North Dakota South (ft)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "02\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"standard_parallel_1\",47.48333333333333],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"standard_parallel_2\",46.18333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",45.66666666666666],PARAMETER[\"cent"); + add_srs_wkt (p, 11, + "ral_meridian\",-100.5],PARAMETER[\"false_easting\",19685"); + add_srs_wkt (p, 12, + "03.937],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 13, "\",\"2266\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2267, "epsg", 2267, + "NAD83 / Oklahoma North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Oklahoma North (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",36.76666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",35.56666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",35],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-98],PARAMETER[\"false_easting\",1968"); + add_srs_wkt (p, 12, + "500],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 13, "\"2267\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2268, "epsg", 2268, + "NAD83 / Oklahoma South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Oklahoma South (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",35.23333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",33.93333333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"latitude_of_origin\",33.333333333333"); + add_srs_wkt (p, 11, + "34],PARAMETER[\"central_meridian\",-98],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_easting\",1968500],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 13, + "HORITY[\"EPSG\",\"2268\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 14, "RTH]]"); + p = add_epsg_def (first, last, 2269, "epsg", 2269, + "NAD83 / Oregon North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 "); + add_proj4text (p, 2, "+ellps=GRS80 +datum=NAD83 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Oregon North (ft)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER["); + add_srs_wkt (p, 8, + "\"standard_parallel_1\",46],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 9, + "l_2\",44.33333333333334],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 10, + ",43.66666666666666],PARAMETER[\"central_meridian\",-120."); + add_srs_wkt (p, 11, + "5],PARAMETER[\"false_easting\",8202099.738],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2269\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2270, "epsg", 2270, + "NAD83 / Oregon South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 "); + add_proj4text (p, 2, "+ellps=GRS80 +datum=NAD83 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Oregon South (ft)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER["); + add_srs_wkt (p, 8, + "\"standard_parallel_1\",44],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 9, + "l_2\",42.33333333333334],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 10, + ",41.66666666666666],PARAMETER[\"central_meridian\",-120."); + add_srs_wkt (p, 11, + "5],PARAMETER[\"false_easting\",4921259.843],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2270\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2271, "epsg", 2271, + "NAD83 / Pennsylvania North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=4"); + add_proj4text (p, 1, + "0.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps"); + add_proj4text (p, 2, "=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Pennsylvania North (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41."); + add_srs_wkt (p, 9, + "95],PARAMETER[\"standard_parallel_2\",40.88333333333333]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"latitude_of_origin\",40.16666666666666],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"central_meridian\",-77.75],PARAMETER[\"false_ea"); + add_srs_wkt (p, 12, + "sting\",1968500],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 13, + "TY[\"EPSG\",\"2271\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 14, "]"); + p = add_epsg_def (first, last, 2272, "epsg", 2272, + "NAD83 / Pennsylvania South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +"); + add_proj4text (p, 2, + "y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Pennsylvania South (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",40."); + add_srs_wkt (p, 9, + "96666666666667],PARAMETER[\"standard_parallel_2\",39.933"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"latitude_of_origin\",39.3333333"); + add_srs_wkt (p, 11, + "3333334],PARAMETER[\"central_meridian\",-77.75],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_easting\",1968500],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"2272\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2273, "epsg", 2273, + "NAD83 / South Carolina (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31"); + add_proj4text (p, 1, + ".83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +datum=NAD83 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / South Carolina (ft)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"standard_parallel_1\",34.83333333333334],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",32.5],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",31.83333333333333],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 11, + "81],PARAMETER[\"false_easting\",2000000],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_northing\",0],AUTHORITY[\"EPSG\",\"2273\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_02 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 2274, "epsg", 2274, + "NAD83 / Tennessee (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=3"); + add_proj4text (p, 1, + "4.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GR"); + add_proj4text (p, 2, "S80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Tennessee (ftUS)\",GEOGCS[\"NAD83\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "9\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_2SP\"],PARAMETER[\"standard_parallel_1\",36.41666666"); + add_srs_wkt (p, 9, + "666666],PARAMETER[\"standard_parallel_2\",35.25],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"latitude_of_origin\",34.33333333333334],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-86],PARAMETER[\"false_easting\",1968"); + add_srs_wkt (p, 12, + "500],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 13, "\"2274\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2275, "epsg", 2275, + "NAD83 / Texas North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=3"); + add_proj4text (p, 1, + "4 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.99989"); + add_proj4text (p, 2, + "83998 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas North (ftUS)\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_"); + add_srs_wkt (p, 8, + "Conic_2SP\"],PARAMETER[\"standard_parallel_1\",36.183333"); + add_srs_wkt (p, 9, + "33333333],PARAMETER[\"standard_parallel_2\",34.65],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"latitude_of_origin\",34],PARAMETER[\"central_meri"); + add_srs_wkt (p, 11, + "dian\",-101.5],PARAMETER[\"false_easting\",656166.667],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",3280833.333],AUTHORITY[\"EPS"); + add_srs_wkt (p, 13, "G\",\"2275\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2276, "epsg", 2276, + "NAD83 / Texas North Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333"); + add_proj4text (p, 1, + "333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y"); + add_proj4text (p, 2, + "_0=2000000.0001016 +ellps=GRS80 +datum=NAD83 +units=us-f"); + add_proj4text (p, 3, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas North Central (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4269\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 7, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 8, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",3"); + add_srs_wkt (p, 9, + "3.96666666666667],PARAMETER[\"standard_parallel_2\",32.1"); + add_srs_wkt (p, 10, + "3333333333333],PARAMETER[\"latitude_of_origin\",31.66666"); + add_srs_wkt (p, 11, + "666666667],PARAMETER[\"central_meridian\",-98.5],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_easting\",1968500],PARAMETER[\"false_northing"); + add_srs_wkt (p, 13, + "\",6561666.667],AUTHORITY[\"EPSG\",\"2276\"],AXIS[\"X\","); + add_srs_wkt (p, 14, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2277, "epsg", 2277, + "NAD83 / Texas Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666"); + add_proj4text (p, 1, + "667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +"); + add_proj4text (p, 2, + "x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +datum=N"); + add_proj4text (p, 3, "AD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas Central (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",31.88333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",30.11666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",29.666666666666"); + add_srs_wkt (p, 11, + "67],PARAMETER[\"central_meridian\",-100.3333333333333],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_easting\",2296583.333],PARAMETER[\"fals"); + add_srs_wkt (p, 13, + "e_northing\",9842500.000000002],AUTHORITY[\"EPSG\",\"227"); + add_srs_wkt (p, 14, "7\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2278, "epsg", 2278, + "NAD83 / Texas South Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333"); + add_proj4text (p, 1, + "333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0"); + add_proj4text (p, 2, + "=3999999.9998984 +ellps=GRS80 +datum=NAD83 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas South Central (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4269\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 7, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 8, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",3"); + add_srs_wkt (p, 9, + "0.28333333333333],PARAMETER[\"standard_parallel_2\",28.3"); + add_srs_wkt (p, 10, + "8333333333333],PARAMETER[\"latitude_of_origin\",27.83333"); + add_srs_wkt (p, 11, + "333333333],PARAMETER[\"central_meridian\",-99],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_easting\",1968500],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",13123333.333],AUTHORITY[\"EPSG\",\"2278\"],AXIS[\"X\",E"); + add_srs_wkt (p, 14, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2279, "epsg", 2279, + "NAD83 / Texas South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.00"); + add_proj4text (p, 2, + "00000001 +y_0=5000000.0001016 +ellps=GRS80 +datum=NAD83 "); + add_proj4text (p, 3, "+units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas South (ftUS)\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_"); + add_srs_wkt (p, 8, + "Conic_2SP\"],PARAMETER[\"standard_parallel_1\",27.833333"); + add_srs_wkt (p, 9, + "33333333],PARAMETER[\"standard_parallel_2\",26.166666666"); + add_srs_wkt (p, 10, + "66667],PARAMETER[\"latitude_of_origin\",25.6666666666666"); + add_srs_wkt (p, 11, + "7],PARAMETER[\"central_meridian\",-98.5],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_easting\",984250.0000000002],PARAMETER[\"false_northi"); + add_srs_wkt (p, 13, + "ng\",16404166.667],AUTHORITY[\"EPSG\",\"2279\"],AXIS[\"X"); + add_srs_wkt (p, 14, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2280, "epsg", 2280, + "NAD83 / Utah North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0"); + add_proj4text (p, 2, + "001504 +y_0=999999.9999960001 +ellps=GRS80 +datum=NAD83 "); + add_proj4text (p, 3, "+units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Utah North (ft)\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "standard_parallel_1\",41.78333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_2\",40.71666666666667],PARAMETER[\"latitu"); + add_srs_wkt (p, 10, + "de_of_origin\",40.33333333333334],PARAMETER[\"central_me"); + add_srs_wkt (p, 11, + "ridian\",-111.5],PARAMETER[\"false_easting\",1640419.948"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",3280839.895],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"2280\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2281, "epsg", 2281, + "NAD83 / Utah Central (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=3"); + add_proj4text (p, 1, + "8.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0="); + add_proj4text (p, 2, + "1999999.999992 +ellps=GRS80 +datum=NAD83 +units=ft +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Utah Central (ft)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER["); + add_srs_wkt (p, 8, + "\"standard_parallel_1\",40.65],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_2\",39.01666666666667],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",38.33333333333334],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 11, + "111.5],PARAMETER[\"false_easting\",1640419.948],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_northing\",6561679.79],AUTHORITY[\"EPSG\",\"22"); + add_srs_wkt (p, 13, "81\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2282, "epsg", 2282, + "NAD83 / Utah South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=3"); + add_proj4text (p, 1, + "6.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0="); + add_proj4text (p, 2, + "2999999.999988 +ellps=GRS80 +datum=NAD83 +units=ft +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Utah South (ft)\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "standard_parallel_1\",38.35],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 9, + "el_2\",37.21666666666667],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 10, + "\",36.66666666666666],PARAMETER[\"central_meridian\",-11"); + add_srs_wkt (p, 11, + "1.5],PARAMETER[\"false_easting\",1640419.948],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_northing\",9842519.685],AUTHORITY[\"EPSG\",\"228"); + add_srs_wkt (p, 13, "2\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2283, "epsg", 2283, + "NAD83 / Virginia North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2"); + add_proj4text (p, 2, + "000000.0001016 +ellps=GRS80 +datum=NAD83 +units=us-ft +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Virginia North (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",39.2],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"standard_parallel_2\",38.03333333333333],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"latitude_of_origin\",37.66666666666666],PARAMETER"); + add_srs_wkt (p, 11, + "[\"central_meridian\",-78.5],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",11482916.667],PARAMETER[\"false_northing\",6561666.667]"); + add_srs_wkt (p, 13, + ",AUTHORITY[\"EPSG\",\"2283\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 2284, "epsg", 2284, + "NAD83 / Virginia South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0"); + add_proj4text (p, 2, + "001016 +y_0=999999.9998983998 +ellps=GRS80 +datum=NAD83 "); + add_proj4text (p, 3, "+units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Virginia South (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",37.96666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",36.76666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",36.333333333333"); + add_srs_wkt (p, 11, + "34],PARAMETER[\"central_meridian\",-78.5],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_easting\",11482916.667],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",3280833.333],AUTHORITY[\"EPSG\",\"2284\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 14, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2285, "epsg", 2285, + "NAD83 / Washington North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47"); + add_proj4text (p, 1, + " +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0"); + add_proj4text (p, 2, " +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Washington North (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",48.73"); + add_srs_wkt (p, 9, + "333333333333],PARAMETER[\"standard_parallel_2\",47.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",47],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",-120.8333333333333],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",1640416.667],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"2285\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2286, "epsg", 2286, + "NAD83 / Washington South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333"); + add_proj4text (p, 1, + "334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0"); + add_proj4text (p, 2, + "001016001 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Washington South (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",47.33"); + add_srs_wkt (p, 9, + "333333333334],PARAMETER[\"standard_parallel_2\",45.83333"); + add_srs_wkt (p, 10, + "333333334],PARAMETER[\"latitude_of_origin\",45.333333333"); + add_srs_wkt (p, 11, + "33334],PARAMETER[\"central_meridian\",-120.5],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_easting\",1640416.667],PARAMETER[\"false_northin"); + add_srs_wkt (p, 13, + "g\",0],AUTHORITY[\"EPSG\",\"2286\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 14, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2287, "epsg", 2287, + "NAD83 / Wisconsin North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wisconsin North (ftUS)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",46.76"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"standard_parallel_2\",45.56666"); + add_srs_wkt (p, 10, + "666666667],PARAMETER[\"latitude_of_origin\",45.166666666"); + add_srs_wkt (p, 11, + "66666],PARAMETER[\"central_meridian\",-90],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_easting\",1968500],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"2287\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 2288, "epsg", 2288, + "NAD83 / Wisconsin Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333"); + add_proj4text (p, 1, + "334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NA"); + add_proj4text (p, 2, "D83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wisconsin Central (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",45."); + add_srs_wkt (p, 9, + "5],PARAMETER[\"standard_parallel_2\",44.25],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",43.83333333333334],PARAMETER[\"cent"); + add_srs_wkt (p, 11, + "ral_meridian\",-90],PARAMETER[\"false_easting\",1968500]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"22"); + add_srs_wkt (p, 13, "88\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2289, "epsg", 2289, + "NAD83 / Wisconsin South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wisconsin South (ftUS)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",44.06"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"standard_parallel_2\",42.73333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"latitude_of_origin\",42],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"central_meridian\",-90],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "1968500],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 13, "G\",\"2289\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2290, "epsg", 2290, + "ATS77 / Prince Edward Isl. Stereographic (ATS77)"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=70"); + add_proj4text (p, 1, + "0000 +y_0=400000 +a=6378135 +b=6356750.304921594 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ATS77 / Prince Edward Isl. Stereographic (ATS77"); + add_srs_wkt (p, 1, + ")\",GEOGCS[\"ATS77\",DATUM[\"Average_Terrestrial_System_"); + add_srs_wkt (p, 2, + "1977\",SPHEROID[\"Average Terrestrial System 1977\",6378"); + add_srs_wkt (p, 3, + "135,298.257,AUTHORITY[\"EPSG\",\"7041\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 4, + "SG\",\"6122\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4122\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Oblique_Stereographic\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",47.25],PARAMETER[\"central_meridian\",-63],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.999912],PARAMETER[\"false_easting\",700"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",400000],AUTHORITY[\"EP"); + add_srs_wkt (p, 12, + "SG\",\"2290\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 2291, "epsg", 2291, + "NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=40"); + add_proj4text (p, 1, + "0000 +y_0=800000 +a=6378135 +b=6356750.304921594 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / Prince Edward Isl. Stereographi"); + add_srs_wkt (p, 1, + "c (NAD83) (deprecated)\",GEOGCS[\"ATS77\",DATUM[\"Averag"); + add_srs_wkt (p, 2, + "e_Terrestrial_System_1977\",SPHEROID[\"Average Terrestri"); + add_srs_wkt (p, 3, + "al System 1977\",6378135,298.257,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 4, + "41\"]],AUTHORITY[\"EPSG\",\"6122\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4122\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 8, + "001\"]],PROJECTION[\"Oblique_Stereographic\"],PARAMETER["); + add_srs_wkt (p, 9, + "\"latitude_of_origin\",47.25],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",-63],PARAMETER[\"scale_factor\",0.999912],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",400000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 12, + "800000],AUTHORITY[\"EPSG\",\"2291\"],AXIS[\"E(X)\",EAST]"); + add_srs_wkt (p, 13, ",AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 2292, "epsg", 2292, + "NAD83(CSRS98) / Prince Edward Isl. Stereographic (NAD83) (deprecated)"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=40"); + add_proj4text (p, 1, + "0000 +y_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +un"); + add_proj4text (p, 2, "its=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS98) / Prince Edward Isl. Stereographi"); + add_srs_wkt (p, 1, + "c (NAD83) (deprecated)\",GEOGCS[\"NAD83(CSRS98)\",DATUM["); + add_srs_wkt (p, 2, + "\"NAD83_Canadian_Spatial_Reference_System\",SPHEROID[\"G"); + add_srs_wkt (p, 3, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 4, + "9\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6140\""); + add_srs_wkt (p, 5, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 6, + "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9108\"]],AUTHORITY[\"EPSG\",\"4140\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 8, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Oblique_Stere"); + add_srs_wkt (p, 9, + "ographic\"],PARAMETER[\"latitude_of_origin\",47.25],PARA"); + add_srs_wkt (p, 10, + "METER[\"central_meridian\",-63],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 11, + "\",0.999912],PARAMETER[\"false_easting\",400000],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_northing\",800000],AUTHORITY[\"EPSG\",\"2292\""); + add_srs_wkt (p, 13, "],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 2294, "epsg", 2294, + "ATS77 / MTM Nova Scotia zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=4500000"); + add_proj4text (p, 1, + " +y_0=0 +a=6378135 +b=6356750.304921594 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"ATS77 / MTM Nova Scotia zone 4\",GEOGCS[\"ATS77"); + add_srs_wkt (p, 1, + "\",DATUM[\"Average_Terrestrial_System_1977\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Average Terrestrial System 1977\",6378135,298.257,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7041\"]],AUTHORITY[\"EPSG\",\"6122\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4122\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",-61.5],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "9],PARAMETER[\"false_easting\",4500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"2294\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2295, "epsg", 2295, + "ATS77 / MTM Nova Scotia zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=5500000"); + add_proj4text (p, 1, + " +y_0=0 +a=6378135 +b=6356750.304921594 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"ATS77 / MTM Nova Scotia zone 5\",GEOGCS[\"ATS77"); + add_srs_wkt (p, 1, + "\",DATUM[\"Average_Terrestrial_System_1977\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Average Terrestrial System 1977\",6378135,298.257,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7041\"]],AUTHORITY[\"EPSG\",\"6122\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4122\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",-64.5],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "9],PARAMETER[\"false_easting\",5500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"2295\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2308, "epsg", 2308, "Batavia / TM 109 SE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=109 +k=0.9996 +x_0=500000 +y"); + add_proj4text (p, 1, "_0=10000000 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Batavia / TM 109 SE\",GEOGCS[\"Batavia\",DATUM["); + add_srs_wkt (p, 1, + "\"Batavia\",SPHEROID[\"Bessel 1841\",6377397.155,299.152"); + add_srs_wkt (p, 2, + "8128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6211\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4211\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",109],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 9, + "r\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"2308"); + add_srs_wkt (p, 11, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2309, "epsg", 2309, "WGS 84 / TM 116 SE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=116 +k=0.9996 +x_0=500000 +y"); + add_proj4text (p, 1, + "_0=10000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / TM 116 SE\",GEOGCS[\"WGS 84\",DATUM[\""); + add_srs_wkt (p, 1, + "WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]]"); + add_srs_wkt (p, 3, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 4, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 5, + "122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 6, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 7, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 8, + "central_meridian\",116],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"2309\"],AXIS["); + add_srs_wkt (p, 11, "\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2310, "epsg", 2310, "WGS 84 / TM 132 SE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=132 +k=0.9996 +x_0=500000 +y"); + add_proj4text (p, 1, + "_0=10000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / TM 132 SE\",GEOGCS[\"WGS 84\",DATUM[\""); + add_srs_wkt (p, 1, + "WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]]"); + add_srs_wkt (p, 3, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 4, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 5, + "122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 6, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 7, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 8, + "central_meridian\",132],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"2310\"],AXIS["); + add_srs_wkt (p, 11, "\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2311, "epsg", 2311, "WGS 84 / TM 6 NE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=6 +k=0.9996 +x_0=500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / TM 6 NE\",GEOGCS[\"WGS 84\",DATUM[\"WG"); + add_srs_wkt (p, 1, + "S_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],P"); + add_srs_wkt (p, 3, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 4, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 5, + "2\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 7, + "tor\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"c"); + add_srs_wkt (p, 8, + "entral_meridian\",6],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"2311\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2312, "epsg", 2312, "Garoua / UTM zone 33N"); + add_proj4text (p, 0, "+proj=utm +zone=33 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Garoua / UTM zone 33N\",GEOGCS[\"Garoua\",DATUM"); + add_srs_wkt (p, 1, + "[\"Garoua\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,2"); + add_srs_wkt (p, 2, + "93.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"6197\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4197\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",15],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2312\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2313, "epsg", 2313, + "Kousseri / UTM zone 33N"); + add_proj4text (p, 0, "+proj=utm +zone=33 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kousseri / UTM zone 33N\",GEOGCS[\"Kousseri\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Kousseri\",SPHEROID[\"Clarke 1880 (RGS)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6198\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4198\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",15],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2313\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2314, "epsg", 2314, + "Trinidad 1903 / Trinidad Grid (ftCla)"); + add_proj4text (p, 0, + "+proj=cass +lat_0=10.44166666666667 +lon_0=-61.333333333"); + add_proj4text (p, 1, + "33334 +x_0=86501.46392052001 +y_0=65379.0134283 +a=63782"); + add_proj4text (p, 2, + "93.645208759 +b=6356617.987679838 +to_meter=0.3047972654"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Trinidad 1903 / Trinidad Grid (ftCla)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Trinidad 1903\",DATUM[\"Trinidad_1903\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1858\",6378293.645208759,294.2606763692569,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7007\"]],AUTHORITY[\"EPSG\",\"6302\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4302\"]],UNIT[\"Clarke's foot\",0"); + add_srs_wkt (p, 7, + ".3047972654,AUTHORITY[\"EPSG\",\"9005\"]],PROJECTION[\"C"); + add_srs_wkt (p, 8, + "assini_Soldner\"],PARAMETER[\"latitude_of_origin\",10.44"); + add_srs_wkt (p, 9, + "166666666667],PARAMETER[\"central_meridian\",-61.3333333"); + add_srs_wkt (p, 10, + "3333334],PARAMETER[\"false_easting\",283800],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",214500],AUTHORITY[\"EPSG\",\"2314\"],AX"); + add_srs_wkt (p, 12, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2315, "epsg", 2315, + "Campo Inchauspe / UTM zone 19S"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Campo Inchauspe / UTM zone 19S\",GEOGCS[\"Campo"); + add_srs_wkt (p, 1, + " Inchauspe\",DATUM[\"Campo_Inchauspe\",SPHEROID[\"Intern"); + add_srs_wkt (p, 2, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6221\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4221\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-69],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"2315\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2316, "epsg", 2316, + "Campo Inchauspe / UTM zone 20S"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Campo Inchauspe / UTM zone 20S\",GEOGCS[\"Campo"); + add_srs_wkt (p, 1, + " Inchauspe\",DATUM[\"Campo_Inchauspe\",SPHEROID[\"Intern"); + add_srs_wkt (p, 2, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6221\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4221\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-63],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"2316\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2317, "epsg", 2317, "PSAD56 / ICN Regional"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=9 +lat_2=3 +lat_0=6 +lon_0=-66 +x_0=100"); + add_proj4text (p, 1, "0000 +y_0=1000000 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / ICN Regional\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"standard_parallel_1\",9],PARAMETER[\"standard_par"); + add_srs_wkt (p, 9, + "allel_2\",3],PARAMETER[\"latitude_of_origin\",6],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"central_meridian\",-66],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",1000000],PARAMETER[\"false_northing\",1000000],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"2317\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 2318, "epsg", 2318, + "Ain el Abd / Aramco Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=17 +lat_2=33 +lat_0=25.08951 +lon_0=48 "); + add_proj4text (p, 1, "+x_0=0 +y_0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Ain el Abd / Aramco Lambert\",GEOGCS[\"Ain el A"); + add_srs_wkt (p, 1, + "bd\",DATUM[\"Ain_el_Abd_1970\",SPHEROID[\"International "); + add_srs_wkt (p, 2, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6204\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4204\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",17],PARAMETER[\"standard_parallel_2\",33"); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",25.08951],PARAMETER[\""); + add_srs_wkt (p, 10, + "central_meridian\",48],PARAMETER[\"false_easting\",0],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2318\""); + add_srs_wkt (p, 12, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2319, "epsg", 2319, "ED50 / TM27"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / TM27\",GEOGCS[\"ED50\",DATUM[\"European_"); + add_srs_wkt (p, 1, + "Datum_1950\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6230"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",27],PARAMETER[\"scale_factor\",1"); + add_srs_wkt (p, 9, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "northing\",0],AUTHORITY[\"EPSG\",\"2319\"],AXIS[\"X\",NO"); + add_srs_wkt (p, 11, "RTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2320, "epsg", 2320, "ED50 / TM30"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / TM30\",GEOGCS[\"ED50\",DATUM[\"European_"); + add_srs_wkt (p, 1, + "Datum_1950\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6230"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",30],PARAMETER[\"scale_factor\",1"); + add_srs_wkt (p, 9, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "northing\",0],AUTHORITY[\"EPSG\",\"2320\"],AXIS[\"X\",NO"); + add_srs_wkt (p, 11, "RTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2321, "epsg", 2321, "ED50 / TM33"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / TM33\",GEOGCS[\"ED50\",DATUM[\"European_"); + add_srs_wkt (p, 1, + "Datum_1950\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6230"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",33],PARAMETER[\"scale_factor\",1"); + add_srs_wkt (p, 9, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "northing\",0],AUTHORITY[\"EPSG\",\"2321\"],AXIS[\"X\",NO"); + add_srs_wkt (p, 11, "RTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2322, "epsg", 2322, "ED50 / TM36"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / TM36\",GEOGCS[\"ED50\",DATUM[\"European_"); + add_srs_wkt (p, 1, + "Datum_1950\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6230"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",36],PARAMETER[\"scale_factor\",1"); + add_srs_wkt (p, 9, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "northing\",0],AUTHORITY[\"EPSG\",\"2322\"],AXIS[\"X\",NO"); + add_srs_wkt (p, 11, "RTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2323, "epsg", 2323, "ED50 / TM39"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / TM39\",GEOGCS[\"ED50\",DATUM[\"European_"); + add_srs_wkt (p, 1, + "Datum_1950\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6230"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",39],PARAMETER[\"scale_factor\",1"); + add_srs_wkt (p, 9, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "northing\",0],AUTHORITY[\"EPSG\",\"2323\"],AXIS[\"X\",NO"); + add_srs_wkt (p, 11, "RTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2324, "epsg", 2324, "ED50 / TM42"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / TM42\",GEOGCS[\"ED50\",DATUM[\"European_"); + add_srs_wkt (p, 1, + "Datum_1950\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6230"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",42],PARAMETER[\"scale_factor\",1"); + add_srs_wkt (p, 9, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "northing\",0],AUTHORITY[\"EPSG\",\"2324\"],AXIS[\"X\",NO"); + add_srs_wkt (p, 11, "RTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2325, "epsg", 2325, "ED50 / TM45"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / TM45\",GEOGCS[\"ED50\",DATUM[\"European_"); + add_srs_wkt (p, 1, + "Datum_1950\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6230"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",45],PARAMETER[\"scale_factor\",1"); + add_srs_wkt (p, 9, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "northing\",0],AUTHORITY[\"EPSG\",\"2325\"],AXIS[\"X\",NO"); + add_srs_wkt (p, 11, "RTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2326, "epsg", 2326, + "Hong Kong 1980 Grid System"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=22.31213333333334 +lon_0=114.17855555"); + add_proj4text (p, 1, + "55556 +k=1 +x_0=836694.05 +y_0=819069.8 +ellps=intl +tow"); + add_proj4text (p, 2, + "gs84=-162.619,-276.959,-161.764,0.067753,-2.24365,-1.158"); + add_proj4text (p, 3, "83,-1.09425 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hong Kong 1980 Grid System\",GEOGCS[\"Hong Kong"); + add_srs_wkt (p, 1, + " 1980\",DATUM[\"Hong_Kong_1980\",SPHEROID[\"Internationa"); + add_srs_wkt (p, 2, + "l 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS"); + add_srs_wkt (p, 3, + "84[-162.619,-276.959,-161.764,0.067753,-2.24365,-1.15883"); + add_srs_wkt (p, 4, + ",-1.09425],AUTHORITY[\"EPSG\",\"6611\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 5, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 6, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"4611\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"latitude_of_origin\",22.31213333333334],PARAMETER[\""); + add_srs_wkt (p, 10, + "central_meridian\",114.1785555555556],PARAMETER[\"scale_"); + add_srs_wkt (p, 11, + "factor\",1],PARAMETER[\"false_easting\",836694.05],PARAM"); + add_srs_wkt (p, 12, + "ETER[\"false_northing\",819069.8],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 13, + "326\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 2327, "epsg", 2327, + "Xian 1980 / Gauss-Kruger zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 13\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",75],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",1],PARAMETER[\"false_easting\",13500000],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2327\"],A"); + add_srs_wkt (p, 11, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2328, "epsg", 2328, + "Xian 1980 / Gauss-Kruger zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 14\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",81],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",1],PARAMETER[\"false_easting\",14500000],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2328\"],A"); + add_srs_wkt (p, 11, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2329, "epsg", 2329, + "Xian 1980 / Gauss-Kruger zone 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 15\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",87],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",1],PARAMETER[\"false_easting\",15500000],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2329\"],A"); + add_srs_wkt (p, 11, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2330, "epsg", 2330, + "Xian 1980 / Gauss-Kruger zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 16\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",93],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",1],PARAMETER[\"false_easting\",16500000],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2330\"],A"); + add_srs_wkt (p, 11, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2331, "epsg", 2331, + "Xian 1980 / Gauss-Kruger zone 17"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 17\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",99],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",1],PARAMETER[\"false_easting\",17500000],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2331\"],A"); + add_srs_wkt (p, 11, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2332, "epsg", 2332, + "Xian 1980 / Gauss-Kruger zone 18"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 18\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",105],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",18500000],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2332\"],"); + add_srs_wkt (p, 11, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2333, "epsg", 2333, + "Xian 1980 / Gauss-Kruger zone 19"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 19\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",111],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",19500000],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2333\"],"); + add_srs_wkt (p, 11, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2334, "epsg", 2334, + "Xian 1980 / Gauss-Kruger zone 20"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 20\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",117],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",20500000],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2334\"],"); + add_srs_wkt (p, 11, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2335, "epsg", 2335, + "Xian 1980 / Gauss-Kruger zone 21"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 21\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",123],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",21500000],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2335\"],"); + add_srs_wkt (p, 11, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2336, "epsg", 2336, + "Xian 1980 / Gauss-Kruger zone 22"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 22\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",129],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",22500000],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2336\"],"); + add_srs_wkt (p, 11, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2337, "epsg", 2337, + "Xian 1980 / Gauss-Kruger zone 23"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger zone 23\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",135],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",23500000],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2337\"],"); + add_srs_wkt (p, 11, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2338, "epsg", 2338, + "Xian 1980 / Gauss-Kruger CM 75E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 75E\",GEOGCS[\"Xian"); + add_srs_wkt (p, 1, + " 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",63781"); + add_srs_wkt (p, 2, + "40,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",75],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",1],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2338\"],AXI"); + add_srs_wkt (p, 11, "S[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2339, "epsg", 2339, + "Xian 1980 / Gauss-Kruger CM 81E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 81E\",GEOGCS[\"Xian"); + add_srs_wkt (p, 1, + " 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",63781"); + add_srs_wkt (p, 2, + "40,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",81],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",1],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2339\"],AXI"); + add_srs_wkt (p, 11, "S[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2340, "epsg", 2340, + "Xian 1980 / Gauss-Kruger CM 87E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 87E\",GEOGCS[\"Xian"); + add_srs_wkt (p, 1, + " 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",63781"); + add_srs_wkt (p, 2, + "40,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",87],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",1],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2340\"],AXI"); + add_srs_wkt (p, 11, "S[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2341, "epsg", 2341, + "Xian 1980 / Gauss-Kruger CM 93E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 93E\",GEOGCS[\"Xian"); + add_srs_wkt (p, 1, + " 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",63781"); + add_srs_wkt (p, 2, + "40,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",93],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",1],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2341\"],AXI"); + add_srs_wkt (p, 11, "S[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2342, "epsg", 2342, + "Xian 1980 / Gauss-Kruger CM 99E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 99E\",GEOGCS[\"Xian"); + add_srs_wkt (p, 1, + " 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",63781"); + add_srs_wkt (p, 2, + "40,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",99],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",1],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2342\"],AXI"); + add_srs_wkt (p, 11, "S[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2343, "epsg", 2343, + "Xian 1980 / Gauss-Kruger CM 105E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 105E\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",105],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2343\"],AX"); + add_srs_wkt (p, 11, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2344, "epsg", 2344, + "Xian 1980 / Gauss-Kruger CM 111E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 111E\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",111],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2344\"],AX"); + add_srs_wkt (p, 11, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2345, "epsg", 2345, + "Xian 1980 / Gauss-Kruger CM 117E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 117E\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",117],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2345\"],AX"); + add_srs_wkt (p, 11, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2346, "epsg", 2346, + "Xian 1980 / Gauss-Kruger CM 123E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 123E\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",123],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2346\"],AX"); + add_srs_wkt (p, 11, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2347, "epsg", 2347, + "Xian 1980 / Gauss-Kruger CM 129E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 129E\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",129],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2347\"],AX"); + add_srs_wkt (p, 11, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2348, "epsg", 2348, + "Xian 1980 / Gauss-Kruger CM 135E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / Gauss-Kruger CM 135E\",GEOGCS[\"Xia"); + add_srs_wkt (p, 1, + "n 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 1980\",6378"); + add_srs_wkt (p, 2, + "140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",135],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2348\"],AX"); + add_srs_wkt (p, 11, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2349, "epsg", 2349, + "Xian 1980 / 3-degree Gauss-Kruger zone 25"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 25\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",75],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",255000"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2349\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2350, "epsg", 2350, + "Xian 1980 / 3-degree Gauss-Kruger zone 26"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 26\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",78],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",265000"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2350\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2351, "epsg", 2351, + "Xian 1980 / 3-degree Gauss-Kruger zone 27"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 27\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",81],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",275000"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2351\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2352, "epsg", 2352, + "Xian 1980 / 3-degree Gauss-Kruger zone 28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 28\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",84],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",285000"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2352\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2353, "epsg", 2353, + "Xian 1980 / 3-degree Gauss-Kruger zone 29"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 29\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",87],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",295000"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2353\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2354, "epsg", 2354, + "Xian 1980 / 3-degree Gauss-Kruger zone 30"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 30\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",90],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",305000"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2354\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2355, "epsg", 2355, + "Xian 1980 / 3-degree Gauss-Kruger zone 31"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 31\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",93],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",315000"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2355\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2356, "epsg", 2356, + "Xian 1980 / 3-degree Gauss-Kruger zone 32"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 32\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",96],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",325000"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2356\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2357, "epsg", 2357, + "Xian 1980 / 3-degree Gauss-Kruger zone 33"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0"); + add_proj4text (p, 1, " +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 33\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",99],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",335000"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2357\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2358, "epsg", 2358, + "Xian 1980 / 3-degree Gauss-Kruger zone 34"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 34\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",102],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",34500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2358\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2359, "epsg", 2359, + "Xian 1980 / 3-degree Gauss-Kruger zone 35"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 35\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",105],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",35500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2359\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2360, "epsg", 2360, + "Xian 1980 / 3-degree Gauss-Kruger zone 36"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 36\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",108],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",36500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2360\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2361, "epsg", 2361, + "Xian 1980 / 3-degree Gauss-Kruger zone 37"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 37\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",111],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",37500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2361\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2362, "epsg", 2362, + "Xian 1980 / 3-degree Gauss-Kruger zone 38"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 38\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",114],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",38500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2362\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2363, "epsg", 2363, + "Xian 1980 / 3-degree Gauss-Kruger zone 39"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 39\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",117],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",39500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2363\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2364, "epsg", 2364, + "Xian 1980 / 3-degree Gauss-Kruger zone 40"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 40\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",120],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",40500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2364\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2365, "epsg", 2365, + "Xian 1980 / 3-degree Gauss-Kruger zone 41"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 41\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",123],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",41500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2365\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2366, "epsg", 2366, + "Xian 1980 / 3-degree Gauss-Kruger zone 42"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 42\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",126],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",42500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2366\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2367, "epsg", 2367, + "Xian 1980 / 3-degree Gauss-Kruger zone 43"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 43\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",129],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",43500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2367\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2368, "epsg", 2368, + "Xian 1980 / 3-degree Gauss-Kruger zone 44"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 44\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",132],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",44500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2368\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2369, "epsg", 2369, + "Xian 1980 / 3-degree Gauss-Kruger zone 45"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0="); + add_proj4text (p, 1, "0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger zone 45\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",135],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",45500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"2369\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2370, "epsg", 2370, + "Xian 1980 / 3-degree Gauss-Kruger CM 75E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 75E\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 198"); + add_srs_wkt (p, 2, + "0\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",75],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23"); + add_srs_wkt (p, 11, "70\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2371, "epsg", 2371, + "Xian 1980 / 3-degree Gauss-Kruger CM 78E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 78E\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 198"); + add_srs_wkt (p, 2, + "0\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",78],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23"); + add_srs_wkt (p, 11, "71\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2372, "epsg", 2372, + "Xian 1980 / 3-degree Gauss-Kruger CM 81E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 81E\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 198"); + add_srs_wkt (p, 2, + "0\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",81],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23"); + add_srs_wkt (p, 11, "72\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2373, "epsg", 2373, + "Xian 1980 / 3-degree Gauss-Kruger CM 84E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 84E\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 198"); + add_srs_wkt (p, 2, + "0\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",84],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23"); + add_srs_wkt (p, 11, "73\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2374, "epsg", 2374, + "Xian 1980 / 3-degree Gauss-Kruger CM 87E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 87E\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 198"); + add_srs_wkt (p, 2, + "0\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",87],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23"); + add_srs_wkt (p, 11, "74\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2375, "epsg", 2375, + "Xian 1980 / 3-degree Gauss-Kruger CM 90E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 90E\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 198"); + add_srs_wkt (p, 2, + "0\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",90],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23"); + add_srs_wkt (p, 11, "75\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2376, "epsg", 2376, + "Xian 1980 / 3-degree Gauss-Kruger CM 93E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 93E\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 198"); + add_srs_wkt (p, 2, + "0\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",93],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23"); + add_srs_wkt (p, 11, "76\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2377, "epsg", 2377, + "Xian 1980 / 3-degree Gauss-Kruger CM 96E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 96E\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 198"); + add_srs_wkt (p, 2, + "0\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",96],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23"); + add_srs_wkt (p, 11, "77\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2378, "epsg", 2378, + "Xian 1980 / 3-degree Gauss-Kruger CM 99E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 99E\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 198"); + add_srs_wkt (p, 2, + "0\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4610"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",99],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23"); + add_srs_wkt (p, 11, "78\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2379, "epsg", 2379, + "Xian 1980 / 3-degree Gauss-Kruger CM 102E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 102E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",102],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2379\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2380, "epsg", 2380, + "Xian 1980 / 3-degree Gauss-Kruger CM 105E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 105E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",105],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2380\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2381, "epsg", 2381, + "Xian 1980 / 3-degree Gauss-Kruger CM 108E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 108E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",108],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2381\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2382, "epsg", 2382, + "Xian 1980 / 3-degree Gauss-Kruger CM 111E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 111E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",111],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2382\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2383, "epsg", 2383, + "Xian 1980 / 3-degree Gauss-Kruger CM 114E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 114E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",114],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2383\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2384, "epsg", 2384, + "Xian 1980 / 3-degree Gauss-Kruger CM 117E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 117E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",117],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2384\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2385, "epsg", 2385, + "Xian 1980 / 3-degree Gauss-Kruger CM 120E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 120E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",120],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2385\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2386, "epsg", 2386, + "Xian 1980 / 3-degree Gauss-Kruger CM 123E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 123E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",123],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2386\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2387, "epsg", 2387, + "Xian 1980 / 3-degree Gauss-Kruger CM 126E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 126E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",126],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2387\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2388, "epsg", 2388, + "Xian 1980 / 3-degree Gauss-Kruger CM 129E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 129E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",129],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2388\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2389, "epsg", 2389, + "Xian 1980 / 3-degree Gauss-Kruger CM 132E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 132E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",132],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2389\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2390, "epsg", 2390, + "Xian 1980 / 3-degree Gauss-Kruger CM 135E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+a=6378140 +b=6356755.288157528 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Xian 1980 / 3-degree Gauss-Kruger CM 135E\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian 19"); + add_srs_wkt (p, 2, + "80\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"461"); + add_srs_wkt (p, 6, + "0\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",135],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "2390\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2391, "epsg", 2391, "KKJ / Finland zone 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=1500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"KKJ / Finland zone 1\",GEOGCS[\"KKJ\",DATUM[\"K"); + add_srs_wkt (p, 1, + "artastokoordinaattijarjestelma_1966\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6123\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4123\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",0],PARAMETER[\"central_meridian\",21],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",1"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"2391\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2392, "epsg", 2392, "KKJ / Finland zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=2500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"KKJ / Finland zone 2\",GEOGCS[\"KKJ\",DATUM[\"K"); + add_srs_wkt (p, 1, + "artastokoordinaattijarjestelma_1966\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6123\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4123\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",0],PARAMETER[\"central_meridian\",24],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"2392\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2393, "epsg", 2393, + "KKJ / Finland Uniform Coordinate System"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=3500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"KKJ / Finland Uniform Coordinate System\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"KKJ\",DATUM[\"Kartastokoordinaattijarjestelma_1966\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6123\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4123\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",27],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",3500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2393\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 2394, "epsg", 2394, "KKJ / Finland zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"KKJ / Finland zone 4\",GEOGCS[\"KKJ\",DATUM[\"K"); + add_srs_wkt (p, 1, + "artastokoordinaattijarjestelma_1966\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6123\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4123\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",0],PARAMETER[\"central_meridian\",30],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",4"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"2394\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2395, "epsg", 2395, + "South Yemen / Gauss-Kruger zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"South Yemen / Gauss-Kruger zone 8\",GEOGCS[\"So"); + add_srs_wkt (p, 1, + "uth Yemen\",DATUM[\"South_Yemen\",SPHEROID[\"Krassowsky "); + add_srs_wkt (p, 2, + "1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS"); + add_srs_wkt (p, 3, + "84[-76,-138,67,0,0,0,0],AUTHORITY[\"EPSG\",\"6164\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4164\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",45],PARAMETER[\"scale_factor\",1],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",8500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"2395\"],AXIS[\"X\",NORTH],A"); + add_srs_wkt (p, 12, "XIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2396, "epsg", 2396, + "South Yemen / Gauss-Kruger zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=-76,-138,67,0,0,0,0 +units=m +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"South Yemen / Gauss-Kruger zone 9\",GEOGCS[\"So"); + add_srs_wkt (p, 1, + "uth Yemen\",DATUM[\"South_Yemen\",SPHEROID[\"Krassowsky "); + add_srs_wkt (p, 2, + "1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS"); + add_srs_wkt (p, 3, + "84[-76,-138,67,0,0,0,0],AUTHORITY[\"EPSG\",\"6164\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4164\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",51],PARAMETER[\"scale_factor\",1],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",9500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"2396\"],AXIS[\"X\",NORTH],A"); + add_srs_wkt (p, 12, "XIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2397, "epsg", 2397, + "Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 3"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_83\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",9],PARAMETER[\"scale_factor\",1],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",3500000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"2397\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 2398, "epsg", 2398, + "Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 4"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_83\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",12],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",4500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2398\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 2399, "epsg", 2399, + "Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 5"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_83\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",15],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",5500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"2399\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 2400, "epsg", 2400, + "RT90 2.5 gon W (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT90 2.5 gon W (deprecated)\",GEOGCS[\"RT90\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Rikets_koordinatsystem_1990\",SPHEROID[\"Bessel 1"); + add_srs_wkt (p, 2, + "841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6124\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4124\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",15.8"); + add_srs_wkt (p, 9, + "0827777777778],PARAMETER[\"scale_factor\",1],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",1500000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 11, + ",AUTHORITY[\"EPSG\",\"2400\"],AXIS[\"X\",NORTH],AXIS[\"Y"); + add_srs_wkt (p, 12, "\",EAST]]"); + p = add_epsg_def (first, last, 2401, "epsg", 2401, + "Beijing 1954 / 3-degree Gauss-Kruger zone 25"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 25\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",7"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",25500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"2401\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2402, "epsg", 2402, + "Beijing 1954 / 3-degree Gauss-Kruger zone 26"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 26\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",7"); + add_srs_wkt (p, 9, + "8],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",26500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"2402\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2403, "epsg", 2403, + "Beijing 1954 / 3-degree Gauss-Kruger zone 27"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 27\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",8"); + add_srs_wkt (p, 9, + "1],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",27500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"2403\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2404, "epsg", 2404, + "Beijing 1954 / 3-degree Gauss-Kruger zone 28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 28\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",8"); + add_srs_wkt (p, 9, + "4],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",28500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"2404\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2405, "epsg", 2405, + "Beijing 1954 / 3-degree Gauss-Kruger zone 29"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 29\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",8"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",29500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"2405\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2406, "epsg", 2406, + "Beijing 1954 / 3-degree Gauss-Kruger zone 30"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 30\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",30500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"2406\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2407, "epsg", 2407, + "Beijing 1954 / 3-degree Gauss-Kruger zone 31"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 31\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",31500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"2407\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2408, "epsg", 2408, + "Beijing 1954 / 3-degree Gauss-Kruger zone 32"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 32\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",32500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"2408\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2409, "epsg", 2409, + "Beijing 1954 / 3-degree Gauss-Kruger zone 33"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 33\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "9],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",33500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"2409\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2410, "epsg", 2410, + "Beijing 1954 / 3-degree Gauss-Kruger zone 34"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 34\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "02],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",34500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2410\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2411, "epsg", 2411, + "Beijing 1954 / 3-degree Gauss-Kruger zone 35"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 35\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "05],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",35500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2411\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2412, "epsg", 2412, + "Beijing 1954 / 3-degree Gauss-Kruger zone 36"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 36\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "08],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",36500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2412\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2413, "epsg", 2413, + "Beijing 1954 / 3-degree Gauss-Kruger zone 37"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 37\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "11],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",37500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2413\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2414, "epsg", 2414, + "Beijing 1954 / 3-degree Gauss-Kruger zone 38"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 38\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "14],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",38500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2414\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_03 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 2415, "epsg", 2415, + "Beijing 1954 / 3-degree Gauss-Kruger zone 39"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 39\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "17],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",39500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2415\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2416, "epsg", 2416, + "Beijing 1954 / 3-degree Gauss-Kruger zone 40"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 40\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "20],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",40500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2416\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2417, "epsg", 2417, + "Beijing 1954 / 3-degree Gauss-Kruger zone 41"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 41\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "23],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",41500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2417\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2418, "epsg", 2418, + "Beijing 1954 / 3-degree Gauss-Kruger zone 42"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 42\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "26],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",42500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2418\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2419, "epsg", 2419, + "Beijing 1954 / 3-degree Gauss-Kruger zone 43"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 43\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "29],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",43500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2419\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2420, "epsg", 2420, + "Beijing 1954 / 3-degree Gauss-Kruger zone 44"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 44\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "32],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",44500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2420\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2421, "epsg", 2421, + "Beijing 1954 / 3-degree Gauss-Kruger zone 45"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger zone 45\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "35],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",45500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"2421\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 2422, "epsg", 2422, + "Beijing 1954 / 3-degree Gauss-Kruger CM 75E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 75E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",7"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, "EPSG\",\"2422\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2423, "epsg", 2423, + "Beijing 1954 / 3-degree Gauss-Kruger CM 78E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 78E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",7"); + add_srs_wkt (p, 9, + "8],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, "EPSG\",\"2423\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2424, "epsg", 2424, + "Beijing 1954 / 3-degree Gauss-Kruger CM 81E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 81E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",8"); + add_srs_wkt (p, 9, + "1],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, "EPSG\",\"2424\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2425, "epsg", 2425, + "Beijing 1954 / 3-degree Gauss-Kruger CM 84E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 84E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",8"); + add_srs_wkt (p, 9, + "4],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, "EPSG\",\"2425\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2426, "epsg", 2426, + "Beijing 1954 / 3-degree Gauss-Kruger CM 87E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 87E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",8"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, "EPSG\",\"2426\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2427, "epsg", 2427, + "Beijing 1954 / 3-degree Gauss-Kruger CM 90E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 90E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, "EPSG\",\"2427\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2428, "epsg", 2428, + "Beijing 1954 / 3-degree Gauss-Kruger CM 93E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 93E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, "EPSG\",\"2428\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2429, "epsg", 2429, + "Beijing 1954 / 3-degree Gauss-Kruger CM 96E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 96E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, "EPSG\",\"2429\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2430, "epsg", 2430, + "Beijing 1954 / 3-degree Gauss-Kruger CM 99E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 99E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "9],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, "EPSG\",\"2430\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2431, "epsg", 2431, + "Beijing 1954 / 3-degree Gauss-Kruger CM 102E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 102E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "02],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2431\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2432, "epsg", 2432, + "Beijing 1954 / 3-degree Gauss-Kruger CM 105E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 105E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "05],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2432\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2433, "epsg", 2433, + "Beijing 1954 / 3-degree Gauss-Kruger CM 108E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 108E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "08],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2433\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2434, "epsg", 2434, + "Beijing 1954 / 3-degree Gauss-Kruger CM 111E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 111E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "11],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2434\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2435, "epsg", 2435, + "Beijing 1954 / 3-degree Gauss-Kruger CM 114E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 114E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "14],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2435\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2436, "epsg", 2436, + "Beijing 1954 / 3-degree Gauss-Kruger CM 117E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 117E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "17],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2436\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2437, "epsg", 2437, + "Beijing 1954 / 3-degree Gauss-Kruger CM 120E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 120E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "20],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2437\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2438, "epsg", 2438, + "Beijing 1954 / 3-degree Gauss-Kruger CM 123E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 123E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "23],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2438\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2439, "epsg", 2439, + "Beijing 1954 / 3-degree Gauss-Kruger CM 126E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 126E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "26],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2439\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2440, "epsg", 2440, + "Beijing 1954 / 3-degree Gauss-Kruger CM 129E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 129E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "29],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2440\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2441, "epsg", 2441, + "Beijing 1954 / 3-degree Gauss-Kruger CM 132E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 132E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "32],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2441\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2442, "epsg", 2442, + "Beijing 1954 / 3-degree Gauss-Kruger CM 135E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / 3-degree Gauss-Kruger CM 135E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "35],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2442\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2443, "epsg", 2443, + "JGD2000 / Japan Plane Rectangular CS I"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=33 +lon_0=129.5 +k=0.9999 +x_0=0 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS I\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",33],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",129.5],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9999],PARAMETER[\"false_easting\",0],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2443\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2444, "epsg", 2444, + "JGD2000 / Japan Plane Rectangular CS II"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=33 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS II\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",33],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",131],PARAMETER[\"scale_fa"); + add_srs_wkt (p, 10, + "ctor\",0.9999],PARAMETER[\"false_easting\",0],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"2444\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2445, "epsg", 2445, + "JGD2000 / Japan Plane Rectangular CS III"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=132.1666666666667 +k=0.9999"); + add_proj4text (p, 1, + " +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS III\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",36],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",132.1666666666667],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2445\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2446, "epsg", 2446, + "JGD2000 / Japan Plane Rectangular CS IV"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=33 +lon_0=133.5 +k=0.9999 +x_0=0 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS IV\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",33],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",133.5],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9999],PARAMETER[\"false_easting\",0],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2446\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2447, "epsg", 2447, + "JGD2000 / Japan Plane Rectangular CS V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=134.3333333333333 +k=0.9999"); + add_proj4text (p, 1, + " +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS V\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",36],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",134.3333333333333],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2447\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2448, "epsg", 2448, + "JGD2000 / Japan Plane Rectangular CS VI"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS VI\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",36],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",136],PARAMETER[\"scale_fa"); + add_srs_wkt (p, 10, + "ctor\",0.9999],PARAMETER[\"false_easting\",0],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"2448\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2449, "epsg", 2449, + "JGD2000 / Japan Plane Rectangular CS VII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=137.1666666666667 +k=0.9999"); + add_proj4text (p, 1, + " +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS VII\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",36],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",137.1666666666667],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2449\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2450, "epsg", 2450, + "JGD2000 / Japan Plane Rectangular CS VIII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.9999 +x_0=0 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS VIII\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",3"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"central_meridian\",138.5],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",0.9999],PARAMETER[\"false_easting\",0],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2450\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2451, "epsg", 2451, + "JGD2000 / Japan Plane Rectangular CS IX"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=139.8333333333333 +k=0.9999"); + add_proj4text (p, 1, + " +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS IX\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",36],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",139.8333333333333],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2451\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2452, "epsg", 2452, + "JGD2000 / Japan Plane Rectangular CS X"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=140.8333333333333 +k=0.9999"); + add_proj4text (p, 1, + " +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS X\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",40],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",140.8333333333333],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2452\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2453, "epsg", 2453, + "JGD2000 / Japan Plane Rectangular CS XI"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=44 +lon_0=140.25 +k=0.9999 +x_0=0 +y_"); + add_proj4text (p, 1, + "0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS XI\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",44],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",140.25],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9999],PARAMETER[\"false_easting\",0],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2453\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2454, "epsg", 2454, + "JGD2000 / Japan Plane Rectangular CS XII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=44 +lon_0=142.25 +k=0.9999 +x_0=0 +y_"); + add_proj4text (p, 1, + "0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS XII\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",44],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",142.25],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9999],PARAMETER[\"false_easting\",0],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2454\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2455, "epsg", 2455, + "JGD2000 / Japan Plane Rectangular CS XIII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=44 +lon_0=144.25 +k=0.9999 +x_0=0 +y_"); + add_proj4text (p, 1, + "0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS XIII\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",4"); + add_srs_wkt (p, 9, + "4],PARAMETER[\"central_meridian\",144.25],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",0.9999],PARAMETER[\"false_easting\",0],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2455\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2456, "epsg", 2456, + "JGD2000 / Japan Plane Rectangular CS XIV"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=26 +lon_0=142 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS XIV\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",26],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",142],PARAMETER[\"scale_fa"); + add_srs_wkt (p, 10, + "ctor\",0.9999],PARAMETER[\"false_easting\",0],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"2456\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2457, "epsg", 2457, + "JGD2000 / Japan Plane Rectangular CS XV"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=26 +lon_0=127.5 +k=0.9999 +x_0=0 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS XV\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",26],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",127.5],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9999],PARAMETER[\"false_easting\",0],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2457\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2458, "epsg", 2458, + "JGD2000 / Japan Plane Rectangular CS XVI"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=26 +lon_0=124 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS XVI\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",26],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",124],PARAMETER[\"scale_fa"); + add_srs_wkt (p, 10, + "ctor\",0.9999],PARAMETER[\"false_easting\",0],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"2458\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2459, "epsg", 2459, + "JGD2000 / Japan Plane Rectangular CS XVII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=26 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS XVII\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",2"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"central_meridian\",131],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9999],PARAMETER[\"false_easting\",0],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2459\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2460, "epsg", 2460, + "JGD2000 / Japan Plane Rectangular CS XVIII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=20 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS XVIII\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "20],PARAMETER[\"central_meridian\",136],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",0.9999],PARAMETER[\"false_easting\",0],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2460\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2461, "epsg", 2461, + "JGD2000 / Japan Plane Rectangular CS XIX"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=26 +lon_0=154 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / Japan Plane Rectangular CS XIX\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",26],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",154],PARAMETER[\"scale_fa"); + add_srs_wkt (p, 10, + "ctor\",0.9999],PARAMETER[\"false_easting\",0],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"2461\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2462, "epsg", 2462, + "Albanian 1987 / Gauss-Kruger zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Albanian 1987 / Gauss-Kruger zone 4\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Albanian 1987\",DATUM[\"Albanian_1987\",SPHEROID[\"Krass"); + add_srs_wkt (p, 2, + "owsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6191\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4191\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",21],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "4500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, "G\",\"2462\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2463, "epsg", 2463, + "Pulkovo 1995 / Gauss-Kruger CM 21E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 21E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",21],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2463\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2464, "epsg", 2464, + "Pulkovo 1995 / Gauss-Kruger CM 27E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 27E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",27],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2464\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2465, "epsg", 2465, + "Pulkovo 1995 / Gauss-Kruger CM 33E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 33E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",33],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2465\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2466, "epsg", 2466, + "Pulkovo 1995 / Gauss-Kruger CM 39E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 39E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",39],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2466\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2467, "epsg", 2467, + "Pulkovo 1995 / Gauss-Kruger CM 45E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 45E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",45],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2467\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2468, "epsg", 2468, + "Pulkovo 1995 / Gauss-Kruger CM 51E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 51E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",51],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2468\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2469, "epsg", 2469, + "Pulkovo 1995 / Gauss-Kruger CM 57E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 57E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",57],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2469\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2470, "epsg", 2470, + "Pulkovo 1995 / Gauss-Kruger CM 63E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 63E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",63],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2470\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2471, "epsg", 2471, + "Pulkovo 1995 / Gauss-Kruger CM 69E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 69E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",69],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2471\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2472, "epsg", 2472, + "Pulkovo 1995 / Gauss-Kruger CM 75E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 75E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",75],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2472\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2473, "epsg", 2473, + "Pulkovo 1995 / Gauss-Kruger CM 81E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 81E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",81],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2473\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2474, "epsg", 2474, + "Pulkovo 1995 / Gauss-Kruger CM 87E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 87E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",87],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2474\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2475, "epsg", 2475, + "Pulkovo 1995 / Gauss-Kruger CM 93E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 93E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",93],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2475\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2476, "epsg", 2476, + "Pulkovo 1995 / Gauss-Kruger CM 99E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 99E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",99],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2476\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2477, "epsg", 2477, + "Pulkovo 1995 / Gauss-Kruger CM 105E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 105E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",105],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2477\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2478, "epsg", 2478, + "Pulkovo 1995 / Gauss-Kruger CM 111E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 111E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",111],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2478\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2479, "epsg", 2479, + "Pulkovo 1995 / Gauss-Kruger CM 117E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 117E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",117],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2479\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2480, "epsg", 2480, + "Pulkovo 1995 / Gauss-Kruger CM 123E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 123E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",123],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2480\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2481, "epsg", 2481, + "Pulkovo 1995 / Gauss-Kruger CM 129E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 129E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",129],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2481\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2482, "epsg", 2482, + "Pulkovo 1995 / Gauss-Kruger CM 135E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 135E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",135],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2482\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2483, "epsg", 2483, + "Pulkovo 1995 / Gauss-Kruger CM 141E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 141E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",141],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2483\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2484, "epsg", 2484, + "Pulkovo 1995 / Gauss-Kruger CM 147E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 147E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",147],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2484\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2485, "epsg", 2485, + "Pulkovo 1995 / Gauss-Kruger CM 153E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 153E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2485\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2486, "epsg", 2486, + "Pulkovo 1995 / Gauss-Kruger CM 159E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 159E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",159],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2486\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2487, "epsg", 2487, + "Pulkovo 1995 / Gauss-Kruger CM 165E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 165E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",165],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2487\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2488, "epsg", 2488, + "Pulkovo 1995 / Gauss-Kruger CM 171E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 171E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",171],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2488\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2489, "epsg", 2489, + "Pulkovo 1995 / Gauss-Kruger CM 177E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 177E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",177],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2489\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2490, "epsg", 2490, + "Pulkovo 1995 / Gauss-Kruger CM 177W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 177W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",-177],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2490\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2491, "epsg", 2491, + "Pulkovo 1995 / Gauss-Kruger CM 171W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger CM 171W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",-171],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2491\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2492, "epsg", 2492, + "Pulkovo 1942 / Gauss-Kruger CM 9E (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=500000 +y_0=0 +e"); + add_proj4text (p, 1, "llps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 9E (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2492\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2493, "epsg", 2493, + "Pulkovo 1942 / Gauss-Kruger CM 15E (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 15E (deprecated)"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",15],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2493\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2494, "epsg", 2494, + "Pulkovo 1942 / Gauss-Kruger CM 21E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 21E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",21],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2494\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2495, "epsg", 2495, + "Pulkovo 1942 / Gauss-Kruger CM 27E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 27E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",27],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2495\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2496, "epsg", 2496, + "Pulkovo 1942 / Gauss-Kruger CM 33E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 33E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",33],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2496\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2497, "epsg", 2497, + "Pulkovo 1942 / Gauss-Kruger CM 39E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 39E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",39],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2497\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2498, "epsg", 2498, + "Pulkovo 1942 / Gauss-Kruger CM 45E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 45E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",45],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2498\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2499, "epsg", 2499, + "Pulkovo 1942 / Gauss-Kruger CM 51E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 51E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",51],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2499\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2500, "epsg", 2500, + "Pulkovo 1942 / Gauss-Kruger CM 57E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 57E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",57],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2500\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2501, "epsg", 2501, + "Pulkovo 1942 / Gauss-Kruger CM 63E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 63E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",63],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2501\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2502, "epsg", 2502, + "Pulkovo 1942 / Gauss-Kruger CM 69E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 69E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",69],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2502\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2503, "epsg", 2503, + "Pulkovo 1942 / Gauss-Kruger CM 75E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 75E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",75],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2503\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2504, "epsg", 2504, + "Pulkovo 1942 / Gauss-Kruger CM 81E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 81E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",81],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2504\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2505, "epsg", 2505, + "Pulkovo 1942 / Gauss-Kruger CM 87E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 87E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",87],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2505\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2506, "epsg", 2506, + "Pulkovo 1942 / Gauss-Kruger CM 93E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 93E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",93],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2506\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2507, "epsg", 2507, + "Pulkovo 1942 / Gauss-Kruger CM 99E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 99E\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",99],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2507\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2508, "epsg", 2508, + "Pulkovo 1942 / Gauss-Kruger CM 105E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 105E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",105],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2508\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2509, "epsg", 2509, + "Pulkovo 1942 / Gauss-Kruger CM 111E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 111E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",111],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2509\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2510, "epsg", 2510, + "Pulkovo 1942 / Gauss-Kruger CM 117E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 117E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",117],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2510\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2511, "epsg", 2511, + "Pulkovo 1942 / Gauss-Kruger CM 123E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 123E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",123],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2511\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2512, "epsg", 2512, + "Pulkovo 1942 / Gauss-Kruger CM 129E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 129E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",129],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2512\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2513, "epsg", 2513, + "Pulkovo 1942 / Gauss-Kruger CM 135E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 135E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",135],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2513\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2514, "epsg", 2514, + "Pulkovo 1942 / Gauss-Kruger CM 141E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 141E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",141],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2514\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2515, "epsg", 2515, + "Pulkovo 1942 / Gauss-Kruger CM 147E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 147E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",147],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2515\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2516, "epsg", 2516, + "Pulkovo 1942 / Gauss-Kruger CM 153E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 153E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2516\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2517, "epsg", 2517, + "Pulkovo 1942 / Gauss-Kruger CM 159E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 159E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",159],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2517\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2518, "epsg", 2518, + "Pulkovo 1942 / Gauss-Kruger CM 165E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 165E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",165],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2518\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2519, "epsg", 2519, + "Pulkovo 1942 / Gauss-Kruger CM 171E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 171E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",171],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2519\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2520, "epsg", 2520, + "Pulkovo 1942 / Gauss-Kruger CM 177E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 177E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",177],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2520\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2521, "epsg", 2521, + "Pulkovo 1942 / Gauss-Kruger CM 177W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 177W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",-177],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2521\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2522, "epsg", 2522, + "Pulkovo 1942 / Gauss-Kruger CM 171W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger CM 171W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",-171],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2522\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2523, "epsg", 2523, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 7\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",21],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",75000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2523\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2524, "epsg", 2524, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 8\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",24],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",85000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2524\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2525, "epsg", 2525, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 9\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",27],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",95000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2525\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2526, "epsg", 2526, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 10\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",30],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",105"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2526\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2527, "epsg", 2527, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 11"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 11\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",33],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",115"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2527\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2528, "epsg", 2528, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 12\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",36],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",125"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2528\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2529, "epsg", 2529, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 13\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",39],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",135"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2529\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2530, "epsg", 2530, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=14500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 14\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",42],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",145"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2530\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2531, "epsg", 2531, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=15500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 15\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",45],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",155"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2531\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2532, "epsg", 2532, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=16500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 16\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",48],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",165"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2532\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2533, "epsg", 2533, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 17"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=17500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 17\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",51],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",175"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2533\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2534, "epsg", 2534, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 18"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=18500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 18\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",54],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",185"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2534\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2535, "epsg", 2535, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 19"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=19500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 19\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",57],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",195"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2535\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2536, "epsg", 2536, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 20"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=20500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 20\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",60],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",205"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2536\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2537, "epsg", 2537, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 21"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=21500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 21\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",63],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",215"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2537\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2538, "epsg", 2538, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 22"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=22500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 22\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",66],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",225"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2538\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2539, "epsg", 2539, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 23"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=23500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 23\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",69],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",235"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2539\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2540, "epsg", 2540, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 24"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=24500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 24\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",72],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",245"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2540\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2541, "epsg", 2541, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 25"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 25\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",75],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",255"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2541\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2542, "epsg", 2542, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 26"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 26\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",78],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",265"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2542\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_04 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 2543, "epsg", 2543, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 27"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 27\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",81],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",275"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2543\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2544, "epsg", 2544, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 28\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",84],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",285"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2544\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2545, "epsg", 2545, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 29"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 29\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",87],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",295"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2545\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2546, "epsg", 2546, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 30"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 30\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",90],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",305"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2546\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2547, "epsg", 2547, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 31"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 31\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",93],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",315"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2547\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2548, "epsg", 2548, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 32"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 32\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",96],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",325"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2548\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2549, "epsg", 2549, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 33"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 33\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",99],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",335"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2549\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2550, "epsg", 2550, + "Samboja / UTM zone 50S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +ellps=bessel +towgs84=-404.78"); + add_proj4text (p, 1, ",685.68,45.47,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Samboja / UTM zone 50S (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Samboja\",DATUM[\"Samboja\",SPHEROID[\"Bessel 1841\",637"); + add_srs_wkt (p, 2, + "7397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS"); + add_srs_wkt (p, 3, + "84[-404.78,685.68,45.47,0,0,0,0],AUTHORITY[\"EPSG\",\"61"); + add_srs_wkt (p, 4, + "25\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9108\"]],AUTHORITY[\"EPSG\",\"4125\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",117],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"2550\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2551, "epsg", 2551, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 34"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 34\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",102],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",34"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2551\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2552, "epsg", 2552, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 35"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 35\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",105],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",35"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2552\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2553, "epsg", 2553, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 36"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 36\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",108],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",36"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2553\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2554, "epsg", 2554, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 37"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 37\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",111],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",37"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2554\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2555, "epsg", 2555, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 38"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 38\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",114],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",38"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2555\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2556, "epsg", 2556, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 39"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 39\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",117],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",39"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2556\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2557, "epsg", 2557, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 40"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 40\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",120],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",40"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2557\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2558, "epsg", 2558, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 41"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 41\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",123],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",41"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2558\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2559, "epsg", 2559, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 42"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 42\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",126],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",42"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2559\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2560, "epsg", 2560, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 43"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 43\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",129],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",43"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2560\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2561, "epsg", 2561, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 44"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 44\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",132],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",44"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2561\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2562, "epsg", 2562, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 45"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 45\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",135],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",45"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2562\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2563, "epsg", 2563, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 46"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=46500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 46\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",138],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",46"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2563\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2564, "epsg", 2564, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 47"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=47500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 47\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",141],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",47"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2564\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2565, "epsg", 2565, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 48"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=48500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 48\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",144],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",48"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2565\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2566, "epsg", 2566, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 49"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=49500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 49\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",147],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",49"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2566\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2567, "epsg", 2567, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 50"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=50500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 50\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",150],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2567\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2568, "epsg", 2568, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 51"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=51500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 51\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",153],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",51"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2568\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2569, "epsg", 2569, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 52"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=52500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 52\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",156],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",52"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2569\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2570, "epsg", 2570, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 53"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=53500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 53\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",159],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",53"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2570\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2571, "epsg", 2571, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 54"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=54500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 54\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",162],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",54"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2571\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2572, "epsg", 2572, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 55"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=55500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 55\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",165],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",55"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2572\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2573, "epsg", 2573, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 56"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=56500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 56\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",168],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",56"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2573\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2574, "epsg", 2574, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 57"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=57500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 57\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",171],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",57"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2574\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2575, "epsg", 2575, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 58"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=58500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 58\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",174],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",58"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2575\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2576, "epsg", 2576, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 59"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=59500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 59\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",177],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",59"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2576\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2577, "epsg", 2577, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 60 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60000000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 60 (d"); + add_srs_wkt (p, 1, + "eprecated)\",GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_194"); + add_srs_wkt (p, 2, + "2\",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0"); + add_srs_wkt (p, 4, + ".85,-0.12],AUTHORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 5, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 6, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 10, + "\",180],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",60000000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 12, + "ORITY[\"EPSG\",\"2577\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EA"); + add_srs_wkt (p, 13, "ST]]"); + p = add_epsg_def (first, last, 2578, "epsg", 2578, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 61"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=61500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 61\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-177],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",6"); + add_srs_wkt (p, 11, + "1500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"2578\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2579, "epsg", 2579, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 62"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=62500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 62\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-174],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",6"); + add_srs_wkt (p, 11, + "2500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"2579\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2580, "epsg", 2580, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 63"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=63500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 63\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-171],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",6"); + add_srs_wkt (p, 11, + "3500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"2580\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2581, "epsg", 2581, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 64"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=64500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 64\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-168],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",6"); + add_srs_wkt (p, 11, + "4500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"2581\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2582, "epsg", 2582, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",21],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2582\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2583, "epsg", 2583, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",24],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2583\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2584, "epsg", 2584, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",27],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2584\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2585, "epsg", 2585, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",30],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2585\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2586, "epsg", 2586, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",33],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2586\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2587, "epsg", 2587, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",36],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2587\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2588, "epsg", 2588, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",39],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2588\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2589, "epsg", 2589, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",42],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2589\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2590, "epsg", 2590, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",45],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2590\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2591, "epsg", 2591, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",48],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2591\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2592, "epsg", 2592, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",51],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2592\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2593, "epsg", 2593, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",54],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2593\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2594, "epsg", 2594, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",57],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2594\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2595, "epsg", 2595, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",60],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2595\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2596, "epsg", 2596, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",63],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2596\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2597, "epsg", 2597, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",66],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2597\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2598, "epsg", 2598, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",69],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2598\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2599, "epsg", 2599, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",72],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2599\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2600, "epsg", 2600, + "Lietuvos Koordinoei Sistema 1994 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9998 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Lietuvos Koordinoei Sistema 1994 (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"LKS94\",DATUM[\"Lithuania_1994_ETRS89\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6126\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4669\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",24],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9998],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2600\"],AXIS"); + add_srs_wkt (p, 12, "[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2601, "epsg", 2601, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",75],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2601\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2602, "epsg", 2602, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",78],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2602\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2603, "epsg", 2603, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",81],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2603\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2604, "epsg", 2604, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",84],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2604\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2605, "epsg", 2605, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",87],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2605\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2606, "epsg", 2606, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",90],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2606\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2607, "epsg", 2607, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",93],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2607\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2608, "epsg", 2608, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",96],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2608\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2609, "epsg", 2609, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",99],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2609\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2610, "epsg", 2610, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",102],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2610\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2611, "epsg", 2611, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",105],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2611\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2612, "epsg", 2612, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",108],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2612\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2613, "epsg", 2613, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",111],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2613\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2614, "epsg", 2614, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",114],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2614\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2615, "epsg", 2615, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",117],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2615\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2616, "epsg", 2616, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",120],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2616\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2617, "epsg", 2617, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",123],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2617\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2618, "epsg", 2618, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",126],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2618\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2619, "epsg", 2619, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",129],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2619\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2620, "epsg", 2620, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",132],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2620\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2621, "epsg", 2621, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",135],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2621\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2622, "epsg", 2622, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",138],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2622\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2623, "epsg", 2623, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",141],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2623\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2624, "epsg", 2624, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",144],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2624\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2625, "epsg", 2625, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",147],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2625\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2626, "epsg", 2626, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",150],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2626\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2627, "epsg", 2627, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",153],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2627\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2628, "epsg", 2628, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",156],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2628\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2629, "epsg", 2629, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",159],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2629\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2630, "epsg", 2630, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",162],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2630\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2631, "epsg", 2631, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",165],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2631\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2632, "epsg", 2632, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",168],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2632\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2633, "epsg", 2633, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",171],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2633\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2634, "epsg", 2634, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",174],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2634\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2635, "epsg", 2635, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",177],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2635\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2636, "epsg", 2636, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",180],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2636\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2637, "epsg", 2637, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-177],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2637\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2638, "epsg", 2638, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-174],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2638\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2639, "epsg", 2639, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-171],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2639\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2640, "epsg", 2640, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-168],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2640\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2641, "epsg", 2641, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 7\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",21],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",7500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"2641\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2642, "epsg", 2642, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 8\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",24],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",8500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"2642\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2643, "epsg", 2643, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 9\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",27],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",9500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"2643\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2644, "epsg", 2644, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 10\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",30],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",105"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2644\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2645, "epsg", 2645, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 11"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 11\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",33],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",115"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2645\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2646, "epsg", 2646, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 12\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",36],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",125"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2646\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2647, "epsg", 2647, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 13\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",39],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",135"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2647\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2648, "epsg", 2648, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=14500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 14\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",42],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",145"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2648\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2649, "epsg", 2649, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=15500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 15\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",45],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",155"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2649\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2650, "epsg", 2650, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=16500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 16\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",48],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",165"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2650\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2651, "epsg", 2651, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 17"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=17500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 17\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",51],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",175"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2651\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2652, "epsg", 2652, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 18"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=18500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 18\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",54],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",185"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2652\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2653, "epsg", 2653, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 19"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=19500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 19\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",57],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",195"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2653\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2654, "epsg", 2654, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 20"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=20500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 20\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",60],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",205"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2654\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2655, "epsg", 2655, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 21"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=21500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 21\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",63],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",215"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2655\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2656, "epsg", 2656, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 22"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=22500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 22\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",66],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",225"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2656\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2657, "epsg", 2657, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 23"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=23500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 23\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",69],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",235"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2657\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2658, "epsg", 2658, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 24"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=24500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 24\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",72],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",245"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2658\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2659, "epsg", 2659, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 25"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 25\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",75],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",255"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2659\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2660, "epsg", 2660, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 26"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 26\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",78],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",265"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2660\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2661, "epsg", 2661, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 27"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 27\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",81],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",275"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2661\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2662, "epsg", 2662, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 28\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",84],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",285"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2662\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2663, "epsg", 2663, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 29"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 29\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",87],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",295"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2663\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2664, "epsg", 2664, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 30"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 30\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",90],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",305"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2664\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2665, "epsg", 2665, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 31"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 31\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",93],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",315"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2665\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2666, "epsg", 2666, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 32"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 32\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",96],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",325"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2666\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2667, "epsg", 2667, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 33"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 33\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",99],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",335"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2667\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2668, "epsg", 2668, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 34"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 34\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",102],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",34"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2668\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2669, "epsg", 2669, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 35"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 35\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",105],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",35"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2669\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2670, "epsg", 2670, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 36"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 36\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",108],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",36"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2670\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_05 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 2671, "epsg", 2671, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 37"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 37\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",111],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",37"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2671\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2672, "epsg", 2672, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 38"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 38\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",114],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",38"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2672\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2673, "epsg", 2673, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 39"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 39\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",117],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",39"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2673\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2674, "epsg", 2674, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 40"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 40\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",120],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",40"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2674\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2675, "epsg", 2675, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 41"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 41\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",123],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",41"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2675\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2676, "epsg", 2676, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 42"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 42\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",126],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",42"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2676\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2677, "epsg", 2677, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 43"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 43\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",129],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",43"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2677\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2678, "epsg", 2678, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 44"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 44\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",132],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",44"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2678\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2679, "epsg", 2679, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 45"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 45\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",135],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",45"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2679\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2680, "epsg", 2680, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 46"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=46500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 46\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",138],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",46"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2680\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2681, "epsg", 2681, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 47"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=47500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 47\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",141],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",47"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2681\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2682, "epsg", 2682, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 48"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=48500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 48\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",144],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",48"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2682\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2683, "epsg", 2683, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 49"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=49500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 49\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",147],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",49"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2683\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2684, "epsg", 2684, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 50"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=50500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 50\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",150],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2684\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2685, "epsg", 2685, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 51"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=51500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 51\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",153],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",51"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2685\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2686, "epsg", 2686, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 52"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=52500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 52\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",156],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",52"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2686\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2687, "epsg", 2687, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 53"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=53500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 53\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",159],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",53"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2687\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2688, "epsg", 2688, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 54"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=54500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 54\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",162],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",54"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2688\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2689, "epsg", 2689, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 55"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=55500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 55\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",165],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",55"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2689\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2690, "epsg", 2690, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 56"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=56500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 56\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",168],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",56"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2690\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2691, "epsg", 2691, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 57"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=57500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 57\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",171],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",57"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2691\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2692, "epsg", 2692, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 58"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=58500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 58\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",174],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",58"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2692\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2693, "epsg", 2693, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 59"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=59500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 59\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",177],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",59"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"2693\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2694, "epsg", 2694, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 60 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60000000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 60 (d"); + add_srs_wkt (p, 1, + "eprecated)\",GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_199"); + add_srs_wkt (p, 2, + "5\",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,"); + add_srs_wkt (p, 4, + "0.16,-0.12],AUTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",180],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",60000000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 12, + "THORITY[\"EPSG\",\"2694\"],AXIS[\"X\",NORTH],AXIS[\"Y\","); + add_srs_wkt (p, 13, "EAST]]"); + p = add_epsg_def (first, last, 2695, "epsg", 2695, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 61"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=61500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16"); + add_proj4text (p, 2, ",-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 61\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-177],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",6"); + add_srs_wkt (p, 11, + "1500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"2695\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2696, "epsg", 2696, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 62"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=62500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16"); + add_proj4text (p, 2, ",-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 62\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-174],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",6"); + add_srs_wkt (p, 11, + "2500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"2696\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2697, "epsg", 2697, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 63"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=63500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16"); + add_proj4text (p, 2, ",-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 63\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-171],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",6"); + add_srs_wkt (p, 11, + "3500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"2697\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2698, "epsg", 2698, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 64"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=64500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16"); + add_proj4text (p, 2, ",-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 64\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-168],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",6"); + add_srs_wkt (p, 11, + "4500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"2698\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2699, "epsg", 2699, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",21],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2699\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2700, "epsg", 2700, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",24],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2700\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2701, "epsg", 2701, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",27],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2701\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2702, "epsg", 2702, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",30],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2702\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2703, "epsg", 2703, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",33],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2703\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2704, "epsg", 2704, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",36],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2704\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2705, "epsg", 2705, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",39],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2705\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2706, "epsg", 2706, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=42 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",42],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2706\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2707, "epsg", 2707, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",45],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2707\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2708, "epsg", 2708, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",48],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2708\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2709, "epsg", 2709, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",51],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2709\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2710, "epsg", 2710, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=54 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",54],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2710\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2711, "epsg", 2711, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",57],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2711\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2712, "epsg", 2712, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=60 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",60],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2712\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2713, "epsg", 2713, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",63],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2713\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2714, "epsg", 2714, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=66 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",66],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2714\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2715, "epsg", 2715, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",69],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2715\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2716, "epsg", 2716, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=72 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",72],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2716\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2717, "epsg", 2717, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",75],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2717\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2718, "epsg", 2718, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",78],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2718\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2719, "epsg", 2719, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",81],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2719\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2720, "epsg", 2720, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",84],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2720\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2721, "epsg", 2721, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",87],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2721\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2722, "epsg", 2722, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",90],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2722\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2723, "epsg", 2723, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",93],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2723\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2724, "epsg", 2724, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",96],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2724\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2725, "epsg", 2725, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",99],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2725\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2726, "epsg", 2726, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",102],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2726\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2727, "epsg", 2727, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",105],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2727\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2728, "epsg", 2728, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",108],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2728\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2729, "epsg", 2729, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",111],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2729\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2730, "epsg", 2730, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",114],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2730\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2731, "epsg", 2731, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",117],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2731\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2732, "epsg", 2732, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",120],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2732\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2733, "epsg", 2733, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",123],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2733\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2734, "epsg", 2734, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",126],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2734\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2735, "epsg", 2735, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",129],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2735\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2736, "epsg", 2736, "Tete / UTM zone 36S"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +south +ellps=clrk66 +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Tete / UTM zone 36S\",GEOGCS[\"Tete\",DATUM[\"T"); + add_srs_wkt (p, 1, + "ete\",SPHEROID[\"Clarke 1866\",6378206.4,294.97869821390"); + add_srs_wkt (p, 2, + "06,AUTHORITY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"61"); + add_srs_wkt (p, 3, + "27\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4127\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",33],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 9, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"2736\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2737, "epsg", 2737, "Tete / UTM zone 37S"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +south +ellps=clrk66 +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Tete / UTM zone 37S\",GEOGCS[\"Tete\",DATUM[\"T"); + add_srs_wkt (p, 1, + "ete\",SPHEROID[\"Clarke 1866\",6378206.4,294.97869821390"); + add_srs_wkt (p, 2, + "06,AUTHORITY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"61"); + add_srs_wkt (p, 3, + "27\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4127\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",39],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 9, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"2737\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2738, "epsg", 2738, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",132],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2738\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2739, "epsg", 2739, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",135],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2739\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2740, "epsg", 2740, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=138 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",138],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2740\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2741, "epsg", 2741, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",141],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2741\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2742, "epsg", 2742, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=144 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",144],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2742\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2743, "epsg", 2743, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",147],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2743\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2744, "epsg", 2744, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=150 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",150],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2744\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2745, "epsg", 2745, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",153],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2745\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2746, "epsg", 2746, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=156 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",156],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2746\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2747, "epsg", 2747, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",159],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2747\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2748, "epsg", 2748, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=162 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",162],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2748\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2749, "epsg", 2749, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",165],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2749\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2750, "epsg", 2750, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=168 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",168],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2750\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2751, "epsg", 2751, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",171],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2751\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2752, "epsg", 2752, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=174 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",174],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2752\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2753, "epsg", 2753, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",177],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2753\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2754, "epsg", 2754, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",180],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2754\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2755, "epsg", 2755, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-177],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2755\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2756, "epsg", 2756, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-174 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-174],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2756\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2757, "epsg", 2757, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-171],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2757\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2758, "epsg", 2758, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-168 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-168],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2758\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 2759, "epsg", 2759, + "NAD83(HARN) / Alabama East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.9"); + add_proj4text (p, 1, + "9996 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Alabama East\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",30.5],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-85.83333333333333],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.99996],PARAMETER[\"false_easting\",200000],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"2759\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2760, "epsg", 2760, + "NAD83(HARN) / Alabama West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=6"); + add_proj4text (p, 1, "00000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Alabama West\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",30],PARAMETER[\"central_mer"); + add_srs_wkt (p, 9, + "idian\",-87.5],PARAMETER[\"scale_factor\",0.999933333],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",600000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2760\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2761, "epsg", 2761, + "NAD83(HARN) / Arizona East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999"); + add_proj4text (p, 1, "9 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Arizona East\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",31],PARAMETER[\"central_mer"); + add_srs_wkt (p, 9, + "idian\",-110.1666666666667],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9999],PARAMETER[\"false_easting\",213360],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"2761\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2762, "epsg", 2762, + "NAD83(HARN) / Arizona Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999"); + add_proj4text (p, 1, "9 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Arizona Central\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",31],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-111.9166666666667],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9999],PARAMETER[\"false_easting\",213360],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2762\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2763, "epsg", 2763, + "NAD83(HARN) / Arizona West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0"); + add_proj4text (p, 1, "=213360 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Arizona West\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",31],PARAMETER[\"central_mer"); + add_srs_wkt (p, 9, + "idian\",-113.75],PARAMETER[\"scale_factor\",0.999933333]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_easting\",213360],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",0],AUTHORITY[\"EPSG\",\"2763\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 12, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2764, "epsg", 2764, + "NAD83(HARN) / Arkansas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Arkansas North\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",36.2333333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",34.93333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",34.33333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-92],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",400000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"2764\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2765, "epsg", 2765, + "NAD83(HARN) / Arkansas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellp"); + add_proj4text (p, 2, "s=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Arkansas South\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",34.7666666666666"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"standard_parallel_2\",33.3],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",32.66666666666666],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-92],PARAMETER[\"false_easting\",400000],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",400000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "2765\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2766, "epsg", 2766, + "NAD83(HARN) / California zone 1"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.3"); + add_proj4text (p, 1, + "3333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellp"); + add_proj4text (p, 2, "s=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 1\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",41.6666666666666"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"standard_parallel_2\",40],PARAMETER[\"lat"); + add_srs_wkt (p, 10, + "itude_of_origin\",39.33333333333334],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-122],PARAMETER[\"false_easting\",2000000],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "2766\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2767, "epsg", 2767, + "NAD83(HARN) / California zone 2"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y"); + add_proj4text (p, 2, "_0=500000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 2\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",39.8333333333333"); + add_srs_wkt (p, 9, + "4],PARAMETER[\"standard_parallel_2\",38.33333333333334],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",37.66666666666666],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-122],PARAMETER[\"false_easti"); + add_srs_wkt (p, 12, + "ng\",2000000],PARAMETER[\"false_northing\",500000],AUTHO"); + add_srs_wkt (p, 13, + "RITY[\"EPSG\",\"2767\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 14, "H]]"); + p = add_epsg_def (first, last, 2768, "epsg", 2768, + "NAD83(HARN) / California zone 3"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +"); + add_proj4text (p, 2, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 3\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",38.4333333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",37.06666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",36.5],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-120.5],PARAMETER[\"false_easting\",200000"); + add_srs_wkt (p, 12, + "0],PARAMETER[\"false_northing\",500000],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 13, "\",\"2768\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2769, "epsg", 2769, + "NAD83(HARN) / California zone 4"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.3333333333333"); + add_proj4text (p, 1, + "4 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 4\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",37.25],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_2\",36],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 10, + "gin\",35.33333333333334],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 11, + "-119],PARAMETER[\"false_easting\",2000000],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_northing\",500000],AUTHORITY[\"EPSG\",\"2769\"],AXI"); + add_srs_wkt (p, 13, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2770, "epsg", 2770, + "NAD83(HARN) / California zone 5"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +el"); + add_proj4text (p, 2, "lps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 5\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",35.4666666666666"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"standard_parallel_2\",34.03333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",33.5],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-118],PARAMETER[\"false_easting\",2000000]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"2770\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2771, "epsg", 2771, + "NAD83(HARN) / California zone 6"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000"); + add_proj4text (p, 2, " +y_0=500000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 6\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",33.8833333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",32.78333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",32.16666666666666],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-116.25],PARAMETER[\"false_ea"); + add_srs_wkt (p, 12, + "sting\",2000000],PARAMETER[\"false_northing\",500000],AU"); + add_srs_wkt (p, 13, + "THORITY[\"EPSG\",\"2771\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 14, "ORTH]]"); + p = add_epsg_def (first, last, 2772, "epsg", 2772, + "NAD83(HARN) / Colorado North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, "289 +y_0=304800.6096 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Colorado North\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",40.7833333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",39.71666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",39.33333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-105.5],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",914401.8289],PARAMETER[\"false_northing\",304800."); + add_srs_wkt (p, 13, + "6096],AUTHORITY[\"EPSG\",\"2772\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 14, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2773, "epsg", 2773, + "NAD83(HARN) / Colorado Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.8333333333"); + add_proj4text (p, 1, + "3334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +el"); + add_proj4text (p, 2, "lps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Colorado Central\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",39.75],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_2\",38.45],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",37.83333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 11, + "\",-105.5],PARAMETER[\"false_easting\",914401.8289],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_northing\",304800.6096],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"2773\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2774, "epsg", 2774, + "NAD83(HARN) / Colorado South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, "289 +y_0=304800.6096 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Colorado South\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",38.4333333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",37.23333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",36.66666666666666],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-105.5],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",914401.8289],PARAMETER[\"false_northing\",304800."); + add_srs_wkt (p, 13, + "6096],AUTHORITY[\"EPSG\",\"2774\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 14, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2775, "epsg", 2775, + "NAD83(HARN) / Connecticut"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40"); + add_proj4text (p, 1, + ".83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=1524"); + add_proj4text (p, 2, "00.3048 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Connecticut\",GEOGCS[\"NAD83(HARN"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",41.86666666666667],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"standard_parallel_2\",41.2],PARAMETER[\"latit"); + add_srs_wkt (p, 10, + "ude_of_origin\",40.83333333333334],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",-72.75],PARAMETER[\"false_easting\",304800.609"); + add_srs_wkt (p, 12, + "6],PARAMETER[\"false_northing\",152400.3048],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"2775\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2776, "epsg", 2776, + "NAD83(HARN) / Delaware"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999"); + add_proj4text (p, 1, + "995 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Delaware\",GEOGCS[\"NAD83(HARN)\""); + add_srs_wkt (p, 1, + ",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",38],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",-75.41666666666667],PARAMETER[\"scale_factor\",0.9999"); + add_srs_wkt (p, 10, + "95],PARAMETER[\"false_easting\",200000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"2776\"],AXIS[\"X\","); + add_srs_wkt (p, 12, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2777, "epsg", 2777, + "NAD83(HARN) / Florida East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Florida East\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",24.33333333333333],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-81],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".999941177],PARAMETER[\"false_easting\",200000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2777\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2778, "epsg", 2778, + "NAD83(HARN) / Florida West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Florida West\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",24.33333333333333],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-82],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".999941177],PARAMETER[\"false_easting\",200000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2778\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2779, "epsg", 2779, + "NAD83(HARN) / Florida North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=2"); + add_proj4text (p, 1, + "9 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Florida North\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"standard_parallel_1\",30.75],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",29.58333333333333],PARAMETER[\"lat"); + add_srs_wkt (p, 10, + "itude_of_origin\",29],PARAMETER[\"central_meridian\",-84"); + add_srs_wkt (p, 11, + ".5],PARAMETER[\"false_easting\",600000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",0],AUTHORITY[\"EPSG\",\"2779\"],AXIS[\"X\","); + add_srs_wkt (p, 13, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2780, "epsg", 2780, + "NAD83(HARN) / Georgia East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999"); + add_proj4text (p, 1, "9 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Georgia East\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",30],PARAMETER[\"central_mer"); + add_srs_wkt (p, 9, + "idian\",-82.16666666666667],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9999],PARAMETER[\"false_easting\",200000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"2780\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2781, "epsg", 2781, + "NAD83(HARN) / Georgia West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999"); + add_proj4text (p, 1, "9 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Georgia West\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",30],PARAMETER[\"central_mer"); + add_srs_wkt (p, 9, + "idian\",-84.16666666666667],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9999],PARAMETER[\"false_easting\",700000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"2781\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2782, "epsg", 2782, + "NAD83(HARN) / Hawaii zone 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0."); + add_proj4text (p, 1, + "999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Hawaii zone 1\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",18.83333333333333],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-155.5],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999966667],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2782\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2783, "epsg", 2783, + "NAD83(HARN) / Hawaii zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Hawaii zone 2\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",20.33333333333333],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-156.6666666666667],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.999966667],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2783\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2784, "epsg", 2784, + "NAD83(HARN) / Hawaii zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99"); + add_proj4text (p, 1, + "999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Hawaii zone 3\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",21.16666666666667],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-158],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.99999],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2784\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2785, "epsg", 2785, + "NAD83(HARN) / Hawaii zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0."); + add_proj4text (p, 1, + "99999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Hawaii zone 4\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",21.83333333333333],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-159.5],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.99999],PARAMETER[\"false_easting\",500000],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"2785\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2786, "epsg", 2786, + "NAD83(HARN) / Hawaii zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Hawaii zone 5\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",21.66666666666667],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-160.1666666666667],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2786\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2787, "epsg", 2787, + "NAD83(HARN) / Idaho East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666"); + add_proj4text (p, 1, + "666667 +k=0.9999473679999999 +x_0=200000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Idaho East\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",41.66666666666666],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-112.1666666666667],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",0.999947368],PARAMETER[\"false_easting\",200"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"2787\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2788, "epsg", 2788, + "NAD83(HARN) / Idaho Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.99"); + add_proj4text (p, 1, + "99473679999999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Idaho Central\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",41.66666666666666],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-114],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.999947368],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2788\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2789, "epsg", 2789, + "NAD83(HARN) / Idaho West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0"); + add_proj4text (p, 1, + ".999933333 +x_0=800000 +y_0=0 +ellps=GRS80 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Idaho West\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",41.66666666666666],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-115.75],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999933333],PARAMETER[\"false_easting\",800000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2789\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2790, "epsg", 2790, + "NAD83(HARN) / Illinois East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333"); + add_proj4text (p, 1, + "333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Illinois East\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",36.66666666666666],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-88.33333333333333],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.999975],PARAMETER[\"false_easting\",3000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "2790\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2791, "epsg", 2791, + "NAD83(HARN) / Illinois West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999941177 +x_0=700000 +y_0=0 +ellps=GRS80 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Illinois West\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",36.66666666666666],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-90.16666666666667],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.999941177],PARAMETER[\"false_easting\",7"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2791\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2792, "epsg", 2792, + "NAD83(HARN) / Indiana East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=100000 +y_0=250000 +ellps=GRS80 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Indiana East\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",37.5],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-85.66666666666667],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999966667],PARAMETER[\"false_easting\",100000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",250000],AUTHORITY[\"EPSG\",\"2792"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2793, "epsg", 2793, + "NAD83(HARN) / Indiana West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=900000 +y_0=250000 +ellps=GRS80 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Indiana West\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",37.5],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-87.08333333333333],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999966667],PARAMETER[\"false_easting\",900000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",250000],AUTHORITY[\"EPSG\",\"2793"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2794, "epsg", 2794, + "NAD83(HARN) / Iowa North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +"); + add_proj4text (p, 2, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Iowa North\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",43.26666666666667],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"standard_parallel_2\",42.06666666666667],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",41.5],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",-93.5],PARAMETER[\"false_easting\",1500000],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_northing\",1000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "2794\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2795, "epsg", 2795, + "NAD83(HARN) / Iowa South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666"); + add_proj4text (p, 1, + "667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Iowa South\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",41.78333333333333],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"standard_parallel_2\",40.61666666666667],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",40],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-93.5],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 12, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2795\"],"); + add_srs_wkt (p, 13, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2796, "epsg", 2796, + "NAD83(HARN) / Kansas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Kansas North\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"standard_parallel_1\",39.78333333333333]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"standard_parallel_2\",38.71666666666667],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",38.33333333333334],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-98],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",400000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 13, "G\",\"2796\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2797, "epsg", 2797, + "NAD83(HARN) / Kansas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y"); + add_proj4text (p, 2, "_0=400000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Kansas South\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"standard_parallel_1\",38.56666666666667]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"standard_parallel_2\",37.26666666666667],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",36.66666666666666],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-98.5],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",400000],PARAMETER[\"false_northing\",400000],AUTHORI"); + add_srs_wkt (p, 13, + "TY[\"EPSG\",\"2797\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 14, "]"); + p = add_epsg_def (first, last, 2798, "epsg", 2798, + "NAD83(HARN) / Kentucky North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps="); + add_proj4text (p, 2, "GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Kentucky North\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",37.9666666666666"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"standard_parallel_2\",38.96666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",37.5],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-84.25],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 13, "798\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_06 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 2799, "epsg", 2799, + "NAD83(HARN) / Kentucky South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +"); + add_proj4text (p, 2, "y_0=500000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Kentucky South\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",37.9333333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",36.73333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",36.33333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-85.75],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",500000],PARAMETER[\"false_northing\",500000],AUTH"); + add_srs_wkt (p, 13, + "ORITY[\"EPSG\",\"2799\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 14, "TH]]"); + p = add_epsg_def (first, last, 2800, "epsg", 2800, + "NAD83(HARN) / Louisiana North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps="); + add_proj4text (p, 2, "GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Louisiana North\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",32.6666666666666"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"standard_parallel_2\",31.16666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",30.5],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-92.5],PARAMETER[\"false_easting\",1000000"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 13, "800\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2801, "epsg", 2801, + "NAD83(HARN) / Louisiana South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91"); + add_proj4text (p, 1, + ".33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Louisiana South\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",30.7],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_2\",29.3],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 10, + "igin\",28.5],PARAMETER[\"central_meridian\",-91.33333333"); + add_srs_wkt (p, 11, + "333333],PARAMETER[\"false_easting\",1000000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2801\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2802, "epsg", 2802, + "NAD83(HARN) / Maine East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maine East\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",43.66666666666666],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-68.5],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9999],PARAMETER[\"false_easting\",300000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"2802\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2803, "epsg", 2803, + "NAD83(HARN) / Maine West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maine West\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",42.83333333333334],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-70.16666666666667],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",0.999966667],PARAMETER[\"false_easting\",900"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"2803\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2804, "epsg", 2804, + "NAD83(HARN) / Maryland"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666"); + add_proj4text (p, 1, + "666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maryland\",GEOGCS[\"NAD83(HARN)\""); + add_srs_wkt (p, 1, + ",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"standard_parallel_1\",39.45],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",38.3],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 10, + ",37.66666666666666],PARAMETER[\"central_meridian\",-77],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_easting\",400000],PARAMETER[\"false_no"); + add_srs_wkt (p, 12, + "rthing\",0],AUTHORITY[\"EPSG\",\"2804\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 13, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2805, "epsg", 2805, + "NAD83(HARN) / Massachusetts Mainland"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellp"); + add_proj4text (p, 2, "s=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Massachusetts Mainland\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",42.6833333"); + add_srs_wkt (p, 9, + "3333333],PARAMETER[\"standard_parallel_2\",41.7166666666"); + add_srs_wkt (p, 10, + "6667],PARAMETER[\"latitude_of_origin\",41],PARAMETER[\"c"); + add_srs_wkt (p, 11, + "entral_meridian\",-71.5],PARAMETER[\"false_easting\",200"); + add_srs_wkt (p, 12, + "000],PARAMETER[\"false_northing\",750000],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"2805\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2806, "epsg", 2806, + "NAD83(HARN) / Massachusetts Island"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333"); + add_proj4text (p, 1, + "333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Massachusetts Island\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",41.4833333"); + add_srs_wkt (p, 9, + "3333333],PARAMETER[\"standard_parallel_2\",41.2833333333"); + add_srs_wkt (p, 10, + "3333],PARAMETER[\"latitude_of_origin\",41],PARAMETER[\"c"); + add_srs_wkt (p, 11, + "entral_meridian\",-70.5],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 12, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 13, "\"2806\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2807, "epsg", 2807, + "NAD83(HARN) / Michigan North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_"); + add_proj4text (p, 2, "0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Michigan North\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",47.0833333333333"); + add_srs_wkt (p, 9, + "4],PARAMETER[\"standard_parallel_2\",45.48333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",44.78333333333333],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-87],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",8000000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"2807\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2808, "epsg", 2808, + "NAD83(HARN) / Michigan Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43"); + add_proj4text (p, 1, + ".31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +"); + add_proj4text (p, 2, "y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Michigan Central\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",45.7],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_2\",44.18333333333333],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",43.31666666666667],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-84.36666666666666],PARAMETER[\"false_east"); + add_srs_wkt (p, 12, + "ing\",6000000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"2808\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2809, "epsg", 2809, + "NAD83(HARN) / Michigan South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41"); + add_proj4text (p, 1, + ".5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps="); + add_proj4text (p, 2, "GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Michigan South\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",43.6666666666666"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"standard_parallel_2\",42.1],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",41.5],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 11, + ",-84.36666666666666],PARAMETER[\"false_easting\",4000000"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 13, "809\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2810, "epsg", 2810, + "NAD83(HARN) / Minnesota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y"); + add_proj4text (p, 2, "_0=100000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Minnesota North\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",48.6333333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",47.03333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",46.5],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-93.1],PARAMETER[\"false_easting\",800000]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"false_northing\",100000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"2810\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2811, "epsg", 2811, + "NAD83(HARN) / Minnesota Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=4"); + add_proj4text (p, 1, + "5 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +un"); + add_proj4text (p, 2, "its=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Minnesota Central\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",47.05],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_2\",45.61666666666667],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",45],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 11, + "-94.25],PARAMETER[\"false_easting\",800000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",100000],AUTHORITY[\"EPSG\",\"2811\"],AX"); + add_srs_wkt (p, 13, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2812, "epsg", 2812, + "NAD83(HARN) / Minnesota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps="); + add_proj4text (p, 2, "GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Minnesota South\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",45.2166666666666"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"standard_parallel_2\",43.78333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",43],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-94],PARAMETER[\"false_easting\",800000],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"false_northing\",100000],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 13, "812\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2813, "epsg", 2813, + "NAD83(HARN) / Mississippi East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Mississippi East\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",29.5],PARAMETER[\"central"); + add_srs_wkt (p, 9, + "_meridian\",-88.83333333333333],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.99995],PARAMETER[\"false_easting\",300000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2813\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2814, "epsg", 2814, + "NAD83(HARN) / Mississippi West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Mississippi West\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",29.5],PARAMETER[\"central"); + add_srs_wkt (p, 9, + "_meridian\",-90.33333333333333],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.99995],PARAMETER[\"false_easting\",700000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2814\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2815, "epsg", 2815, + "NAD83(HARN) / Missouri East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.9"); + add_proj4text (p, 1, + "99933333 +x_0=250000 +y_0=0 +ellps=GRS80 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Missouri East\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",35.83333333333334],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-90.5],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999933333],PARAMETER[\"false_easting\",250000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2815\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2816, "epsg", 2816, + "NAD83(HARN) / Missouri Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.9"); + add_proj4text (p, 1, + "99933333 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Missouri Central\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",35.83333333333334],PARAME"); + add_srs_wkt (p, 9, + "TER[\"central_meridian\",-92.5],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.999933333],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2816\"]"); + add_srs_wkt (p, 12, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2817, "epsg", 2817, + "NAD83(HARN) / Missouri West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.9"); + add_proj4text (p, 1, + "99941177 +x_0=850000 +y_0=0 +ellps=GRS80 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Missouri West\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",36.16666666666666],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-94.5],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999941177],PARAMETER[\"false_easting\",850000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2817\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2818, "epsg", 2818, "NAD83(HARN) / Montana"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5"); + add_proj4text (p, 1, " +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Montana\",GEOGCS[\"NAD83(HARN)\","); + add_srs_wkt (p, 1, + "DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHEROID["); + add_srs_wkt (p, 2, + "\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"standard_parallel_1\",49],PARAMETER[\"standar"); + add_srs_wkt (p, 9, + "d_parallel_2\",45],PARAMETER[\"latitude_of_origin\",44.2"); + add_srs_wkt (p, 10, + "5],PARAMETER[\"central_meridian\",-109.5],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_easting\",600000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 12, + "THORITY[\"EPSG\",\"2818\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 2819, "epsg", 2819, + "NAD83(HARN) / Nebraska"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +"); + add_proj4text (p, 1, + "lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Nebraska\",GEOGCS[\"NAD83(HARN)\""); + add_srs_wkt (p, 1, + ",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"standard_parallel_1\",43],PARAMETER[\"standar"); + add_srs_wkt (p, 9, + "d_parallel_2\",40],PARAMETER[\"latitude_of_origin\",39.8"); + add_srs_wkt (p, 10, + "3333333333334],PARAMETER[\"central_meridian\",-100],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 12, + "ng\",0],AUTHORITY[\"EPSG\",\"2819\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2820, "epsg", 2820, + "NAD83(HARN) / Nevada East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=200000 +y_0=8000000 +ellps=GRS80 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Nevada East\",GEOGCS[\"NAD83(HARN"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",34.75],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-115.5833333333333],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9999],PARAMETER[\"false_easting\",200000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",8000000],AUTHORITY[\"EPSG\",\"2820\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2821, "epsg", 2821, + "NAD83(HARN) / Nevada Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=500000 +y_0=6000000 +ellps=GRS80 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Nevada Central\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",34.75],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-116.6666666666667],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 10, + "r\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",6000000],AUTHORITY[\"EPSG\",\"2821\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2822, "epsg", 2822, + "NAD83(HARN) / Nevada West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=800000 +y_0=4000000 +ellps=GRS80 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Nevada West\",GEOGCS[\"NAD83(HARN"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",34.75],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-118.5833333333333],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9999],PARAMETER[\"false_easting\",800000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",4000000],AUTHORITY[\"EPSG\",\"2822\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2823, "epsg", 2823, + "NAD83(HARN) / New Hampshire"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New Hampshire\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",42.5],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-71.66666666666667],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999966667],PARAMETER[\"false_easting\",300000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2823\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2824, "epsg", 2824, + "NAD83(HARN) / New Jersey"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New Jersey\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",38.83333333333334],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-74.5],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9999],PARAMETER[\"false_easting\",150000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"2824\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2825, "epsg", 2825, + "NAD83(HARN) / New Mexico East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999"); + add_proj4text (p, 1, + "909091 +x_0=165000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New Mexico East\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",31],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-104.3333333333333],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999909091],PARAMETER[\"false_easting\",165000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2825\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2826, "epsg", 2826, + "NAD83(HARN) / New Mexico Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=5000"); + add_proj4text (p, 1, "00 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New Mexico Central\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",31],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-106.25],PARAMETER[\"scale_factor\",0.9999],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 11, + "hing\",0],AUTHORITY[\"EPSG\",\"2826\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2827, "epsg", 2827, + "NAD83(HARN) / New Mexico West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999"); + add_proj4text (p, 1, + "916667 +x_0=830000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New Mexico West\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",31],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-107.8333333333333],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999916667],PARAMETER[\"false_easting\",830000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2827\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2828, "epsg", 2828, + "NAD83(HARN) / New York East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New York East\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",38.83333333333334],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-74.5],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9999],PARAMETER[\"false_easting\",150000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2828\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2829, "epsg", 2829, + "NAD83(HARN) / New York Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=250000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New York Central\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",40],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-76.58333333333333],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9999375],PARAMETER[\"false_easting\",250000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2829\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2830, "epsg", 2830, + "NAD83(HARN) / New York West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=350000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New York West\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",40],PARAMETER[\"central_mer"); + add_srs_wkt (p, 9, + "idian\",-78.58333333333333],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9999375],PARAMETER[\"false_easting\",350000],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"2830\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2831, "epsg", 2831, + "NAD83(HARN) / New York Long Island"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New York Long Island\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",41.0333333"); + add_srs_wkt (p, 9, + "3333333],PARAMETER[\"standard_parallel_2\",40.6666666666"); + add_srs_wkt (p, 10, + "6666],PARAMETER[\"latitude_of_origin\",40.16666666666666"); + add_srs_wkt (p, 11, + "],PARAMETER[\"central_meridian\",-74],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "easting\",300000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 13, + "ITY[\"EPSG\",\"2831\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 14, "]]"); + p = add_epsg_def (first, last, 2832, "epsg", 2832, + "NAD83(HARN) / North Dakota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333"); + add_proj4text (p, 1, + "333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GR"); + add_proj4text (p, 2, "S80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / North Dakota North\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",48.7333333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",47.43333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",47],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-100.5],PARAMETER[\"false_easting\",600000],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"283"); + add_srs_wkt (p, 13, "2\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2833, "epsg", 2833, + "NAD83(HARN) / North Dakota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333"); + add_proj4text (p, 1, + "333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +"); + add_proj4text (p, 2, "y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / North Dakota South\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",47.4833333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",46.18333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",45.66666666666666],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-100.5],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",600000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"2833\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2834, "epsg", 2834, + "NAD83(HARN) / Ohio North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Ohio North\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",41.7],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_2\",40.43333333333333],PARAMETER[\"latit"); + add_srs_wkt (p, 10, + "ude_of_origin\",39.66666666666666],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",-82.5],PARAMETER[\"false_easting\",600000],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2834\""); + add_srs_wkt (p, 13, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2835, "epsg", 2835, + "NAD83(HARN) / Ohio South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Ohio South\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",40.03333333333333],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"standard_parallel_2\",38.73333333333333],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",38],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-82.5],PARAMETER[\"false_easting\",600000],PARAM"); + add_srs_wkt (p, 12, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2835\"],"); + add_srs_wkt (p, 13, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2836, "epsg", 2836, + "NAD83(HARN) / Oklahoma North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Oklahoma North\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",36.7666666666666"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"standard_parallel_2\",35.56666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",35],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-98],PARAMETER[\"false_easting\",600000],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2836\""); + add_srs_wkt (p, 13, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2837, "epsg", 2837, + "NAD83(HARN) / Oklahoma South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Oklahoma South\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",35.2333333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",33.93333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",33.33333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-98],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",600000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"2837\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2838, "epsg", 2838, + "NAD83(HARN) / Oregon North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Oregon North\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"standard_parallel_1\",46],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_2\",44.33333333333334],PARAMETER[\"latit"); + add_srs_wkt (p, 10, + "ude_of_origin\",43.66666666666666],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",-120.5],PARAMETER[\"false_easting\",2500000],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2838"); + add_srs_wkt (p, 13, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2839, "epsg", 2839, + "NAD83(HARN) / Oregon South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Oregon South\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"standard_parallel_1\",44],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_2\",42.33333333333334],PARAMETER[\"latit"); + add_srs_wkt (p, 10, + "ude_of_origin\",41.66666666666666],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",-120.5],PARAMETER[\"false_easting\",1500000],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2839"); + add_srs_wkt (p, 13, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2840, "epsg", 2840, + "NAD83(HARN) / Rhode Island"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.9"); + add_proj4text (p, 1, + "9999375 +x_0=100000 +y_0=0 +ellps=GRS80 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Rhode Island\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",41.08333333333334],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-71.5],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.99999375],PARAMETER[\"false_easting\",100000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2840\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2841, "epsg", 2841, + "NAD83(HARN) / South Dakota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666"); + add_proj4text (p, 1, + "666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_"); + add_proj4text (p, 2, "0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / South Dakota North\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",45.6833333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",44.41666666666666],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",43.83333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-100],PARAMETER[\"false_easti"); + add_srs_wkt (p, 12, + "ng\",600000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"2841\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2842, "epsg", 2842, + "NAD83(HARN) / South Dakota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42"); + add_proj4text (p, 1, + ".33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y"); + add_proj4text (p, 2, "_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / South Dakota South\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",44.4],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_2\",42.83333333333334],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",42.33333333333334],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-100.3333333333333],PARAMETER[\"false_east"); + add_srs_wkt (p, 12, + "ing\",600000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"2842\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2843, "epsg", 2843, + "NAD83(HARN) / Tennessee"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=3"); + add_proj4text (p, 1, + "4.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GR"); + add_proj4text (p, 2, "S80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Tennessee\",GEOGCS[\"NAD83(HARN)\""); + add_srs_wkt (p, 1, + ",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"standard_parallel_1\",36.41666666666666],PARA"); + add_srs_wkt (p, 9, + "METER[\"standard_parallel_2\",35.25],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",34.33333333333334],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-86],PARAMETER[\"false_easting\",600000],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2843\"],AX"); + add_srs_wkt (p, 13, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2844, "epsg", 2844, + "NAD83(HARN) / Texas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=3"); + add_proj4text (p, 1, + "4 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas North\",GEOGCS[\"NAD83(HARN"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",36.18333333333333],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"standard_parallel_2\",34.65],PARAMETER[\"lati"); + add_srs_wkt (p, 10, + "tude_of_origin\",34],PARAMETER[\"central_meridian\",-101"); + add_srs_wkt (p, 11, + ".5],PARAMETER[\"false_easting\",200000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",1000000],AUTHORITY[\"EPSG\",\"2844\"],AXIS["); + add_srs_wkt (p, 13, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2845, "epsg", 2845, + "NAD83(HARN) / Texas North Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333"); + add_proj4text (p, 1, + "333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y"); + add_proj4text (p, 2, "_0=2000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas North Central\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_2SP\"],PARAMETER[\"standard_parallel_1\",33.96666666"); + add_srs_wkt (p, 9, + "666667],PARAMETER[\"standard_parallel_2\",32.13333333333"); + add_srs_wkt (p, 10, + "333],PARAMETER[\"latitude_of_origin\",31.66666666666667]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"central_meridian\",-98.5],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_easting\",600000],PARAMETER[\"false_northing\",2000000]"); + add_srs_wkt (p, 13, + ",AUTHORITY[\"EPSG\",\"2845\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 2846, "epsg", 2846, + "NAD83(HARN) / Texas Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666"); + add_proj4text (p, 1, + "667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +"); + add_proj4text (p, 2, + "x_0=700000 +y_0=3000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas Central\",GEOGCS[\"NAD83(HA"); + add_srs_wkt (p, 1, + "RN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"standard_parallel_1\",31.88333333333333]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"standard_parallel_2\",30.11666666666667],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",29.66666666666667],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-100.3333333333333],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",700000],PARAMETER[\"false_northing\",300"); + add_srs_wkt (p, 13, + "0000],AUTHORITY[\"EPSG\",\"2846\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 14, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2847, "epsg", 2847, + "NAD83(HARN) / Texas South Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333"); + add_proj4text (p, 1, + "333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0"); + add_proj4text (p, 2, "=4000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas South Central\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_2SP\"],PARAMETER[\"standard_parallel_1\",30.28333333"); + add_srs_wkt (p, 9, + "333333],PARAMETER[\"standard_parallel_2\",28.38333333333"); + add_srs_wkt (p, 10, + "333],PARAMETER[\"latitude_of_origin\",27.83333333333333]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"central_meridian\",-99],PARAMETER[\"false_e"); + add_srs_wkt (p, 12, + "asting\",600000],PARAMETER[\"false_northing\",4000000],A"); + add_srs_wkt (p, 13, + "UTHORITY[\"EPSG\",\"2847\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 14, "NORTH]]"); + p = add_epsg_def (first, last, 2848, "epsg", 2848, + "NAD83(HARN) / Texas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y"); + add_proj4text (p, 2, "_0=5000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas South\",GEOGCS[\"NAD83(HARN"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",27.83333333333333],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"standard_parallel_2\",26.16666666666667],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",25.66666666666667],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"central_meridian\",-98.5],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",300000],PARAMETER[\"false_northing\",5000000],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"2848\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2849, "epsg", 2849, + "NAD83(HARN) / Utah North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +"); + add_proj4text (p, 2, "y_0=1000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Utah North\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",41.78333333333333],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"standard_parallel_2\",40.71666666666667],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",40.33333333333334],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"central_meridian\",-111.5],PARAMETER[\"false_easting"); + add_srs_wkt (p, 12, + "\",500000],PARAMETER[\"false_northing\",1000000],AUTHORI"); + add_srs_wkt (p, 13, + "TY[\"EPSG\",\"2849\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 14, "]"); + p = add_epsg_def (first, last, 2850, "epsg", 2850, + "NAD83(HARN) / Utah Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=3"); + add_proj4text (p, 1, + "8.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 "); + add_proj4text (p, 2, "+ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Utah Central\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"standard_parallel_1\",40.65],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",39.01666666666667],PARAMETER[\"lat"); + add_srs_wkt (p, 10, + "itude_of_origin\",38.33333333333334],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-111.5],PARAMETER[\"false_easting\",500000],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_northing\",2000000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"2850\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2851, "epsg", 2851, + "NAD83(HARN) / Utah South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=3"); + add_proj4text (p, 1, + "6.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 "); + add_proj4text (p, 2, "+ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Utah South\",GEOGCS[\"NAD83(HARN)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",38.35],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",37.21666666666667],PARAMETER[\"lati"); + add_srs_wkt (p, 10, + "tude_of_origin\",36.66666666666666],PARAMETER[\"central_"); + add_srs_wkt (p, 11, + "meridian\",-111.5],PARAMETER[\"false_easting\",500000],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",3000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 13, "\"2851\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2852, "epsg", 2852, "NAD83(HARN) / Vermont"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0"); + add_proj4text (p, 1, "=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Vermont\",GEOGCS[\"NAD83(HARN)\","); + add_srs_wkt (p, 1, + "DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHEROID["); + add_srs_wkt (p, 2, + "\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",42.5],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-72.5],PARAMETER[\"scale_factor\",0.999964286],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"2852\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2853, "epsg", 2853, + "NAD83(HARN) / Virginia North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +"); + add_proj4text (p, 2, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Virginia North\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",39.2],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_2\",38.03333333333333],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",37.66666666666666],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-78.5],PARAMETER[\"false_easting\",3500000"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",2000000],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 13, "\",\"2853\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2854, "epsg", 2854, + "NAD83(HARN) / Virginia South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +"); + add_proj4text (p, 2, "y_0=1000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Virginia South\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",37.9666666666666"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"standard_parallel_2\",36.76666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",36.33333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-78.5],PARAMETER[\"false_east"); + add_srs_wkt (p, 12, + "ing\",3500000],PARAMETER[\"false_northing\",1000000],AUT"); + add_srs_wkt (p, 13, + "HORITY[\"EPSG\",\"2854\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 14, "RTH]]"); + p = add_epsg_def (first, last, 2855, "epsg", 2855, + "NAD83(HARN) / Washington North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47"); + add_proj4text (p, 1, + " +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Washington North\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",48.7333333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",47.5],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",47],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 11, + "120.8333333333333],PARAMETER[\"false_easting\",500000],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2855"); + add_srs_wkt (p, 13, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2856, "epsg", 2856, + "NAD83(HARN) / Washington South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333"); + add_proj4text (p, 1, + "334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +"); + add_proj4text (p, 2, "y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Washington South\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",47.3333333333333"); + add_srs_wkt (p, 9, + "4],PARAMETER[\"standard_parallel_2\",45.83333333333334],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",45.33333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-120.5],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"2856\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2857, "epsg", 2857, + "NAD83(HARN) / West Virginia North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79."); + add_proj4text (p, 1, "5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / West Virginia North\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_2SP\"],PARAMETER[\"standard_parallel_1\",40.25],PARA"); + add_srs_wkt (p, 9, + "METER[\"standard_parallel_2\",39],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 10, + "f_origin\",38.5],PARAMETER[\"central_meridian\",-79.5],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",600000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",0],AUTHORITY[\"EPSG\",\"2857\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 13, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2858, "epsg", 2858, + "NAD83(HARN) / West Virginia South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / West Virginia South\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_2SP\"],PARAMETER[\"standard_parallel_1\",38.88333333"); + add_srs_wkt (p, 9, + "333333],PARAMETER[\"standard_parallel_2\",37.48333333333"); + add_srs_wkt (p, 10, + "333],PARAMETER[\"latitude_of_origin\",37],PARAMETER[\"ce"); + add_srs_wkt (p, 11, + "ntral_meridian\",-81],PARAMETER[\"false_easting\",600000"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 13, "858\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2859, "epsg", 2859, + "NAD83(HARN) / Wisconsin North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wisconsin North\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",46.7666666666666"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"standard_parallel_2\",45.56666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",45.16666666666666],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-90],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",600000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"2859\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2860, "epsg", 2860, + "NAD83(HARN) / Wisconsin Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333"); + add_proj4text (p, 1, + "334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wisconsin Central\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",45.5],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_2\",44.25],PARAMETER[\"latitude_of_o"); + add_srs_wkt (p, 10, + "rigin\",43.83333333333334],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 11, + ",-90],PARAMETER[\"false_easting\",600000],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"2860\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2861, "epsg", 2861, + "NAD83(HARN) / Wisconsin South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wisconsin South\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",44.0666666666666"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"standard_parallel_2\",42.73333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",42],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-90],PARAMETER[\"false_easting\",600000],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2861\""); + add_srs_wkt (p, 13, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2862, "epsg", 2862, + "NAD83(HARN) / Wyoming East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wyoming East\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",40.5],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-105.1666666666667],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9999375],PARAMETER[\"false_easting\",200000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2862\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2863, "epsg", 2863, + "NAD83(HARN) / Wyoming East Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=400000 +y_0=100000 +ellps=GRS80 +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wyoming East Central\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",40.5],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-107.3333333333333],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9999375],PARAMETER[\"false_easting\",400000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",100000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"2863\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2864, "epsg", 2864, + "NAD83(HARN) / Wyoming West Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0"); + add_proj4text (p, 1, "=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wyoming West Central\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",40.5],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-108.75],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9999375],PARAMETER[\"false_easting\",600000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2864\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2865, "epsg", 2865, + "NAD83(HARN) / Wyoming West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wyoming West\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",40.5],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-110.0833333333333],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9999375],PARAMETER[\"false_easting\",800000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",100000],AUTHORITY[\"EPSG\",\"2865\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2866, "epsg", 2866, + "NAD83(HARN) / Puerto Rico and Virgin Is."); + add_proj4text (p, 0, + "+proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +"); + add_proj4text (p, 2, + "x_0=200000 +y_0=200000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Puerto Rico and Virgin Is.\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_"); + add_srs_wkt (p, 2, + "Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Confo"); + add_srs_wkt (p, 8, + "rmal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",18.4"); + add_srs_wkt (p, 9, + "3333333333333],PARAMETER[\"standard_parallel_2\",18.0333"); + add_srs_wkt (p, 10, + "3333333333],PARAMETER[\"latitude_of_origin\",17.83333333"); + add_srs_wkt (p, 11, + "333333],PARAMETER[\"central_meridian\",-66.4333333333333"); + add_srs_wkt (p, 12, + "4],PARAMETER[\"false_easting\",200000],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",200000],AUTHORITY[\"EPSG\",\"2866\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2867, "epsg", 2867, + "NAD83(HARN) / Arizona East (ft)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=213360 +y_0=0 +ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Arizona East (ft)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9002\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",31],PARAMETER[\"centr"); + add_srs_wkt (p, 9, + "al_meridian\",-110.1666666666667],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.9999],PARAMETER[\"false_easting\",700000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2867\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2868, "epsg", 2868, + "NAD83(HARN) / Arizona Central (ft)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=213360 +y_0=0 +ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Arizona Central (ft)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9002\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",31],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-111.9166666666667],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9999],PARAMETER[\"false_easting\",700000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2868\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2869, "epsg", 2869, + "NAD83(HARN) / Arizona West (ft)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0"); + add_proj4text (p, 1, "=213360 +y_0=0 +ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Arizona West (ft)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9002\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",31],PARAMETER[\"centr"); + add_srs_wkt (p, 9, + "al_meridian\",-113.75],PARAMETER[\"scale_factor\",0.9999"); + add_srs_wkt (p, 10, + "33333],PARAMETER[\"false_easting\",700000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"2869\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2870, "epsg", 2870, + "NAD83(HARN) / California zone 1 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.3"); + add_proj4text (p, 1, + "3333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=5000"); + add_proj4text (p, 2, "00.0001016001 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 1 (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Ne"); + add_srs_wkt (p, 2, + "twork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey fo"); + add_srs_wkt (p, 7, + "ot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",41.66666666666666],PARAMETER[\"stand"); + add_srs_wkt (p, 10, + "ard_parallel_2\",40],PARAMETER[\"latitude_of_origin\",39"); + add_srs_wkt (p, 11, + ".33333333333334],PARAMETER[\"central_meridian\",-122],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_easting\",6561666.667],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",1640416.667],AUTHORITY[\"EPSG\",\"2870\"],AX"); + add_srs_wkt (p, 14, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2871, "epsg", 2871, + "NAD83(HARN) / California zone 2 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.00"); + add_proj4text (p, 2, + "01016 +y_0=500000.0001016001 +ellps=GRS80 +units=us-ft +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 2 (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Ne"); + add_srs_wkt (p, 2, + "twork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey fo"); + add_srs_wkt (p, 7, + "ot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",39.83333333333334],PARAMETER[\"stand"); + add_srs_wkt (p, 10, + "ard_parallel_2\",38.33333333333334],PARAMETER[\"latitude"); + add_srs_wkt (p, 11, + "_of_origin\",37.66666666666666],PARAMETER[\"central_meri"); + add_srs_wkt (p, 12, + "dian\",-122],PARAMETER[\"false_easting\",6561666.667],PA"); + add_srs_wkt (p, 13, + "RAMETER[\"false_northing\",1640416.667],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 14, "\",\"2871\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2872, "epsg", 2872, + "NAD83(HARN) / California zone 3 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0="); + add_proj4text (p, 2, + "500000.0001016001 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 3 (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Ne"); + add_srs_wkt (p, 2, + "twork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey fo"); + add_srs_wkt (p, 7, + "ot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",38.43333333333333],PARAMETER[\"stand"); + add_srs_wkt (p, 10, + "ard_parallel_2\",37.06666666666667],PARAMETER[\"latitude"); + add_srs_wkt (p, 11, + "_of_origin\",36.5],PARAMETER[\"central_meridian\",-120.5"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_easting\",6561666.667],PARAMETER[\"f"); + add_srs_wkt (p, 13, + "alse_northing\",1640416.667],AUTHORITY[\"EPSG\",\"2872\""); + add_srs_wkt (p, 14, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2873, "epsg", 2873, + "NAD83(HARN) / California zone 4 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.3333333333333"); + add_proj4text (p, 1, + "4 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.000101600"); + add_proj4text (p, 2, "1 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 4 (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Ne"); + add_srs_wkt (p, 2, + "twork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey fo"); + add_srs_wkt (p, 7, + "ot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",37.25],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 10, + "_2\",36],PARAMETER[\"latitude_of_origin\",35.33333333333"); + add_srs_wkt (p, 11, + "334],PARAMETER[\"central_meridian\",-119],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_easting\",6561666.667],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 13, + "1640416.667],AUTHORITY[\"EPSG\",\"2873\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 14, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2874, "epsg", 2874, + "NAD83(HARN) / California zone 5 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=50"); + add_proj4text (p, 2, "0000.0001016001 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 5 (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Ne"); + add_srs_wkt (p, 2, + "twork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey fo"); + add_srs_wkt (p, 7, + "ot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",35.46666666666667],PARAMETER[\"stand"); + add_srs_wkt (p, 10, + "ard_parallel_2\",34.03333333333333],PARAMETER[\"latitude"); + add_srs_wkt (p, 11, + "_of_origin\",33.5],PARAMETER[\"central_meridian\",-118],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_easting\",6561666.667],PARAMETER[\"fal"); + add_srs_wkt (p, 13, + "se_northing\",1640416.667],AUTHORITY[\"EPSG\",\"2874\"],"); + add_srs_wkt (p, 14, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2875, "epsg", 2875, + "NAD83(HARN) / California zone 6 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000"); + add_proj4text (p, 2, + ".0001016 +y_0=500000.0001016001 +ellps=GRS80 +units=us-f"); + add_proj4text (p, 3, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California zone 6 (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Ne"); + add_srs_wkt (p, 2, + "twork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey fo"); + add_srs_wkt (p, 7, + "ot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",33.88333333333333],PARAMETER[\"stand"); + add_srs_wkt (p, 10, + "ard_parallel_2\",32.78333333333333],PARAMETER[\"latitude"); + add_srs_wkt (p, 11, + "_of_origin\",32.16666666666666],PARAMETER[\"central_meri"); + add_srs_wkt (p, 12, + "dian\",-116.25],PARAMETER[\"false_easting\",6561666.667]"); + add_srs_wkt (p, 13, + ",PARAMETER[\"false_northing\",1640416.667],AUTHORITY[\"E"); + add_srs_wkt (p, 14, "PSG\",\"2875\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2876, "epsg", 2876, + "NAD83(HARN) / Colorado North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, + "288036576 +y_0=304800.6096012192 +ellps=GRS80 +units=us-"); + add_proj4text (p, 3, "ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Colorado North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",40.78333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",39.71666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",39.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-105.5],PARAMETER[\"false_easting\",3000000],PARAMETE"); + add_srs_wkt (p, 13, + "R[\"false_northing\",1000000],AUTHORITY[\"EPSG\",\"2876\""); + add_srs_wkt (p, 14, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2877, "epsg", 2877, + "NAD83(HARN) / Colorado Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.8333333333"); + add_proj4text (p, 1, + "3334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.60"); + add_proj4text (p, 2, "96012192 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Colorado Central (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Net"); + add_srs_wkt (p, 2, + "work\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foo"); + add_srs_wkt (p, 7, + "t\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_1\",39.75],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 10, + "2\",38.45],PARAMETER[\"latitude_of_origin\",37.833333333"); + add_srs_wkt (p, 11, + "33334],PARAMETER[\"central_meridian\",-105.5],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_easting\",3000000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 13, + "1000000],AUTHORITY[\"EPSG\",\"2877\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 14, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2878, "epsg", 2878, + "NAD83(HARN) / Colorado South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, + "288036576 +y_0=304800.6096012192 +ellps=GRS80 +units=us-"); + add_proj4text (p, 3, "ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Colorado South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",38.43333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",37.23333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",36.66666666666666],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-105.5],PARAMETER[\"false_easting\",3000000],PARAMETE"); + add_srs_wkt (p, 13, + "R[\"false_northing\",1000000],AUTHORITY[\"EPSG\",\"2878\""); + add_srs_wkt (p, 14, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2879, "epsg", 2879, + "NAD83(HARN) / Connecticut (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40"); + add_proj4text (p, 1, + ".83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_"); + add_proj4text (p, 2, + "0=152400.3048006096 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Connecticut (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",41.86666666666667],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_2\",41.2],PARAMETER[\"latitude_of_origin\",40.833333"); + add_srs_wkt (p, 11, + "33333334],PARAMETER[\"central_meridian\",-72.75],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_easting\",1000000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 13, + "\",500000],AUTHORITY[\"EPSG\",\"2879\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 14, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2880, "epsg", 2880, + "NAD83(HARN) / Delaware (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999"); + add_proj4text (p, 1, + "995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +units=us"); + add_proj4text (p, 2, "-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Delaware (ftUS)\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",38],PARAMETER[\"central_meridian\",-75.41666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"scale_factor\",0.999995],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",656166.667],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"2880\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 13, "RTH]]"); + p = add_epsg_def (first, last, 2881, "epsg", 2881, + "NAD83(HARN) / Florida East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +units"); + add_proj4text (p, 2, "=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Florida East (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",24.33333333333333],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 10, + "-81],PARAMETER[\"scale_factor\",0.999941177],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",656166.667],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"2881\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2882, "epsg", 2882, + "NAD83(HARN) / Florida West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +units"); + add_proj4text (p, 2, "=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Florida West (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",24.33333333333333],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 10, + "-82],PARAMETER[\"scale_factor\",0.999941177],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",656166.667],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"2882\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2883, "epsg", 2883, + "NAD83(HARN) / Florida North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=2"); + add_proj4text (p, 1, + "9 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us"); + add_proj4text (p, 2, "-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Florida North (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",30.75],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 10, + ",29.58333333333333],PARAMETER[\"latitude_of_origin\",29]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"central_meridian\",-84.5],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_easting\",1968500],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 13, + "ORITY[\"EPSG\",\"2883\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 14, "TH]]"); + p = add_epsg_def (first, last, 2884, "epsg", 2884, + "NAD83(HARN) / Georgia East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Georgia East (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",30],PARAMETER[\"central_meridian\",-82.16666666666"); + add_srs_wkt (p, 10, + "667],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",656166.667],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"2884\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 2885, "epsg", 2885, + "NAD83(HARN) / Georgia West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Georgia West (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",30],PARAMETER[\"central_meridian\",-84.16666666666"); + add_srs_wkt (p, 10, + "667],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",2296583.333],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"2885\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 2886, "epsg", 2886, + "NAD83(HARN) / Idaho East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666"); + add_proj4text (p, 1, + "666667 +k=0.9999473679999999 +x_0=200000.0001016002 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Idaho East (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",41.66666666666666],PARAMETER[\"central_meridian\",-112."); + add_srs_wkt (p, 10, + "1666666666667],PARAMETER[\"scale_factor\",0.999947368],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",656166.667],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_northing\",0],AUTHORITY[\"EPSG\",\"2886\"],AXIS[\"X\",E"); + add_srs_wkt (p, 13, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2887, "epsg", 2887, + "NAD83(HARN) / Idaho Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.99"); + add_proj4text (p, 1, + "99473679999999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS8"); + add_proj4text (p, 2, "0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Idaho Central (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",41.66666666666666],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-114],PARAMETER[\"scale_factor\",0.999947368],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",1640416.667],PARAMETER[\"false_northi"); + add_srs_wkt (p, 12, + "ng\",0],AUTHORITY[\"EPSG\",\"2887\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2888, "epsg", 2888, + "NAD83(HARN) / Idaho West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0"); + add_proj4text (p, 1, + ".999933333 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +u"); + add_proj4text (p, 2, "nits=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Idaho West (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",41.66666666666666],PARAMETER[\"central_meridian\",-115."); + add_srs_wkt (p, 10, + "75],PARAMETER[\"scale_factor\",0.999933333],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",2624666.667],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"2888\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2889, "epsg", 2889, + "NAD83(HARN) / Indiana East (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=99999.99989839978 +y_0=249364.9987299975 +"); + add_proj4text (p, 2, "ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Indiana East (ftUS) (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regi"); + add_srs_wkt (p, 2, + "onal_Network\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"61"); + add_srs_wkt (p, 4, + "52\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US surv"); + add_srs_wkt (p, 7, + "ey foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",37.5],PARAMETER[\"central_meridian\",-85"); + add_srs_wkt (p, 10, + ".66666666666667],PARAMETER[\"scale_factor\",0.999966667]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",328083.333],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_northing\",818125],AUTHORITY[\"EPSG\",\"2889\"],AXIS["); + add_srs_wkt (p, 13, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2890, "epsg", 2890, + "NAD83(HARN) / Indiana West (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=900000 +y_0=249364.9987299975 +ellps=GRS80"); + add_proj4text (p, 2, " +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Indiana West (ftUS) (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regi"); + add_srs_wkt (p, 2, + "onal_Network\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"61"); + add_srs_wkt (p, 4, + "52\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US surv"); + add_srs_wkt (p, 7, + "ey foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",37.5],PARAMETER[\"central_meridian\",-87"); + add_srs_wkt (p, 10, + ".08333333333333],PARAMETER[\"scale_factor\",0.999966667]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",2952750],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "northing\",818125],AUTHORITY[\"EPSG\",\"2890\"],AXIS[\"X"); + add_srs_wkt (p, 13, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2891, "epsg", 2891, + "NAD83(HARN) / Kentucky North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_"); + add_proj4text (p, 2, "0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Kentucky North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",37.96666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",38.96666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",37.5],PARAMETER[\"central_meridian\",-84.25],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_easting\",1640416.667],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",0],AUTHORITY[\"EPSG\",\"2891\"],AXIS[\"X\",E"); + add_srs_wkt (p, 14, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2892, "epsg", 2892, + "NAD83(HARN) / Kentucky South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0"); + add_proj4text (p, 2, + "001016001 +y_0=500000.0001016001 +ellps=GRS80 +units=us-"); + add_proj4text (p, 3, "ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Kentucky South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",37.93333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",36.73333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",36.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-85.75],PARAMETER[\"false_easting\",1640416.667],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_northing\",1640416.667],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"2892\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2893, "epsg", 2893, + "NAD83(HARN) / Maryland (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666"); + add_proj4text (p, 1, + "666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS8"); + add_proj4text (p, 2, "0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maryland (ftUS)\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",39.45],PARAMETER[\"standard_parallel_2\",38.3"); + add_srs_wkt (p, 10, + "],PARAMETER[\"latitude_of_origin\",37.66666666666666],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"central_meridian\",-77],PARAMETER[\"false_east"); + add_srs_wkt (p, 12, + "ing\",1312333.333],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 13, + "RITY[\"EPSG\",\"2893\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 14, "H]]"); + p = add_epsg_def (first, last, 2894, "epsg", 2894, + "NAD83(HARN) / Massachusetts Mainland (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=7"); + add_proj4text (p, 2, "50000 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Massachusetts Mainland (ftUS)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Region"); + add_srs_wkt (p, 2, + "al_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US surv"); + add_srs_wkt (p, 7, + "ey foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",42.68333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",41.71666666666667],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",41],PARAMETER[\"central_meridian\",-71"); + add_srs_wkt (p, 12, + ".5],PARAMETER[\"false_easting\",656166.667],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_northing\",2460625],AUTHORITY[\"EPSG\",\"2894\"],A"); + add_srs_wkt (p, 14, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2895, "epsg", 2895, + "NAD83(HARN) / Massachusetts Island (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333"); + add_proj4text (p, 1, + "333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0"); + add_proj4text (p, 2, " +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Massachusetts Island (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional"); + add_srs_wkt (p, 2, + "_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey "); + add_srs_wkt (p, 7, + "foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",41.48333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",41.28333333333333],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",41],PARAMETER[\"central_meridian\",-70.5]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"false_easting\",1640416.667],PARAMETER[\"fa"); + add_srs_wkt (p, 13, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"2895\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2896, "epsg", 2896, + "NAD83(HARN) / Michigan North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999"); + add_proj4text (p, 2, "968001 +y_0=0 +ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Michigan North (ft)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conforma"); + add_srs_wkt (p, 8, + "l_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",47.0833"); + add_srs_wkt (p, 9, + "3333333334],PARAMETER[\"standard_parallel_2\",45.4833333"); + add_srs_wkt (p, 10, + "3333333],PARAMETER[\"latitude_of_origin\",44.78333333333"); + add_srs_wkt (p, 11, + "333],PARAMETER[\"central_meridian\",-87],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_easting\",26246719.16],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 13, + "],AUTHORITY[\"EPSG\",\"2896\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 14, "\",NORTH]]"); + p = add_epsg_def (first, last, 2897, "epsg", 2897, + "NAD83(HARN) / Michigan Central (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43"); + add_proj4text (p, 1, + ".31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.9"); + add_proj4text (p, 2, "99976001 +y_0=0 +ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Michigan Central (ft)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conform"); + add_srs_wkt (p, 8, + "al_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",45.7],"); + add_srs_wkt (p, 9, + "PARAMETER[\"standard_parallel_2\",44.18333333333333],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"latitude_of_origin\",43.31666666666667],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"central_meridian\",-84.36666666666666],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",19685039.37],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"2897\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2898, "epsg", 2898, + "NAD83(HARN) / Michigan South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41"); + add_proj4text (p, 1, + ".5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 "); + add_proj4text (p, 2, "+ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Michigan South (ft)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conforma"); + add_srs_wkt (p, 8, + "l_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",43.6666"); + add_srs_wkt (p, 9, + "6666666666],PARAMETER[\"standard_parallel_2\",42.1],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",41.5],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",-84.36666666666666],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",13123359.58],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"2898\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2899, "epsg", 2899, + "NAD83(HARN) / Mississippi East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +units=u"); + add_proj4text (p, 2, "s-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Mississippi East (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Net"); + add_srs_wkt (p, 2, + "work\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foo"); + add_srs_wkt (p, 7, + "t\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",29.5],PARAMETER[\"central_meridian\",-88.83333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"scale_factor\",0.99995],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",984250.0000000002],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "northing\",0],AUTHORITY[\"EPSG\",\"2899\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 13, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2900, "epsg", 2900, + "NAD83(HARN) / Mississippi West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +units=u"); + add_proj4text (p, 2, "s-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Mississippi West (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Net"); + add_srs_wkt (p, 2, + "work\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foo"); + add_srs_wkt (p, 7, + "t\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",29.5],PARAMETER[\"central_meridian\",-90.33333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"scale_factor\",0.99995],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",2296583.333],PARAMETER[\"false_northi"); + add_srs_wkt (p, 12, + "ng\",0],AUTHORITY[\"EPSG\",\"2900\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2901, "epsg", 2901, + "NAD83(HARN) / Montana (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5"); + add_proj4text (p, 1, + " +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +units=ft +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Montana (ft)\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conformal_Conic"); + add_srs_wkt (p, 8, + "_2SP\"],PARAMETER[\"standard_parallel_1\",49],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_2\",45],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",44.25],PARAMETER[\"central_meridian\",-109.5],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",1968503.937],PARAMETER[\"false_no"); + add_srs_wkt (p, 12, + "rthing\",0],AUTHORITY[\"EPSG\",\"2901\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 13, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2902, "epsg", 2902, + "NAD83(HARN) / New Mexico East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999"); + add_proj4text (p, 1, + "909091 +x_0=165000 +y_0=0 +ellps=GRS80 +units=us-ft +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New Mexico East (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",31],PARAMETER[\"central_meridian\",-104.333333333"); + add_srs_wkt (p, 10, + "3333],PARAMETER[\"scale_factor\",0.999909091],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",541337.5],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"2902\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2903, "epsg", 2903, + "NAD83(HARN) / New Mexico Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=5000"); + add_proj4text (p, 1, + "00.0001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New Mexico Central (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_N"); + add_srs_wkt (p, 2, + "etwork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey f"); + add_srs_wkt (p, 7, + "oot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",31],PARAMETER[\"central_meridian\",-106.25],"); + add_srs_wkt (p, 10, + "PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",1640416.667],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 12, + "ORITY[\"EPSG\",\"2903\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 2904, "epsg", 2904, + "NAD83(HARN) / New Mexico West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999"); + add_proj4text (p, 1, + "916667 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +units"); + add_proj4text (p, 2, "=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New Mexico West (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",31],PARAMETER[\"central_meridian\",-107.833333333"); + add_srs_wkt (p, 10, + "3333],PARAMETER[\"scale_factor\",0.999916667],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",2723091.667],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"2904\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2905, "epsg", 2905, + "NAD83(HARN) / New York East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +units=us-ft +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New York East (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",38.83333333333334],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-74.5],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",492125],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"2905\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 2906, "epsg", 2906, + "NAD83(HARN) / New York Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +units=u"); + add_proj4text (p, 2, "s-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New York Central (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Net"); + add_srs_wkt (p, 2, + "work\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foo"); + add_srs_wkt (p, 7, + "t\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",40],PARAMETER[\"central_meridian\",-76.5833333"); + add_srs_wkt (p, 10, + "3333333],PARAMETER[\"scale_factor\",0.9999375],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",820208.3330000002],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "northing\",0],AUTHORITY[\"EPSG\",\"2906\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 13, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2907, "epsg", 2907, + "NAD83(HARN) / New York West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +units=u"); + add_proj4text (p, 2, "s-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New York West (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",40],PARAMETER[\"central_meridian\",-78.5833333333"); + add_srs_wkt (p, 10, + "3333],PARAMETER[\"scale_factor\",0.9999375],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",1148291.667],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"2907\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2908, "epsg", 2908, + "NAD83(HARN) / New York Long Island (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000"); + add_proj4text (p, 2, "000001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New York Long Island (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional"); + add_srs_wkt (p, 2, + "_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey "); + add_srs_wkt (p, 7, + "foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",41.03333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",40.66666666666666],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",40.16666666666666],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-74],PARAMETER[\"false_easting\",984250.0000000"); + add_srs_wkt (p, 13, + "002],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 14, "\"2908\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2909, "epsg", 2909, + "NAD83(HARN) / North Dakota North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333"); + add_proj4text (p, 1, + "333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +"); + add_proj4text (p, 2, "ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / North Dakota North (ft)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Net"); + add_srs_wkt (p, 2, + "work\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",48."); + add_srs_wkt (p, 9, + "73333333333333],PARAMETER[\"standard_parallel_2\",47.433"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"latitude_of_origin\",47],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-100.5],PARAMETER[\"false_easti"); + add_srs_wkt (p, 12, + "ng\",1968503.937],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 13, + "ITY[\"EPSG\",\"2909\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 14, "]]"); + p = add_epsg_def (first, last, 2910, "epsg", 2910, + "NAD83(HARN) / North Dakota South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333"); + add_proj4text (p, 1, + "333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9"); + add_proj4text (p, 2, "999976 +y_0=0 +ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / North Dakota South (ft)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Net"); + add_srs_wkt (p, 2, + "work\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",47."); + add_srs_wkt (p, 9, + "48333333333333],PARAMETER[\"standard_parallel_2\",46.183"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"latitude_of_origin\",45.6666666"); + add_srs_wkt (p, 11, + "6666666],PARAMETER[\"central_meridian\",-100.5],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_easting\",1968503.937],PARAMETER[\"false_north"); + add_srs_wkt (p, 13, + "ing\",0],AUTHORITY[\"EPSG\",\"2910\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 14, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2911, "epsg", 2911, + "NAD83(HARN) / Oklahoma North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Oklahoma North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",36.76666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",35.56666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",35],PARAMETER[\"central_meridian\",-98],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_easting\",1968500],PARAMETER[\"false_northing"); + add_srs_wkt (p, 13, + "\",0],AUTHORITY[\"EPSG\",\"2911\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 14, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2912, "epsg", 2912, + "NAD83(HARN) / Oklahoma South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Oklahoma South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",35.23333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",33.93333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",33.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-98],PARAMETER[\"false_easting\",1968500],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2912\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2913, "epsg", 2913, + "NAD83(HARN) / Oregon North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 "); + add_proj4text (p, 2, "+ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Oregon North (ft)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_2SP\"],PARAMETER[\"standard_parallel_1\",46],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"standard_parallel_2\",44.33333333333334],PARAMETER["); + add_srs_wkt (p, 10, + "\"latitude_of_origin\",43.66666666666666],PARAMETER[\"ce"); + add_srs_wkt (p, 11, + "ntral_meridian\",-120.5],PARAMETER[\"false_easting\",820"); + add_srs_wkt (p, 12, + "2099.738],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"2913\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2914, "epsg", 2914, + "NAD83(HARN) / Oregon South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 "); + add_proj4text (p, 2, "+ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Oregon South (ft)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_2SP\"],PARAMETER[\"standard_parallel_1\",44],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"standard_parallel_2\",42.33333333333334],PARAMETER["); + add_srs_wkt (p, 10, + "\"latitude_of_origin\",41.66666666666666],PARAMETER[\"ce"); + add_srs_wkt (p, 11, + "ntral_meridian\",-120.5],PARAMETER[\"false_easting\",492"); + add_srs_wkt (p, 12, + "1259.843],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"2914\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2915, "epsg", 2915, + "NAD83(HARN) / Tennessee (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=3"); + add_proj4text (p, 1, + "4.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GR"); + add_proj4text (p, 2, "S80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Tennessee (ftUS)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",36.41666666666666],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_2\",35.25],PARAMETER[\"latitude_of_origin\",34.33333"); + add_srs_wkt (p, 11, + "333333334],PARAMETER[\"central_meridian\",-86],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_easting\",1968500],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"2915\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2916, "epsg", 2916, + "NAD83(HARN) / Texas North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=3"); + add_proj4text (p, 1, + "4 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.99989"); + add_proj4text (p, 2, "83998 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas North (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",36.18333333333333],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_2\",34.65],PARAMETER[\"latitude_of_origin\",34],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-101.5],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",656166.667],PARAMETER[\"false_northing\",3280833."); + add_srs_wkt (p, 13, + "333],AUTHORITY[\"EPSG\",\"2916\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 14, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2917, "epsg", 2917, + "NAD83(HARN) / Texas North Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333"); + add_proj4text (p, 1, + "333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y"); + add_proj4text (p, 2, + "_0=2000000.0001016 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas North Central (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_"); + add_srs_wkt (p, 2, + "Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey "); + add_srs_wkt (p, 7, + "foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",33.96666666666667],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",32.13333333333333],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",31.66666666666667],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-98.5],PARAMETER[\"false_easting\",1968500],PAR"); + add_srs_wkt (p, 13, + "AMETER[\"false_northing\",6561666.667],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"2917\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2918, "epsg", 2918, + "NAD83(HARN) / Texas Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666"); + add_proj4text (p, 1, + "667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +"); + add_proj4text (p, 2, + "x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +units=u"); + add_proj4text (p, 3, "s-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas Central (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",31.88333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",30.11666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",29.66666666666667],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-100.3333333333333],PARAMETER[\"false_easting\",22965"); + add_srs_wkt (p, 13, + "83.333],PARAMETER[\"false_northing\",9842500.000000002],"); + add_srs_wkt (p, 14, + "AUTHORITY[\"EPSG\",\"2918\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 15, ",NORTH]]"); + p = add_epsg_def (first, last, 2919, "epsg", 2919, + "NAD83(HARN) / Texas South Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333"); + add_proj4text (p, 1, + "333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0"); + add_proj4text (p, 2, "=3999999.9998984 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas South Central (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_"); + add_srs_wkt (p, 2, + "Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey "); + add_srs_wkt (p, 7, + "foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",30.28333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",28.38333333333333],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",27.83333333333333],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-99],PARAMETER[\"false_easting\",1968500],PARAM"); + add_srs_wkt (p, 13, + "ETER[\"false_northing\",13123333.333],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"2919\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2920, "epsg", 2920, + "NAD83(HARN) / Texas South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.00"); + add_proj4text (p, 2, + "00000001 +y_0=5000000.0001016 +ellps=GRS80 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas South (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",27.83333333333333],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_2\",26.16666666666667],PARAMETER[\"latitude_of_origi"); + add_srs_wkt (p, 11, + "n\",25.66666666666667],PARAMETER[\"central_meridian\",-9"); + add_srs_wkt (p, 12, + "8.5],PARAMETER[\"false_easting\",984250.0000000002],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_northing\",16404166.667],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"2920\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2921, "epsg", 2921, + "NAD83(HARN) / Utah North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0"); + add_proj4text (p, 2, + "001504 +y_0=999999.9999960001 +ellps=GRS80 +units=ft +no"); + add_proj4text (p, 3, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Utah North (ft)\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_2SP\"],PARAMETER[\"standard_parallel_1\",41.78333333"); + add_srs_wkt (p, 9, + "333333],PARAMETER[\"standard_parallel_2\",40.71666666666"); + add_srs_wkt (p, 10, + "667],PARAMETER[\"latitude_of_origin\",40.33333333333334]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"central_meridian\",-111.5],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_easting\",1640419.948],PARAMETER[\"false_northing\",32"); + add_srs_wkt (p, 13, + "80839.895],AUTHORITY[\"EPSG\",\"2921\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 14, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2922, "epsg", 2922, + "NAD83(HARN) / Utah Central (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=3"); + add_proj4text (p, 1, + "8.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0="); + add_proj4text (p, 2, "1999999.999992 +ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Utah Central (ft)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_2SP\"],PARAMETER[\"standard_parallel_1\",40.65],PARA"); + add_srs_wkt (p, 9, + "METER[\"standard_parallel_2\",39.01666666666667],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"latitude_of_origin\",38.33333333333334],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-111.5],PARAMETER[\"false_easting\",1"); + add_srs_wkt (p, 12, + "640419.948],PARAMETER[\"false_northing\",6561679.79],AUT"); + add_srs_wkt (p, 13, + "HORITY[\"EPSG\",\"2922\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 14, "RTH]]"); + p = add_epsg_def (first, last, 2923, "epsg", 2923, + "NAD83(HARN) / Utah South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=3"); + add_proj4text (p, 1, + "6.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0="); + add_proj4text (p, 2, "2999999.999988 +ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Utah South (ft)\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_2SP\"],PARAMETER[\"standard_parallel_1\",38.35],PARA"); + add_srs_wkt (p, 9, + "METER[\"standard_parallel_2\",37.21666666666667],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"latitude_of_origin\",36.66666666666666],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-111.5],PARAMETER[\"false_easting\",1"); + add_srs_wkt (p, 12, + "640419.948],PARAMETER[\"false_northing\",9842519.685],AU"); + add_srs_wkt (p, 13, + "THORITY[\"EPSG\",\"2923\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 14, "ORTH]]"); + p = add_epsg_def (first, last, 2924, "epsg", 2924, + "NAD83(HARN) / Virginia North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2"); + add_proj4text (p, 2, "000000.0001016 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Virginia North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",39.2],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 10, + "38.03333333333333],PARAMETER[\"latitude_of_origin\",37.6"); + add_srs_wkt (p, 11, + "6666666666666],PARAMETER[\"central_meridian\",-78.5],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"false_easting\",11482916.667],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",6561666.667],AUTHORITY[\"EPSG\",\"2924\"],AX"); + add_srs_wkt (p, 14, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2925, "epsg", 2925, + "NAD83(HARN) / Virginia South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0"); + add_proj4text (p, 2, + "001016 +y_0=999999.9998983998 +ellps=GRS80 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Virginia South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",37.96666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",36.76666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",36.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-78.5],PARAMETER[\"false_easting\",11482916.667],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_northing\",3280833.333],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"2925\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2926, "epsg", 2926, + "NAD83(HARN) / Washington North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47"); + add_proj4text (p, 1, + " +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0"); + add_proj4text (p, 2, " +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Washington North (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Net"); + add_srs_wkt (p, 2, + "work\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foo"); + add_srs_wkt (p, 7, + "t\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_1\",48.73333333333333],PARAMETER[\"standa"); + add_srs_wkt (p, 10, + "rd_parallel_2\",47.5],PARAMETER[\"latitude_of_origin\",4"); + add_srs_wkt (p, 11, + "7],PARAMETER[\"central_meridian\",-120.8333333333333],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_easting\",1640416.667],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",0],AUTHORITY[\"EPSG\",\"2926\"],AXIS[\"X\",E"); + add_srs_wkt (p, 14, "AST],AXIS[\"Y\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_07 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 2927, "epsg", 2927, + "NAD83(HARN) / Washington South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333"); + add_proj4text (p, 1, + "334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0"); + add_proj4text (p, 2, "001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Washington South (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Net"); + add_srs_wkt (p, 2, + "work\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foo"); + add_srs_wkt (p, 7, + "t\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_1\",47.33333333333334],PARAMETER[\"standa"); + add_srs_wkt (p, 10, + "rd_parallel_2\",45.83333333333334],PARAMETER[\"latitude_"); + add_srs_wkt (p, 11, + "of_origin\",45.33333333333334],PARAMETER[\"central_merid"); + add_srs_wkt (p, 12, + "ian\",-120.5],PARAMETER[\"false_easting\",1640416.667],P"); + add_srs_wkt (p, 13, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2927"); + add_srs_wkt (p, 14, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2928, "epsg", 2928, + "NAD83(HARN) / Wisconsin North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wisconsin North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",46.76666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",45.56666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",45.16666666666666],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-90],PARAMETER[\"false_easting\",1968500],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2928\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2929, "epsg", 2929, + "NAD83(HARN) / Wisconsin Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333"); + add_proj4text (p, 1, + "334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us"); + add_proj4text (p, 2, "-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wisconsin Central (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Ne"); + add_srs_wkt (p, 2, + "twork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey fo"); + add_srs_wkt (p, 7, + "ot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",45.5],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 10, + "2\",44.25],PARAMETER[\"latitude_of_origin\",43.833333333"); + add_srs_wkt (p, 11, + "33334],PARAMETER[\"central_meridian\",-90],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_easting\",1968500],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"2929\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 2930, "epsg", 2930, + "NAD83(HARN) / Wisconsin South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wisconsin South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",44.06666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",42.73333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",42],PARAMETER[\"central_meridian\",-90],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_easting\",1968500],PARAMETER[\"false_northing"); + add_srs_wkt (p, 13, + "\",0],AUTHORITY[\"EPSG\",\"2930\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 14, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2931, "epsg", 2931, "Beduaram / TM 13 NE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=0 +a=6378249.2 +b=6356515 +towgs84=-106,-87,188,0,0,0,"); + add_proj4text (p, 2, "0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beduaram / TM 13 NE\",GEOGCS[\"Beduaram\",DATUM"); + add_srs_wkt (p, 1, + "[\"Beduaram\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,2"); + add_srs_wkt (p, 2, + "93.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-"); + add_srs_wkt (p, 3, + "106,-87,188,0,0,0,0],AUTHORITY[\"EPSG\",\"6213\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4213\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",13],PARAMETER[\"scale_factor\",0.9996],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"2931\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2932, "epsg", 2932, + "QND95 / Qatar National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.45 +lon_0=51.21666666666667 +k=0.9"); + add_proj4text (p, 1, + "9999 +x_0=200000 +y_0=300000 +ellps=intl +towgs84=-119.4"); + add_proj4text (p, 2, + "25,-303.659,-11.0006,1.1643,0.174458,1.09626,3.65706 +un"); + add_proj4text (p, 3, "its=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"QND95 / Qatar National Grid\",GEOGCS[\"QND95\","); + add_srs_wkt (p, 1, + "DATUM[\"Qatar_National_Datum_1995\",SPHEROID[\"Internati"); + add_srs_wkt (p, 2, + "onal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[-119.425,-303.659,-11.0006,1.1643,0.174458,1.09626"); + add_srs_wkt (p, 4, + ",3.65706],AUTHORITY[\"EPSG\",\"6614\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 5, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 6, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"4614\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"latitude_of_origin\",24.45],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",51.21666666666667],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 11, + "9999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_northing\",300000],AUTHORITY[\"EPSG\",\"2932\"],AXIS"); + add_srs_wkt (p, 13, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2933, "epsg", 2933, "Segara / UTM zone 50S"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +ellps=bessel +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Segara / UTM zone 50S\",GEOGCS[\"Segara\",DATUM"); + add_srs_wkt (p, 1, + "[\"Gunung_Segara\",SPHEROID[\"Bessel 1841\",6377397.155,"); + add_srs_wkt (p, 2, + "299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6613\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4613\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",117],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, + "\"2933\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH"); + add_srs_wkt (p, 12, "]]"); + p = add_epsg_def (first, last, 2934, "epsg", 2934, + "Segara (Jakarta) / NEIEZ (deprecated)"); + add_proj4text (p, 0, + "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 "); + add_proj4text (p, 1, "+ellps=bessel +pm=jakarta +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Segara (Jakarta) / NEIEZ (deprecated)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Segara (Jakarta)\",DATUM[\"Gunung_Segara_Jakarta\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6820\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Jakarta\",106.8077194444444,AUTHORITY[\"EPSG\",\"8908"); + add_srs_wkt (p, 5, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4820\"]],UNIT[\"metr"); + add_srs_wkt (p, 7, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Mercato"); + add_srs_wkt (p, 8, + "r_1SP\"],PARAMETER[\"central_meridian\",110],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.997],PARAMETER[\"false_easting\",390000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",900000],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"2934\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2935, "epsg", 2935, + "Pulkovo 1942 / CS63 zone A1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0.1166666666666667 +lon_0=41.53333333"); + add_proj4text (p, 1, + "333333 +k=1 +x_0=1300000 +y_0=0 +ellps=krass +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / CS63 zone A1\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassowsky 1940"); + add_srs_wkt (p, 2, + "\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[2"); + add_srs_wkt (p, 3, + "3.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0.11"); + add_srs_wkt (p, 9, + "66666666666667],PARAMETER[\"central_meridian\",41.533333"); + add_srs_wkt (p, 10, + "33333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",1300000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"2935\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 13, "AST]]"); + p = add_epsg_def (first, last, 2936, "epsg", 2936, + "Pulkovo 1942 / CS63 zone A2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0.1166666666666667 +lon_0=44.53333333"); + add_proj4text (p, 1, + "333333 +k=1 +x_0=2300000 +y_0=0 +ellps=krass +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / CS63 zone A2\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassowsky 1940"); + add_srs_wkt (p, 2, + "\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[2"); + add_srs_wkt (p, 3, + "3.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0.11"); + add_srs_wkt (p, 9, + "66666666666667],PARAMETER[\"central_meridian\",44.533333"); + add_srs_wkt (p, 10, + "33333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",2300000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"2936\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 13, "AST]]"); + p = add_epsg_def (first, last, 2937, "epsg", 2937, + "Pulkovo 1942 / CS63 zone A3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0.1166666666666667 +lon_0=47.53333333"); + add_proj4text (p, 1, + "333333 +k=1 +x_0=3300000 +y_0=0 +ellps=krass +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / CS63 zone A3\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassowsky 1940"); + add_srs_wkt (p, 2, + "\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[2"); + add_srs_wkt (p, 3, + "3.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0.11"); + add_srs_wkt (p, 9, + "66666666666667],PARAMETER[\"central_meridian\",47.533333"); + add_srs_wkt (p, 10, + "33333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",3300000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"2937\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 13, "AST]]"); + p = add_epsg_def (first, last, 2938, "epsg", 2938, + "Pulkovo 1942 / CS63 zone A4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0.1166666666666667 +lon_0=50.53333333"); + add_proj4text (p, 1, + "333333 +k=1 +x_0=4300000 +y_0=0 +ellps=krass +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / CS63 zone A4\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassowsky 1940"); + add_srs_wkt (p, 2, + "\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[2"); + add_srs_wkt (p, 3, + "3.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0.11"); + add_srs_wkt (p, 9, + "66666666666667],PARAMETER[\"central_meridian\",50.533333"); + add_srs_wkt (p, 10, + "33333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",4300000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"2938\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 13, "AST]]"); + p = add_epsg_def (first, last, 2939, "epsg", 2939, + "Pulkovo 1942 / CS63 zone K2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0.1333333333333333 +lon_0=50.76666666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=2300000 +y_0=0 +ellps=krass +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / CS63 zone K2\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassowsky 1940"); + add_srs_wkt (p, 2, + "\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[2"); + add_srs_wkt (p, 3, + "3.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0.13"); + add_srs_wkt (p, 9, + "33333333333333],PARAMETER[\"central_meridian\",50.766666"); + add_srs_wkt (p, 10, + "66666667],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",2300000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"2939\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 13, "AST]]"); + p = add_epsg_def (first, last, 2940, "epsg", 2940, + "Pulkovo 1942 / CS63 zone K3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0.1333333333333333 +lon_0=53.76666666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=3300000 +y_0=0 +ellps=krass +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / CS63 zone K3\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassowsky 1940"); + add_srs_wkt (p, 2, + "\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[2"); + add_srs_wkt (p, 3, + "3.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0.13"); + add_srs_wkt (p, 9, + "33333333333333],PARAMETER[\"central_meridian\",53.766666"); + add_srs_wkt (p, 10, + "66666667],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",3300000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"2940\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 13, "AST]]"); + p = add_epsg_def (first, last, 2941, "epsg", 2941, + "Pulkovo 1942 / CS63 zone K4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0.1333333333333333 +lon_0=56.76666666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=4300000 +y_0=0 +ellps=krass +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / CS63 zone K4\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassowsky 1940"); + add_srs_wkt (p, 2, + "\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[2"); + add_srs_wkt (p, 3, + "3.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0.13"); + add_srs_wkt (p, 9, + "33333333333333],PARAMETER[\"central_meridian\",56.766666"); + add_srs_wkt (p, 10, + "66666667],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",4300000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"2941\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 13, "AST]]"); + p = add_epsg_def (first, last, 2942, "epsg", 2942, + "Porto Santo / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +ellps=intl +towgs84=-499,-249,314,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Porto Santo / UTM zone 28N\",GEOGCS[\"Porto San"); + add_srs_wkt (p, 1, + "to\",DATUM[\"Porto_Santo_1936\",SPHEROID[\"International"); + add_srs_wkt (p, 2, + " 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS8"); + add_srs_wkt (p, 3, + "4[-499,-249,314,0,0,0,0],AUTHORITY[\"EPSG\",\"6615\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4615\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 8, + "tor\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-15],PARAMETER[\"scale_factor\",0.9996"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "northing\",0],AUTHORITY[\"EPSG\",\"2942\"],AXIS[\"Eastin"); + add_srs_wkt (p, 12, "g\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2943, "epsg", 2943, + "Selvagem Grande / UTM zone 28N"); + add_proj4text (p, 0, "+proj=utm +zone=28 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Selvagem Grande / UTM zone 28N\",GEOGCS[\"Selva"); + add_srs_wkt (p, 1, + "gem Grande\",DATUM[\"Selvagem_Grande\",SPHEROID[\"Intern"); + add_srs_wkt (p, 2, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6616\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4616\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-15],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2943\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 2944, "epsg", 2944, + "NAD83(CSRS) / SCoPQ zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / SCoPQ zone 2\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-55.5],PARAMETER[\"scale_factor\",0.9999],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",304800],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",0],AUTHORITY[\"EPSG\",\"2944\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2945, "epsg", 2945, + "NAD83(CSRS) / MTM zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 3\",GEOGCS[\"NAD83(CSRS)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-58.5],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2945\"],AXIS[\"E(X)\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 2946, "epsg", 2946, + "NAD83(CSRS) / MTM zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 4\",GEOGCS[\"NAD83(CSRS)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-61.5],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2946\"],AXIS[\"E(X)\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 2947, "epsg", 2947, + "NAD83(CSRS) / MTM zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 5\",GEOGCS[\"NAD83(CSRS)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-64.5],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2947\"],AXIS[\"E(X)\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 2948, "epsg", 2948, + "NAD83(CSRS) / MTM zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 6\",GEOGCS[\"NAD83(CSRS)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-67.5],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2948\"],AXIS[\"E(X)\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 2949, "epsg", 2949, + "NAD83(CSRS) / MTM zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 7\",GEOGCS[\"NAD83(CSRS)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-70.5],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2949\"],AXIS[\"E(X)\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 2950, "epsg", 2950, + "NAD83(CSRS) / MTM zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 8\",GEOGCS[\"NAD83(CSRS)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-73.5],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2950\"],AXIS[\"E(X)\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 2951, "epsg", 2951, + "NAD83(CSRS) / MTM zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 9\",GEOGCS[\"NAD83(CSRS)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-76.5],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2951\"],AXIS[\"E(X)\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 2952, "epsg", 2952, + "NAD83(CSRS) / MTM zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 10\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-79.5],PARAMETER[\"scale_factor\",0.9999],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",304800],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",0],AUTHORITY[\"EPSG\",\"2952\"],AXIS[\"E(X)\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 2953, "epsg", 2953, + "NAD83(CSRS) / New Brunswick Stereographic"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2"); + add_proj4text (p, 1, "500000 +y_0=7500000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / New Brunswick Stereographic\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"614"); + add_srs_wkt (p, 4, + "0\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Oblique_St"); + add_srs_wkt (p, 8, + "ereographic\"],PARAMETER[\"latitude_of_origin\",46.5],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"central_meridian\",-66.5],PARAMETER[\"scale_fa"); + add_srs_wkt (p, 10, + "ctor\",0.999912],PARAMETER[\"false_easting\",2500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",7500000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "2953\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 2954, "epsg", 2954, + "NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83)"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=47.25 +lon_0=-63 +k=0.999912 +x_0=40"); + add_proj4text (p, 1, "0000 +y_0=800000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Prince Edward Isl. Stereographic "); + add_srs_wkt (p, 1, + "(NAD83)\",GEOGCS[\"NAD83(CSRS)\",DATUM[\"NAD83_Canadian_"); + add_srs_wkt (p, 2, + "Spatial_Reference_System\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 3, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4617\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Oblique_Stereographic\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",47.25],PARAMETER[\"central_meridian\",-63],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.999912],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",400000],PARAMETER[\"false_northing\",800000],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"2954\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 2955, "epsg", 2955, + "NAD83(CSRS) / UTM zone 11N"); + add_proj4text (p, 0, "+proj=utm +zone=11 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 11N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-117],PARAMETER[\"scale_factor\",0.9996],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"2955\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2956, "epsg", 2956, + "NAD83(CSRS) / UTM zone 12N"); + add_proj4text (p, 0, "+proj=utm +zone=12 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 12N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-111],PARAMETER[\"scale_factor\",0.9996],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"2956\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2957, "epsg", 2957, + "NAD83(CSRS) / UTM zone 13N"); + add_proj4text (p, 0, "+proj=utm +zone=13 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 13N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-105],PARAMETER[\"scale_factor\",0.9996],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"2957\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2958, "epsg", 2958, + "NAD83(CSRS) / UTM zone 17N"); + add_proj4text (p, 0, "+proj=utm +zone=17 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 17N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-81],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2958\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2959, "epsg", 2959, + "NAD83(CSRS) / UTM zone 18N"); + add_proj4text (p, 0, "+proj=utm +zone=18 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 18N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-75],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2959\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2960, "epsg", 2960, + "NAD83(CSRS) / UTM zone 19N"); + add_proj4text (p, 0, "+proj=utm +zone=19 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 19N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-69],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2960\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2961, "epsg", 2961, + "NAD83(CSRS) / UTM zone 20N"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 20N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-63],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2961\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2962, "epsg", 2962, + "NAD83(CSRS) / UTM zone 21N"); + add_proj4text (p, 0, "+proj=utm +zone=21 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 21N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-57],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"2962\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2964, "epsg", 2964, "NAD27 / Alaska Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0"); + add_proj4text (p, 1, + "=0 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska Albers\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Albers_Conic_E"); + add_srs_wkt (p, 8, + "qual_Area\"],PARAMETER[\"standard_parallel_1\",55],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"standard_parallel_2\",65],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 10, + "_center\",50],PARAMETER[\"longitude_of_center\",-154],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",0],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"2964\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 2965, "epsg", 2965, + "NAD83 / Indiana East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=99999.99989839978 +y_0=249999.9998983998 +"); + add_proj4text (p, 2, "ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Indiana East (ftUS)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",37.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-85.66666666666667],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.999966667],PARAMETER[\"false_easting\",32808"); + add_srs_wkt (p, 11, + "3.333],PARAMETER[\"false_northing\",820208.3330000002],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"2965\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 2966, "epsg", 2966, + "NAD83 / Indiana West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=900000 +y_0=249999.9998983998 +ellps=GRS80"); + add_proj4text (p, 2, " +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Indiana West (ftUS)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",37.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-87.08333333333333],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.999966667],PARAMETER[\"false_easting\",29527"); + add_srs_wkt (p, 11, + "50],PARAMETER[\"false_northing\",820208.3330000002],AUTH"); + add_srs_wkt (p, 12, + "ORITY[\"EPSG\",\"2966\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 2967, "epsg", 2967, + "NAD83(HARN) / Indiana East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=99999.99989839978 +y_0=249999.9998983998 +"); + add_proj4text (p, 2, "ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Indiana East (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",37.5],PARAMETER[\"central_meridian\",-85.666666666"); + add_srs_wkt (p, 10, + "66667],PARAMETER[\"scale_factor\",0.999966667],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",328083.333],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",820208.3330000002],AUTHORITY[\"EPSG\",\"2967\"],AXIS"); + add_srs_wkt (p, 13, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2968, "epsg", 2968, + "NAD83(HARN) / Indiana West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=900000 +y_0=249999.9998983998 +ellps=GRS80"); + add_proj4text (p, 2, " +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Indiana West (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",37.5],PARAMETER[\"central_meridian\",-87.083333333"); + add_srs_wkt (p, 10, + "33333],PARAMETER[\"scale_factor\",0.999966667],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",2952750],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",820208.3330000002],AUTHORITY[\"EPSG\",\"2968\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2969, "epsg", 2969, + "Fort Marigot / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=intl +towgs84=137,248,-430,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Fort Marigot / UTM zone 20N\",GEOGCS[\"Fort Mar"); + add_srs_wkt (p, 1, + "igot\",DATUM[\"Fort_Marigot\",SPHEROID[\"International 1"); + add_srs_wkt (p, 2, + "924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84["); + add_srs_wkt (p, 3, + "137,248,-430,0,0,0,0],AUTHORITY[\"EPSG\",\"6621\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4621\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",-63],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2969\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2970, "epsg", 2970, + "Guadeloupe 1948 / UTM zone 20N"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Guadeloupe 1948 / UTM zone 20N\",GEOGCS[\"Guade"); + add_srs_wkt (p, 1, + "loupe 1948\",DATUM[\"Guadeloupe_1948\",SPHEROID[\"Intern"); + add_srs_wkt (p, 2, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6622\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4622\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-63],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2970\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 2971, "epsg", 2971, "CSG67 / UTM zone 22N"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +ellps=intl +towgs84=-186,230,110,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"CSG67 / UTM zone 22N\",GEOGCS[\"CSG67\",DATUM[\""); + add_srs_wkt (p, 1, + "Centre_Spatial_Guyanais_1967\",SPHEROID[\"International "); + add_srs_wkt (p, 2, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[-186,230,110,0,0,0,0],AUTHORITY[\"EPSG\",\"6623\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4623\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",-51],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"2971\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2972, "epsg", 2972, "RGFG95 / UTM zone 22N"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +ellps=GRS80 +towgs84=2,2,-2,0,0,0,0 "); + add_proj4text (p, 1, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGFG95 / UTM zone 22N\",GEOGCS[\"RGFG95\",DATUM"); + add_srs_wkt (p, 1, + "[\"Reseau_Geodesique_Francais_Guyane_1995\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],TOWGS84[2,2,-2,0,0,0,0],AUTHORITY[\"EPSG\",\"6624\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4624\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-51],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"2972\"],AXIS[\"Eas"); + add_srs_wkt (p, 12, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2973, "epsg", 2973, + "Martinique 1938 / UTM zone 20N"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Martinique 1938 / UTM zone 20N\",GEOGCS[\"Marti"); + add_srs_wkt (p, 1, + "nique 1938\",DATUM[\"Martinique_1938\",SPHEROID[\"Intern"); + add_srs_wkt (p, 2, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6625\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4625\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-63],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2973\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 2975, "epsg", 2975, "RGR92 / UTM zone 40S"); + add_proj4text (p, 0, + "+proj=utm +zone=40 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGR92 / UTM zone 40S\",GEOGCS[\"RGR92\",DATUM[\""); + add_srs_wkt (p, 1, + "Reseau_Geodesique_de_la_Reunion_1992\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6627\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4627\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",57],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 10, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 11, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"2975\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2976, "epsg", 2976, + "Tahiti 52 / UTM zone 6S"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +south +ellps=intl +towgs84=162,117,15"); + add_proj4text (p, 1, "4,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tahiti 52 / UTM zone 6S\",GEOGCS[\"Tahiti 52\","); + add_srs_wkt (p, 1, + "DATUM[\"Tahiti_52\",SPHEROID[\"International 1924\",6378"); + add_srs_wkt (p, 2, + "388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[162,117,15"); + add_srs_wkt (p, 3, + "4,0,0,0,0],AUTHORITY[\"EPSG\",\"6628\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4628\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",-147],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",100"); + add_srs_wkt (p, 11, + "00000],AUTHORITY[\"EPSG\",\"2976\"],AXIS[\"Easting\",EAS"); + add_srs_wkt (p, 12, "T],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2977, "epsg", 2977, + "Tahaa 54 / UTM zone 5S"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tahaa 54 / UTM zone 5S\",GEOGCS[\"Tahaa 54\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Tahaa_54\",SPHEROID[\"International 1924\",6378388"); + add_srs_wkt (p, 2, + ",297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6629\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4629\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",-153],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"297"); + add_srs_wkt (p, 11, + "7\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2978, "epsg", 2978, + "IGN72 Nuku Hiva / UTM zone 7S"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN72 Nuku Hiva / UTM zone 7S\",GEOGCS[\"IGN72 "); + add_srs_wkt (p, 1, + "Nuku Hiva\",DATUM[\"IGN72_Nuku_Hiva\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6630\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4630\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-141],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"2978\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2979, "epsg", 2979, + "K0 1949 / UTM zone 42S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=42 +south +ellps=intl +towgs84=145,-187,"); + add_proj4text (p, 1, "103,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"K0 1949 / UTM zone 42S (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "K0 1949\",DATUM[\"K0_1949\",SPHEROID[\"International 192"); + add_srs_wkt (p, 2, + "4\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[14"); + add_srs_wkt (p, 3, + "5,-187,103,0,0,0,0],AUTHORITY[\"EPSG\",\"6631\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4631\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",69],PARAMETER[\"scale_factor\",0.9996],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",10000000],AUTHORITY[\"EPSG\",\"2979\"],AXIS[\"Easti"); + add_srs_wkt (p, 12, "ng\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2980, "epsg", 2980, + "Combani 1950 / UTM zone 38S"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +south +ellps=intl +towgs84=-382,-59,"); + add_proj4text (p, 1, "-262,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Combani 1950 / UTM zone 38S\",GEOGCS[\"Combani "); + add_srs_wkt (p, 1, + "1950\",DATUM[\"Combani_1950\",SPHEROID[\"International 1"); + add_srs_wkt (p, 2, + "924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84["); + add_srs_wkt (p, 3, + "-382,-59,-262,0,0,0,0],AUTHORITY[\"EPSG\",\"6632\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4632\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",45],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 11, + "hing\",10000000],AUTHORITY[\"EPSG\",\"2980\"],AXIS[\"Eas"); + add_srs_wkt (p, 12, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2981, "epsg", 2981, + "IGN56 Lifou / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN56 Lifou / UTM zone 58S\",GEOGCS[\"IGN56 Lif"); + add_srs_wkt (p, 1, + "ou\",DATUM[\"IGN56_Lifou\",SPHEROID[\"International 1924"); + add_srs_wkt (p, 2, + "\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6633\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4633\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",165],PARAMETER[\"sc"); + add_srs_wkt (p, 9, + "ale_factor\",0.9996],PARAMETER[\"false_easting\",500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, + "\",\"2981\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NO"); + add_srs_wkt (p, 12, "RTH]]"); + p = add_epsg_def (first, last, 2982, "epsg", 2982, + "IGN72 Grand Terre / UTM zone 58S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN72 Grand Terre / UTM zone 58S (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"IGN72 Grand Terre\",DATUM[\"IGN72_Grande_Terre"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6634\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4634\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",165],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",10000000],AUTHORITY[\"EPSG\",\"2982\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2983, "epsg", 2983, + "ST87 Ouvea / UTM zone 58S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=intl +towgs84=-122.383,"); + add_proj4text (p, 1, + "-188.696,103.344,3.5107,-4.9668,-5.7047,4.4798 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ST87 Ouvea / UTM zone 58S (deprecated)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"ST87 Ouvea\",DATUM[\"ST87_Ouvea\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-122.383,-188.696,103.344,3.5107,-4.9668,-5.7047,"); + add_srs_wkt (p, 4, + "4.4798],AUTHORITY[\"EPSG\",\"6635\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 5, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4635\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 10, + "65],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"2983\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2984, "epsg", 2984, + "RGNC 1991 / Lambert New Caledonia (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-20.66666666666667 +lat_2=-22.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-21.5 +lon_0=166 +x_0=400000 +y_0=300000 +e"); + add_proj4text (p, 2, "llps=intl +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGNC 1991 / Lambert New Caledonia (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"RGNC 1991\",DATUM[\"Reseau_Geodesique_Nouvelle"); + add_srs_wkt (p, 2, + "_Caledonie_1991\",SPHEROID[\"International 1924\",637838"); + add_srs_wkt (p, 3, + "8,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[0,0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0],AUTHORITY[\"EPSG\",\"6645\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 6, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"4645\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 8, + "\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"standard_parallel_1\",-20.66666666666667],PARAMETER"); + add_srs_wkt (p, 10, + "[\"standard_parallel_2\",-22.33333333333333],PARAMETER[\""); + add_srs_wkt (p, 11, + "latitude_of_origin\",-21.5],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",166],PARAMETER[\"false_easting\",400000],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_northing\",300000],AUTHORITY[\"EPSG\",\"2984\"],AX"); + add_srs_wkt (p, 14, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2987, "epsg", 2987, + "Saint Pierre et Miquelon 1950 / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=clrk66 +towgs84=30,430,368,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Saint Pierre et Miquelon 1950 / UTM zone 21N\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Saint Pierre et Miquelon 1950\",DATUM[\"Saint_P"); + add_srs_wkt (p, 2, + "ierre_et_Miquelon_1950\",SPHEROID[\"Clarke 1866\",637820"); + add_srs_wkt (p, 3, + "6.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],TOWG"); + add_srs_wkt (p, 4, + "S84[30,430,368,0,0,0,0],AUTHORITY[\"EPSG\",\"6638\"]],PR"); + add_srs_wkt (p, 5, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 6, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 7, + "\"]],AUTHORITY[\"EPSG\",\"4638\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 8, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 9, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 10, + "ntral_meridian\",-57],PARAMETER[\"scale_factor\",0.9996]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",500000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",0],AUTHORITY[\"EPSG\",\"2987\"],AXIS[\"Easting"); + add_srs_wkt (p, 13, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2988, "epsg", 2988, "MOP78 / UTM zone 1S"); + add_proj4text (p, 0, + "+proj=utm +zone=1 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MOP78 / UTM zone 1S\",GEOGCS[\"MOP78\",DATUM[\""); + add_srs_wkt (p, 1, + "MOP78\",SPHEROID[\"International 1924\",6378388,297,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6639\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, + "22\"]],AUTHORITY[\"EPSG\",\"4639\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 7, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 8, + "central_meridian\",-177],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"2988\"],AXIS"); + add_srs_wkt (p, 11, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2989, "epsg", 2989, + "RRAF 1991 / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RRAF 1991 / UTM zone 20N\",GEOGCS[\"RRAF 1991\""); + add_srs_wkt (p, 1, + ",DATUM[\"Reseau_de_Reference_des_Antilles_Francaises_199"); + add_srs_wkt (p, 2, + "1\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"6640\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4640\"]],UN"); + add_srs_wkt (p, 7, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",0],PARAMETER[\"central_meridian\",-63],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",0.9996],PARAMETER[\"false_easting\",500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2989"); + add_srs_wkt (p, 12, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2990, "epsg", 2990, + "Reunion 1947 / TM Reunion (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-21.11666666666667 +lon_0=55.53333333"); + add_proj4text (p, 1, + "333333 +k=1 +x_0=50000 +y_0=160000 +ellps=intl +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Reunion 1947 / TM Reunion (deprecated)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Reunion 1947\",DATUM[\"Reunion_1947\",SPHEROID[\"Inte"); + add_srs_wkt (p, 2, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6626\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4626\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",-21.11666666666667],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",55.53333333333333],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",1],PARAMETER[\"false_easting\",50000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",160000],AUTHORITY[\"EPSG\",\"2990\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2991, "epsg", 2991, + "NAD83 / Oregon Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120"); + add_proj4text (p, 1, + ".5 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Oregon Lambert\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",43],PARAMETER[\"standard_parallel_2\",45"); + add_srs_wkt (p, 9, + ".5],PARAMETER[\"latitude_of_origin\",41.75],PARAMETER[\""); + add_srs_wkt (p, 10, + "central_meridian\",-120.5],PARAMETER[\"false_easting\",4"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"2991\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2992, "epsg", 2992, + "NAD83 / Oregon Lambert (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120"); + add_proj4text (p, 1, + ".5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +datum=NAD83 "); + add_proj4text (p, 2, "+units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Oregon Lambert (ft)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"standard_parallel_1\",43],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 9, + "el_2\",45.5],PARAMETER[\"latitude_of_origin\",41.75],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"central_meridian\",-120.5],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",1312335.958],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"2992\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 13, "RTH]]"); + p = add_epsg_def (first, last, 2993, "epsg", 2993, + "NAD83(HARN) / Oregon Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120"); + add_proj4text (p, 1, + ".5 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Oregon Lambert\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",43],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",45.5],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",41.75],PARAMETER[\"central_meridian\",-120.5],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",400000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"2993\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2994, "epsg", 2994, + "NAD83(HARN) / Oregon Lambert (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120"); + add_proj4text (p, 1, + ".5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +units=ft +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Oregon Lambert (ft)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conforma"); + add_srs_wkt (p, 8, + "l_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",43],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"standard_parallel_2\",45.5],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",41.75],PARAMETER[\"central_meridian\",-120"); + add_srs_wkt (p, 11, + ".5],PARAMETER[\"false_easting\",1312335.958],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"2994\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 2995, "epsg", 2995, + "IGN53 Mare / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN53 Mare / UTM zone 58S\",GEOGCS[\"IGN53 Mare"); + add_srs_wkt (p, 1, + "\",DATUM[\"IGN53_Mare\",SPHEROID[\"International 1924\","); + add_srs_wkt (p, 2, + "6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6641\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4641\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",165],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, + "\"2995\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH"); + add_srs_wkt (p, 12, "]]"); + p = add_epsg_def (first, last, 2996, "epsg", 2996, + "ST84 Ile des Pins / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ST84 Ile des Pins / UTM zone 58S\",GEOGCS[\"ST8"); + add_srs_wkt (p, 1, + "4 Ile des Pins\",DATUM[\"ST84_Ile_des_Pins\",SPHEROID[\""); + add_srs_wkt (p, 2, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "22\"]],AUTHORITY[\"EPSG\",\"6642\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4642\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "65],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"2996\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 2997, "epsg", 2997, + "ST71 Belep / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=intl +towgs84=-480.26,-"); + add_proj4text (p, 1, + "438.32,-643.429,16.3119,20.1721,-4.0349,-111.7 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ST71 Belep / UTM zone 58S\",GEOGCS[\"ST71 Belep"); + add_srs_wkt (p, 1, + "\",DATUM[\"ST71_Belep\",SPHEROID[\"International 1924\","); + add_srs_wkt (p, 2, + "6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-480.2"); + add_srs_wkt (p, 3, + "6,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6643\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"464"); + add_srs_wkt (p, 7, + "3\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",165],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",10000000],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"2997\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 13, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 2998, "epsg", 2998, + "NEA74 Noumea / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NEA74 Noumea / UTM zone 58S\",GEOGCS[\"NEA74 No"); + add_srs_wkt (p, 1, + "umea\",DATUM[\"NEA74_Noumea\",SPHEROID[\"International 1"); + add_srs_wkt (p, 2, + "924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6644\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4644\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",165],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"2998\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 2999, "epsg", 2999, + "Grand Comoros / UTM zone 38S"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Grand Comoros / UTM zone 38S\",GEOGCS[\"Grand C"); + add_srs_wkt (p, 1, + "omoros\",DATUM[\"Grand_Comoros\",SPHEROID[\"Internationa"); + add_srs_wkt (p, 2, + "l 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6646\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"464"); + add_srs_wkt (p, 6, + "6\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",45],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",10000000],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"2999\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3000, "epsg", 3000, "Segara / NEIEZ"); + add_proj4text (p, 0, + "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 "); + add_proj4text (p, 1, "+ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Segara / NEIEZ\",GEOGCS[\"Segara\",DATUM[\"Gunu"); + add_srs_wkt (p, 1, + "ng_Segara\",SPHEROID[\"Bessel 1841\",6377397.155,299.152"); + add_srs_wkt (p, 2, + "8128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6613\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4613\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Mercat"); + add_srs_wkt (p, 7, + "or_1SP\"],PARAMETER[\"central_meridian\",110],PARAMETER["); + add_srs_wkt (p, 8, + "\"scale_factor\",0.997],PARAMETER[\"false_easting\",3900"); + add_srs_wkt (p, 9, + "000],PARAMETER[\"false_northing\",900000],AUTHORITY[\"EP"); + add_srs_wkt (p, 10, "SG\",\"3000\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3001, "epsg", 3001, "Batavia / NEIEZ"); + add_proj4text (p, 0, + "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 "); + add_proj4text (p, 1, "+ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Batavia / NEIEZ\",GEOGCS[\"Batavia\",DATUM[\"Ba"); + add_srs_wkt (p, 1, + "tavia\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6211"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4211\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Mercator_1"); + add_srs_wkt (p, 7, + "SP\"],PARAMETER[\"central_meridian\",110],PARAMETER[\"sc"); + add_srs_wkt (p, 8, + "ale_factor\",0.997],PARAMETER[\"false_easting\",3900000]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"false_northing\",900000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 10, ",\"3001\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3002, "epsg", 3002, "Makassar / NEIEZ"); + add_proj4text (p, 0, + "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 "); + add_proj4text (p, 1, + "+ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Makassar / NEIEZ\",GEOGCS[\"Makassar\",DATUM[\""); + add_srs_wkt (p, 1, + "Makassar\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528"); + add_srs_wkt (p, 2, + "128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[-587.8,519.75,"); + add_srs_wkt (p, 3, + "145.76,0,0,0,0],AUTHORITY[\"EPSG\",\"6257\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4257\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"central_meridian\",110],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "997],PARAMETER[\"false_easting\",3900000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",900000],AUTHORITY[\"EPSG\",\"3002\"],AXIS"); + add_srs_wkt (p, 11, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3003, "epsg", 3003, + "Monte Mario / Italy zone 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Monte Mario / Italy zone 1\",GEOGCS[\"Monte Mar"); + add_srs_wkt (p, 1, + "io\",DATUM[\"Monte_Mario\",SPHEROID[\"International 1924"); + add_srs_wkt (p, 2, + "\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6265\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4265\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scal"); + add_srs_wkt (p, 9, + "e_factor\",0.9996],PARAMETER[\"false_easting\",1500000],"); + add_srs_wkt (p, 10, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"300"); + add_srs_wkt (p, 11, "3\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3004, "epsg", 3004, + "Monte Mario / Italy zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=2520000 +y"); + add_proj4text (p, 1, "_0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Monte Mario / Italy zone 2\",GEOGCS[\"Monte Mar"); + add_srs_wkt (p, 1, + "io\",DATUM[\"Monte_Mario\",SPHEROID[\"International 1924"); + add_srs_wkt (p, 2, + "\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6265\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4265\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",15],PARAMETER[\"sca"); + add_srs_wkt (p, 9, + "le_factor\",0.9996],PARAMETER[\"false_easting\",2520000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30"); + add_srs_wkt (p, 11, "04\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3005, "epsg", 3005, "NAD83 / BC Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x"); + add_proj4text (p, 1, + "_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / BC Albers\",GEOGCS[\"NAD83\",DATUM[\"No"); + add_srs_wkt (p, 1, + "rth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,"); + add_srs_wkt (p, 2, + "298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Albers_Conic_Equal_Area\"],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 8, + "lel_1\",50],PARAMETER[\"standard_parallel_2\",58.5],PARA"); + add_srs_wkt (p, 9, + "METER[\"latitude_of_center\",45],PARAMETER[\"longitude_o"); + add_srs_wkt (p, 10, + "f_center\",-126],PARAMETER[\"false_easting\",1000000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3005\""); + add_srs_wkt (p, 12, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3006, "epsg", 3006, "SWEREF99 TM"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 TM\",GEOGCS[\"SWEREF99\",DATUM[\"SWERE"); + add_srs_wkt (p, 1, + "F99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",15],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3006\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3007, "epsg", 3007, "SWEREF99 12 00"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=150000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 12 00\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",12],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",150000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30"); + add_srs_wkt (p, 11, "07\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3008, "epsg", 3008, "SWEREF99 13 30"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13.5 +k=1 +x_0=150000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 13 30\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",13.5],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",15000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3008\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3009, "epsg", 3009, "SWEREF99 15 00"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=150000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 15 00\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",15],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",150000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30"); + add_srs_wkt (p, 11, "09\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3010, "epsg", 3010, "SWEREF99 16 30"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=16.5 +k=1 +x_0=150000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 16 30\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",16.5],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",15000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3010\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3011, "epsg", 3011, "SWEREF99 18 00"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=150000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 18 00\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",18],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",150000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30"); + add_srs_wkt (p, 11, "11\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3012, "epsg", 3012, "SWEREF99 14 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=14.25 +k=1 +x_0=150000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 14 15\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",14.25],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",1500"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3012\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3013, "epsg", 3013, "SWEREF99 15 45"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15.75 +k=1 +x_0=150000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 15 45\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",15.75],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",1500"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3013\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3014, "epsg", 3014, "SWEREF99 17 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=17.25 +k=1 +x_0=150000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 17 15\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",17.25],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",1500"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3014\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3015, "epsg", 3015, "SWEREF99 18 45"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18.75 +k=1 +x_0=150000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 18 45\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",18.75],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",1500"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3015\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3016, "epsg", 3016, "SWEREF99 20 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=20.25 +k=1 +x_0=150000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 20 15\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",20.25],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",1500"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3016\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3017, "epsg", 3017, "SWEREF99 21 45"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21.75 +k=1 +x_0=150000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 21 45\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",21.75],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",1500"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3017\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3018, "epsg", 3018, "SWEREF99 23 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=23.25 +k=1 +x_0=150000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 23 15\",GEOGCS[\"SWEREF99\",DATUM[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",23.25],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",1500"); + add_srs_wkt (p, 10, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3018\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3019, "epsg", 3019, "RT90 7.5 gon V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=11.30827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT90 7.5 gon V\",GEOGCS[\"RT90\",DATUM[\"Rikets"); + add_srs_wkt (p, 1, + "_koordinatsystem_1990\",SPHEROID[\"Bessel 1841\",6377397"); + add_srs_wkt (p, 2, + ".155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6124\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4124\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",11.3082777777777"); + add_srs_wkt (p, 9, + "8],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",1500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3019\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3020, "epsg", 3020, "RT90 5 gon V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13.55827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT90 5 gon V\",GEOGCS[\"RT90\",DATUM[\"Rikets_k"); + add_srs_wkt (p, 1, + "oordinatsystem_1990\",SPHEROID[\"Bessel 1841\",6377397.1"); + add_srs_wkt (p, 2, + "55,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6124\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4124\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",13.55827777777778],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",1500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"3020\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3021, "epsg", 3021, "RT90 2.5 gon V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT90 2.5 gon V\",GEOGCS[\"RT90\",DATUM[\"Rikets"); + add_srs_wkt (p, 1, + "_koordinatsystem_1990\",SPHEROID[\"Bessel 1841\",6377397"); + add_srs_wkt (p, 2, + ".155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6124\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4124\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",15.8082777777777"); + add_srs_wkt (p, 9, + "8],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",1500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3021\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3022, "epsg", 3022, "RT90 0 gon"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18.05827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT90 0 gon\",GEOGCS[\"RT90\",DATUM[\"Rikets_koo"); + add_srs_wkt (p, 1, + "rdinatsystem_1990\",SPHEROID[\"Bessel 1841\",6377397.155"); + add_srs_wkt (p, 2, + ",299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6124\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4124\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",18.05827777777778],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "1500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, "G\",\"3022\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3023, "epsg", 3023, "RT90 2.5 gon O"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=20.30827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT90 2.5 gon O\",GEOGCS[\"RT90\",DATUM[\"Rikets"); + add_srs_wkt (p, 1, + "_koordinatsystem_1990\",SPHEROID[\"Bessel 1841\",6377397"); + add_srs_wkt (p, 2, + ".155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6124\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4124\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",20.3082777777777"); + add_srs_wkt (p, 9, + "8],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",1500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3023\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3024, "epsg", 3024, "RT90 5 gon O"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=22.55827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT90 5 gon O\",GEOGCS[\"RT90\",DATUM[\"Rikets_k"); + add_srs_wkt (p, 1, + "oordinatsystem_1990\",SPHEROID[\"Bessel 1841\",6377397.1"); + add_srs_wkt (p, 2, + "55,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6124\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4124\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",22.55827777777778],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",1500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"3024\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3025, "epsg", 3025, "RT38 7.5 gon V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=11.30827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT38 7.5 gon V\",GEOGCS[\"RT38\",DATUM[\"Stockh"); + add_srs_wkt (p, 1, + "olm_1938\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528"); + add_srs_wkt (p, 2, + "128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "308\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4308\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 7, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 8, + "METER[\"central_meridian\",11.30827777777778],PARAMETER["); + add_srs_wkt (p, 9, + "\"scale_factor\",1],PARAMETER[\"false_easting\",1500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30"); + add_srs_wkt (p, 11, "25\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3026, "epsg", 3026, "RT38 5 gon V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13.55827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT38 5 gon V\",GEOGCS[\"RT38\",DATUM[\"Stockhol"); + add_srs_wkt (p, 1, + "m_1938\",SPHEROID[\"Bessel 1841\",6377397.155,299.152812"); + add_srs_wkt (p, 2, + "8,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"630"); + add_srs_wkt (p, 3, + "8\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4308\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",13.55827777777778],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "cale_factor\",1],PARAMETER[\"false_easting\",1500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3026\""); + add_srs_wkt (p, 11, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3027, "epsg", 3027, "RT38 2.5 gon V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT38 2.5 gon V\",GEOGCS[\"RT38\",DATUM[\"Stockh"); + add_srs_wkt (p, 1, + "olm_1938\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528"); + add_srs_wkt (p, 2, + "128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "308\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4308\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 7, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 8, + "METER[\"central_meridian\",15.80827777777778],PARAMETER["); + add_srs_wkt (p, 9, + "\"scale_factor\",1],PARAMETER[\"false_easting\",1500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30"); + add_srs_wkt (p, 11, "27\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3028, "epsg", 3028, "RT38 0 gon"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18.05827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT38 0 gon\",GEOGCS[\"RT38\",DATUM[\"Stockholm_"); + add_srs_wkt (p, 1, + "1938\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6308\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4308\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",18.05827777777778],PARAMETER[\"scal"); + add_srs_wkt (p, 9, + "e_factor\",1],PARAMETER[\"false_easting\",1500000],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3028\"],"); + add_srs_wkt (p, 11, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3029, "epsg", 3029, "RT38 2.5 gon O"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=20.30827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT38 2.5 gon O\",GEOGCS[\"RT38\",DATUM[\"Stockh"); + add_srs_wkt (p, 1, + "olm_1938\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528"); + add_srs_wkt (p, 2, + "128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "308\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4308\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 7, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 8, + "METER[\"central_meridian\",20.30827777777778],PARAMETER["); + add_srs_wkt (p, 9, + "\"scale_factor\",1],PARAMETER[\"false_easting\",1500000]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30"); + add_srs_wkt (p, 11, "29\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3030, "epsg", 3030, "RT38 5 gon O"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=22.55827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT38 5 gon O\",GEOGCS[\"RT38\",DATUM[\"Stockhol"); + add_srs_wkt (p, 1, + "m_1938\",SPHEROID[\"Bessel 1841\",6377397.155,299.152812"); + add_srs_wkt (p, 2, + "8,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"630"); + add_srs_wkt (p, 3, + "8\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4308\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",22.55827777777778],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "cale_factor\",1],PARAMETER[\"false_easting\",1500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3030\""); + add_srs_wkt (p, 11, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3031, "epsg", 3031, + "WGS 84 / Antarctic Polar Stereographic"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 "); + add_proj4text (p, 1, "+y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / Antarctic Polar Stereographic\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",63781"); + add_srs_wkt (p, 2, + "37,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Polar_Stereographic\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",-71],PARAMETER[\"central_meridian\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3031\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3032, "epsg", 3032, + "WGS 84 / Australian Antarctic Polar Stereographic"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=70 +k=1 +x_0=6"); + add_proj4text (p, 1, + "000000 +y_0=6000000 +ellps=WGS84 +datum=WGS84 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / Australian Antarctic Polar Stereograph"); + add_srs_wkt (p, 1, + "ic\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS"); + add_srs_wkt (p, 2, + " 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4326\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Polar_Stereographic\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",-71],PARAMETER[\"central_meridian\",70],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",6000000],PARAMETER[\"false_northing\",6000000],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3032\"],AXIS[\"Easting\",UNKNOWN],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3033, "epsg", 3033, + "WGS 84 / Australian Antarctic Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.5 +lat_2=-74.5 +lat_0=-50 +lon_0=70"); + add_proj4text (p, 1, + " +x_0=6000000 +y_0=6000000 +ellps=WGS84 +datum=WGS84 +un"); + add_proj4text (p, 2, "its=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / Australian Antarctic Lambert\",GEOGCS["); + add_srs_wkt (p, 1, + "\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",-68.5],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "74.5],PARAMETER[\"latitude_of_origin\",-50],PARAMETER[\""); + add_srs_wkt (p, 10, + "central_meridian\",70],PARAMETER[\"false_easting\",60000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",6000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 12, + "SG\",\"3033\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 3034, "epsg", 3034, "ETRS89 / ETRS-LCC"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35 +lat_2=65 +lat_0=52 +lon_0=10 +x_0=4"); + add_proj4text (p, 1, "000000 +y_0=2800000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-LCC\",GEOGCS[\"ETRS89\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Terrestrial_Reference_System_1989\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"standard_parallel_1\",35],PARAMETER[\"standard_p"); + add_srs_wkt (p, 9, + "arallel_2\",65],PARAMETER[\"latitude_of_origin\",52],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"central_meridian\",10],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 11, + "g\",4000000],PARAMETER[\"false_northing\",2800000],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"3034\"],AXIS[\"Northing\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Easting\",EAST]]"); + p = add_epsg_def (first, last, 3035, "epsg", 3035, "ETRS89 / ETRS-LAEA"); + add_proj4text (p, 0, + "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000"); + add_proj4text (p, 1, " +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-LAEA\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Lambert_Azimuthal_Equal_Area\"],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"latitude_of_center\",52],PARAMETER[\"longitude_"); + add_srs_wkt (p, 9, + "of_center\",10],PARAMETER[\"false_easting\",4321000],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",3210000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3035\"],AXIS[\"Y\",NORTH],AXIS[\"X\",EAST]]"); + p = add_epsg_def (first, last, 3036, "epsg", 3036, "Moznet / UTM zone 36S"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +south +ellps=WGS84 +towgs84=0,0,0,-0"); + add_proj4text (p, 1, ",-0,-0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Moznet / UTM zone 36S\",GEOGCS[\"Moznet\",DATUM"); + add_srs_wkt (p, 1, + "[\"Moznet_ITRF94\",SPHEROID[\"WGS 84\",6378137,298.25722"); + add_srs_wkt (p, 2, + "3563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,-0,-0,-"); + add_srs_wkt (p, 3, + "0,0],AUTHORITY[\"EPSG\",\"6130\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4130\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",33"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3036\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3037, "epsg", 3037, "Moznet / UTM zone 37S"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +south +ellps=WGS84 +towgs84=0,0,0,-0"); + add_proj4text (p, 1, ",-0,-0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Moznet / UTM zone 37S\",GEOGCS[\"Moznet\",DATUM"); + add_srs_wkt (p, 1, + "[\"Moznet_ITRF94\",SPHEROID[\"WGS 84\",6378137,298.25722"); + add_srs_wkt (p, 2, + "3563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,-0,-0,-"); + add_srs_wkt (p, 3, + "0,0],AUTHORITY[\"EPSG\",\"6130\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4130\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",39"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3037\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3038, "epsg", 3038, "ETRS89 / ETRS-TM26"); + add_proj4text (p, 0, "+proj=utm +zone=26 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM26\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "27],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"3038\"],AXIS[\"Northing\",NORTH],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST]]"); + p = add_epsg_def (first, last, 3039, "epsg", 3039, "ETRS89 / ETRS-TM27"); + add_proj4text (p, 0, "+proj=utm +zone=27 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM27\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "21],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"3039\"],AXIS[\"Northing\",NORTH],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST]]"); + p = add_epsg_def (first, last, 3040, "epsg", 3040, "ETRS89 / ETRS-TM28"); + add_proj4text (p, 0, "+proj=utm +zone=28 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM28\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "15],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"3040\"],AXIS[\"Northing\",NORTH],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST]]"); + p = add_epsg_def (first, last, 3041, "epsg", 3041, "ETRS89 / ETRS-TM29"); + add_proj4text (p, 0, "+proj=utm +zone=29 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM29\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3041\"],AXIS[\"Northing\",NORTH],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST]]"); + p = add_epsg_def (first, last, 3042, "epsg", 3042, "ETRS89 / ETRS-TM30"); + add_proj4text (p, 0, "+proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM30\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3042\"],AXIS[\"Northing\",NORTH],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST]]"); + p = add_epsg_def (first, last, 3043, "epsg", 3043, "ETRS89 / ETRS-TM31"); + add_proj4text (p, 0, "+proj=utm +zone=31 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM31\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",3"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"3043\"],AXIS[\"Northing\",NORTH],AXIS[\"Ea"); + add_srs_wkt (p, 12, "sting\",EAST]]"); + p = add_epsg_def (first, last, 3044, "epsg", 3044, "ETRS89 / ETRS-TM32"); + add_proj4text (p, 0, "+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM32\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"3044\"],AXIS[\"Northing\",NORTH],AXIS[\"Ea"); + add_srs_wkt (p, 12, "sting\",EAST]]"); + p = add_epsg_def (first, last, 3045, "epsg", 3045, "ETRS89 / ETRS-TM33"); + add_proj4text (p, 0, "+proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM33\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3045\"],AXIS[\"Northing\",NORTH],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST]]"); + p = add_epsg_def (first, last, 3046, "epsg", 3046, "ETRS89 / ETRS-TM34"); + add_proj4text (p, 0, "+proj=utm +zone=34 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM34\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",2"); + add_srs_wkt (p, 9, + "1],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3046\"],AXIS[\"Northing\",NORTH],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST]]"); + p = add_epsg_def (first, last, 3047, "epsg", 3047, "ETRS89 / ETRS-TM35"); + add_proj4text (p, 0, "+proj=utm +zone=35 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM35\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",2"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3047\"],AXIS[\"Northing\",NORTH],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST]]"); + p = add_epsg_def (first, last, 3048, "epsg", 3048, "ETRS89 / ETRS-TM36"); + add_proj4text (p, 0, "+proj=utm +zone=36 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM36\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",3"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3048\"],AXIS[\"Northing\",NORTH],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST]]"); + p = add_epsg_def (first, last, 3049, "epsg", 3049, "ETRS89 / ETRS-TM37"); + add_proj4text (p, 0, "+proj=utm +zone=37 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM37\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",3"); + add_srs_wkt (p, 9, + "9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3049\"],AXIS[\"Northing\",NORTH],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST]]"); + p = add_epsg_def (first, last, 3050, "epsg", 3050, "ETRS89 / ETRS-TM38"); + add_proj4text (p, 0, "+proj=utm +zone=38 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM38\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",4"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3050\"],AXIS[\"Northing\",NORTH],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST]]"); + p = add_epsg_def (first, last, 3051, "epsg", 3051, "ETRS89 / ETRS-TM39"); + add_proj4text (p, 0, "+proj=utm +zone=39 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM39\",GEOGCS[\"ETRS89\",DATUM[\""); + add_srs_wkt (p, 1, + "European_Terrestrial_Reference_System_1989\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",5"); + add_srs_wkt (p, 9, + "1],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3051\"],AXIS[\"Northing\",NORTH],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST]]"); + p = add_epsg_def (first, last, 3054, "epsg", 3054, + "Hjorsey 1955 / UTM zone 26N"); + add_proj4text (p, 0, + "+proj=utm +zone=26 +ellps=intl +towgs84=-73,46,-86,0,0,0"); + add_proj4text (p, 1, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hjorsey 1955 / UTM zone 26N\",GEOGCS[\"Hjorsey "); + add_srs_wkt (p, 1, + "1955\",DATUM[\"Hjorsey_1955\",SPHEROID[\"International 1"); + add_srs_wkt (p, 2, + "924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84["); + add_srs_wkt (p, 3, + "-73,46,-86,0,0,0,0],AUTHORITY[\"EPSG\",\"6658\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4658\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-27],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"3054\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3055, "epsg", 3055, + "Hjorsey 1955 / UTM zone 27N"); + add_proj4text (p, 0, + "+proj=utm +zone=27 +ellps=intl +towgs84=-73,46,-86,0,0,0"); + add_proj4text (p, 1, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hjorsey 1955 / UTM zone 27N\",GEOGCS[\"Hjorsey "); + add_srs_wkt (p, 1, + "1955\",DATUM[\"Hjorsey_1955\",SPHEROID[\"International 1"); + add_srs_wkt (p, 2, + "924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84["); + add_srs_wkt (p, 3, + "-73,46,-86,0,0,0,0],AUTHORITY[\"EPSG\",\"6658\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4658\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-21],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"3055\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3056, "epsg", 3056, + "Hjorsey 1955 / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +ellps=intl +towgs84=-73,46,-86,0,0,0"); + add_proj4text (p, 1, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hjorsey 1955 / UTM zone 28N\",GEOGCS[\"Hjorsey "); + add_srs_wkt (p, 1, + "1955\",DATUM[\"Hjorsey_1955\",SPHEROID[\"International 1"); + add_srs_wkt (p, 2, + "924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84["); + add_srs_wkt (p, 3, + "-73,46,-86,0,0,0,0],AUTHORITY[\"EPSG\",\"6658\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4658\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-15],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"3056\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3057, "epsg", 3057, "ISN93 / Lambert 1993"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=64.25 +lat_2=65.75 +lat_0=65 +lon_0=-19"); + add_proj4text (p, 1, + " +x_0=500000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ISN93 / Lambert 1993\",GEOGCS[\"ISN93\",DATUM[\""); + add_srs_wkt (p, 1, + "Islands_Network_1993\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 2, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0"); + add_srs_wkt (p, 3, + ",0,0,0],AUTHORITY[\"EPSG\",\"6659\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4659\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"standard_parallel_1\",64.25],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_2\",65.75],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 10, + "65],PARAMETER[\"central_meridian\",-19],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",500000],PARAMETER[\"false_northing\",500000]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"3057\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3058, "epsg", 3058, + "Helle 1954 / Jan Mayen Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-8.5 +k=1 +x_0=50000 +y_0=-7"); + add_proj4text (p, 1, + "800000 +ellps=intl +towgs84=982.609,552.753,-540.873,32."); + add_proj4text (p, 2, "3934,-153.257,-96.2266,16.805 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Helle 1954 / Jan Mayen Grid\",GEOGCS[\"Helle 19"); + add_srs_wkt (p, 1, + "54\",DATUM[\"Helle_1954\",SPHEROID[\"International 1924\""); + add_srs_wkt (p, 2, + ",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[982.6"); + add_srs_wkt (p, 3, + "09,552.753,-540.873,32.3934,-153.257,-96.2266,16.805],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6660\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4660\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-8.5],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",-7800000],AUTHORITY[\""); + add_srs_wkt (p, 12, "EPSG\",\"3058\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3059, "epsg", 3059, "LKS92 / Latvia TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=-6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LKS92 / Latvia TM\",GEOGCS[\"LKS92\",DATUM[\"La"); + add_srs_wkt (p, 1, + "tvia_1992\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6661\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "661\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 8, + "of_origin\",0],PARAMETER[\"central_meridian\",24],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",-6000000],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3059\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 3060, "epsg", 3060, + "IGN72 Grande Terre / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN72 Grande Terre / UTM zone 58S\",GEOGCS[\"IG"); + add_srs_wkt (p, 1, + "N72 Grande Terre\",DATUM[\"IGN72_Grande_Terre\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7022\"]],AUTHORITY[\"EPSG\",\"6634\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4662\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",165],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_easting\",500000],PARAMETER[\"false_northing\",100000"); + add_srs_wkt (p, 11, + "00],AUTHORITY[\"EPSG\",\"3060\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_08 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 3061, "epsg", 3061, + "Porto Santo 1995 / UTM zone 28N"); + add_proj4text (p, 0, "+proj=utm +zone=28 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Porto Santo 1995 / UTM zone 28N\",GEOGCS[\"Port"); + add_srs_wkt (p, 1, + "o Santo 1995\",DATUM[\"Porto_Santo_1995\",SPHEROID[\"Int"); + add_srs_wkt (p, 2, + "ernational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6663\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4663\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",-15]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_ea"); + add_srs_wkt (p, 10, + "sting\",500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3061\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 12, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 3062, "epsg", 3062, + "Azores Oriental 1995 / UTM zone 26N"); + add_proj4text (p, 0, "+proj=utm +zone=26 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Azores Oriental 1995 / UTM zone 26N\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Azores Oriental 1995\",DATUM[\"Azores_Oriental_Islands_1"); + add_srs_wkt (p, 2, + "995\",SPHEROID[\"International 1924\",6378388,297,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6664\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4664\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",-27],PARAMETER[\"scale_factor\",0.9996]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_easting\",500000],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",0],AUTHORITY[\"EPSG\",\"3062\"],AXIS[\"Easting"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3063, "epsg", 3063, + "Azores Central 1995 / UTM zone 26N"); + add_proj4text (p, 0, "+proj=utm +zone=26 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Azores Central 1995 / UTM zone 26N\",GEOGCS[\"A"); + add_srs_wkt (p, 1, + "zores Central 1995\",DATUM[\"Azores_Central_Islands_1995"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6665\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4665\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-27],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"3063\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3064, "epsg", 3064, "IGM95 / UTM zone 32N"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGM95 / UTM zone 32N\",GEOGCS[\"IGM95\",DATUM[\""); + add_srs_wkt (p, 1, + "Istituto_Geografico_Militaire_1995\",SPHEROID[\"WGS 84\""); + add_srs_wkt (p, 2, + ",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6670\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4670\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",0],AUTHORITY[\"EPSG\",\"3064\"],AXIS[\"Easting\",EAS"); + add_srs_wkt (p, 12, "T],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3065, "epsg", 3065, "IGM95 / UTM zone 33N"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGM95 / UTM zone 33N\",GEOGCS[\"IGM95\",DATUM[\""); + add_srs_wkt (p, 1, + "Istituto_Geografico_Militaire_1995\",SPHEROID[\"WGS 84\""); + add_srs_wkt (p, 2, + ",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6670\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4670\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",15],PARAMETER[\"scale_factor\",0.9996],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"3065\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3066, "epsg", 3066, "ED50 / Jordan TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=37 +k=0.9998 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=-3000000 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / Jordan TM\",GEOGCS[\"ED50\",DATUM[\"Euro"); + add_srs_wkt (p, 1, + "pean_Datum_1950\",SPHEROID[\"International 1924\",637838"); + add_srs_wkt (p, 2, + "8,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",37],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 9, + "\",0.9998],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_northing\",-3000000],AUTHORITY[\"EPSG\",\"3066\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3067, "epsg", 3067, "ETRS89 / ETRS-TM35FIN"); + add_proj4text (p, 0, "+proj=utm +zone=35 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-TM35FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",27],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"3067\"],AXIS[\"Easting\",EAST],AXIS[\"N"); + add_srs_wkt (p, 12, "orthing\",NORTH]]"); + p = add_epsg_def (first, last, 3068, "epsg", 3068, "DHDN / Soldner Berlin"); + add_proj4text (p, 0, + "+proj=cass +lat_0=52.41864827777778 +lon_0=13.6272036666"); + add_proj4text (p, 1, + "6667 +x_0=40000 +y_0=10000 +ellps=bessel +datum=potsdam "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DHDN / Soldner Berlin\",GEOGCS[\"DHDN\",DATUM[\""); + add_srs_wkt (p, 1, + "Deutsches_Hauptdreiecksnetz\",SPHEROID[\"Bessel 1841\",6"); + add_srs_wkt (p, 2, + "377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6314\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "314\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Cassini_Soldner\"],PARAMETER[\"latitude_of_o"); + add_srs_wkt (p, 8, + "rigin\",52.41864827777778],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",13.62720366666667],PARAMETER[\"false_easting\",40000],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",10000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3068\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3069, "epsg", 3069, + "NAD27 / Wisconsin Transverse Mercator"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=500000 +y"); + add_proj4text (p, 1, + "_0=-4500000 +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Wisconsin Transverse Mercator\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD27\",DATUM[\"North_American_Datum_1927\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-90],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",-4500000],AUTHORITY[\"EPSG\",\"3069\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3070, "epsg", 3070, + "NAD83 / Wisconsin Transverse Mercator"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=520000 +y"); + add_proj4text (p, 1, + "_0=-4480000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wisconsin Transverse Mercator\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "90],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",520000],PARAMETER[\"false_northing\",-4480000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"3070\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 3071, "epsg", 3071, + "NAD83(HARN) / Wisconsin Transverse Mercator"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=520000 +y"); + add_proj4text (p, 1, "_0=-4480000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wisconsin Transverse Mercator\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Region"); + add_srs_wkt (p, 2, + "al_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-90],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",520000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",-4480000],AUTHORITY[\"EPSG\",\"3071\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3072, "epsg", 3072, + "NAD83 / Maine CS2000 East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.83333333333334 +lon_0=-67.875 +k=0"); + add_proj4text (p, 1, + ".99998 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maine CS2000 East\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 8, + "f_origin\",43.83333333333334],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-67.875],PARAMETER[\"scale_factor\",0.99998],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",700000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"3072\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3073, "epsg", 3073, + "NAD83 / Maine CS2000 Central (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43 +lon_0=-69.125 +k=0.99998 +x_0=500"); + add_proj4text (p, 1, + "000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maine CS2000 Central (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",43],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",-69.125],PARAMETER[\"scale_factor\",0.99998],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",0],AUTHORITY[\"EPSG\",\"3073\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3074, "epsg", 3074, + "NAD83 / Maine CS2000 West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.375 +k=0"); + add_proj4text (p, 1, + ".99998 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maine CS2000 West\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 8, + "f_origin\",42.83333333333334],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-70.375],PARAMETER[\"scale_factor\",0.99998],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",300000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"3074\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3075, "epsg", 3075, + "NAD83(HARN) / Maine CS2000 East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.83333333333334 +lon_0=-67.875 +k=0"); + add_proj4text (p, 1, + ".99998 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maine CS2000 East\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",43.83333333333334],PARAME"); + add_srs_wkt (p, 9, + "TER[\"central_meridian\",-67.875],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.99998],PARAMETER[\"false_easting\",700000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3075\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3076, "epsg", 3076, + "NAD83(HARN) / Maine CS2000 Central (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43 +lon_0=-69.125 +k=0.99998 +x_0=500"); + add_proj4text (p, 1, "000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maine CS2000 Central (deprecated)"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Re"); + add_srs_wkt (p, 2, + "gional_Network\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",43],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"central_meridian\",-69.125],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.99998],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3076\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3077, "epsg", 3077, + "NAD83(HARN) / Maine CS2000 West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.375 +k=0"); + add_proj4text (p, 1, + ".99998 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maine CS2000 West\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",42.83333333333334],PARAME"); + add_srs_wkt (p, 9, + "TER[\"central_meridian\",-70.375],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.99998],PARAMETER[\"false_easting\",300000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3077\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3078, "epsg", 3078, + "NAD83 / Michigan Oblique Mercator"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=33"); + add_proj4text (p, 1, + "7.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +el"); + add_proj4text (p, 2, "lps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Michigan Oblique Mercator\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_center\",45.30916666666666],PARAMETER[\"long"); + add_srs_wkt (p, 9, + "itude_of_center\",-86],PARAMETER[\"azimuth\",337.25556],"); + add_srs_wkt (p, 10, + "PARAMETER[\"rectified_grid_angle\",337.25556],PARAMETER["); + add_srs_wkt (p, 11, + "\"scale_factor\",0.9996],PARAMETER[\"false_easting\",254"); + add_srs_wkt (p, 12, + "6731.496],PARAMETER[\"false_northing\",-4354009.816],AUT"); + add_srs_wkt (p, 13, + "HORITY[\"EPSG\",\"3078\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 14, "RTH]]"); + p = add_epsg_def (first, last, 3079, "epsg", 3079, + "NAD83(HARN) / Michigan Oblique Mercator"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=33"); + add_proj4text (p, 1, + "7.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +el"); + add_proj4text (p, 2, "lps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Michigan Oblique Mercator\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_N"); + add_srs_wkt (p, 2, + "etwork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Hotine_Oblique"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_center\",45.3091666"); + add_srs_wkt (p, 9, + "6666666],PARAMETER[\"longitude_of_center\",-86],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"azimuth\",337.25556],PARAMETER[\"rectified_grid_angl"); + add_srs_wkt (p, 11, + "e\",337.25556],PARAMETER[\"scale_factor\",0.9996],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_easting\",2546731.496],PARAMETER[\"false_nor"); + add_srs_wkt (p, 13, + "thing\",-4354009.816],AUTHORITY[\"EPSG\",\"3079\"],AXIS["); + add_srs_wkt (p, 14, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3080, "epsg", 3080, "NAD27 / Shackleford"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.41666666666667 +lat_2=34.91666666666"); + add_proj4text (p, 1, + "666 +lat_0=31.16666666666667 +lon_0=-100 +x_0=914400 +y_"); + add_proj4text (p, 2, + "0=914400 +ellps=clrk66 +datum=NAD27 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Shackleford\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"standard_parallel_1\",27.41666666666667],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",34.91666666666666],PARAMETER[\"lat"); + add_srs_wkt (p, 10, + "itude_of_origin\",31.16666666666667],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-100],PARAMETER[\"false_easting\",3000000],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",3000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 13, "\"3080\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3081, "epsg", 3081, + "NAD83 / Texas State Mapping System"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.41666666666667 +lat_2=34.91666666666"); + add_proj4text (p, 1, + "666 +lat_0=31.16666666666667 +lon_0=-100 +x_0=1000000 +y"); + add_proj4text (p, 2, + "_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas State Mapping System\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"standard_parallel_1\",27.41666666666667],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"standard_parallel_2\",34.91666666666666],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",31.16666666666667],PARAMETER[\"cent"); + add_srs_wkt (p, 11, + "ral_meridian\",-100],PARAMETER[\"false_easting\",1000000"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",1000000],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 13, "\",\"3081\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3082, "epsg", 3082, + "NAD83 / Texas Centric Lambert Conformal"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x"); + add_proj4text (p, 1, + "_0=1500000 +y_0=5000000 +ellps=GRS80 +datum=NAD83 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas Centric Lambert Conformal\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"standard_parallel_1\",27.5],PARAMETER[\"stand"); + add_srs_wkt (p, 9, + "ard_parallel_2\",35],PARAMETER[\"latitude_of_origin\",18"); + add_srs_wkt (p, 10, + "],PARAMETER[\"central_meridian\",-100],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_easting\",1500000],PARAMETER[\"false_northing\",5000000"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3082\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3083, "epsg", 3083, + "NAD83 / Texas Centric Albers Equal Area"); + add_proj4text (p, 0, + "+proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x"); + add_proj4text (p, 1, + "_0=1500000 +y_0=6000000 +ellps=GRS80 +datum=NAD83 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas Centric Albers Equal Area\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Albers_Conic_Equal_Area\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"standard_parallel_1\",27.5],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",35],PARAMETER[\"latitude_of_center\",18],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"longitude_of_center\",-100],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",1500000],PARAMETER[\"false_northing\",6000000]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"3083\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3084, "epsg", 3084, + "NAD83(HARN) / Texas Centric Lambert Conformal"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x"); + add_proj4text (p, 1, + "_0=1500000 +y_0=5000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas Centric Lambert Conformal\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regi"); + add_srs_wkt (p, 2, + "onal_Network\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"61"); + add_srs_wkt (p, 4, + "52\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 8, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",2"); + add_srs_wkt (p, 9, + "7.5],PARAMETER[\"standard_parallel_2\",35],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",18],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 11, + "100],PARAMETER[\"false_easting\",1500000],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_northing\",5000000],AUTHORITY[\"EPSG\",\"3084\"],AXI"); + add_srs_wkt (p, 13, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3085, "epsg", 3085, + "NAD83(HARN) / Texas Centric Albers Equal Area"); + add_proj4text (p, 0, + "+proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x"); + add_proj4text (p, 1, + "_0=1500000 +y_0=6000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Texas Centric Albers Equal Area\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regi"); + add_srs_wkt (p, 2, + "onal_Network\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"61"); + add_srs_wkt (p, 4, + "52\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Albers_Con"); + add_srs_wkt (p, 8, + "ic_Equal_Area\"],PARAMETER[\"standard_parallel_1\",27.5]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"standard_parallel_2\",35],PARAMETER[\"latit"); + add_srs_wkt (p, 10, + "ude_of_center\",18],PARAMETER[\"longitude_of_center\",-1"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_easting\",1500000],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_northing\",6000000],AUTHORITY[\"EPSG\",\"3085\"],AXIS"); + add_srs_wkt (p, 13, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3086, "epsg", 3086, + "NAD83 / Florida GDL Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_"); + add_proj4text (p, 1, + "0=400000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Florida GDL Albers\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"stand"); + add_srs_wkt (p, 8, + "ard_parallel_1\",24],PARAMETER[\"standard_parallel_2\",3"); + add_srs_wkt (p, 9, + "1.5],PARAMETER[\"latitude_of_center\",24],PARAMETER[\"lo"); + add_srs_wkt (p, 10, + "ngitude_of_center\",-84],PARAMETER[\"false_easting\",400"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"3086\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3087, "epsg", 3087, + "NAD83(HARN) / Florida GDL Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_"); + add_proj4text (p, 1, "0=400000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Florida GDL Albers\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Albers_Conic_Equal_Area\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",24],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",31.5],PARAMETER[\"latitude_of_center\""); + add_srs_wkt (p, 10, + ",24],PARAMETER[\"longitude_of_center\",-84],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",400000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"3087\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3088, "epsg", 3088, + "NAD83 / Kentucky Single Zone"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 "); + add_proj4text (p, 2, + "+y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kentucky Single Zone\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "standard_parallel_1\",37.08333333333334],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_2\",38.66666666666666],PARAMETER[\"latitu"); + add_srs_wkt (p, 10, + "de_of_origin\",36.33333333333334],PARAMETER[\"central_me"); + add_srs_wkt (p, 11, + "ridian\",-85.75],PARAMETER[\"false_easting\",1500000],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_northing\",1000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "3088\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3089, "epsg", 3089, + "NAD83 / Kentucky Single Zone (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 "); + add_proj4text (p, 2, + "+y_0=999999.9998983998 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 3, "us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kentucky Single Zone (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "37.08333333333334],PARAMETER[\"standard_parallel_2\",38."); + add_srs_wkt (p, 10, + "66666666666666],PARAMETER[\"latitude_of_origin\",36.3333"); + add_srs_wkt (p, 11, + "3333333334],PARAMETER[\"central_meridian\",-85.75],PARAM"); + add_srs_wkt (p, 12, + "ETER[\"false_easting\",4921250],PARAMETER[\"false_northi"); + add_srs_wkt (p, 13, + "ng\",3280833.333],AUTHORITY[\"EPSG\",\"3089\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3090, "epsg", 3090, + "NAD83(HARN) / Kentucky Single Zone"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 "); + add_proj4text (p, 2, "+y_0=1000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Kentucky Single Zone\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",37.0833333"); + add_srs_wkt (p, 9, + "3333334],PARAMETER[\"standard_parallel_2\",38.6666666666"); + add_srs_wkt (p, 10, + "6666],PARAMETER[\"latitude_of_origin\",36.33333333333334"); + add_srs_wkt (p, 11, + "],PARAMETER[\"central_meridian\",-85.75],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_easting\",1500000],PARAMETER[\"false_northing\",10000"); + add_srs_wkt (p, 13, + "00],AUTHORITY[\"EPSG\",\"3090\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3091, "epsg", 3091, + "NAD83(HARN) / Kentucky Single Zone (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 "); + add_proj4text (p, 2, + "+y_0=999999.9998983998 +ellps=GRS80 +units=us-ft +no_def"); + add_proj4text (p, 3, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Kentucky Single Zone (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional"); + add_srs_wkt (p, 2, + "_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey "); + add_srs_wkt (p, 7, + "foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",37.08333333333334],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",38.66666666666666],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",36.33333333333334],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-85.75],PARAMETER[\"false_easting\",4921250],PA"); + add_srs_wkt (p, 13, + "RAMETER[\"false_northing\",3280833.333],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 14, "\",\"3091\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3092, "epsg", 3092, "Tokyo / UTM zone 51N"); + add_proj4text (p, 0, "+proj=utm +zone=51 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / UTM zone 51N\",GEOGCS[\"Tokyo\",DATUM[\""); + add_srs_wkt (p, 1, + "Tokyo\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6301"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",123],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 9, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3092\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3093, "epsg", 3093, "Tokyo / UTM zone 52N"); + add_proj4text (p, 0, "+proj=utm +zone=52 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / UTM zone 52N\",GEOGCS[\"Tokyo\",DATUM[\""); + add_srs_wkt (p, 1, + "Tokyo\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6301"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",129],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 9, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3093\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3094, "epsg", 3094, "Tokyo / UTM zone 53N"); + add_proj4text (p, 0, "+proj=utm +zone=53 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / UTM zone 53N\",GEOGCS[\"Tokyo\",DATUM[\""); + add_srs_wkt (p, 1, + "Tokyo\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6301"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",135],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 9, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3094\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3095, "epsg", 3095, "Tokyo / UTM zone 54N"); + add_proj4text (p, 0, "+proj=utm +zone=54 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / UTM zone 54N\",GEOGCS[\"Tokyo\",DATUM[\""); + add_srs_wkt (p, 1, + "Tokyo\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6301"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",141],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 9, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3095\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3096, "epsg", 3096, "Tokyo / UTM zone 55N"); + add_proj4text (p, 0, "+proj=utm +zone=55 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / UTM zone 55N\",GEOGCS[\"Tokyo\",DATUM[\""); + add_srs_wkt (p, 1, + "Tokyo\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6301"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",147],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 9, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3096\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3097, "epsg", 3097, + "JGD2000 / UTM zone 51N"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / UTM zone 51N\",GEOGCS[\"JGD2000\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Japanese_Geodetic_Datum_2000\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6612\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",123],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"3097\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3098, "epsg", 3098, + "JGD2000 / UTM zone 52N"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / UTM zone 52N\",GEOGCS[\"JGD2000\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Japanese_Geodetic_Datum_2000\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6612\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",129],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"3098\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3099, "epsg", 3099, + "JGD2000 / UTM zone 53N"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / UTM zone 53N\",GEOGCS[\"JGD2000\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Japanese_Geodetic_Datum_2000\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6612\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",135],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"3099\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3100, "epsg", 3100, + "JGD2000 / UTM zone 54N"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / UTM zone 54N\",GEOGCS[\"JGD2000\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Japanese_Geodetic_Datum_2000\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6612\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",141],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"3100\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3101, "epsg", 3101, + "JGD2000 / UTM zone 55N"); + add_proj4text (p, 0, + "+proj=utm +zone=55 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JGD2000 / UTM zone 55N\",GEOGCS[\"JGD2000\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Japanese_Geodetic_Datum_2000\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6612\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4612\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",147],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"3101\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3102, "epsg", 3102, + "American Samoa 1962 / American Samoa Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-14.26666666666667 +lat_0=-14.266666666"); + add_proj4text (p, 1, + "66667 +lon_0=-170 +k_0=1 +x_0=152400.3048006096 +y_0=951"); + add_proj4text (p, 2, + "69.31165862332 +ellps=clrk66 +towgs84=-115,118,426,0,0,0"); + add_proj4text (p, 3, ",0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"American Samoa 1962 / American Samoa Lambert\","); + add_srs_wkt (p, 1, + "GEOGCS[\"American Samoa 1962\",DATUM[\"American_Samoa_19"); + add_srs_wkt (p, 2, + "62\",SPHEROID[\"Clarke 1866\",6378206.4,294.978698213900"); + add_srs_wkt (p, 3, + "6,AUTHORITY[\"EPSG\",\"7008\"]],TOWGS84[-115,118,426,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6169\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4169\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_1SP\"],PARAMETER[\"latitude_of_origin\",-"); + add_srs_wkt (p, 10, + "14.26666666666667],PARAMETER[\"central_meridian\",-170],"); + add_srs_wkt (p, 11, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",500000],PARAMETER[\"false_northing\",312234.65],AUTHORI"); + add_srs_wkt (p, 13, + "TY[\"EPSG\",\"3102\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 14, "]"); + p = add_epsg_def (first, last, 3103, "epsg", 3103, + "Mauritania 1999 / UTM zone 28N (deprecated)"); + add_proj4text (p, 0, "+proj=utm +zone=28 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Mauritania 1999 / UTM zone 28N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Mauritania 1999\",DATUM[\"Mauritania_1999\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6681\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4681\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-15],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",0],AUTHORITY[\"EPSG\",\"3103\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3104, "epsg", 3104, + "Mauritania 1999 / UTM zone 29N (deprecated)"); + add_proj4text (p, 0, "+proj=utm +zone=29 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Mauritania 1999 / UTM zone 29N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Mauritania 1999\",DATUM[\"Mauritania_1999\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6681\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4681\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"3104\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3105, "epsg", 3105, + "Mauritania 1999 / UTM zone 30N (deprecated)"); + add_proj4text (p, 0, "+proj=utm +zone=30 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Mauritania 1999 / UTM zone 30N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Mauritania 1999\",DATUM[\"Mauritania_1999\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6681\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4681\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",-3],PARAMETER[\"scale_factor\",0.9996],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"3105\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3106, "epsg", 3106, + "Gulshan 303 / Bangladesh Transverse Mercator"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=90 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=0 +a=6377276.345 +b=6356075.41314024 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"Gulshan 303 / Bangladesh Transverse Mercator\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Gulshan 303\",DATUM[\"Gulshan_303\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Everest 1830 (1937 Adjustment)\",6377276.345,300.8017,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7015\"]],AUTHORITY[\"EPSG\",\"6682\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4682\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",90],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3106\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3107, "epsg", 3107, "GDA94 / SA Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-28 +lat_2=-36 +lat_0=-32 +lon_0=135 +x"); + add_proj4text (p, 1, + "_0=1000000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / SA Lambert\",GEOGCS[\"GDA94\",DATUM[\"G"); + add_srs_wkt (p, 1, + "eocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Con"); + add_srs_wkt (p, 8, + "ic_2SP\"],PARAMETER[\"standard_parallel_1\",-28],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"standard_parallel_2\",-36],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",-32],PARAMETER[\"central_meridian\",135],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",1000000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",2000000],AUTHORITY[\"EPSG\",\"3107\"],AXIS[\"Easting"); + add_srs_wkt (p, 13, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3108, "epsg", 3108, + "ETRS89 / Guernsey Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=49.5 +lon_0=-2.416666666666667 +k=0.9"); + add_proj4text (p, 1, + "99997 +x_0=47000 +y_0=50000 +ellps=GRS80 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Guernsey Grid\",GEOGCS[\"ETRS89\",DATU"); + add_srs_wkt (p, 1, + "M[\"European_Terrestrial_Reference_System_1989\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",49.5],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",-2.416666666666667],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "99997],PARAMETER[\"false_easting\",47000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",50000],AUTHORITY[\"EPSG\",\"3108\"],AXIS["); + add_srs_wkt (p, 12, "\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3109, "epsg", 3109, + "ETRS89 / Jersey Transverse Mercator"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=49.225 +lon_0=-2.135 +k=0.99999990000"); + add_proj4text (p, 1, + "00001 +x_0=40000 +y_0=70000 +ellps=GRS80 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Jersey Transverse Mercator\",GEOGCS[\""); + add_srs_wkt (p, 1, + "ETRS89\",DATUM[\"European_Terrestrial_Reference_System_1"); + add_srs_wkt (p, 2, + "989\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",49.225],PARAMETER"); + add_srs_wkt (p, 9, + "[\"central_meridian\",-2.135],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9999999],PARAMETER[\"false_easting\",40000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",70000],AUTHORITY[\"EPSG\",\"3109\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3110, "epsg", 3110, "AGD66 / Vicgrid66"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-36 +lat_2=-38 +lat_0=-37 +lon_0=145 +x"); + add_proj4text (p, 1, + "_0=2500000 +y_0=4500000 +ellps=aust_SA +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / Vicgrid66\",GEOGCS[\"AGD66\",DATUM[\"Au"); + add_srs_wkt (p, 1, + "stralian_Geodetic_Datum_1966\",SPHEROID[\"Australian Nat"); + add_srs_wkt (p, 2, + "ional Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "3\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"standard_parallel_1\",-36],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",-38],PARAMETER[\"latitude_of_origin\",-37],"); + add_srs_wkt (p, 10, + "PARAMETER[\"central_meridian\",145],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",2500000],PARAMETER[\"false_northing\",4500000],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"3110\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3111, "epsg", 3111, "GDA94 / Vicgrid94"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-36 +lat_2=-38 +lat_0=-37 +lon_0=145 +x"); + add_proj4text (p, 1, + "_0=2500000 +y_0=2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / Vicgrid94\",GEOGCS[\"GDA94\",DATUM[\"Ge"); + add_srs_wkt (p, 1, + "ocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Con"); + add_srs_wkt (p, 8, + "ic_2SP\"],PARAMETER[\"standard_parallel_1\",-36],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"standard_parallel_2\",-38],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",-37],PARAMETER[\"central_meridian\",145],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",2500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",2500000],AUTHORITY[\"EPSG\",\"3111\"],AXIS[\"Easting"); + add_srs_wkt (p, 13, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3112, "epsg", 3112, + "GDA94 / Geoscience Australia Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=134 +x_0"); + add_proj4text (p, 1, + "=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / Geoscience Australia Lambert\",GEOGCS[\""); + add_srs_wkt (p, 1, + "GDA94\",DATUM[\"Geocentric_Datum_of_Australia_1994\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6283\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lamb"); + add_srs_wkt (p, 8, + "ert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 9, + "_1\",-18],PARAMETER[\"standard_parallel_2\",-36],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"latitude_of_origin\",0],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 11, + "n\",134],PARAMETER[\"false_easting\",0],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3112\"],AXIS[\"East"); + add_srs_wkt (p, 13, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3113, "epsg", 3113, "GDA94 / BCSG02"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-28 +lon_0=153 +k=0.99999 +x_0=50000 "); + add_proj4text (p, 1, + "+y_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / BCSG02\",GEOGCS[\"GDA94\",DATUM[\"Geoce"); + add_srs_wkt (p, 1, + "ntric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS8"); + add_srs_wkt (p, 3, + "4[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",-28],PARAMETER[\"central_"); + add_srs_wkt (p, 9, + "meridian\",153],PARAMETER[\"scale_factor\",0.99999],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",50000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",100000],AUTHORITY[\"EPSG\",\"3113\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3114, "epsg", 3114, + "MAGNA-SIRGAS / Colombia Far West zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-80.07750791"); + add_proj4text (p, 1, + "666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towg"); + add_proj4text (p, 2, "s84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MAGNA-SIRGAS / Colombia Far West zone\",GEOGCS["); + add_srs_wkt (p, 1, + "\"MAGNA-SIRGAS\",DATUM[\"Marco_Geocentrico_Nacional_de_R"); + add_srs_wkt (p, 2, + "eferencia\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6686\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "686\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",4.596200416666666],PARAMETER[\"central_merid"); + add_srs_wkt (p, 10, + "ian\",-80.07750791666666],PARAMETER[\"scale_factor\",1],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_easting\",1000000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",1000000],AUTHORITY[\"EPSG\",\"3114\"],AXIS[\"N"); + add_srs_wkt (p, 13, "orthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3115, "epsg", 3115, + "MAGNA-SIRGAS / Colombia West zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-77.07750791"); + add_proj4text (p, 1, + "666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towg"); + add_proj4text (p, 2, "s84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MAGNA-SIRGAS / Colombia West zone\",GEOGCS[\"MA"); + add_srs_wkt (p, 1, + "GNA-SIRGAS\",DATUM[\"Marco_Geocentrico_Nacional_de_Refer"); + add_srs_wkt (p, 2, + "encia\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"6686\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 5, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4686\""); + add_srs_wkt (p, 7, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",4.596200416666666],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-77.07750791666666],PARAMETER[\"scale_factor\",1],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",1000000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 12, + "ng\",1000000],AUTHORITY[\"EPSG\",\"3115\"],AXIS[\"Northi"); + add_srs_wkt (p, 13, "ng\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3116, "epsg", 3116, + "MAGNA-SIRGAS / Colombia Bogota zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-74.07750791"); + add_proj4text (p, 1, + "666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towg"); + add_proj4text (p, 2, "s84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MAGNA-SIRGAS / Colombia Bogota zone\",GEOGCS[\""); + add_srs_wkt (p, 1, + "MAGNA-SIRGAS\",DATUM[\"Marco_Geocentrico_Nacional_de_Ref"); + add_srs_wkt (p, 2, + "erencia\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6686\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"468"); + add_srs_wkt (p, 7, + "6\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",4.596200416666666],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 10, + "n\",-74.07750791666666],PARAMETER[\"scale_factor\",1],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",1000000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",1000000],AUTHORITY[\"EPSG\",\"3116\"],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3117, "epsg", 3117, + "MAGNA-SIRGAS / Colombia East Central zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-71.07750791"); + add_proj4text (p, 1, + "666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towg"); + add_proj4text (p, 2, "s84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MAGNA-SIRGAS / Colombia East Central zone\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"MAGNA-SIRGAS\",DATUM[\"Marco_Geocentrico_Nacional_"); + add_srs_wkt (p, 2, + "de_Referencia\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6686\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4686\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",4.596200416666666],PARAMETER[\"central_m"); + add_srs_wkt (p, 10, + "eridian\",-71.07750791666666],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 11, + ",1],PARAMETER[\"false_easting\",1000000],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_northing\",1000000],AUTHORITY[\"EPSG\",\"3117\"],AXIS"); + add_srs_wkt (p, 13, "[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3118, "epsg", 3118, + "MAGNA-SIRGAS / Colombia East zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-68.07750791"); + add_proj4text (p, 1, + "666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towg"); + add_proj4text (p, 2, "s84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MAGNA-SIRGAS / Colombia East zone\",GEOGCS[\"MA"); + add_srs_wkt (p, 1, + "GNA-SIRGAS\",DATUM[\"Marco_Geocentrico_Nacional_de_Refer"); + add_srs_wkt (p, 2, + "encia\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"6686\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 5, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4686\""); + add_srs_wkt (p, 7, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",4.596200416666666],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-68.07750791666666],PARAMETER[\"scale_factor\",1],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",1000000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 12, + "ng\",1000000],AUTHORITY[\"EPSG\",\"3118\"],AXIS[\"Northi"); + add_srs_wkt (p, 13, "ng\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3119, "epsg", 3119, + "Douala 1948 / AEF west"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=10.5 +k=0.999 +x_0=1000000 +"); + add_proj4text (p, 1, + "y_0=1000000 +ellps=intl +towgs84=-206.1,-174.7,-87.7,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Douala 1948 / AEF west\",GEOGCS[\"Douala 1948\""); + add_srs_wkt (p, 1, + ",DATUM[\"Douala_1948\",SPHEROID[\"International 1924\",6"); + add_srs_wkt (p, 2, + "378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-206.1,"); + add_srs_wkt (p, 3, + "-174.7,-87.7,0,0,0,0],AUTHORITY[\"EPSG\",\"6192\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4192\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",10.5],PARAMETER[\"scale_factor\",0.999],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",1000000],PARAMETER[\"false_no"); + add_srs_wkt (p, 11, + "rthing\",1000000],AUTHORITY[\"EPSG\",\"3119\"],AXIS[\"Ea"); + add_srs_wkt (p, 12, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3120, "epsg", 3120, + "Pulkovo 1942(58) / Poland zone I"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=50.625 +lon_0=21.08333333333333 +k=0"); + add_proj4text (p, 1, + ".9998 +x_0=4637000 +y_0=5467000 +ellps=krass +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Poland zone I\",GEOGCS[\"Pul"); + add_srs_wkt (p, 1, + "kovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID[\"Kra"); + add_srs_wkt (p, 2, + "ssowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Oblique_Stereographic\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",50.625],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",21.08333333333333],PARAMETER[\"scale_factor\",0.9998]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_easting\",4637000],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "northing\",5467000],AUTHORITY[\"EPSG\",\"3120\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3121, "epsg", 3121, + "PRS92 / Philippines zone 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=0.99995 +x_0=500000 +"); + add_proj4text (p, 1, + "y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.06"); + add_proj4text (p, 2, "8,4.903,1.578,-1.06 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PRS92 / Philippines zone 1\",GEOGCS[\"PRS92\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Philippine_Reference_System_1992\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],TOWGS84[-127.62,-67.24,-47.04,-3.068,4.903,1"); + add_srs_wkt (p, 4, + ".578,-1.06],AUTHORITY[\"EPSG\",\"6683\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4683\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",117],PARAMETER[\"scale_factor\",0.99995],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3121\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3122, "epsg", 3122, + "PRS92 / Philippines zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=119 +k=0.99995 +x_0=500000 +"); + add_proj4text (p, 1, + "y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.06"); + add_proj4text (p, 2, "8,4.903,1.578,-1.06 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PRS92 / Philippines zone 2\",GEOGCS[\"PRS92\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Philippine_Reference_System_1992\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],TOWGS84[-127.62,-67.24,-47.04,-3.068,4.903,1"); + add_srs_wkt (p, 4, + ".578,-1.06],AUTHORITY[\"EPSG\",\"6683\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4683\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",119],PARAMETER[\"scale_factor\",0.99995],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3122\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3123, "epsg", 3123, + "PRS92 / Philippines zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=121 +k=0.99995 +x_0=500000 +"); + add_proj4text (p, 1, + "y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.06"); + add_proj4text (p, 2, "8,4.903,1.578,-1.06 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PRS92 / Philippines zone 3\",GEOGCS[\"PRS92\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Philippine_Reference_System_1992\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],TOWGS84[-127.62,-67.24,-47.04,-3.068,4.903,1"); + add_srs_wkt (p, 4, + ".578,-1.06],AUTHORITY[\"EPSG\",\"6683\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4683\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",121],PARAMETER[\"scale_factor\",0.99995],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3123\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3124, "epsg", 3124, + "PRS92 / Philippines zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=0.99995 +x_0=500000 +"); + add_proj4text (p, 1, + "y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.06"); + add_proj4text (p, 2, "8,4.903,1.578,-1.06 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PRS92 / Philippines zone 4\",GEOGCS[\"PRS92\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Philippine_Reference_System_1992\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],TOWGS84[-127.62,-67.24,-47.04,-3.068,4.903,1"); + add_srs_wkt (p, 4, + ".578,-1.06],AUTHORITY[\"EPSG\",\"6683\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4683\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",123],PARAMETER[\"scale_factor\",0.99995],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3124\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3125, "epsg", 3125, + "PRS92 / Philippines zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=125 +k=0.99995 +x_0=500000 +"); + add_proj4text (p, 1, + "y_0=0 +ellps=clrk66 +towgs84=-127.62,-67.24,-47.04,-3.06"); + add_proj4text (p, 2, "8,4.903,1.578,-1.06 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PRS92 / Philippines zone 5\",GEOGCS[\"PRS92\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Philippine_Reference_System_1992\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],TOWGS84[-127.62,-67.24,-47.04,-3.068,4.903,1"); + add_srs_wkt (p, 4, + ".578,-1.06],AUTHORITY[\"EPSG\",\"6683\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4683\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",125],PARAMETER[\"scale_factor\",0.99995],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3125\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3126, "epsg", 3126, "ETRS89 / ETRS-GK19FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=19 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK19FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",19],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3126\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3127, "epsg", 3127, "ETRS89 / ETRS-GK20FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=20 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK20FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",20],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3127\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3128, "epsg", 3128, "ETRS89 / ETRS-GK21FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK21FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",21],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3128\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3129, "epsg", 3129, "ETRS89 / ETRS-GK22FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=22 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK22FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",22],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3129\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3130, "epsg", 3130, "ETRS89 / ETRS-GK23FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=23 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK23FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",23],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3130\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3131, "epsg", 3131, "ETRS89 / ETRS-GK24FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK24FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",24],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3131\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3132, "epsg", 3132, "ETRS89 / ETRS-GK25FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=25 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK25FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",25],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3132\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3133, "epsg", 3133, "ETRS89 / ETRS-GK26FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=26 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK26FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",26],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3133\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3134, "epsg", 3134, "ETRS89 / ETRS-GK27FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK27FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",27],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3134\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3135, "epsg", 3135, "ETRS89 / ETRS-GK28FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK28FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",28],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3135\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3136, "epsg", 3136, "ETRS89 / ETRS-GK29FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=29 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK29FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",29],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3136\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3137, "epsg", 3137, "ETRS89 / ETRS-GK30FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK30FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",30],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3137\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3138, "epsg", 3138, "ETRS89 / ETRS-GK31FIN"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / ETRS-GK31FIN\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",31],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3138\"],AXIS[\"Northing\",NORTH],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST]]"); + p = add_epsg_def (first, last, 3140, "epsg", 3140, + "Viti Levu 1912 / Viti Levu Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=-18 +lon_0=178 +x_0=109435.392 +y_0=14"); + add_proj4text (p, 1, + "1622.272 +a=6378306.3696 +b=6356571.996 +towgs84=51,391,"); + add_proj4text (p, 2, "-36,0,0,0,0 +to_meter=0.201168 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Viti Levu 1912 / Viti Levu Grid\",GEOGCS[\"Viti"); + add_srs_wkt (p, 1, + " Levu 1912\",DATUM[\"Viti_Levu_1912\",SPHEROID[\"Clarke "); + add_srs_wkt (p, 2, + "1880 (international foot)\",6378306.3696,293.46630765563"); + add_srs_wkt (p, 3, + "49,AUTHORITY[\"EPSG\",\"7055\"]],TOWGS84[51,391,-36,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6752\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4752\"]],UNIT[\"link\",0.201168,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9098\"]],PROJECTION[\"Cassini_Soldner\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "latitude_of_origin\",-18],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",178],PARAMETER[\"false_easting\",544000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",704000],AUTHORITY[\"EPSG\",\"3140\"],AXIS"); + add_srs_wkt (p, 12, "[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3141, "epsg", 3141, + "Fiji 1956 / UTM zone 60S"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +south +ellps=intl +towgs84=265.025,3"); + add_proj4text (p, 1, "84.929,-194.046,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Fiji 1956 / UTM zone 60S\",GEOGCS[\"Fiji 1956\""); + add_srs_wkt (p, 1, + ",DATUM[\"Fiji_1956\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[265.025,3"); + add_srs_wkt (p, 3, + "84.929,-194.046,0,0,0,0],AUTHORITY[\"EPSG\",\"6721\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4721\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 8, + "tor\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",177],PARAMETER[\"scale_factor\",0.9996"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "northing\",10000000],AUTHORITY[\"EPSG\",\"3141\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3142, "epsg", 3142, + "Fiji 1956 / UTM zone 1S"); + add_proj4text (p, 0, + "+proj=utm +zone=1 +south +ellps=intl +towgs84=265.025,38"); + add_proj4text (p, 1, "4.929,-194.046,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Fiji 1956 / UTM zone 1S\",GEOGCS[\"Fiji 1956\","); + add_srs_wkt (p, 1, + "DATUM[\"Fiji_1956\",SPHEROID[\"International 1924\",6378"); + add_srs_wkt (p, 2, + "388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[265.025,38"); + add_srs_wkt (p, 3, + "4.929,-194.046,0,0,0,0],AUTHORITY[\"EPSG\",\"6721\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4721\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",-177],PARAMETER[\"scale_factor\",0.9996"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "northing\",10000000],AUTHORITY[\"EPSG\",\"3142\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3143, "epsg", 3143, + "Fiji 1986 / Fiji Map Grid (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-17 +lon_0=178.75 +k=0.99985 +x_0=200"); + add_proj4text (p, 1, "0000 +y_0=4000000 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Fiji 1986 / Fiji Map Grid (deprecated)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Fiji 1986\",DATUM[\"Fiji_Geodetic_Datum_1986\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6720\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4720\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",-17],PARAMETER[\"central_meridian\",17"); + add_srs_wkt (p, 9, + "8.75],PARAMETER[\"scale_factor\",0.99985],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",2000000],PARAMETER[\"false_northing\",4000"); + add_srs_wkt (p, 11, + "000],AUTHORITY[\"EPSG\",\"3143\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3146, "epsg", 3146, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 6\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",18],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",65000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "3146\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3147, "epsg", 3147, + "Pulkovo 1942 / 3-degree Gauss-Kruger CM 18E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger CM 18E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",18],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "3147\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3148, "epsg", 3148, + "Indian 1960 / UTM zone 48N"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +a=6377276.345 +b=6356075.41314024 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Indian 1960 / UTM zone 48N\",GEOGCS[\"Indian 19"); + add_srs_wkt (p, 1, + "60\",DATUM[\"Indian_1960\",SPHEROID[\"Everest 1830 (1937"); + add_srs_wkt (p, 2, + " Adjustment)\",6377276.345,300.8017,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7015\"]],AUTHORITY[\"EPSG\",\"6131\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4131\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",105],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_easting\",500000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"3148\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3149, "epsg", 3149, + "Indian 1960 / UTM zone 49N"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +a=6377276.345 +b=6356075.41314024 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Indian 1960 / UTM zone 49N\",GEOGCS[\"Indian 19"); + add_srs_wkt (p, 1, + "60\",DATUM[\"Indian_1960\",SPHEROID[\"Everest 1830 (1937"); + add_srs_wkt (p, 2, + " Adjustment)\",6377276.345,300.8017,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7015\"]],AUTHORITY[\"EPSG\",\"6131\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4131\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",111],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_easting\",500000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"3149\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3150, "epsg", 3150, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 6\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",18],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",6500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"3150\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3151, "epsg", 3151, + "Pulkovo 1995 / 3-degree Gauss-Kruger CM 18E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger CM 18E\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",18],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "3151\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3152, "epsg", 3152, "ST74"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18.05779 +k=0.99999425 +x_0="); + add_proj4text (p, 1, + "100178.1808 +y_0=-6500614.7836 +ellps=GRS80 +towgs84=0,0"); + add_proj4text (p, 2, ",0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ST74\",GEOGCS[\"SWEREF99\",DATUM[\"SWEREF99\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 2, + "PSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 7, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 8, + "],PARAMETER[\"central_meridian\",18.05779],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "cale_factor\",0.99999425],PARAMETER[\"false_easting\",10"); + add_srs_wkt (p, 10, + "0178.1808],PARAMETER[\"false_northing\",-6500614.7836],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"3152\"],AXIS[\"x\",NORTH],AXIS[\"y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3153, "epsg", 3153, + "NAD83(CSRS) / BC Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x"); + add_proj4text (p, 1, "_0=1000000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / BC Albers\",GEOGCS[\"NAD83(CSRS)\""); + add_srs_wkt (p, 1, + ",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Albers_Conic_Equal_Area\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"standard_parallel_1\",50],PARAMETER[\"standard"); + add_srs_wkt (p, 9, + "_parallel_2\",58.5],PARAMETER[\"latitude_of_center\",45]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"longitude_of_center\",-126],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_easting\",1000000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 12, + "THORITY[\"EPSG\",\"3153\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3154, "epsg", 3154, + "NAD83(CSRS) / UTM zone 7N"); + add_proj4text (p, 0, "+proj=utm +zone=7 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 7N\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-141],PARAMETER[\"scale_factor\",0.9996],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"3154\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3155, "epsg", 3155, + "NAD83(CSRS) / UTM zone 8N"); + add_proj4text (p, 0, "+proj=utm +zone=8 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 8N\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-135],PARAMETER[\"scale_factor\",0.9996],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"3155\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3156, "epsg", 3156, + "NAD83(CSRS) / UTM zone 9N"); + add_proj4text (p, 0, "+proj=utm +zone=9 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 9N\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-129],PARAMETER[\"scale_factor\",0.9996],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"3156\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3157, "epsg", 3157, + "NAD83(CSRS) / UTM zone 10N"); + add_proj4text (p, 0, "+proj=utm +zone=10 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 10N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-123],PARAMETER[\"scale_factor\",0.9996],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"3157\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3158, "epsg", 3158, + "NAD83(CSRS) / UTM zone 14N"); + add_proj4text (p, 0, "+proj=utm +zone=14 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 14N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-99],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"3158\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3159, "epsg", 3159, + "NAD83(CSRS) / UTM zone 15N"); + add_proj4text (p, 0, "+proj=utm +zone=15 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 15N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-93],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"3159\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3160, "epsg", 3160, + "NAD83(CSRS) / UTM zone 16N"); + add_proj4text (p, 0, "+proj=utm +zone=16 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 16N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-87],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"3160\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3161, "epsg", 3161, + "NAD83 / Ontario MNR Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.5 +lat_2=53.5 +lat_0=0 +lon_0=-85 +x"); + add_proj4text (p, 1, + "_0=930000 +y_0=6430000 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Ontario MNR Lambert\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",44.5],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 9, + "_2\",53.5],PARAMETER[\"latitude_of_origin\",0],PARAMETER"); + add_srs_wkt (p, 10, + "[\"central_meridian\",-85],PARAMETER[\"false_easting\",9"); + add_srs_wkt (p, 11, + "30000],PARAMETER[\"false_northing\",6430000],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3161\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3162, "epsg", 3162, + "NAD83(CSRS) / Ontario MNR Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.5 +lat_2=53.5 +lat_0=0 +lon_0=-85 +x"); + add_proj4text (p, 1, + "_0=930000 +y_0=6430000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Ontario MNR Lambert\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",44.5],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"standard_parallel_2\",53.5],PARAMETER[\"latitu"); + add_srs_wkt (p, 10, + "de_of_origin\",0],PARAMETER[\"central_meridian\",-85],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",930000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",6430000],AUTHORITY[\"EPSG\",\"3162\"],AXIS[\"East"); + add_srs_wkt (p, 13, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3163, "epsg", 3163, + "RGNC91-93 / Lambert New Caledonia"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-20.66666666666667 +lat_2=-22.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-21.5 +lon_0=166 +x_0=400000 +y_0=300000 +e"); + add_proj4text (p, 2, "llps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGNC91-93 / Lambert New Caledonia\",GEOGCS[\"RG"); + add_srs_wkt (p, 1, + "NC91-93\",DATUM[\"Reseau_Geodesique_de_Nouvelle_Caledoni"); + add_srs_wkt (p, 2, + "e_91_93\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6749\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"474"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_1\",-20.66666666666667],PARAMETER[\"stand"); + add_srs_wkt (p, 10, + "ard_parallel_2\",-22.33333333333333],PARAMETER[\"latitud"); + add_srs_wkt (p, 11, + "e_of_origin\",-21.5],PARAMETER[\"central_meridian\",166]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"false_easting\",400000],PARAMETER[\"false_n"); + add_srs_wkt (p, 13, + "orthing\",300000],AUTHORITY[\"EPSG\",\"3163\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3164, "epsg", 3164, + "ST87 Ouvea / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=WGS84 +towgs84=-56.263,"); + add_proj4text (p, 1, "16.136,-22.856,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ST87 Ouvea / UTM zone 58S\",GEOGCS[\"ST87 Ouvea"); + add_srs_wkt (p, 1, + "\",DATUM[\"ST87_Ouvea\",SPHEROID[\"WGS 84\",6378137,298."); + add_srs_wkt (p, 2, + "257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[-56.263,"); + add_srs_wkt (p, 3, + "16.136,-22.856,0,0,0,0],AUTHORITY[\"EPSG\",\"6750\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4750\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",165],PARAMETER[\"scale_factor\",0.9996]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_easting\",500000],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",10000000],AUTHORITY[\"EPSG\",\"3164\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3165, "epsg", 3165, + "NEA74 Noumea / Noumea Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-22.24469175 +lat_2=-22.29469175 +lat_0"); + add_proj4text (p, 1, + "=-22.26969175 +lon_0=166.44242575 +x_0=0.66 +y_0=1.02 +e"); + add_proj4text (p, 2, "llps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NEA74 Noumea / Noumea Lambert\",GEOGCS[\"NEA74 "); + add_srs_wkt (p, 1, + "Noumea\",DATUM[\"NEA74_Noumea\",SPHEROID[\"International"); + add_srs_wkt (p, 2, + " 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6644\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4644"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 8, + "dard_parallel_1\",-22.24469175],PARAMETER[\"standard_par"); + add_srs_wkt (p, 9, + "allel_2\",-22.29469175],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 10, + ",-22.26969175],PARAMETER[\"central_meridian\",166.442425"); + add_srs_wkt (p, 11, + "75],PARAMETER[\"false_easting\",0.66],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "northing\",1.02],AUTHORITY[\"EPSG\",\"3165\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3166, "epsg", 3166, + "NEA74 Noumea / Noumea Lambert 2"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-22.24472222222222 +lat_2=-22.294722222"); + add_proj4text (p, 1, + "22222 +lat_0=-22.26972222222222 +lon_0=166.4425 +x_0=8.3"); + add_proj4text (p, 2, + "13000000000001 +y_0=-2.354 +ellps=intl +units=m +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NEA74 Noumea / Noumea Lambert 2\",GEOGCS[\"NEA7"); + add_srs_wkt (p, 1, + "4 Noumea\",DATUM[\"NEA74_Noumea\",SPHEROID[\"Internation"); + add_srs_wkt (p, 2, + "al 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6644\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"46"); + add_srs_wkt (p, 6, + "44\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 8, + "andard_parallel_1\",-22.24472222222222],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",-22.29472222222222],PARAMETER[\"latitu"); + add_srs_wkt (p, 10, + "de_of_origin\",-22.26972222222222],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",166.4425],PARAMETER[\"false_easting\",8.313],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",-2.354],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "3166\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3167, "epsg", 3167, + "Kertau (RSO) / RSO Malaya (ch)"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k="); + add_proj4text (p, 1, + "0.99984 +x_0=40000 +y_0=0 +a=6377295.664 +b=6356094.6679"); + add_proj4text (p, 2, "15204 +to_meter=20.116756 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kertau (RSO) / RSO Malaya (ch)\",GEOGCS[\"Kerta"); + add_srs_wkt (p, 1, + "u (RSO)\",DATUM[\"Kertau_RSO\",SPHEROID[\"Everest 1830 ("); + add_srs_wkt (p, 2, + "RSO 1969)\",6377295.664,300.8017,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "56\"]],AUTHORITY[\"EPSG\",\"6751\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4751\"]],UNIT[\"British chain (Sears 1922 trunca"); + add_srs_wkt (p, 7, + "ted)\",20.116756,AUTHORITY[\"EPSG\",\"9301\"]],PROJECTIO"); + add_srs_wkt (p, 8, + "N[\"Hotine_Oblique_Mercator\"],PARAMETER[\"latitude_of_c"); + add_srs_wkt (p, 9, + "enter\",4],PARAMETER[\"longitude_of_center\",102.25],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"azimuth\",323.0257905],PARAMETER[\"rectified_gr"); + add_srs_wkt (p, 11, + "id_angle\",323.1301023611111],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 12, + ",0.99984],PARAMETER[\"false_easting\",1988.392164223695]"); + add_srs_wkt (p, 13, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"31"); + add_srs_wkt (p, 14, + "67\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3168, "epsg", 3168, + "Kertau (RSO) / RSO Malaya (m)"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k="); + add_proj4text (p, 1, + "0.99984 +x_0=804670.24 +y_0=0 +a=6377295.664 +b=6356094."); + add_proj4text (p, 2, "667915204 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kertau (RSO) / RSO Malaya (m)\",GEOGCS[\"Kertau"); + add_srs_wkt (p, 1, + " (RSO)\",DATUM[\"Kertau_RSO\",SPHEROID[\"Everest 1830 (R"); + add_srs_wkt (p, 2, + "SO 1969)\",6377295.664,300.8017,AUTHORITY[\"EPSG\",\"705"); + add_srs_wkt (p, 3, + "6\"]],AUTHORITY[\"EPSG\",\"6751\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4751\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_center\",4],PARAMETER[\"longitude_of_cen"); + add_srs_wkt (p, 9, + "ter\",102.25],PARAMETER[\"azimuth\",323.0257905],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"rectified_grid_angle\",323.1301023611111],PARAMETER"); + add_srs_wkt (p, 11, + "[\"scale_factor\",0.99984],PARAMETER[\"false_easting\",8"); + add_srs_wkt (p, 12, + "04670.24],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, + "SG\",\"3168\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 14, "NORTH]]"); + p = add_epsg_def (first, last, 3169, "epsg", 3169, + "RGNC91-93 / UTM zone 57S"); + add_proj4text (p, 0, + "+proj=utm +zone=57 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGNC91-93 / UTM zone 57S\",GEOGCS[\"RGNC91-93\""); + add_srs_wkt (p, 1, + ",DATUM[\"Reseau_Geodesique_de_Nouvelle_Caledonie_91_93\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"6749\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4749\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",159],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, + "\"3169\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 3170, "epsg", 3170, + "RGNC91-93 / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGNC91-93 / UTM zone 58S\",GEOGCS[\"RGNC91-93\""); + add_srs_wkt (p, 1, + ",DATUM[\"Reseau_Geodesique_de_Nouvelle_Caledonie_91_93\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"6749\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4749\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",165],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, + "\"3170\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 3171, "epsg", 3171, + "RGNC91-93 / UTM zone 59S"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGNC91-93 / UTM zone 59S\",GEOGCS[\"RGNC91-93\""); + add_srs_wkt (p, 1, + ",DATUM[\"Reseau_Geodesique_de_Nouvelle_Caledonie_91_93\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"6749\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4749\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",171],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, + "\"3171\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 3172, "epsg", 3172, + "IGN53 Mare / UTM zone 59S"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN53 Mare / UTM zone 59S\",GEOGCS[\"IGN53 Mare"); + add_srs_wkt (p, 1, + "\",DATUM[\"IGN53_Mare\",SPHEROID[\"International 1924\","); + add_srs_wkt (p, 2, + "6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6641\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4641\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",171],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, + "\"3172\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH"); + add_srs_wkt (p, 12, "]]"); + p = add_epsg_def (first, last, 3174, "epsg", 3174, + "NAD83 / Great Lakes Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=42.122774 +lat_2=49.01518 +lat_0=45.568"); + add_proj4text (p, 1, + "977 +lon_0=-84.455955 +x_0=1000000 +y_0=1000000 +ellps=G"); + add_proj4text (p, 2, "RS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Great Lakes Albers\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"stand"); + add_srs_wkt (p, 8, + "ard_parallel_1\",42.122774],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 9, + "l_2\",49.01518],PARAMETER[\"latitude_of_center\",45.5689"); + add_srs_wkt (p, 10, + "77],PARAMETER[\"longitude_of_center\",-84.455955],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",1000000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",1000000],AUTHORITY[\"EPSG\",\"3174\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 13, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3175, "epsg", 3175, + "NAD83 / Great Lakes and St Lawrence Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=42.122774 +lat_2=49.01518 +lat_0=45.568"); + add_proj4text (p, 1, + "977 +lon_0=-83.248627 +x_0=1000000 +y_0=1000000 +ellps=G"); + add_proj4text (p, 2, "RS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Great Lakes and St Lawrence Albers\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Albers_Conic_Equal_Area\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"standard_parallel_1\",42.122774],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",49.01518],PARAMETER[\"latitude_of_c"); + add_srs_wkt (p, 10, + "enter\",45.568977],PARAMETER[\"longitude_of_center\",-83"); + add_srs_wkt (p, 11, + ".248627],PARAMETER[\"false_easting\",1000000],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_northing\",1000000],AUTHORITY[\"EPSG\",\"3175\"]"); + add_srs_wkt (p, 13, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3176, "epsg", 3176, + "Indian 1960 / TM 106 NE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=106 +k=0.9996 +x_0=500000 +y"); + add_proj4text (p, 1, + "_0=0 +a=6377276.345 +b=6356075.41314024 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Indian 1960 / TM 106 NE\",GEOGCS[\"Indian 1960\""); + add_srs_wkt (p, 1, + ",DATUM[\"Indian_1960\",SPHEROID[\"Everest 1830 (1937 Adj"); + add_srs_wkt (p, 2, + "ustment)\",6377276.345,300.8017,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "5\"]],AUTHORITY[\"EPSG\",\"6131\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4131\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "06],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"3176\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 3177, "epsg", 3177, "LGD2006 / Libya TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=17 +k=0.9965000000000001 +x_"); + add_proj4text (p, 1, + "0=1000000 +y_0=0 +ellps=intl +towgs84=-208.406,-109.878,"); + add_proj4text (p, 2, "-2.5764,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / Libya TM\",GEOGCS[\"LGD2006\",DATUM[\""); + add_srs_wkt (p, 1, + "Libyan_Geodetic_Datum_2006\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-"); + add_srs_wkt (p, 3, + "208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 4, + "754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 5, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UNIT[\"metr"); + add_srs_wkt (p, 7, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 8, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 9, + "METER[\"central_meridian\",17],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9965],PARAMETER[\"false_easting\",1000000],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"3177\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3178, "epsg", 3178, "GR96 / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 18N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-75],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3178\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3179, "epsg", 3179, "GR96 / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 19N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-69],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3179\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3180, "epsg", 3180, "GR96 / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 20N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-63],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3180\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3181, "epsg", 3181, "GR96 / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 21N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-57],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3181\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3182, "epsg", 3182, "GR96 / UTM zone 22N"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 22N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-51],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3182\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3183, "epsg", 3183, "GR96 / UTM zone 23N"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 23N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-45],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3183\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3184, "epsg", 3184, "GR96 / UTM zone 24N"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 24N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-39],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3184\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3185, "epsg", 3185, "GR96 / UTM zone 25N"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 25N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-33],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3185\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3186, "epsg", 3186, "GR96 / UTM zone 26N"); + add_proj4text (p, 0, + "+proj=utm +zone=26 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 26N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-27],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3186\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3187, "epsg", 3187, "GR96 / UTM zone 27N"); + add_proj4text (p, 0, + "+proj=utm +zone=27 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 27N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-21],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3187\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3188, "epsg", 3188, "GR96 / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 28N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-15],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3188\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3189, "epsg", 3189, "GR96 / UTM zone 29N"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GR96 / UTM zone 29N\",GEOGCS[\"GR96\",DATUM[\"G"); + add_srs_wkt (p, 1, + "reenland_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 2, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6747\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4747\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-9],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"3189\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 3190, "epsg", 3190, + "LGD2006 / Libya TM zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.99995 +x_0=200000 +y_"); + add_proj4text (p, 1, + "0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,0"); + add_proj4text (p, 2, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / Libya TM zone 5\",GEOGCS[\"LGD2006\","); + add_srs_wkt (p, 1, + "DATUM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 4, + "SG\",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.99995],PARAMETER[\"false_easting\",200000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3190\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3191, "epsg", 3191, + "LGD2006 / Libya TM zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=11 +k=0.99995 +x_0=200000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / Libya TM zone 6\",GEOGCS[\"LGD2006\","); + add_srs_wkt (p, 1, + "DATUM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 4, + "SG\",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",11],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.99995],PARAMETER[\"false_easting\",200000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3191\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3192, "epsg", 3192, + "LGD2006 / Libya TM zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13 +k=0.99995 +x_0=200000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / Libya TM zone 7\",GEOGCS[\"LGD2006\","); + add_srs_wkt (p, 1, + "DATUM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 4, + "SG\",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",13],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.99995],PARAMETER[\"false_easting\",200000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3192\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_09 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 3193, "epsg", 3193, + "LGD2006 / Libya TM zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.99995 +x_0=200000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / Libya TM zone 8\",GEOGCS[\"LGD2006\","); + add_srs_wkt (p, 1, + "DATUM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 4, + "SG\",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",15],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.99995],PARAMETER[\"false_easting\",200000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3193\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3194, "epsg", 3194, + "LGD2006 / Libya TM zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=17 +k=0.99995 +x_0=200000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / Libya TM zone 9\",GEOGCS[\"LGD2006\","); + add_srs_wkt (p, 1, + "DATUM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 4, + "SG\",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",17],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.99995],PARAMETER[\"false_easting\",200000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3194\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3195, "epsg", 3195, + "LGD2006 / Libya TM zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=19 +k=0.99995 +x_0=200000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / Libya TM zone 10\",GEOGCS[\"LGD2006\""); + add_srs_wkt (p, 1, + ",DATUM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "TOWGS84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UN"); + add_srs_wkt (p, 7, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",0],PARAMETER[\"central_meridian\",19],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.99995],PARAMETER[\"false_easting\",200000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3195"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3196, "epsg", 3196, + "LGD2006 / Libya TM zone 11"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.99995 +x_0=200000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / Libya TM zone 11\",GEOGCS[\"LGD2006\""); + add_srs_wkt (p, 1, + ",DATUM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "TOWGS84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UN"); + add_srs_wkt (p, 7, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",0],PARAMETER[\"central_meridian\",21],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.99995],PARAMETER[\"false_easting\",200000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3196"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3197, "epsg", 3197, + "LGD2006 / Libya TM zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=23 +k=0.99995 +x_0=200000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / Libya TM zone 12\",GEOGCS[\"LGD2006\""); + add_srs_wkt (p, 1, + ",DATUM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "TOWGS84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UN"); + add_srs_wkt (p, 7, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",0],PARAMETER[\"central_meridian\",23],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.99995],PARAMETER[\"false_easting\",200000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3197"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3198, "epsg", 3198, + "LGD2006 / Libya TM zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=25 +k=0.99995 +x_0=200000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +towgs84=-208.406,-109.878,-2.5764,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / Libya TM zone 13\",GEOGCS[\"LGD2006\""); + add_srs_wkt (p, 1, + ",DATUM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "TOWGS84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UN"); + add_srs_wkt (p, 7, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",0],PARAMETER[\"central_meridian\",25],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.99995],PARAMETER[\"false_easting\",200000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3198"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3199, "epsg", 3199, + "LGD2006 / UTM zone 32N"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +ellps=intl +towgs84=-208.406,-109.87"); + add_proj4text (p, 1, "8,-2.5764,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / UTM zone 32N\",GEOGCS[\"LGD2006\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Internation"); + add_srs_wkt (p, 2, + "al 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWG"); + add_srs_wkt (p, 3, + "S84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",9],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 10, + "r\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3199\"],AXI"); + add_srs_wkt (p, 12, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3200, "epsg", 3200, "FD58 / Iraq zone"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.99878"); + add_proj4text (p, 1, + "64078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"FD58 / Iraq zone\",GEOGCS[\"FD58\",DATUM[\"Fina"); + add_srs_wkt (p, 1, + "l_Datum_1958\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 2, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6132\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4132\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"L"); + add_srs_wkt (p, 7, + "ambert_Conformal_Conic_1SP\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",32.5],PARAMETER[\"central_meridian\",45],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",0.9987864078],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",1500000],PARAMETER[\"false_northing\",1166200],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"3200\"],AXIS[\"Easting\",EAST],AXIS[\"N"); + add_srs_wkt (p, 12, "orthing\",NORTH]]"); + p = add_epsg_def (first, last, 3201, "epsg", 3201, + "LGD2006 / UTM zone 33N"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +ellps=intl +towgs84=-208.406,-109.87"); + add_proj4text (p, 1, "8,-2.5764,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / UTM zone 33N\",GEOGCS[\"LGD2006\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Internation"); + add_srs_wkt (p, 2, + "al 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWG"); + add_srs_wkt (p, 3, + "S84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",15],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3201\"],AX"); + add_srs_wkt (p, 12, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3202, "epsg", 3202, + "LGD2006 / UTM zone 34N"); + add_proj4text (p, 0, + "+proj=utm +zone=34 +ellps=intl +towgs84=-208.406,-109.87"); + add_proj4text (p, 1, "8,-2.5764,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / UTM zone 34N\",GEOGCS[\"LGD2006\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Internation"); + add_srs_wkt (p, 2, + "al 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWG"); + add_srs_wkt (p, 3, + "S84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",21],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3202\"],AX"); + add_srs_wkt (p, 12, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3203, "epsg", 3203, + "LGD2006 / UTM zone 35N"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +ellps=intl +towgs84=-208.406,-109.87"); + add_proj4text (p, 1, "8,-2.5764,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"LGD2006 / UTM zone 35N\",GEOGCS[\"LGD2006\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Libyan_Geodetic_Datum_2006\",SPHEROID[\"Internation"); + add_srs_wkt (p, 2, + "al 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWG"); + add_srs_wkt (p, 3, + "S84[-208.406,-109.878,-2.5764,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6754\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4754\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",27],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3203\"],AX"); + add_srs_wkt (p, 12, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3204, "epsg", 3204, + "WGS 84 / SCAR IMW SP19-20"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-60.66666666666666 +lat_2=-63.333333333"); + add_proj4text (p, 1, + "33334 +lat_0=-90 +lon_0=-66 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SP19-20\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-60.66666666666666],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "63.33333333333334],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-66],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3204\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3205, "epsg", 3205, + "WGS 84 / SCAR IMW SP21-22"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-60.66666666666666 +lat_2=-63.333333333"); + add_proj4text (p, 1, + "33334 +lat_0=-90 +lon_0=-54 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SP21-22\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-60.66666666666666],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "63.33333333333334],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-54],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3205\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3206, "epsg", 3206, + "WGS 84 / SCAR IMW SP23-24"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-60.66666666666666 +lat_2=-63.333333333"); + add_proj4text (p, 1, + "33334 +lat_0=-90 +lon_0=-42 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SP23-24\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-60.66666666666666],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "63.33333333333334],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-42],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3206\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3207, "epsg", 3207, + "WGS 84 / SCAR IMW SQ01-02"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-174 +x_0=0 +y_0=0 +ellps=WGS84 "); + add_proj4text (p, 2, "+datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ01-02\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-174],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3207\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3208, "epsg", 3208, + "WGS 84 / SCAR IMW SQ19-20"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-66 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ19-20\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-66],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3208\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3209, "epsg", 3209, + "WGS 84 / SCAR IMW SQ21-22"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-54 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ21-22\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-54],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3209\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3210, "epsg", 3210, + "WGS 84 / SCAR IMW SQ37-38"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=42 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ37-38\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",42],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3210\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3211, "epsg", 3211, + "WGS 84 / SCAR IMW SQ39-40"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=54 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ39-40\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",54],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3211\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3212, "epsg", 3212, + "WGS 84 / SCAR IMW SQ41-42"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=66 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ41-42\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",66],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3212\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3213, "epsg", 3213, + "WGS 84 / SCAR IMW SQ43-44"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=78 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ43-44\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",78],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3213\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3214, "epsg", 3214, + "WGS 84 / SCAR IMW SQ45-46"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=90 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ45-46\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",90],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3214\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3215, "epsg", 3215, + "WGS 84 / SCAR IMW SQ47-48"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=102 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ47-48\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",102],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3215\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3216, "epsg", 3216, + "WGS 84 / SCAR IMW SQ49-50"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=114 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ49-50\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",114],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3216\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3217, "epsg", 3217, + "WGS 84 / SCAR IMW SQ51-52"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=126 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ51-52\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",126],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3217\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3218, "epsg", 3218, + "WGS 84 / SCAR IMW SQ53-54"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=138 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ53-54\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",138],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3218\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3219, "epsg", 3219, + "WGS 84 / SCAR IMW SQ55-56"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=150 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ55-56\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",150],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3219\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3220, "epsg", 3220, + "WGS 84 / SCAR IMW SQ57-58"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-64.66666666666667 +lat_2=-67.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=162 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SQ57-58\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-64.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "67.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",162],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3220\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3221, "epsg", 3221, + "WGS 84 / SCAR IMW SR13-14"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-102 +x_0=0 +y_0=0 +ellps=WGS84 "); + add_proj4text (p, 2, "+datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR13-14\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-102],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3221\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3222, "epsg", 3222, + "WGS 84 / SCAR IMW SR15-16"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-90 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR15-16\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-90],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3222\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3223, "epsg", 3223, + "WGS 84 / SCAR IMW SR17-18"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-78 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR17-18\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-78],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3223\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3224, "epsg", 3224, + "WGS 84 / SCAR IMW SR19-20"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-66 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR19-20\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-66],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3224\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3225, "epsg", 3225, + "WGS 84 / SCAR IMW SR27-28"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-18 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR27-28\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-18],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3225\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3226, "epsg", 3226, + "WGS 84 / SCAR IMW SR29-30"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-6 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR29-30\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-6],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3226\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3227, "epsg", 3227, + "WGS 84 / SCAR IMW SR31-32"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=6 +x_0=0 +y_0=0 +ellps=WGS84 +da"); + add_proj4text (p, 2, "tum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR31-32\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",6],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 12, + "SG\",\"3227\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 3228, "epsg", 3228, + "WGS 84 / SCAR IMW SR33-34"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=18 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR33-34\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",18],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3228\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3229, "epsg", 3229, + "WGS 84 / SCAR IMW SR35-36"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=30 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR35-36\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",30],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3229\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3230, "epsg", 3230, + "WGS 84 / SCAR IMW SR37-38"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=42 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR37-38\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",42],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3230\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3231, "epsg", 3231, + "WGS 84 / SCAR IMW SR39-40"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=54 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR39-40\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",54],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3231\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3232, "epsg", 3232, + "WGS 84 / SCAR IMW SR41-42"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=66 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR41-42\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",66],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3232\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3233, "epsg", 3233, + "WGS 84 / SCAR IMW SR43-44"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=78 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR43-44\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",78],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3233\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3234, "epsg", 3234, + "WGS 84 / SCAR IMW SR45-46"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=90 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR45-46\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",90],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3234\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3235, "epsg", 3235, + "WGS 84 / SCAR IMW SR47-48"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=102 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR47-48\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",102],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3235\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3236, "epsg", 3236, + "WGS 84 / SCAR IMW SR49-50"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=114 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR49-50\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",114],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3236\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3237, "epsg", 3237, + "WGS 84 / SCAR IMW SR51-52"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=126 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR51-52\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",126],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3237\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3238, "epsg", 3238, + "WGS 84 / SCAR IMW SR53-54"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=138 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR53-54\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",138],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3238\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3239, "epsg", 3239, + "WGS 84 / SCAR IMW SR55-56"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=150 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR55-56\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",150],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3239\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3240, "epsg", 3240, + "WGS 84 / SCAR IMW SR57-58"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=162 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR57-58\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",162],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3240\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3241, "epsg", 3241, + "WGS 84 / SCAR IMW SR59-60"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-68.66666666666667 +lat_2=-71.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=174 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SR59-60\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-68.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "71.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",174],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3241\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3242, "epsg", 3242, + "WGS 84 / SCAR IMW SS04-06"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-153 +x_0=0 +y_0=0 +ellps=WGS84 "); + add_proj4text (p, 2, "+datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS04-06\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-153],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3242\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3243, "epsg", 3243, + "WGS 84 / SCAR IMW SS07-09"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-135 +x_0=0 +y_0=0 +ellps=WGS84 "); + add_proj4text (p, 2, "+datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS07-09\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-135],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3243\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3244, "epsg", 3244, + "WGS 84 / SCAR IMW SS10-12"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-117 +x_0=0 +y_0=0 +ellps=WGS84 "); + add_proj4text (p, 2, "+datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS10-12\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-117],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3244\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3245, "epsg", 3245, + "WGS 84 / SCAR IMW SS13-15"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-99 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS13-15\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-99],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3245\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3246, "epsg", 3246, + "WGS 84 / SCAR IMW SS16-18"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-81 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS16-18\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-81],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3246\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3247, "epsg", 3247, + "WGS 84 / SCAR IMW SS19-21"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-63 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS19-21\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-63],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3247\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3248, "epsg", 3248, + "WGS 84 / SCAR IMW SS25-27"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-27 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS25-27\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-27],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3248\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3249, "epsg", 3249, + "WGS 84 / SCAR IMW SS28-30"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-9 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS28-30\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-9],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3249\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3250, "epsg", 3250, + "WGS 84 / SCAR IMW SS31-33"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=9 +x_0=0 +y_0=0 +ellps=WGS84 +da"); + add_proj4text (p, 2, "tum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS31-33\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",9],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 12, + "SG\",\"3250\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 3251, "epsg", 3251, + "WGS 84 / SCAR IMW SS34-36"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=27 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS34-36\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",27],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3251\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3252, "epsg", 3252, + "WGS 84 / SCAR IMW SS37-39"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=45 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS37-39\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",45],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3252\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3253, "epsg", 3253, + "WGS 84 / SCAR IMW SS40-42"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=63 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS40-42\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",63],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3253\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3254, "epsg", 3254, + "WGS 84 / SCAR IMW SS43-45"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=81 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS43-45\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",81],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3254\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3255, "epsg", 3255, + "WGS 84 / SCAR IMW SS46-48"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=99 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS46-48\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",99],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3255\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3256, "epsg", 3256, + "WGS 84 / SCAR IMW SS49-51"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=117 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS49-51\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",117],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3256\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3257, "epsg", 3257, + "WGS 84 / SCAR IMW SS52-54"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=135 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS52-54\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",135],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3257\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3258, "epsg", 3258, + "WGS 84 / SCAR IMW SS55-57"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=153 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS55-57\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",153],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3258\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3259, "epsg", 3259, + "WGS 84 / SCAR IMW SS58-60"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-72.66666666666667 +lat_2=-75.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=171 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SS58-60\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-72.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "75.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",171],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3259\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3260, "epsg", 3260, + "WGS 84 / SCAR IMW ST01-04"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-168 +x_0=0 +y_0=0 +ellps=WGS84 "); + add_proj4text (p, 2, "+datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST01-04\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-168],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3260\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3261, "epsg", 3261, + "WGS 84 / SCAR IMW ST05-08"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-144 +x_0=0 +y_0=0 +ellps=WGS84 "); + add_proj4text (p, 2, "+datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST05-08\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-144],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3261\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3262, "epsg", 3262, + "WGS 84 / SCAR IMW ST09-12"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-120 +x_0=0 +y_0=0 +ellps=WGS84 "); + add_proj4text (p, 2, "+datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST09-12\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-120],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3262\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3263, "epsg", 3263, + "WGS 84 / SCAR IMW ST13-16"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-96 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST13-16\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-96],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3263\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3264, "epsg", 3264, + "WGS 84 / SCAR IMW ST17-20"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-72 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST17-20\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-72],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3264\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3265, "epsg", 3265, + "WGS 84 / SCAR IMW ST21-24"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-48 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST21-24\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-48],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3265\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3266, "epsg", 3266, + "WGS 84 / SCAR IMW ST25-28"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=-24 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST25-28\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-24],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3266\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3267, "epsg", 3267, + "WGS 84 / SCAR IMW ST29-32"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +da"); + add_proj4text (p, 2, "tum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST29-32\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",0],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 12, + "SG\",\"3267\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 3268, "epsg", 3268, + "WGS 84 / SCAR IMW ST33-36"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=24 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST33-36\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",24],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3268\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3269, "epsg", 3269, + "WGS 84 / SCAR IMW ST37-40"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=48 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST37-40\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",48],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3269\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3270, "epsg", 3270, + "WGS 84 / SCAR IMW ST41-44"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=72 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST41-44\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",72],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3270\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3271, "epsg", 3271, + "WGS 84 / SCAR IMW ST45-48"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=96 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 2, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST45-48\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",96],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3271\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3272, "epsg", 3272, + "WGS 84 / SCAR IMW ST49-52"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=120 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST49-52\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",120],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3272\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3273, "epsg", 3273, + "WGS 84 / SCAR IMW ST53-56"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=144 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST53-56\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",144],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3273\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3274, "epsg", 3274, + "WGS 84 / SCAR IMW ST57-60"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=168 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW ST57-60\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert"); + add_srs_wkt (p, 7, + "_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 8, + ",-76.66666666666667],PARAMETER[\"standard_parallel_2\",-"); + add_srs_wkt (p, 9, + "79.33333333333333],PARAMETER[\"latitude_of_origin\",-90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",168],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, + "EPSG\",\"3274\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3275, "epsg", 3275, + "WGS 84 / SCAR IMW SU01-05"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=-165 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU01-05\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",-165],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3275"); + add_srs_wkt (p, 11, + "\"],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 3276, "epsg", 3276, + "WGS 84 / SCAR IMW SU06-10"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=-135 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU06-10\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",-135],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3276"); + add_srs_wkt (p, 11, + "\"],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 3277, "epsg", 3277, + "WGS 84 / SCAR IMW SU11-15"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=-105 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU11-15\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",-105],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3277"); + add_srs_wkt (p, 11, + "\"],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 3278, "epsg", 3278, + "WGS 84 / SCAR IMW SU16-20"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=-75 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU16-20\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",-75],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3278\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3279, "epsg", 3279, + "WGS 84 / SCAR IMW SU21-25"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=-45 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU21-25\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",-45],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3279\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3280, "epsg", 3280, + "WGS 84 / SCAR IMW SU26-30"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=-15 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU26-30\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",-15],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3280\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3281, "epsg", 3281, + "WGS 84 / SCAR IMW SU31-35"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=15 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU31-35\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",15],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3281\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3282, "epsg", 3282, + "WGS 84 / SCAR IMW SU36-40"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=45 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU36-40\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",45],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3282\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3283, "epsg", 3283, + "WGS 84 / SCAR IMW SU41-45"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=75 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU41-45\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",75],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3283\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3284, "epsg", 3284, + "WGS 84 / SCAR IMW SU46-50"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=105 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU46-50\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",105],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3284\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3285, "epsg", 3285, + "WGS 84 / SCAR IMW SU51-55"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=135 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU51-55\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",135],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3285\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3286, "epsg", 3286, + "WGS 84 / SCAR IMW SU56-60"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=165 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SU56-60\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",165],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3286\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3287, "epsg", 3287, + "WGS 84 / SCAR IMW SV01-10"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=-150 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SV01-10\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",-150],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3287"); + add_srs_wkt (p, 11, + "\"],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 3288, "epsg", 3288, + "WGS 84 / SCAR IMW SV11-20"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=-90 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SV11-20\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",-90],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3288\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3289, "epsg", 3289, + "WGS 84 / SCAR IMW SV21-30"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=-30 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SV21-30\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",-30],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3289\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3290, "epsg", 3290, + "WGS 84 / SCAR IMW SV31-40"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=30 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SV31-40\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",30],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3290\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3291, "epsg", 3291, + "WGS 84 / SCAR IMW SV41-50"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=90 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SV41-50\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",90],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3291\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3292, "epsg", 3292, + "WGS 84 / SCAR IMW SV51-60"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=150 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SV51-60\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",150],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3292\""); + add_srs_wkt (p, 11, + "],AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3293, "epsg", 3293, + "WGS 84 / SCAR IMW SW01-60"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-80.23861111111111 +lon_0"); + add_proj4text (p, 1, + "=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / SCAR IMW SW01-60\",GEOGCS[\"WGS 84\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223"); + add_srs_wkt (p, 2, + "563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_S"); + add_srs_wkt (p, 7, + "tereographic\"],PARAMETER[\"latitude_of_origin\",-80.238"); + add_srs_wkt (p, 8, + "61111111111],PARAMETER[\"central_meridian\",0],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3293\"]"); + add_srs_wkt (p, 11, + ",AXIS[\"Easting\",UNKNOWN],AXIS[\"Northing\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3294, "epsg", 3294, + "WGS 84 / USGS Transantarctic Mountains"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-78 +lon_0=162 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 2, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / USGS Transantarctic Mountains\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",63781"); + add_srs_wkt (p, 2, + "37,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standar"); + add_srs_wkt (p, 8, + "d_parallel_1\",-76.66666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",-79.33333333333333],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 10, + "_origin\",-78],PARAMETER[\"central_meridian\",162],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",0],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3294\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3296, "epsg", 3296, "RGPF / UTM zone 5S"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +south +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGPF / UTM zone 5S\",GEOGCS[\"RGPF\",DATUM[\"Re"); + add_srs_wkt (p, 1, + "seau_Geodesique_de_la_Polynesie_Francaise\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6687\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4687\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "153],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",1000000"); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"3296\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3297, "epsg", 3297, "RGPF / UTM zone 6S"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +south +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGPF / UTM zone 6S\",GEOGCS[\"RGPF\",DATUM[\"Re"); + add_srs_wkt (p, 1, + "seau_Geodesique_de_la_Polynesie_Francaise\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6687\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4687\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "147],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",1000000"); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"3297\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3298, "epsg", 3298, "RGPF / UTM zone 7S"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +south +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGPF / UTM zone 7S\",GEOGCS[\"RGPF\",DATUM[\"Re"); + add_srs_wkt (p, 1, + "seau_Geodesique_de_la_Polynesie_Francaise\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6687\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4687\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "141],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",1000000"); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"3298\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3299, "epsg", 3299, "RGPF / UTM zone 8S"); + add_proj4text (p, 0, + "+proj=utm +zone=8 +south +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGPF / UTM zone 8S\",GEOGCS[\"RGPF\",DATUM[\"Re"); + add_srs_wkt (p, 1, + "seau_Geodesique_de_la_Polynesie_Francaise\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6687\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4687\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "135],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",1000000"); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"3299\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3300, "epsg", 3300, + "Estonian Coordinate System of 1992"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.5"); + add_proj4text (p, 1, + "1755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps="); + add_proj4text (p, 2, + "GRS80 +towgs84=0.055,-0.541,-0.185,0.0183,-0.0003,-0.007"); + add_proj4text (p, 3, ",-0.014 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Estonian Coordinate System of 1992\",GEOGCS[\"E"); + add_srs_wkt (p, 1, + "ST92\",DATUM[\"Estonia_1992\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 3, + "0.055,-0.541,-0.185,0.0183,-0.0003,-0.007,-0.014],AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"6133\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4133"); + add_srs_wkt (p, 7, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_1\",59.33333333333334],PARAMETER[\"standar"); + add_srs_wkt (p, 10, + "d_parallel_2\",58],PARAMETER[\"latitude_of_origin\",57.5"); + add_srs_wkt (p, 11, + "1755393055556],PARAMETER[\"central_meridian\",24],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_easting\",500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 13, + "\",6375000],AUTHORITY[\"EPSG\",\"3300\"],AXIS[\"X\",NORT"); + add_srs_wkt (p, 14, "H],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3301, "epsg", 3301, + "Estonian Coordinate System of 1997"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.5"); + add_proj4text (p, 1, + "1755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps="); + add_proj4text (p, 2, "GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Estonian Coordinate System of 1997\",GEOGCS[\"E"); + add_srs_wkt (p, 1, + "ST97\",DATUM[\"Estonia_1997\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 3, + "0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6180\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4180\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"standard_parallel_1\",59.33333333333334]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"standard_parallel_2\",58],PARAMETER[\"latit"); + add_srs_wkt (p, 10, + "ude_of_origin\",57.51755393055556],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",24],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_northing\",6375000],AUTHORITY[\"EPSG\",\"330"); + add_srs_wkt (p, 13, "1\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3302, "epsg", 3302, + "IGN63 Hiva Oa / UTM zone 7S"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN63 Hiva Oa / UTM zone 7S\",GEOGCS[\"IGN63 Hi"); + add_srs_wkt (p, 1, + "va Oa\",DATUM[\"IGN63_Hiva_Oa\",SPHEROID[\"International"); + add_srs_wkt (p, 2, + " 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6689\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4689"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",-141],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",10000000],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3302\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 3303, "epsg", 3303, + "Fatu Iva 72 / UTM zone 7S"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +south +ellps=intl +towgs84=347.103,10"); + add_proj4text (p, 1, + "78.12,2623.92,-33.8875,70.6773,-9.3943,186.074 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Fatu Iva 72 / UTM zone 7S\",GEOGCS[\"Fatu Iva 7"); + add_srs_wkt (p, 1, + "2\",DATUM[\"Fatu_Iva_72\",SPHEROID[\"International 1924\""); + add_srs_wkt (p, 2, + ",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[347.1"); + add_srs_wkt (p, 3, + "03,1078.12,2623.92,-33.8875,70.6773,-9.3943,186.074],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6688\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "688\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-141],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",500000],PARAMETER[\"false_northing\",10000000],AUTHOR"); + add_srs_wkt (p, 12, + "ITY[\"EPSG\",\"3303\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 3304, "epsg", 3304, + "Tahiti 79 / UTM zone 6S"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tahiti 79 / UTM zone 6S\",GEOGCS[\"Tahiti 79\","); + add_srs_wkt (p, 1, + "DATUM[\"Tahiti_79\",SPHEROID[\"International 1924\",6378"); + add_srs_wkt (p, 2, + "388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6690\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4690\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",-147],PARAMETER[\"scale_fa"); + add_srs_wkt (p, 9, + "ctor\",0.9996],PARAMETER[\"false_easting\",500000],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"3"); + add_srs_wkt (p, 11, + "304\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3305, "epsg", 3305, + "Moorea 87 / UTM zone 6S"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +south +ellps=intl +towgs84=215.525,14"); + add_proj4text (p, 1, + "9.593,176.229,-3.2624,-1.692,-1.1571,10.4773 +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Moorea 87 / UTM zone 6S\",GEOGCS[\"Moorea 87\","); + add_srs_wkt (p, 1, + "DATUM[\"Moorea_87\",SPHEROID[\"International 1924\",6378"); + add_srs_wkt (p, 2, + "388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[215.525,14"); + add_srs_wkt (p, 3, + "9.593,176.229,-3.2624,-1.692,-1.1571,10.4773],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6691\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4691\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",-147],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 12, + "SG\",\"3305\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 3306, "epsg", 3306, + "Maupiti 83 / UTM zone 5S"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +south +ellps=intl +towgs84=217.037,86"); + add_proj4text (p, 1, ".959,23.956,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Maupiti 83 / UTM zone 5S\",GEOGCS[\"Maupiti 83\""); + add_srs_wkt (p, 1, + ",DATUM[\"Maupiti_83\",SPHEROID[\"International 1924\",63"); + add_srs_wkt (p, 2, + "78388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[217.037,"); + add_srs_wkt (p, 3, + "86.959,23.956,0,0,0,0],AUTHORITY[\"EPSG\",\"6692\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4692\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",-153],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 10, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 11, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"3306\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3307, "epsg", 3307, + "Nakhl-e Ghanem / UTM zone 39N"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +ellps=WGS84 +towgs84=0,-0.15,0.68,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nakhl-e Ghanem / UTM zone 39N\",GEOGCS[\"Nakhl-"); + add_srs_wkt (p, 1, + "e Ghanem\",DATUM[\"Nakhl_e_Ghanem\",SPHEROID[\"WGS 84\","); + add_srs_wkt (p, 2, + "6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWG"); + add_srs_wkt (p, 3, + "S84[0,-0.15,0.68,0,0,0,0],AUTHORITY[\"EPSG\",\"6693\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4693\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",51],PARAMETER[\"scale_factor\",0.9996"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "northing\",0],AUTHORITY[\"EPSG\",\"3307\"],AXIS[\"Eastin"); + add_srs_wkt (p, 12, "g\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3308, "epsg", 3308, "GDA94 / NSW Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-30.75 +lat_2=-35.75 +lat_0=-33.25 +lon"); + add_proj4text (p, 1, + "_0=147 +x_0=9300000 +y_0=4500000 +ellps=GRS80 +towgs84=0"); + add_proj4text (p, 2, ",0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / NSW Lambert\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",-30.75],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"standard_parallel_2\",-35.75],PARAMETER[\"lati"); + add_srs_wkt (p, 10, + "tude_of_origin\",-33.25],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 11, + "147],PARAMETER[\"false_easting\",9300000],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_northing\",4500000],AUTHORITY[\"EPSG\",\"3308\"],AXI"); + add_srs_wkt (p, 13, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3309, "epsg", 3309, + "NAD27 / California Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_"); + add_proj4text (p, 1, + "0=0 +y_0=-4000000 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / California Albers\",GEOGCS[\"NAD27\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866"); + add_srs_wkt (p, 2, + "\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"standard_parallel_1\",34],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 9, + "el_2\",40.5],PARAMETER[\"latitude_of_center\",0],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"longitude_of_center\",-120],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",0],PARAMETER[\"false_northing\",-4000000],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"3309\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3310, "epsg", 3310, + "NAD83 / California Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_"); + add_proj4text (p, 1, + "0=0 +y_0=-4000000 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California Albers\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",34],PARAMETER[\"standard_parallel_2\",40"); + add_srs_wkt (p, 9, + ".5],PARAMETER[\"latitude_of_center\",0],PARAMETER[\"long"); + add_srs_wkt (p, 10, + "itude_of_center\",-120],PARAMETER[\"false_easting\",0],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",-4000000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"3310\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3311, "epsg", 3311, + "NAD83(HARN) / California Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_"); + add_proj4text (p, 1, "0=0 +y_0=-4000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / California Albers\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Albers_Conic_Equal_Area\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",34],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",40.5],PARAMETER[\"latitude_of_center\""); + add_srs_wkt (p, 10, + ",0],PARAMETER[\"longitude_of_center\",-120],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",0],PARAMETER[\"false_northing\",-4000000"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3311\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3312, "epsg", 3312, "CSG67 / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=intl +towgs84=-186,230,110,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"CSG67 / UTM zone 21N\",GEOGCS[\"CSG67\",DATUM[\""); + add_srs_wkt (p, 1, + "Centre_Spatial_Guyanais_1967\",SPHEROID[\"International "); + add_srs_wkt (p, 2, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[-186,230,110,0,0,0,0],AUTHORITY[\"EPSG\",\"6623\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4623\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",-57],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"3312\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3313, "epsg", 3313, "RGFG95 / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=GRS80 +towgs84=2,2,-2,0,0,0,0 "); + add_proj4text (p, 1, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGFG95 / UTM zone 21N\",GEOGCS[\"RGFG95\",DATUM"); + add_srs_wkt (p, 1, + "[\"Reseau_Geodesique_Francais_Guyane_1995\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],TOWGS84[2,2,-2,0,0,0,0],AUTHORITY[\"EPSG\",\"6624\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4624\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-57],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"3313\"],AXIS[\"Eas"); + add_srs_wkt (p, 12, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3314, "epsg", 3314, + "Katanga 1955 / Katanga Lambert (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-6.5 +lat_2=-11.5 +lat_0=0 +lon_0=26 +x"); + add_proj4text (p, 1, + "_0=0 +y_0=0 +ellps=clrk66 +towgs84=-103.746,-9.614,-255."); + add_proj4text (p, 2, "95,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Katanga 1955 / Katanga Lambert (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Katanga 1955\",DATUM[\"Katanga_1955\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7008\"]],TOWGS84[-103.746,-9.614,-255.95,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6695\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4695\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",-6.5],PARAMETER[\"standard_para"); + add_srs_wkt (p, 10, + "llel_2\",-11.5],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",26],PARAMETER[\"false_easting"); + add_srs_wkt (p, 12, + "\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, + ",\"3314\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORT"); + add_srs_wkt (p, 14, "H]]"); + p = add_epsg_def (first, last, 3315, "epsg", 3315, + "Katanga 1955 / Katanga TM (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-9 +lon_0=26 +k=0.9998 +x_0=0 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,0,0 +"); + add_proj4text (p, 2, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Katanga 1955 / Katanga TM (deprecated)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Katanga 1955\",DATUM[\"Katanga_1955\",SPHEROID[\"Clar"); + add_srs_wkt (p, 2, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7008\"]],TOWGS84[-103.746,-9.614,-255.95,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6695\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "695\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",-9],PARAMETER[\"central_meridian\",26],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9998],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3315\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3316, "epsg", 3316, + "Kasai 1953 / Congo TM zone 22"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=22 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kasai 1953 / Congo TM zone 22\",GEOGCS[\"Kasai "); + add_srs_wkt (p, 1, + "1953\",DATUM[\"Kasai_1953\",SPHEROID[\"Clarke 1880 (RGS)"); + add_srs_wkt (p, 2, + "\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6696\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "696\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 8, + "of_origin\",0],PARAMETER[\"central_meridian\",22],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",10000000],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3316\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 12, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 3317, "epsg", 3317, + "Kasai 1953 / Congo TM zone 24"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kasai 1953 / Congo TM zone 24\",GEOGCS[\"Kasai "); + add_srs_wkt (p, 1, + "1953\",DATUM[\"Kasai_1953\",SPHEROID[\"Clarke 1880 (RGS)"); + add_srs_wkt (p, 2, + "\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6696\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "696\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 8, + "of_origin\",0],PARAMETER[\"central_meridian\",24],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",10000000],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3317\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 12, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 3318, "epsg", 3318, + "IGC 1962 / Congo TM zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGC 1962 / Congo TM zone 12\",GEOGCS[\"IGC 1962"); + add_srs_wkt (p, 1, + " 6th Parallel South\",DATUM[\"IGC_1962_Arc_of_the_6th_Pa"); + add_srs_wkt (p, 2, + "rallel_South\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6697\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4697\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",12],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3318\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3319, "epsg", 3319, + "IGC 1962 / Congo TM zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=14 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGC 1962 / Congo TM zone 14\",GEOGCS[\"IGC 1962"); + add_srs_wkt (p, 1, + " 6th Parallel South\",DATUM[\"IGC_1962_Arc_of_the_6th_Pa"); + add_srs_wkt (p, 2, + "rallel_South\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6697\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4697\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",14],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3319\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3320, "epsg", 3320, + "IGC 1962 / Congo TM zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=16 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGC 1962 / Congo TM zone 16\",GEOGCS[\"IGC 1962"); + add_srs_wkt (p, 1, + " 6th Parallel South\",DATUM[\"IGC_1962_Arc_of_the_6th_Pa"); + add_srs_wkt (p, 2, + "rallel_South\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6697\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4697\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",16],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3320\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3321, "epsg", 3321, + "IGC 1962 / Congo TM zone 18"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGC 1962 / Congo TM zone 18\",GEOGCS[\"IGC 1962"); + add_srs_wkt (p, 1, + " 6th Parallel South\",DATUM[\"IGC_1962_Arc_of_the_6th_Pa"); + add_srs_wkt (p, 2, + "rallel_South\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6697\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4697\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",18],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3321\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_10 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 3322, "epsg", 3322, + "IGC 1962 / Congo TM zone 20"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=20 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGC 1962 / Congo TM zone 20\",GEOGCS[\"IGC 1962"); + add_srs_wkt (p, 1, + " 6th Parallel South\",DATUM[\"IGC_1962_Arc_of_the_6th_Pa"); + add_srs_wkt (p, 2, + "rallel_South\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6697\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4697\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",20],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3322\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3323, "epsg", 3323, + "IGC 1962 / Congo TM zone 22"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=22 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGC 1962 / Congo TM zone 22\",GEOGCS[\"IGC 1962"); + add_srs_wkt (p, 1, + " 6th Parallel South\",DATUM[\"IGC_1962_Arc_of_the_6th_Pa"); + add_srs_wkt (p, 2, + "rallel_South\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6697\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4697\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",22],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3323\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3324, "epsg", 3324, + "IGC 1962 / Congo TM zone 24"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGC 1962 / Congo TM zone 24\",GEOGCS[\"IGC 1962"); + add_srs_wkt (p, 1, + " 6th Parallel South\",DATUM[\"IGC_1962_Arc_of_the_6th_Pa"); + add_srs_wkt (p, 2, + "rallel_South\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6697\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4697\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",24],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3324\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3325, "epsg", 3325, + "IGC 1962 / Congo TM zone 26"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=26 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGC 1962 / Congo TM zone 26\",GEOGCS[\"IGC 1962"); + add_srs_wkt (p, 1, + " 6th Parallel South\",DATUM[\"IGC_1962_Arc_of_the_6th_Pa"); + add_srs_wkt (p, 2, + "rallel_South\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6697\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4697\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",26],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3325\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3326, "epsg", 3326, + "IGC 1962 / Congo TM zone 28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=28 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGC 1962 / Congo TM zone 28\",GEOGCS[\"IGC 1962"); + add_srs_wkt (p, 1, + " 6th Parallel South\",DATUM[\"IGC_1962_Arc_of_the_6th_Pa"); + add_srs_wkt (p, 2, + "rallel_South\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6697\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4697\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",28],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3326\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3327, "epsg", 3327, + "IGC 1962 / Congo TM zone 30"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGC 1962 / Congo TM zone 30\",GEOGCS[\"IGC 1962"); + add_srs_wkt (p, 1, + " 6th Parallel South\",DATUM[\"IGC_1962_Arc_of_the_6th_Pa"); + add_srs_wkt (p, 2, + "rallel_South\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6697\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4697\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",30],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3327\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3328, "epsg", 3328, + "Pulkovo 1942(58) / GUGiK-80"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=52.16666666666666 +lon_0=19.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999714 +x_0=500000 +y_0=500000 +ellps=krass "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / GUGiK-80\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Oblique_Stereographic\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",52.16666666666666],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",19.16666666666667],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".999714],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",500000],AUTHORITY[\"EPSG\",\"3328\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3329, "epsg", 3329, + "Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 5"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",15],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",5500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3329\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3330, "epsg", 3330, + "Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 6"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",18],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",6500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3330\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3331, "epsg", 3331, + "Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 7"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",21],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",7500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3331\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3332, "epsg", 3332, + "Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 8"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",24],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",8500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3332\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3333, "epsg", 3333, + "Pulkovo 1942(58) / Gauss-Kruger zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=3500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Gauss-Kruger zone 3\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",15],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",3500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3333\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 3334, "epsg", 3334, + "Pulkovo 1942(58) / Gauss-Kruger zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Gauss-Kruger zone 4\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",21],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",4500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3334\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 3335, "epsg", 3335, + "Pulkovo 1942(58) / Gauss-Kruger zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Gauss-Kruger zone 5\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",27],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",5500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3335\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 3336, "epsg", 3336, + "IGN 1962 Kerguelen / UTM zone 42S"); + add_proj4text (p, 0, + "+proj=utm +zone=42 +south +ellps=intl +towgs84=145,-187,"); + add_proj4text (p, 1, "103,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN 1962 Kerguelen / UTM zone 42S\",GEOGCS[\"IG"); + add_srs_wkt (p, 1, + "N 1962 Kerguelen\",DATUM[\"IGN_1962_Kerguelen\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7022\"]],TOWGS84[145,-187,103,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6698\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4698\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",69],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"333"); + add_srs_wkt (p, 12, + "6\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3337, "epsg", 3337, + "Le Pouce 1934 / Mauritius Grid"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-20.19506944444445 +lat_0=-20.195069444"); + add_proj4text (p, 1, + "44445 +lon_0=57.52182777777778 +k_0=1 +x_0=1000000 +y_0="); + add_proj4text (p, 2, + "1000000 +ellps=clrk80 +towgs84=-770.1,158.4,-498.2,0,0,0"); + add_proj4text (p, 3, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Le Pouce 1934 / Mauritius Grid\",GEOGCS[\"Le Po"); + add_srs_wkt (p, 1, + "uce 1934\",DATUM[\"Le_Pouce_1934\",SPHEROID[\"Clarke 188"); + add_srs_wkt (p, 2, + "0 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\""); + add_srs_wkt (p, 3, + "]],TOWGS84[-770.1,158.4,-498.2,0,0,0,0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6699\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4699\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"L"); + add_srs_wkt (p, 8, + "ambert_Conformal_Conic_1SP\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",-20.19506944444445],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",57.52182777777778],PARAMETER[\"scale_factor\",1],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",1000000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",1000000],AUTHORITY[\"EPSG\",\"3337\"],AXIS[\"Easting"); + add_srs_wkt (p, 13, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3338, "epsg", 3338, "NAD83 / Alaska Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0"); + add_proj4text (p, 1, + "=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska Albers\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 8, + "rallel_1\",55],PARAMETER[\"standard_parallel_2\",65],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"latitude_of_center\",50],PARAMETER[\"longitude_"); + add_srs_wkt (p, 10, + "of_center\",-154],PARAMETER[\"false_easting\",0],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3338\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3339, "epsg", 3339, + "IGCB 1955 / Congo TM zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGCB 1955 / Congo TM zone 12\",GEOGCS[\"IGCB 19"); + add_srs_wkt (p, 1, + "55\",DATUM[\"Institut_Geographique_du_Congo_Belge_1955\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7012\"]],TOWGS84[-79.9,-158,-168.9,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6701\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4701\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",12"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"3339\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3340, "epsg", 3340, + "IGCB 1955 / Congo TM zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=14 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGCB 1955 / Congo TM zone 14\",GEOGCS[\"IGCB 19"); + add_srs_wkt (p, 1, + "55\",DATUM[\"Institut_Geographique_du_Congo_Belge_1955\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7012\"]],TOWGS84[-79.9,-158,-168.9,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6701\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4701\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",14"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"3340\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3341, "epsg", 3341, + "IGCB 1955 / Congo TM zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=16 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGCB 1955 / Congo TM zone 16\",GEOGCS[\"IGCB 19"); + add_srs_wkt (p, 1, + "55\",DATUM[\"Institut_Geographique_du_Congo_Belge_1955\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7012\"]],TOWGS84[-79.9,-158,-168.9,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6701\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4701\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",16"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"3341\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3342, "epsg", 3342, + "IGCB 1955 / UTM zone 33S"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +south +ellps=clrk80 +towgs84=-79.9,-"); + add_proj4text (p, 1, "158,-168.9,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGCB 1955 / UTM zone 33S\",GEOGCS[\"IGCB 1955\""); + add_srs_wkt (p, 1, + ",DATUM[\"Institut_Geographique_du_Congo_Belge_1955\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7012\"]],TOWGS84[-79.9,-158,-168.9,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6701\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4701\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",15],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",10000000],AUTH"); + add_srs_wkt (p, 12, + "ORITY[\"EPSG\",\"3342\"],AXIS[\"Easting\",EAST],AXIS[\"N"); + add_srs_wkt (p, 13, "orthing\",NORTH]]"); + p = add_epsg_def (first, last, 3343, "epsg", 3343, + "Mauritania 1999 / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Mauritania 1999 / UTM zone 28N\",GEOGCS[\"Mauri"); + add_srs_wkt (p, 1, + "tania 1999\",DATUM[\"Mauritania_1999\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6702\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4702\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",-15],PARAMETER[\"scale_factor\",0.9996]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_easting\",500000],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",0],AUTHORITY[\"EPSG\",\"3343\"],AXIS[\"Easting"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3344, "epsg", 3344, + "Mauritania 1999 / UTM zone 29N"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Mauritania 1999 / UTM zone 29N\",GEOGCS[\"Mauri"); + add_srs_wkt (p, 1, + "tania 1999\",DATUM[\"Mauritania_1999\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6702\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4702\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 10, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 11, + "rthing\",0],AUTHORITY[\"EPSG\",\"3344\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3345, "epsg", 3345, + "Mauritania 1999 / UTM zone 30N"); + add_proj4text (p, 0, + "+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Mauritania 1999 / UTM zone 30N\",GEOGCS[\"Mauri"); + add_srs_wkt (p, 1, + "tania 1999\",DATUM[\"Mauritania_1999\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6702\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4702\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",-3],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 10, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 11, + "rthing\",0],AUTHORITY[\"EPSG\",\"3345\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3346, "epsg", 3346, "LKS94 / Lithuania TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9998 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"LKS94 / Lithuania TM\",GEOGCS[\"LKS94\",DATUM[\""); + add_srs_wkt (p, 1, + "Lithuania_1994_ETRS89\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 2, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,"); + add_srs_wkt (p, 3, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6126\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4669\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",24],PARAMETER[\"scale_factor\",0.9998],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"3346\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EA"); + add_srs_wkt (p, 12, "ST]]"); + p = add_epsg_def (first, last, 3347, "epsg", 3347, + "NAD83 / Statistics Canada Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-9"); + add_proj4text (p, 1, + "1.86666666666666 +x_0=6200000 +y_0=3000000 +ellps=GRS80 "); + add_proj4text (p, 2, "+datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Statistics Canada Lambert\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"standard_parallel_1\",49],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_2\",77],PARAMETER[\"latitude_of_origin\",63.390675]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"central_meridian\",-91.86666666666666],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_easting\",6200000],PARAMETER[\"false_north"); + add_srs_wkt (p, 12, + "ing\",3000000],AUTHORITY[\"EPSG\",\"3347\"],AXIS[\"Easti"); + add_srs_wkt (p, 13, "ng\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3348, "epsg", 3348, + "NAD83(CSRS) / Statistics Canada Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-9"); + add_proj4text (p, 1, + "1.86666666666666 +x_0=6200000 +y_0=3000000 +ellps=GRS80 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Statistics Canada Lambert\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Confo"); + add_srs_wkt (p, 8, + "rmal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",49],"); + add_srs_wkt (p, 9, + "PARAMETER[\"standard_parallel_2\",77],PARAMETER[\"latitu"); + add_srs_wkt (p, 10, + "de_of_origin\",63.390675],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 11, + ",-91.86666666666666],PARAMETER[\"false_easting\",6200000"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",3000000],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 13, + "\",\"3348\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NO"); + add_srs_wkt (p, 14, "RTH]]"); + p = add_epsg_def (first, last, 3349, "epsg", 3349, + "WGS 84 / PDC Mercator (deprecated)"); + add_proj4text (p, 0, + "+proj=merc +lon_0=-150 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +"); + add_proj4text (p, 1, "datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / PDC Mercator (deprecated)\",GEOGCS[\"W"); + add_srs_wkt (p, 1, + "GS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,2"); + add_srs_wkt (p, 2, + "98.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Mercator_1SP\"],PARAMETER[\"central_meridian\",-150],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 9, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 10, + "3349\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 11, ""); + p = add_epsg_def (first, last, 3350, "epsg", 3350, + "Pulkovo 1942 / CS63 zone C0"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0.1 +lon_0=21.95 +k=1 +x_0=250000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / CS63 zone C0\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassowsky 1940"); + add_srs_wkt (p, 2, + "\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[2"); + add_srs_wkt (p, 3, + "3.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0.1]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"central_meridian\",21.95],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",1],PARAMETER[\"false_easting\",250000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3350\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3351, "epsg", 3351, + "Pulkovo 1942 / CS63 zone C1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0.1 +lon_0=24.95 +k=1 +x_0=1250000 +y"); + add_proj4text (p, 1, "_0=0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / CS63 zone C1\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassowsky 1940"); + add_srs_wkt (p, 2, + "\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[2"); + add_srs_wkt (p, 3, + "3.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0.1]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"central_meridian\",24.95],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",1],PARAMETER[\"false_easting\",1250000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3351\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3352, "epsg", 3352, + "Pulkovo 1942 / CS63 zone C2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0.1 +lon_0=27.95 +k=1 +x_0=2250000 +y"); + add_proj4text (p, 1, "_0=0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / CS63 zone C2\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassowsky 1940"); + add_srs_wkt (p, 2, + "\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[2"); + add_srs_wkt (p, 3, + "3.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0.1]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"central_meridian\",27.95],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",1],PARAMETER[\"false_easting\",2250000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3352\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3353, "epsg", 3353, + "Mhast (onshore) / UTM zone 32S"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Mhast (onshore) / UTM zone 32S\",GEOGCS[\"Mhast"); + add_srs_wkt (p, 1, + " (onshore)\",DATUM[\"Mhast_onshore\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6704\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4704\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",10000000],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3353\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 12, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 3354, "epsg", 3354, + "Mhast (offshore) / UTM zone 32S"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Mhast (offshore) / UTM zone 32S\",GEOGCS[\"Mhas"); + add_srs_wkt (p, 1, + "t (offshore)\",DATUM[\"Mhast_offshore\",SPHEROID[\"Inter"); + add_srs_wkt (p, 2, + "national 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6705\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4705\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",9],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",10000000],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"3354\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 3355, "epsg", 3355, + "Egypt Gulf of Suez S-650 TL / Red Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=31 +k=1 +x_0=615000 +y_0=81"); + add_proj4text (p, 1, + "0000 +ellps=helmert +towgs84=-146.21,112.63,4.05,0,0,0,0"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Egypt Gulf of Suez S-650 TL / Red Belt\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Egypt Gulf of Suez S-650 TL\",DATUM[\"Egypt_Gulf_of_S"); + add_srs_wkt (p, 2, + "uez_S_650_TL\",SPHEROID[\"Helmert 1906\",6378200,298.3,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7020\"]],TOWGS84[-146.21,112.63,4.05"); + add_srs_wkt (p, 4, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6706\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 5, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 6, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"4706\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"latitude_of_origin\",30],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 10, + "n\",31],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",615000],PARAMETER[\"false_northing\",810000],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"3355\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3356, "epsg", 3356, + "Grand Cayman 1959 / UTM zone 17N"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=clrk66 +towgs84=67.8,106.1,138"); + add_proj4text (p, 1, ".8,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Grand Cayman 1959 / UTM zone 17N\",GEOGCS[\"Gra"); + add_srs_wkt (p, 1, + "nd Cayman 1959\",DATUM[\"Grand_Cayman_1959\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7008\"]],TOWGS84[67.8,106.1,138.8,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"6723\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4723"); + add_srs_wkt (p, 7, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 9, + "origin\",0],PARAMETER[\"central_meridian\",-81],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"3356\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORT"); + add_srs_wkt (p, 13, "H]]"); + p = add_epsg_def (first, last, 3357, "epsg", 3357, + "Little Cayman 1961 / UTM zone 17N"); + add_proj4text (p, 0, "+proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Little Cayman 1961 / UTM zone 17N\",GEOGCS[\"Li"); + add_srs_wkt (p, 1, + "ttle Cayman 1961\",DATUM[\"Little_Cayman_1961\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6726\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4726\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-81],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"3357\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3358, "epsg", 3358, + "NAD83(HARN) / North Carolina"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps"); + add_proj4text (p, 2, "=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / North Carolina\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",36.1666666666666"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"standard_parallel_2\",34.33333333333334],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",33.75],PARAMETER[\"cent"); + add_srs_wkt (p, 11, + "ral_meridian\",-79],PARAMETER[\"false_easting\",609601.2"); + add_srs_wkt (p, 12, + "2],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "3358\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3359, "epsg", 3359, + "NAD83(HARN) / North Carolina (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024385 +y_0="); + add_proj4text (p, 2, "0 +ellps=GRS80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / North Carolina (ftUS) (deprecated"); + add_srs_wkt (p, 1, + ")\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_R"); + add_srs_wkt (p, 2, + "egional_Network\",SPHEROID[\"GRS 1980\",6378137,298.2572"); + add_srs_wkt (p, 3, + "22101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"foo"); + add_srs_wkt (p, 7, + "t\",0.3048,AUTHORITY[\"EPSG\",\"9002\"]],PROJECTION[\"La"); + add_srs_wkt (p, 8, + "mbert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 9, + "el_1\",36.16666666666666],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 10, + "2\",34.33333333333334],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 11, + "33.75],PARAMETER[\"central_meridian\",-79],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_easting\",2000004.000008],PARAMETER[\"false_northin"); + add_srs_wkt (p, 13, + "g\",0],AUTHORITY[\"EPSG\",\"3359\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 14, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3360, "epsg", 3360, + "NAD83(HARN) / South Carolina"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31"); + add_proj4text (p, 1, + ".83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / South Carolina\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",34.8333333333333"); + add_srs_wkt (p, 9, + "4],PARAMETER[\"standard_parallel_2\",32.5],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",31.83333333333333],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-81],PARAMETER[\"false_easting\",609600],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3360"); + add_srs_wkt (p, 13, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3361, "epsg", 3361, + "NAD83(HARN) / South Carolina (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31"); + add_proj4text (p, 1, + ".83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / South Carolina (ft)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"foot\",0.3048,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9002\"]],PROJECTION[\"Lambert_Conforma"); + add_srs_wkt (p, 8, + "l_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",34.8333"); + add_srs_wkt (p, 9, + "3333333334],PARAMETER[\"standard_parallel_2\",32.5],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",31.83333333333333],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"central_meridian\",-81],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 13, "G\",\"3361\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3362, "epsg", 3362, + "NAD83(HARN) / Pennsylvania North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=4"); + add_proj4text (p, 1, + "0.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps"); + add_proj4text (p, 2, "=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Pennsylvania North\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",41.95],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_2\",40.88333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",40.16666666666666],PARAMETER[\"cent"); + add_srs_wkt (p, 11, + "ral_meridian\",-77.75],PARAMETER[\"false_easting\",60000"); + add_srs_wkt (p, 12, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "3362\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3363, "epsg", 3363, + "NAD83(HARN) / Pennsylvania North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=4"); + add_proj4text (p, 1, + "0.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps"); + add_proj4text (p, 2, "=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Pennsylvania North (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_N"); + add_srs_wkt (p, 2, + "etwork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey f"); + add_srs_wkt (p, 7, + "oot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",41.95],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 10, + "l_2\",40.88333333333333],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 11, + ",40.16666666666666],PARAMETER[\"central_meridian\",-77.7"); + add_srs_wkt (p, 12, + "5],PARAMETER[\"false_easting\",1968500],PARAMETER[\"fals"); + add_srs_wkt (p, 13, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3363\"],AXIS[\"X\","); + add_srs_wkt (p, 14, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3364, "epsg", 3364, + "NAD83(HARN) / Pennsylvania South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +"); + add_proj4text (p, 2, "y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Pennsylvania South\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",40.9666666666666"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"standard_parallel_2\",39.93333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",39.33333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-77.75],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",600000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"3364\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3365, "epsg", 3365, + "NAD83(HARN) / Pennsylvania South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +"); + add_proj4text (p, 2, "y_0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Pennsylvania South (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_N"); + add_srs_wkt (p, 2, + "etwork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey f"); + add_srs_wkt (p, 7, + "oot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",40.96666666666667],PARAMETER[\"stan"); + add_srs_wkt (p, 10, + "dard_parallel_2\",39.93333333333333],PARAMETER[\"latitud"); + add_srs_wkt (p, 11, + "e_of_origin\",39.33333333333334],PARAMETER[\"central_mer"); + add_srs_wkt (p, 12, + "idian\",-77.75],PARAMETER[\"false_easting\",1968500],PAR"); + add_srs_wkt (p, 13, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3365\""); + add_srs_wkt (p, 14, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3366, "epsg", 3366, + "Hong Kong 1963 Grid System (deprecated)"); + add_proj4text (p, 0, + "+proj=cass +lat_0=22.31213333333334 +lon_0=114.178555555"); + add_proj4text (p, 1, + "5556 +x_0=40243.57775604237 +y_0=19069.93351512578 +a=63"); + add_proj4text (p, 2, + "78293.645208759 +b=6356617.987679838 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hong Kong 1963 Grid System (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Hong Kong 1963\",DATUM[\"Hong_Kong_1963\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Clarke 1858\",6378293.645208759,294.2606763692569,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7007\"]],AUTHORITY[\"EPSG\",\"6738\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4738\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Cassini_Soldner\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",22.31213333333334],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"central_meridian\",114.1785555555556],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",40243.57775604237],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",19069.93351512578],AUTHORITY[\"EPSG\",\"3366"); + add_srs_wkt (p, 12, "\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3367, "epsg", 3367, + "IGN Astro 1960 / UTM zone 28N"); + add_proj4text (p, 0, "+proj=utm +zone=28 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN Astro 1960 / UTM zone 28N\",GEOGCS[\"IGN As"); + add_srs_wkt (p, 1, + "tro 1960\",DATUM[\"IGN_Astro_1960\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "80 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6700\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4700\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-1"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3367\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 12, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 3368, "epsg", 3368, + "IGN Astro 1960 / UTM zone 29N"); + add_proj4text (p, 0, "+proj=utm +zone=29 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN Astro 1960 / UTM zone 29N\",GEOGCS[\"IGN As"); + add_srs_wkt (p, 1, + "tro 1960\",DATUM[\"IGN_Astro_1960\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "80 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6700\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4700\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-9"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"3368\"],AXIS[\"Easting\",EAST],AXIS[\"Nort"); + add_srs_wkt (p, 12, "hing\",NORTH]]"); + p = add_epsg_def (first, last, 3369, "epsg", 3369, + "IGN Astro 1960 / UTM zone 30N"); + add_proj4text (p, 0, "+proj=utm +zone=30 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGN Astro 1960 / UTM zone 30N\",GEOGCS[\"IGN As"); + add_srs_wkt (p, 1, + "tro 1960\",DATUM[\"IGN_Astro_1960\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "80 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6700\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4700\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-3"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"3369\"],AXIS[\"Easting\",EAST],AXIS[\"Nort"); + add_srs_wkt (p, 12, "hing\",NORTH]]"); + p = add_epsg_def (first, last, 3370, "epsg", 3370, "NAD27 / UTM zone 59N"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 59N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",171],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"3370\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 3371, "epsg", 3371, "NAD27 / UTM zone 60N"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 60N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",177],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"3371\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 3372, "epsg", 3372, "NAD83 / UTM zone 59N"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 59N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",171],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "3372\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 3373, "epsg", 3373, "NAD83 / UTM zone 60N"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 60N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",177],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "3373\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 3374, "epsg", 3374, "FD54 / UTM zone 29N"); + add_proj4text (p, 0, "+proj=utm +zone=29 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"FD54 / UTM zone 29N\",GEOGCS[\"FD54\",DATUM[\"F"); + add_srs_wkt (p, 1, + "aroe_Datum_1954\",SPHEROID[\"International 1924\",637838"); + add_srs_wkt (p, 2, + "8,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6741\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4741\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 9, + "\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3374\"],AXIS"); + add_srs_wkt (p, 11, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3375, "epsg", 3375, + "GDM2000 / Peninsula RSO"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.02579646666"); + add_proj4text (p, 1, + "66 +k=0.99984 +x_0=804671 +y_0=0 +ellps=GRS80 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / Peninsula RSO\",GEOGCS[\"GDM2000\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Geodetic_Datum_of_Malaysia_2000\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_center\",4],PARAMETER[\"longitude_of_center\""); + add_srs_wkt (p, 9, + ",102.25],PARAMETER[\"azimuth\",323.0257964666666],PARAME"); + add_srs_wkt (p, 10, + "TER[\"rectified_grid_angle\",323.1301023611111],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"scale_factor\",0.99984],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "804671],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 13, + "\",\"3375\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NO"); + add_srs_wkt (p, 14, "RTH]]"); + p = add_epsg_def (first, last, 3376, "epsg", 3376, + "GDM2000 / East Malaysia BRSO"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.9"); + add_proj4text (p, 1, "9984 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / East Malaysia BRSO\",GEOGCS[\"GDM2000"); + add_srs_wkt (p, 1, + "\",DATUM[\"Geodetic_Datum_of_Malaysia_2000\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],AUTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_center\",4],PARAMETER[\"longitude_of_cen"); + add_srs_wkt (p, 9, + "ter\",115],PARAMETER[\"azimuth\",53.31580995],PARAMETER["); + add_srs_wkt (p, 10, + "\"rectified_grid_angle\",53.13010236111111],PARAMETER[\""); + add_srs_wkt (p, 11, + "scale_factor\",0.99984],PARAMETER[\"false_easting\",0],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3376"); + add_srs_wkt (p, 13, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3377, "epsg", 3377, "GDM2000 / Johor Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=2.121679744444445 +lon_0=103.427936236"); + add_proj4text (p, 1, + "1111 +x_0=-14810.562 +y_0=8758.32 +ellps=GRS80 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / Johor Grid\",GEOGCS[\"GDM2000\",DATUM"); + add_srs_wkt (p, 1, + "[\"Geodetic_Datum_of_Malaysia_2000\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Cassini_Soldner\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",2.121679744444445],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",103.4279362361111],PARAMETER[\"false_easting\",-14810"); + add_srs_wkt (p, 10, + ".562],PARAMETER[\"false_northing\",8758.32],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"3377\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 3378, "epsg", 3378, + "GDM2000 / Sembilan and Melaka Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=2.682347636111111 +lon_0=101.974905041"); + add_proj4text (p, 1, + "6667 +x_0=3673.785 +y_0=-4240.573 +ellps=GRS80 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / Sembilan and Melaka Grid\",GEOGCS[\"G"); + add_srs_wkt (p, 1, + "DM2000\",DATUM[\"Geodetic_Datum_of_Malaysia_2000\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Cassini_Soldner\"],PARAMETER["); + add_srs_wkt (p, 8, + "\"latitude_of_origin\",2.682347636111111],PARAMETER[\"ce"); + add_srs_wkt (p, 9, + "ntral_meridian\",101.9749050416667],PARAMETER[\"false_ea"); + add_srs_wkt (p, 10, + "sting\",3673.785],PARAMETER[\"false_northing\",-4240.573"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"3378\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3379, "epsg", 3379, "GDM2000 / PahangGrid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=3.769388088888889 +lon_0=102.368298983"); + add_proj4text (p, 1, + "3333 +x_0=-7368.228 +y_0=6485.858 +ellps=GRS80 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / PahangGrid\",GEOGCS[\"GDM2000\",DATUM"); + add_srs_wkt (p, 1, + "[\"Geodetic_Datum_of_Malaysia_2000\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Cassini_Soldner\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",3.769388088888889],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",102.3682989833333],PARAMETER[\"false_easting\",-7368."); + add_srs_wkt (p, 10, + "228],PARAMETER[\"false_northing\",6485.858],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"3379\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 3380, "epsg", 3380, + "GDM2000 / Selangor Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=3.68464905 +lon_0=101.3891079138889 +x"); + add_proj4text (p, 1, + "_0=-34836.161 +y_0=56464.049 +ellps=GRS80 +units=m +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / Selangor Grid\",GEOGCS[\"GDM2000\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Geodetic_Datum_of_Malaysia_2000\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Cassini_Soldner\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 8, + "of_origin\",3.68464905],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "01.3891079138889],PARAMETER[\"false_easting\",-34836.161"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_northing\",56464.049],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"3380\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 3381, "epsg", 3381, + "GDM2000 / Terengganu Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=4.9762852 +lon_0=103.070275625 +x_0=19"); + add_proj4text (p, 1, + "594.245 +y_0=3371.895 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / Terengganu Grid\",GEOGCS[\"GDM2000\","); + add_srs_wkt (p, 1, + "DATUM[\"Geodetic_Datum_of_Malaysia_2000\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Cassini_Soldner\"],PARAMETER[\"latitud"); + add_srs_wkt (p, 8, + "e_of_origin\",4.9762852],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "103.070275625],PARAMETER[\"false_easting\",19594.245],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",3371.895],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, + "\"3381\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH"); + add_srs_wkt (p, 12, "]]"); + p = add_epsg_def (first, last, 3382, "epsg", 3382, "GDM2000 / Pinang Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=5.421517541666667 +lon_0=100.344376963"); + add_proj4text (p, 1, + "8889 +x_0=-23.414 +y_0=62.283 +ellps=GRS80 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / Pinang Grid\",GEOGCS[\"GDM2000\",DATU"); + add_srs_wkt (p, 1, + "M[\"Geodetic_Datum_of_Malaysia_2000\",SPHEROID[\"GRS 198"); + add_srs_wkt (p, 2, + "0\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Cassini_Soldner\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 8, + "f_origin\",5.421517541666667],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",100.3443769638889],PARAMETER[\"false_easting\",-23."); + add_srs_wkt (p, 10, + "414],PARAMETER[\"false_northing\",62.283],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"3382\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 3383, "epsg", 3383, + "GDM2000 / Kedah and Perlis Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=5.964672713888889 +lon_0=100.636371111"); + add_proj4text (p, 1, "1111 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / Kedah and Perlis Grid\",GEOGCS[\"GDM2"); + add_srs_wkt (p, 1, + "000\",DATUM[\"Geodetic_Datum_of_Malaysia_2000\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Cassini_Soldner\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",5.964672713888889],PARAMETER[\"centr"); + add_srs_wkt (p, 9, + "al_meridian\",100.6363711111111],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, + "\",\"3383\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NO"); + add_srs_wkt (p, 12, "RTH]]"); + p = add_epsg_def (first, last, 3384, "epsg", 3384, "GDM2000 / Perak Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=4.859063022222222 +lon_0=100.815410586"); + add_proj4text (p, 1, + "1111 +x_0=-1.769 +y_0=133454.779 +ellps=GRS80 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / Perak Grid\",GEOGCS[\"GDM2000\",DATUM"); + add_srs_wkt (p, 1, + "[\"Geodetic_Datum_of_Malaysia_2000\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Cassini_Soldner\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",4.859063022222222],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",100.8154105861111],PARAMETER[\"false_easting\",-1.769"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_northing\",133454.779],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"3384\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 3385, "epsg", 3385, + "GDM2000 / Kelantan Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=5.972543658333334 +lon_0=102.295241669"); + add_proj4text (p, 1, + "4444 +x_0=13227.851 +y_0=8739.894 +ellps=GRS80 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDM2000 / Kelantan Grid\",GEOGCS[\"GDM2000\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Geodetic_Datum_of_Malaysia_2000\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6742\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4742\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Cassini_Soldner\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 8, + "of_origin\",5.972543658333334],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",102.2952416694444],PARAMETER[\"false_easting\",132"); + add_srs_wkt (p, 10, + "27.851],PARAMETER[\"false_northing\",8739.894],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3385\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 3386, "epsg", 3386, "KKJ / Finland zone 0"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"KKJ / Finland zone 0\",GEOGCS[\"KKJ\",DATUM[\"K"); + add_srs_wkt (p, 1, + "artastokoordinaattijarjestelma_1966\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6123\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4123\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",0],PARAMETER[\"central_meridian\",18],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"3386\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3387, "epsg", 3387, "KKJ / Finland zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"KKJ / Finland zone 5\",GEOGCS[\"KKJ\",DATUM[\"K"); + add_srs_wkt (p, 1, + "artastokoordinaattijarjestelma_1966\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6123\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4123\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",0],PARAMETER[\"central_meridian\",33],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"3387\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3388, "epsg", 3388, + "Pulkovo 1942 / Caspian Sea Mercator"); + add_proj4text (p, 0, + "+proj=merc +lon_0=51 +k=1 +x_0=0 +y_0=0 +ellps=krass +un"); + add_proj4text (p, 1, "its=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Caspian Sea Mercator\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",51],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3388\"],AXIS[\"none\",NORTH],AXIS[\"none\",EAST]]"); + p = add_epsg_def (first, last, 3389, "epsg", 3389, + "Pulkovo 1942 / 3-degree Gauss-Kruger zone 60"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / 3-degree Gauss-Kruger zone 60\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",180],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",60"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"3389\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3390, "epsg", 3390, + "Pulkovo 1995 / 3-degree Gauss-Kruger zone 60"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=180 +k=1 +x_0=60500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / 3-degree Gauss-Kruger zone 60\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",180],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",60"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"3390\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3391, "epsg", 3391, + "Karbala 1979 / UTM zone 37N"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +ellps=clrk80 +towgs84=84.1,-320.1,21"); + add_proj4text (p, 1, "8.7,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Karbala 1979 / UTM zone 37N\",GEOGCS[\"Karbala "); + add_srs_wkt (p, 1, + "1979\",DATUM[\"Karbala_1979\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[84.1,-320.1,218.7,0,0,0,0],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 4, + "743\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 5, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4743\"]],UNIT[\"metr"); + add_srs_wkt (p, 7, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 8, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 9, + "METER[\"central_meridian\",39],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3391\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3392, "epsg", 3392, + "Karbala 1979 / UTM zone 38N"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +ellps=clrk80 +towgs84=84.1,-320.1,21"); + add_proj4text (p, 1, "8.7,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Karbala 1979 / UTM zone 38N\",GEOGCS[\"Karbala "); + add_srs_wkt (p, 1, + "1979\",DATUM[\"Karbala_1979\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[84.1,-320.1,218.7,0,0,0,0],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 4, + "743\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 5, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4743\"]],UNIT[\"metr"); + add_srs_wkt (p, 7, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 8, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 9, + "METER[\"central_meridian\",45],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3392\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3393, "epsg", 3393, + "Karbala 1979 / UTM zone 39N"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +ellps=clrk80 +towgs84=84.1,-320.1,21"); + add_proj4text (p, 1, "8.7,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Karbala 1979 / UTM zone 39N\",GEOGCS[\"Karbala "); + add_srs_wkt (p, 1, + "1979\",DATUM[\"Karbala_1979\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[84.1,-320.1,218.7,0,0,0,0],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 4, + "743\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 5, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4743\"]],UNIT[\"metr"); + add_srs_wkt (p, 7, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 8, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 9, + "METER[\"central_meridian\",51],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3393\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3394, "epsg", 3394, + "Nahrwan 1934 / Iraq zone"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.99878"); + add_proj4text (p, 1, + "64078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nahrwan 1934 / Iraq zone\",GEOGCS[\"Nahrwan 193"); + add_srs_wkt (p, 1, + "4\",DATUM[\"Nahrwan_1934\",SPHEROID[\"Clarke 1880 (RGS)\""); + add_srs_wkt (p, 2, + ",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6744\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"474"); + add_srs_wkt (p, 6, + "4\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",32.5],PARAMETER[\"central_meridian\",4"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",0.9987864078],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",1500000],PARAMETER[\"false_northing\",11"); + add_srs_wkt (p, 11, + "66200],AUTHORITY[\"EPSG\",\"3394\"],AXIS[\"Easting\",EAS"); + add_srs_wkt (p, 12, "T],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3395, "epsg", 3395, + "WGS 84 / World Mercator"); + add_proj4text (p, 0, + "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +dat"); + add_proj4text (p, 1, "um=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / World Mercator\",GEOGCS[\"WGS 84\",DAT"); + add_srs_wkt (p, 1, + "UM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.25722356"); + add_srs_wkt (p, 2, + "3,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"632"); + add_srs_wkt (p, 3, + "6\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Mercator_1"); + add_srs_wkt (p, 7, + "SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scal"); + add_srs_wkt (p, 8, + "e_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3395\"],AXIS[\""); + add_srs_wkt (p, 10, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3396, "epsg", 3396, + "PD/83 / 3-degree Gauss-Kruger zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PD/83 / 3-degree Gauss-Kruger zone 3\",GEOGCS[\""); + add_srs_wkt (p, 1, + "PD/83\",DATUM[\"Potsdam_Datum_83\",SPHEROID[\"Bessel 184"); + add_srs_wkt (p, 2, + "1\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6746\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4746\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",9],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",3"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"3396\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3397, "epsg", 3397, + "PD/83 / 3-degree Gauss-Kruger zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PD/83 / 3-degree Gauss-Kruger zone 4\",GEOGCS[\""); + add_srs_wkt (p, 1, + "PD/83\",DATUM[\"Potsdam_Datum_83\",SPHEROID[\"Bessel 184"); + add_srs_wkt (p, 2, + "1\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6746\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4746\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",12],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "4500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, "G\",\"3397\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3398, "epsg", 3398, + "RD/83 / 3-degree Gauss-Kruger zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RD/83 / 3-degree Gauss-Kruger zone 4\",GEOGCS[\""); + add_srs_wkt (p, 1, + "RD/83\",DATUM[\"Rauenberg_Datum_83\",SPHEROID[\"Bessel 1"); + add_srs_wkt (p, 2, + "841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6745\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4745\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",12],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",4500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"3398\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3399, "epsg", 3399, + "RD/83 / 3-degree Gauss-Kruger zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RD/83 / 3-degree Gauss-Kruger zone 5\",GEOGCS[\""); + add_srs_wkt (p, 1, + "RD/83\",DATUM[\"Rauenberg_Datum_83\",SPHEROID[\"Bessel 1"); + add_srs_wkt (p, 2, + "841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6745\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4745\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",15],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",5500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"3399\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3400, "epsg", 3400, + "NAD83 / Alberta 10-TM (Forest)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=500000 +"); + add_proj4text (p, 1, "y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alberta 10-TM (Forest)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-115],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",0.9992],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3400\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 3401, "epsg", 3401, + "NAD83 / Alberta 10-TM (Resource)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alberta 10-TM (Resource)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",-115"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9992],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"3401\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 3402, "epsg", 3402, + "NAD83(CSRS) / Alberta 10-TM (Forest)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=500000 +"); + add_proj4text (p, 1, "y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Alberta 10-TM (Forest)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-115],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "92],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3402\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3403, "epsg", 3403, + "NAD83(CSRS) / Alberta 10-TM (Resource)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-115 +k=0.9992 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Alberta 10-TM (Resource)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-115],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9992],PARAMETER[\"false_easting\",0],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",0],AUTHORITY[\"EPSG\",\"3403\"],AXIS[\"Easting"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3404, "epsg", 3404, + "NAD83(HARN) / North Carolina (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0="); + add_proj4text (p, 2, "0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / North Carolina (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",36.16666666666666],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",34.33333333333334],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",33.75],PARAMETER[\"central_meridian\",-79],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_easting\",2000000],PARAMETER[\"false_north"); + add_srs_wkt (p, 13, + "ing\",0],AUTHORITY[\"EPSG\",\"3404\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 14, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3405, "epsg", 3405, + "VN-2000 / UTM zone 48N"); + add_proj4text (p, 0, "+proj=utm +zone=48 +ellps=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"VN-2000 / UTM zone 48N\",GEOGCS[\"VN-2000\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Vietnam_2000\",SPHEROID[\"WGS 84\",6378137,298.2572"); + add_srs_wkt (p, 2, + "23563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6756\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4756\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",105],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 9, + "r\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3405\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3406, "epsg", 3406, + "VN-2000 / UTM zone 49N"); + add_proj4text (p, 0, "+proj=utm +zone=49 +ellps=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"VN-2000 / UTM zone 49N\",GEOGCS[\"VN-2000\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Vietnam_2000\",SPHEROID[\"WGS 84\",6378137,298.2572"); + add_srs_wkt (p, 2, + "23563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6756\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4756\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",111],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 9, + "r\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3406\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3407, "epsg", 3407, + "Hong Kong 1963 Grid System"); + add_proj4text (p, 0, + "+proj=cass +lat_0=22.31213333333334 +lon_0=114.178555555"); + add_proj4text (p, 1, + "5556 +x_0=40243.57775604237 +y_0=19069.93351512578 +a=63"); + add_proj4text (p, 2, + "78293.645208759 +b=6356617.987679838 +to_meter=0.3047972"); + add_proj4text (p, 3, "654 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hong Kong 1963 Grid System\",GEOGCS[\"Hong Kong"); + add_srs_wkt (p, 1, + " 1963\",DATUM[\"Hong_Kong_1963\",SPHEROID[\"Clarke 1858\""); + add_srs_wkt (p, 2, + ",6378293.645208759,294.2606763692569,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7007\"]],AUTHORITY[\"EPSG\",\"6738\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4738\"]],UNIT[\"Clarke's foot\",0.304797265"); + add_srs_wkt (p, 7, + "4,AUTHORITY[\"EPSG\",\"9005\"]],PROJECTION[\"Cassini_Sol"); + add_srs_wkt (p, 8, + "dner\"],PARAMETER[\"latitude_of_origin\",22.312133333333"); + add_srs_wkt (p, 9, + "34],PARAMETER[\"central_meridian\",114.1785555555556],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_easting\",132033.92],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",62565.96],AUTHORITY[\"EPSG\",\"3407\"],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3408, "epsg", 3408, "unnamed"); + add_proj4text (p, 0, + "+proj=laea +lat_0=90 +lon_0=0 +x_0=0 +y_0=0 +a=6371228 +"); + add_proj4text (p, 1, "b=6371228 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"unnamed\",GEOGCS[\"unnamed ellipse\",DATUM[\"un"); + add_srs_wkt (p, 1, + "known\",SPHEROID[\"unnamed\",6371228,0]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 2, + "ich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION"); + add_srs_wkt (p, 3, + "[\"Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 4, + "of_center\",90],PARAMETER[\"longitude_of_center\",0],PAR"); + add_srs_wkt (p, 5, + "AMETER[\"false_easting\",0],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 6, ",0],UNIT[\"Meter\",1],AUTHORITY[\"EPSG\",\"3408\"]]"); + p = add_epsg_def (first, last, 3409, "epsg", 3409, "unnamed"); + add_proj4text (p, 0, + "+proj=laea +lat_0=-90 +lon_0=0 +x_0=0 +y_0=0 +a=6371228 "); + add_proj4text (p, 1, "+b=6371228 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"unnamed\",GEOGCS[\"unnamed ellipse\",DATUM[\"un"); + add_srs_wkt (p, 1, + "known\",SPHEROID[\"unnamed\",6371228,0]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 2, + "ich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION"); + add_srs_wkt (p, 3, + "[\"Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 4, + "of_center\",-90],PARAMETER[\"longitude_of_center\",0],PA"); + add_srs_wkt (p, 5, + "RAMETER[\"false_easting\",0],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 6, ",0],UNIT[\"Meter\",1],AUTHORITY[\"EPSG\",\"3409\"]]"); + p = add_epsg_def (first, last, 3410, "epsg", 3410, + "NSIDC EASE-Grid Global"); + add_proj4text (p, 0, + "+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +a=6371228 +"); + add_proj4text (p, 1, "b=6371228 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NSIDC EASE-Grid Global\",GEOGCS[\"Unspecified d"); + add_srs_wkt (p, 1, + "atum based upon the International 1924 Authalic Sphere\""); + add_srs_wkt (p, 2, + ",DATUM[\"Not_specified_based_on_International_1924_Autha"); + add_srs_wkt (p, 3, + "lic_Sphere\",SPHEROID[\"International 1924 Authalic Sphe"); + add_srs_wkt (p, 4, + "re\",6371228,0,AUTHORITY[\"EPSG\",\"7057\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"6053\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4053\"]],U"); + add_srs_wkt (p, 8, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 9, + "[\"Cylindrical_Equal_Area\"],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 10, + "el_1\",30],PARAMETER[\"central_meridian\",0],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",0],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"3410\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 13, "H]]"); + p = add_epsg_def (first, last, 3411, "epsg", 3411, + "NSIDC Sea Ice Polar Stereographic North"); + add_proj4text (p, 0, + "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 "); + add_proj4text (p, 1, "+y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NSIDC Sea Ice Polar Stereographic North\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Unspecified datum based upon the Hughes 1980 ellipso"); + add_srs_wkt (p, 2, + "id\",DATUM[\"Not_specified_based_on_Hughes_1980_ellipsoi"); + add_srs_wkt (p, 3, + "d\",SPHEROID[\"Hughes 1980\",6378273,298.279411123061,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"7058\"]],AUTHORITY[\"EPSG\",\"6054\"]"); + add_srs_wkt (p, 5, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9122\"]],AUTHORITY[\"EPSG\",\"4054\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 8, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_Stereog"); + add_srs_wkt (p, 9, + "raphic\"],PARAMETER[\"latitude_of_origin\",70],PARAMETER"); + add_srs_wkt (p, 10, + "[\"central_meridian\",-45],PARAMETER[\"scale_factor\",1]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",0],PARAMETER[\"false_northi"); + add_srs_wkt (p, 12, + "ng\",0],AUTHORITY[\"EPSG\",\"3411\"],AXIS[\"X\",UNKNOWN]"); + add_srs_wkt (p, 13, ",AXIS[\"Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3412, "epsg", 3412, + "NSIDC Sea Ice Polar Stereographic South"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-70 +lon_0=0 +k=1 +x_0=0 "); + add_proj4text (p, 1, "+y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NSIDC Sea Ice Polar Stereographic South\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Unspecified datum based upon the Hughes 1980 ellipso"); + add_srs_wkt (p, 2, + "id\",DATUM[\"Not_specified_based_on_Hughes_1980_ellipsoi"); + add_srs_wkt (p, 3, + "d\",SPHEROID[\"Hughes 1980\",6378273,298.279411123061,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"7058\"]],AUTHORITY[\"EPSG\",\"6054\"]"); + add_srs_wkt (p, 5, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9122\"]],AUTHORITY[\"EPSG\",\"4054\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 8, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_Stereog"); + add_srs_wkt (p, 9, + "raphic\"],PARAMETER[\"latitude_of_origin\",-70],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_easting\",0],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"3412\"],AXIS[\"X\",UNKNOWN],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3413, "epsg", 3413, + "WGS 84 / NSIDC Sea Ice Polar Stereographic North"); + add_proj4text (p, 0, + "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 "); + add_proj4text (p, 1, "+y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / NSIDC Sea Ice Polar Stereographic Nort"); + add_srs_wkt (p, 1, + "h\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS "); + add_srs_wkt (p, 2, + "84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4326\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Polar_Stereographic\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",70],PARAMETER[\"central_meridian\",-45],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3413\"],AXIS[\"X\",UNKNOWN],AXIS[\"Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3414, "epsg", 3414, "SVY21 / Singapore TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=1.366666666666667 +lon_0=103.83333333"); + add_proj4text (p, 1, + "33333 +k=1 +x_0=28001.642 +y_0=38744.572 +ellps=WGS84 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SVY21 / Singapore TM\",GEOGCS[\"SVY21\",DATUM[\""); + add_srs_wkt (p, 1, + "SVY21\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6757\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, + "\"]],AUTHORITY[\"EPSG\",\"4757\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 6, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 7, + "or\"],PARAMETER[\"latitude_of_origin\",1.366666666666667"); + add_srs_wkt (p, 8, + "],PARAMETER[\"central_meridian\",103.8333333333333],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",28"); + add_srs_wkt (p, 10, + "001.642],PARAMETER[\"false_northing\",38744.572],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"3414\"],AXIS[\"Northing\",NORTH],AXIS[\"Ea"); + add_srs_wkt (p, 12, "sting\",EAST]]"); + p = add_epsg_def (first, last, 3415, "epsg", 3415, + "WGS 72BE / South China Sea Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=18 +lat_2=24 +lat_0=21 +lon_0=114 +x_0="); + add_proj4text (p, 1, + "500000 +y_0=500000 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 2, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / South China Sea Lambert\",GEOGCS[\"W"); + add_srs_wkt (p, 1, + "GS 72BE\",DATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7043\"]],TOWGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EP"); + add_srs_wkt (p, 4, + "SG\",\"6324\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_1\",18],PARAMETER[\"standard_parallel_2\",24],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"latitude_of_origin\",21],PARAMETER[\"central_meri"); + add_srs_wkt (p, 11, + "dian\",114],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_northing\",500000],AUTHORITY[\"EPSG\",\"3415\""); + add_srs_wkt (p, 13, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3416, "epsg", 3416, + "ETRS89 / Austria Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.3333"); + add_proj4text (p, 1, + "3333333333 +x_0=400000 +y_0=400000 +ellps=GRS80 +units=m"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Austria Lambert\",GEOGCS[\"ETRS89\",DA"); + add_srs_wkt (p, 1, + "TUM[\"European_Terrestrial_Reference_System_1989\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",49],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",46],PARAMETER[\"latitude_of_origin\",4"); + add_srs_wkt (p, 10, + "7.5],PARAMETER[\"central_meridian\",13.33333333333333],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",400000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",400000],AUTHORITY[\"EPSG\",\"3416\"],AXIS[\"X\","); + add_srs_wkt (p, 13, "NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3417, "epsg", 3417, + "NAD83 / Iowa North (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.99"); + add_proj4text (p, 2, + "99898402 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Iowa North (ft US)\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_"); + add_srs_wkt (p, 8, + "Conic_2SP\"],PARAMETER[\"standard_parallel_1\",43.266666"); + add_srs_wkt (p, 9, + "66666667],PARAMETER[\"standard_parallel_2\",42.066666666"); + add_srs_wkt (p, 10, + "66667],PARAMETER[\"latitude_of_origin\",41.5],PARAMETER["); + add_srs_wkt (p, 11, + "\"central_meridian\",-93.5],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "4921250],PARAMETER[\"false_northing\",3280833.333300001]"); + add_srs_wkt (p, 13, + ",AUTHORITY[\"EPSG\",\"3417\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 3418, "epsg", 3418, + "NAD83 / Iowa South (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666"); + add_proj4text (p, 1, + "667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +"); + add_proj4text (p, 2, "ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Iowa South (ft US)\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_"); + add_srs_wkt (p, 8, + "Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41.783333"); + add_srs_wkt (p, 9, + "33333333],PARAMETER[\"standard_parallel_2\",40.616666666"); + add_srs_wkt (p, 10, + "66667],PARAMETER[\"latitude_of_origin\",40],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-93.5],PARAMETER[\"false_easting\",16"); + add_srs_wkt (p, 12, + "40416.6667],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"3418\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3419, "epsg", 3419, + "NAD83 / Kansas North (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.9999"); + add_proj4text (p, 2, + "8984 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kansas North (ft US)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",39.78333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",38.71666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",38.333333333333"); + add_srs_wkt (p, 11, + "34],PARAMETER[\"central_meridian\",-98],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_easting\",1312333.3333],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 13, + "],AUTHORITY[\"EPSG\",\"3419\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 14, "\",NORTH]]"); + p = add_epsg_def (first, last, 3420, "epsg", 3420, + "NAD83 / Kansas South (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99"); + add_proj4text (p, 2, + "998984 +y_0=399999.99998984 +ellps=GRS80 +datum=NAD83 +u"); + add_proj4text (p, 3, "nits=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kansas South (ft US)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",38.56666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",37.26666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",36.666666666666"); + add_srs_wkt (p, 11, + "66],PARAMETER[\"central_meridian\",-98.5],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_easting\",1312333.3333],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",1312333.3333],AUTHORITY[\"EPSG\",\"3420\"],AXIS[\"X\",E"); + add_srs_wkt (p, 14, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3421, "epsg", 3421, + "NAD83 / Nevada East (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps="); + add_proj4text (p, 2, "GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Nevada East (ft US)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",34.75],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-115.5833333333333],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9999],PARAMETER[\"false_easting\",656166.666"); + add_srs_wkt (p, 11, + "7],PARAMETER[\"false_northing\",26246666.66670001],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"3421\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 13, "H]]"); + p = add_epsg_def (first, last, 3422, "epsg", 3422, + "NAD83 / Nevada Central (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +dat"); + add_proj4text (p, 2, "um=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Nevada Central (ft US)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",34.75],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-116.6666666666667],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",16404"); + add_srs_wkt (p, 11, + "16.6667],PARAMETER[\"false_northing\",19685000],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"3422\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3423, "epsg", 3423, + "NAD83 / Nevada West (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps"); + add_proj4text (p, 2, "=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Nevada West (ft US)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",34.75],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-118.5833333333333],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9999],PARAMETER[\"false_easting\",2624666.66"); + add_srs_wkt (p, 11, + "67],PARAMETER[\"false_northing\",13123333.3333],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"3423\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3424, "epsg", 3424, + "NAD83 / New Jersey (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 2, "us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New Jersey (ft US)\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",38.83333333333334]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"central_meridian\",-74.5],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9999],PARAMETER[\"false_easting\",492125],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3424\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3425, "epsg", 3425, + "NAD83(HARN) / Iowa North (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.99"); + add_proj4text (p, 2, "99898402 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Iowa North (ft US)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",43.26666666666667],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_2\",42.06666666666667],PARAMETER[\"latitude_of_origi"); + add_srs_wkt (p, 11, + "n\",41.5],PARAMETER[\"central_meridian\",-93.5],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_easting\",4921250],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",3280833.333300001],AUTHORITY[\"EPSG\",\"3425\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3426, "epsg", 3426, + "NAD83(HARN) / Iowa South (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666"); + add_proj4text (p, 1, + "667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +"); + add_proj4text (p, 2, "ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Iowa South (ft US)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",41.78333333333333],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_2\",40.61666666666667],PARAMETER[\"latitude_of_origi"); + add_srs_wkt (p, 11, + "n\",40],PARAMETER[\"central_meridian\",-93.5],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_easting\",1640416.6667],PARAMETER[\"false_northi"); + add_srs_wkt (p, 13, + "ng\",0],AUTHORITY[\"EPSG\",\"3426\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 14, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3427, "epsg", 3427, + "NAD83(HARN) / Kansas North (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.9999"); + add_proj4text (p, 2, "8984 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Kansas North (ft US)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",39.78333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",38.71666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",38.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-98],PARAMETER[\"false_easting\",1312333.3333],PARAME"); + add_srs_wkt (p, 13, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3427\"],A"); + add_srs_wkt (p, 14, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3428, "epsg", 3428, + "NAD83(HARN) / Kansas South (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99"); + add_proj4text (p, 2, + "998984 +y_0=399999.99998984 +ellps=GRS80 +units=us-ft +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Kansas South (ft US)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",38.56666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",37.26666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",36.66666666666666],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-98.5],PARAMETER[\"false_easting\",1312333.3333],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_northing\",1312333.3333],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"3428\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3429, "epsg", 3429, + "NAD83(HARN) / Nevada East (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps="); + add_proj4text (p, 2, "GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Nevada East (ft US)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",34.75],PARAMETER[\"central_meridian\",-115.5833333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",656166.6667],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",26246666.66670001],AUTHORITY[\"EPSG\",\"3429\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3430, "epsg", 3430, + "NAD83(HARN) / Nevada Central (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +uni"); + add_proj4text (p, 2, "ts=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Nevada Central (ft US)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",34.75],PARAMETER[\"central_meridian\",-116.666666"); + add_srs_wkt (p, 10, + "6666667],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",1640416.6667],PARAMETER[\"false_northing"); + add_srs_wkt (p, 12, + "\",19685000],AUTHORITY[\"EPSG\",\"3430\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 13, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3431, "epsg", 3431, + "NAD83(HARN) / Nevada West (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps"); + add_proj4text (p, 2, "=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Nevada West (ft US)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",34.75],PARAMETER[\"central_meridian\",-118.5833333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",2624666.6667],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",13123333.3333],AUTHORITY[\"EPSG\",\"3431\"],AXIS[\"X\","); + add_srs_wkt (p, 13, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3432, "epsg", 3432, + "NAD83(HARN) / New Jersey (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +units=us-ft +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New Jersey (ft US)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",38.83333333333334],PARAMETER[\"central_meridian\",-74.5"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",492125],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"3432\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 13, "]"); + p = add_epsg_def (first, last, 3433, "epsg", 3433, + "NAD83 / Arkansas North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.9999"); + add_proj4text (p, 2, + "8984 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Arkansas North (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",36.23333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",34.93333333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"latitude_of_origin\",34.333333333333"); + add_srs_wkt (p, 11, + "34],PARAMETER[\"central_meridian\",-92],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_easting\",1312333.3333],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 13, + "],AUTHORITY[\"EPSG\",\"3433\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 14, "\",NORTH]]"); + p = add_epsg_def (first, last, 3434, "epsg", 3434, + "NAD83 / Arkansas South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-92 +x_0=399999.99998984 +y_0=399"); + add_proj4text (p, 2, + "999.99998984 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_"); + add_proj4text (p, 3, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Arkansas South (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",34.76666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",33.3],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"latitude_of_origin\",32.66666666666666],PARAMETER"); + add_srs_wkt (p, 11, + "[\"central_meridian\",-92],PARAMETER[\"false_easting\",1"); + add_srs_wkt (p, 12, + "312333.3333],PARAMETER[\"false_northing\",1312333.3333],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"3434\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 3435, "epsg", 3435, + "NAD83 / Illinois East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333"); + add_proj4text (p, 1, + "333333 +k=0.9999749999999999 +x_0=300000.0000000001 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Illinois East (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",36.66666666666666"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-88.33333333333333],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",0.999975],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",984250.0000000002],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"3435\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3436, "epsg", 3436, + "NAD83 / Illinois West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999941177 +x_0=699999.9999898402 +y_0=0 +ell"); + add_proj4text (p, 2, "ps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Illinois West (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",36.66666666666666"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-90.16666666666667],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",0.999941177],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",2296583.333300001],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"3436\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3437, "epsg", 3437, + "NAD83 / New Hampshire (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +dat"); + add_proj4text (p, 2, "um=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New Hampshire (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",42.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-71.66666666666667],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.999966667],PARAMETER[\"false_easting\",98425"); + add_srs_wkt (p, 11, + "0.0000000002],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"3437\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3438, "epsg", 3438, + "NAD83 / Rhode Island (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.9"); + add_proj4text (p, 1, + "9999375 +x_0=99999.99998983997 +y_0=0 +ellps=GRS80 +datu"); + add_proj4text (p, 2, "m=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Rhode Island (ftUS)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",41.08333333333334]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"central_meridian\",-71.5],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.99999375],PARAMETER[\"false_easting\",328083"); + add_srs_wkt (p, 11, + ".3333],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"3438\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3439, "epsg", 3439, "PSD93 / UTM zone 39N"); + add_proj4text (p, 0, "+proj=utm +zone=39 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSD93 / UTM zone 39N\",GEOGCS[\"PSD93\",DATUM[\""); + add_srs_wkt (p, 1, + "PDO_Survey_Datum_1993\",SPHEROID[\"Clarke 1880 (RGS)\",6"); + add_srs_wkt (p, 2, + "378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6134\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4134\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",0],PARAMETER[\"central_meridian\",51],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "3439\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 3440, "epsg", 3440, "PSD93 / UTM zone 40N"); + add_proj4text (p, 0, "+proj=utm +zone=40 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSD93 / UTM zone 40N\",GEOGCS[\"PSD93\",DATUM[\""); + add_srs_wkt (p, 1, + "PDO_Survey_Datum_1993\",SPHEROID[\"Clarke 1880 (RGS)\",6"); + add_srs_wkt (p, 2, + "378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6134\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4134\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",0],PARAMETER[\"central_meridian\",57],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "3440\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 3441, "epsg", 3441, + "NAD83(HARN) / Arkansas North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.9999"); + add_proj4text (p, 2, "8984 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Arkansas North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",36.23333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",34.93333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",34.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-92],PARAMETER[\"false_easting\",1312333.3333],PARAME"); + add_srs_wkt (p, 13, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3441\"],A"); + add_srs_wkt (p, 14, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3442, "epsg", 3442, + "NAD83(HARN) / Arkansas South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-92 +x_0=399999.99998984 +y_0=399"); + add_proj4text (p, 2, "999.99998984 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Arkansas South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",34.76666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",33.3],PARAMETER[\"latitude_of_origin\",32.6"); + add_srs_wkt (p, 11, + "6666666666666],PARAMETER[\"central_meridian\",-92],PARAM"); + add_srs_wkt (p, 12, + "ETER[\"false_easting\",1312333.3333],PARAMETER[\"false_n"); + add_srs_wkt (p, 13, + "orthing\",1312333.3333],AUTHORITY[\"EPSG\",\"3442\"],AXI"); + add_srs_wkt (p, 14, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3443, "epsg", 3443, + "NAD83(HARN) / Illinois East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333"); + add_proj4text (p, 1, + "333333 +k=0.9999749999999999 +x_0=300000.0000000001 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Illinois East (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",36.66666666666666],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-88.33333333333333],PARAMETER[\"scale_factor\",0.999975"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_easting\",984250.0000000002],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3443\"],AX"); + add_srs_wkt (p, 13, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3444, "epsg", 3444, + "NAD83(HARN) / Illinois West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999941177 +x_0=699999.9999898402 +y_0=0 +ell"); + add_proj4text (p, 2, "ps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Illinois West (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",36.66666666666666],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-90.16666666666667],PARAMETER[\"scale_factor\",0.999941"); + add_srs_wkt (p, 11, + "177],PARAMETER[\"false_easting\",2296583.333300001],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3444\"]"); + add_srs_wkt (p, 13, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3445, "epsg", 3445, + "NAD83(HARN) / New Hampshire (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +uni"); + add_proj4text (p, 2, "ts=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / New Hampshire (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",42.5],PARAMETER[\"central_meridian\",-71.66666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"scale_factor\",0.999966667],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_easting\",984250.0000000002],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_northing\",0],AUTHORITY[\"EPSG\",\"3445\"],AXIS[\"X\",E"); + add_srs_wkt (p, 13, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3446, "epsg", 3446, + "NAD83(HARN) / Rhode Island (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.9"); + add_proj4text (p, 1, + "9999375 +x_0=99999.99998983997 +y_0=0 +ellps=GRS80 +unit"); + add_proj4text (p, 2, "s=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Rhode Island (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",41.08333333333334],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 10, + "-71.5],PARAMETER[\"scale_factor\",0.99999375],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",328083.3333],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"3446\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3447, "epsg", 3447, + "ETRS89 / Belgian Lambert 2005"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666"); + add_proj4text (p, 1, + "666 +lat_0=50.797815 +lon_0=4.359215833333333 +x_0=15032"); + add_proj4text (p, 2, "8 +y_0=166262 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Belgian Lambert 2005\",GEOGCS[\"ETRS89"); + add_srs_wkt (p, 1, + "\",DATUM[\"European_Terrestrial_Reference_System_1989\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",49.8333333333333"); + add_srs_wkt (p, 9, + "4],PARAMETER[\"standard_parallel_2\",51.16666666666666],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",50.797815],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",4.359215833333333],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "easting\",150328],PARAMETER[\"false_northing\",166262],A"); + add_srs_wkt (p, 13, + "UTHORITY[\"EPSG\",\"3447\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 14, "NORTH]]"); + p = add_epsg_def (first, last, 3448, "epsg", 3448, + "JAD2001 / Jamaica Metric Grid"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=750"); + add_proj4text (p, 1, + "000 +y_0=650000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JAD2001 / Jamaica Metric Grid\",GEOGCS[\"JAD200"); + add_srs_wkt (p, 1, + "1\",DATUM[\"Jamaica_2001\",SPHEROID[\"WGS 84\",6378137,2"); + add_srs_wkt (p, 2, + "98.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6758\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 4, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 5, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"4758\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],"); + add_srs_wkt (p, 8, + "PARAMETER[\"latitude_of_origin\",18],PARAMETER[\"central"); + add_srs_wkt (p, 9, + "_meridian\",-77],PARAMETER[\"scale_factor\",1],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",750000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "650000],AUTHORITY[\"EPSG\",\"3448\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3449, "epsg", 3449, + "JAD2001 / UTM zone 17N"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JAD2001 / UTM zone 17N\",GEOGCS[\"JAD2001\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Jamaica_2001\",SPHEROID[\"WGS 84\",6378137,298.2572"); + add_srs_wkt (p, 2, + "23563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,"); + add_srs_wkt (p, 3, + "0],AUTHORITY[\"EPSG\",\"6758\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4758\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",-81]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_ea"); + add_srs_wkt (p, 10, + "sting\",500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3449\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 12, "ing\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_11 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 3450, "epsg", 3450, + "JAD2001 / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JAD2001 / UTM zone 18N\",GEOGCS[\"JAD2001\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Jamaica_2001\",SPHEROID[\"WGS 84\",6378137,298.2572"); + add_srs_wkt (p, 2, + "23563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,"); + add_srs_wkt (p, 3, + "0],AUTHORITY[\"EPSG\",\"6758\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4758\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",-75]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_ea"); + add_srs_wkt (p, 10, + "sting\",500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3450\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 12, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 3451, "epsg", 3451, + "NAD83 / Louisiana North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=30.5 +lon_0=-92.5 +x_0=999999.9999898402 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Louisiana North (ftUS)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",32.66"); + add_srs_wkt (p, 9, + "666666666666],PARAMETER[\"standard_parallel_2\",31.16666"); + add_srs_wkt (p, 10, + "666666667],PARAMETER[\"latitude_of_origin\",30.5],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-92.5],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",3280833.333300001],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 13, + "UTHORITY[\"EPSG\",\"3451\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 14, "NORTH]]"); + p = add_epsg_def (first, last, 3452, "epsg", 3452, + "NAD83 / Louisiana South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91"); + add_proj4text (p, 1, + ".33333333333333 +x_0=999999.9999898402 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Louisiana South (ftUS)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",30.7]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"standard_parallel_2\",29.3],PARAMETER[\"lat"); + add_srs_wkt (p, 10, + "itude_of_origin\",28.5],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 11, + "91.33333333333333],PARAMETER[\"false_easting\",3280833.3"); + add_srs_wkt (p, 12, + "33300001],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"3452\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3453, "epsg", 3453, + "NAD83 / Louisiana Offshore (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=25.5 +lon_0=-91.33333333333333 +x_0=999999.99"); + add_proj4text (p, 2, + "99898402 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Louisiana Offshore (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",27."); + add_srs_wkt (p, 9, + "83333333333333],PARAMETER[\"standard_parallel_2\",26.166"); + add_srs_wkt (p, 10, + "66666666667],PARAMETER[\"latitude_of_origin\",25.5],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-91.33333333333333],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_easting\",3280833.333300001],PARAMETER[\"false_"); + add_srs_wkt (p, 13, + "northing\",0],AUTHORITY[\"EPSG\",\"3453\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 14, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3454, "epsg", 3454, + "NAD83 / South Dakota North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42"); + add_proj4text (p, 1, + ".33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y"); + add_proj4text (p, 2, + "_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / South Dakota North (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",44."); + add_srs_wkt (p, 9, + "4],PARAMETER[\"standard_parallel_2\",42.83333333333334],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",42.33333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-100.3333333333333],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_easting\",1968500],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"3454\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3455, "epsg", 3455, + "NAD83 / South Dakota South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42"); + add_proj4text (p, 1, + ".33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y"); + add_proj4text (p, 2, + "_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / South Dakota South (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",44."); + add_srs_wkt (p, 9, + "4],PARAMETER[\"standard_parallel_2\",42.83333333333334],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",42.33333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-100.3333333333333],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_easting\",1968500],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"3455\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3456, "epsg", 3456, + "NAD83(HARN) / Louisiana North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=30.5 +lon_0=-92.5 +x_0=999999.9999898402 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Louisiana North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",32.66666666666666],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",31.16666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",30.5],PARAMETER[\"central_meridian\",-92.5],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"false_easting\",3280833.333300001],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3456\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3457, "epsg", 3457, + "NAD83(HARN) / Louisiana South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91"); + add_proj4text (p, 1, + ".33333333333333 +x_0=999999.9999898402 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Louisiana South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",30.7],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 10, + "29.3],PARAMETER[\"latitude_of_origin\",28.5],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-91.33333333333333],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_easting\",3280833.333300001],PARAMETER[\"false_northing"); + add_srs_wkt (p, 13, + "\",0],AUTHORITY[\"EPSG\",\"3457\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 14, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3458, "epsg", 3458, + "NAD83(HARN) / South Dakota North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666"); + add_proj4text (p, 1, + "666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_"); + add_proj4text (p, 2, "0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / South Dakota North (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_N"); + add_srs_wkt (p, 2, + "etwork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey f"); + add_srs_wkt (p, 7, + "oot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",45.68333333333333],PARAMETER[\"stan"); + add_srs_wkt (p, 10, + "dard_parallel_2\",44.41666666666666],PARAMETER[\"latitud"); + add_srs_wkt (p, 11, + "e_of_origin\",43.83333333333334],PARAMETER[\"central_mer"); + add_srs_wkt (p, 12, + "idian\",-100],PARAMETER[\"false_easting\",1968500],PARAM"); + add_srs_wkt (p, 13, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3458\"],"); + add_srs_wkt (p, 14, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3459, "epsg", 3459, + "NAD83(HARN) / South Dakota South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42"); + add_proj4text (p, 1, + ".33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y"); + add_proj4text (p, 2, "_0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / South Dakota South (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_N"); + add_srs_wkt (p, 2, + "etwork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey f"); + add_srs_wkt (p, 7, + "oot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",44.4],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 10, + "_2\",42.83333333333334],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 11, + ",42.33333333333334],PARAMETER[\"central_meridian\",-100."); + add_srs_wkt (p, 12, + "3333333333333],PARAMETER[\"false_easting\",1968500],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3459\"]"); + add_srs_wkt (p, 14, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3460, "epsg", 3460, + "Fiji 1986 / Fiji Map Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-17 +lon_0=178.75 +k=0.99985 +x_0=200"); + add_proj4text (p, 1, "0000 +y_0=4000000 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Fiji 1986 / Fiji Map Grid\",GEOGCS[\"Fiji 1986\""); + add_srs_wkt (p, 1, + ",DATUM[\"Fiji_Geodetic_Datum_1986\",SPHEROID[\"WGS 72\","); + add_srs_wkt (p, 2, + "6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6720\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4720\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",-17],PARAMETER[\"central_meridian\",178.75],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.99985],PARAMETER[\"false_easting\",2"); + add_srs_wkt (p, 10, + "000000],PARAMETER[\"false_northing\",4000000],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3460\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3461, "epsg", 3461, + "Dabola 1981 / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-83,"); + add_proj4text (p, 1, "37,124,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Dabola 1981 / UTM zone 28N\",GEOGCS[\"Dabola 19"); + add_srs_wkt (p, 1, + "81\",DATUM[\"Dabola_1981\",SPHEROID[\"Clarke 1880 (IGN)\""); + add_srs_wkt (p, 2, + ",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\""); + add_srs_wkt (p, 3, + "]],TOWGS84[-83,37,124,0,0,0,0],AUTHORITY[\"EPSG\",\"6155"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4155\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-15],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3461\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3462, "epsg", 3462, + "Dabola 1981 / UTM zone 29N"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-83,"); + add_proj4text (p, 1, "37,124,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Dabola 1981 / UTM zone 29N\",GEOGCS[\"Dabola 19"); + add_srs_wkt (p, 1, + "81\",DATUM[\"Dabola_1981\",SPHEROID[\"Clarke 1880 (IGN)\""); + add_srs_wkt (p, 2, + ",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\""); + add_srs_wkt (p, 3, + "]],TOWGS84[-83,37,124,0,0,0,0],AUTHORITY[\"EPSG\",\"6155"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4155\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"3462\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3463, "epsg", 3463, + "NAD83 / Maine CS2000 Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.5 +lon_0=-69.125 +k=0.99998 +x_0=5"); + add_proj4text (p, 1, + "00000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maine CS2000 Central\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",43.5],PARAMETER[\"central_meridian\",-69.12"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",0.99998],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"3463\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 12, "H]]"); + p = add_epsg_def (first, last, 3464, "epsg", 3464, + "NAD83(HARN) / Maine CS2000 Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.5 +lon_0=-69.125 +k=0.99998 +x_0=5"); + add_proj4text (p, 1, "00000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maine CS2000 Central\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",43.5],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-69.125],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "99998],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"3464\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3465, "epsg", 3465, + "NAD83(NSRS2007) / Alabama East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.9"); + add_proj4text (p, 1, + "9996 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alabama East\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",30.5],PARAMETER[\"central_meridian\",-85.833"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"scale_factor\",0.99996],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",200000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"3465\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3466, "epsg", 3466, + "NAD83(NSRS2007) / Alabama West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=6"); + add_proj4text (p, 1, + "00000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alabama West\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",30],PARAMETER[\"central_meridian\",-87.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.999933333],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",600000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 12, + "ITY[\"EPSG\",\"3466\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 3467, "epsg", 3467, + "NAD83(NSRS2007) / Alaska Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0"); + add_proj4text (p, 1, + "=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska Albers\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_1\",55],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 10, + "65],PARAMETER[\"latitude_of_center\",50],PARAMETER[\"lon"); + add_srs_wkt (p, 11, + "gitude_of_center\",-154],PARAMETER[\"false_easting\",0],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"346"); + add_srs_wkt (p, 13, "7\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3468, "epsg", 3468, + "NAD83(NSRS2007) / Alaska zone 1"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=32"); + add_proj4text (p, 1, + "3.1301023611111 +k=0.9999 +x_0=5000000 +y_0=-5000000 +el"); + add_proj4text (p, 2, "lps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska zone 1\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMETER[\"lati"); + add_srs_wkt (p, 9, + "tude_of_center\",57],PARAMETER[\"longitude_of_center\",-"); + add_srs_wkt (p, 10, + "133.6666666666667],PARAMETER[\"azimuth\",323.13010236111"); + add_srs_wkt (p, 11, + "11],PARAMETER[\"rectified_grid_angle\",323.1301023611111"); + add_srs_wkt (p, 12, + "],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_e"); + add_srs_wkt (p, 13, + "asting\",5000000],PARAMETER[\"false_northing\",-5000000]"); + add_srs_wkt (p, 14, + ",AUTHORITY[\"EPSG\",\"3468\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 15, ",NORTH]]"); + p = add_epsg_def (first, last, 3469, "epsg", 3469, + "NAD83(NSRS2007) / Alaska zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-142 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska zone 2\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",54],PARAMETER[\"central_meridian\",-142],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, "EPSG\",\"3469\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3470, "epsg", 3470, + "NAD83(NSRS2007) / Alaska zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-146 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska zone 3\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",54],PARAMETER[\"central_meridian\",-146],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, "EPSG\",\"3470\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3471, "epsg", 3471, + "NAD83(NSRS2007) / Alaska zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska zone 4\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",54],PARAMETER[\"central_meridian\",-150],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, "EPSG\",\"3471\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3472, "epsg", 3472, + "NAD83(NSRS2007) / Alaska zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-154 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska zone 5\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",54],PARAMETER[\"central_meridian\",-154],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, "EPSG\",\"3472\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3473, "epsg", 3473, + "NAD83(NSRS2007) / Alaska zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-158 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska zone 6\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",54],PARAMETER[\"central_meridian\",-158],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, "EPSG\",\"3473\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3474, "epsg", 3474, + "NAD83(NSRS2007) / Alaska zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-162 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska zone 7\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",54],PARAMETER[\"central_meridian\",-162],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, "EPSG\",\"3474\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3475, "epsg", 3475, + "NAD83(NSRS2007) / Alaska zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-166 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska zone 8\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",54],PARAMETER[\"central_meridian\",-166],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, "EPSG\",\"3475\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3476, "epsg", 3476, + "NAD83(NSRS2007) / Alaska zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-170 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, + "+y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska zone 9\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",54],PARAMETER[\"central_meridian\",-170],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 11, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 12, "EPSG\",\"3476\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3477, "epsg", 3477, + "NAD83(NSRS2007) / Alaska zone 10"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333"); + add_proj4text (p, 1, + "334 +lat_0=51 +lon_0=-176 +x_0=1000000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Alaska zone 10\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",53.83333333333334],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",51.83333333333334],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",51],PARAMETER[\"central_meridian\",-176],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_easting\",1000000],PARAMETER[\"false_n"); + add_srs_wkt (p, 13, + "orthing\",0],AUTHORITY[\"EPSG\",\"3477\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 14, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3478, "epsg", 3478, + "NAD83(NSRS2007) / Arizona Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Arizona Central\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",31],PARAMETER[\"central_meridian\",-111.9"); + add_srs_wkt (p, 10, + "166666666667],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",213360],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"3478\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3479, "epsg", 3479, + "NAD83(NSRS2007) / Arizona Central (ft)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 2, " +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Arizona Central (ft)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 8, + "\"9002\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"latitude_of_origin\",31],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 10, + "\",-111.9166666666667],PARAMETER[\"scale_factor\",0.9999"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_easting\",700000],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "northing\",0],AUTHORITY[\"EPSG\",\"3479\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 13, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3480, "epsg", 3480, + "NAD83(NSRS2007) / Arizona East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Arizona East\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",31],PARAMETER[\"central_meridian\",-110.1666"); + add_srs_wkt (p, 10, + "666666667],PARAMETER[\"scale_factor\",0.9999],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",213360],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3480\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3481, "epsg", 3481, + "NAD83(NSRS2007) / Arizona East (ft)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 2, " +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Arizona East (ft)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "02\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",31],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 10, + "110.1666666666667],PARAMETER[\"scale_factor\",0.9999],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",700000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",0],AUTHORITY[\"EPSG\",\"3481\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3482, "epsg", 3482, + "NAD83(NSRS2007) / Arizona West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0"); + add_proj4text (p, 1, + "=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Arizona West\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",31],PARAMETER[\"central_meridian\",-113.75],"); + add_srs_wkt (p, 10, + "PARAMETER[\"scale_factor\",0.999933333],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",213360],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 12, + "ORITY[\"EPSG\",\"3482\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 3483, "epsg", 3483, + "NAD83(NSRS2007) / Arizona West (ft)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0"); + add_proj4text (p, 1, + "=213360 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 2, "s=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Arizona West (ft)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "02\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",31],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 10, + "113.75],PARAMETER[\"scale_factor\",0.999933333],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_easting\",700000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"3483\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3484, "epsg", 3484, + "NAD83(NSRS2007) / Arkansas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0"); + add_proj4text (p, 2, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Arkansas North\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",36.23333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",34.93333333333333],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",34.33333333333334],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-92],PARAMETER[\"false_easting\",400000],PARAME"); + add_srs_wkt (p, 13, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3484\"],A"); + add_srs_wkt (p, 14, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3485, "epsg", 3485, + "NAD83(NSRS2007) / Arkansas North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.9999"); + add_proj4text (p, 2, + "8984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=u"); + add_proj4text (p, 3, "s-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Arkansas North (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "36.23333333333333],PARAMETER[\"standard_parallel_2\",34."); + add_srs_wkt (p, 11, + "93333333333333],PARAMETER[\"latitude_of_origin\",34.3333"); + add_srs_wkt (p, 12, + "3333333334],PARAMETER[\"central_meridian\",-92],PARAMETE"); + add_srs_wkt (p, 13, + "R[\"false_easting\",1312333.3333],PARAMETER[\"false_nort"); + add_srs_wkt (p, 14, + "hing\",0],AUTHORITY[\"EPSG\",\"3485\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 15, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3486, "epsg", 3486, + "NAD83(NSRS2007) / Arkansas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellp"); + add_proj4text (p, 2, "s=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Arkansas South\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",34.76666666666667],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",33.3],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 11, + ",32.66666666666666],PARAMETER[\"central_meridian\",-92],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_easting\",400000],PARAMETER[\"false_no"); + add_srs_wkt (p, 13, + "rthing\",400000],AUTHORITY[\"EPSG\",\"3486\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3487, "epsg", 3487, + "NAD83(NSRS2007) / Arkansas South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-92 +x_0=399999.99998984 +y_0=399"); + add_proj4text (p, 2, + "999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 3, "us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Arkansas South (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "34.76666666666667],PARAMETER[\"standard_parallel_2\",33."); + add_srs_wkt (p, 11, + "3],PARAMETER[\"latitude_of_origin\",32.66666666666666],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"central_meridian\",-92],PARAMETER[\"false_eas"); + add_srs_wkt (p, 13, + "ting\",1312333.3333],PARAMETER[\"false_northing\",131233"); + add_srs_wkt (p, 14, + "3.3333],AUTHORITY[\"EPSG\",\"3487\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 15, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3488, "epsg", 3488, + "NAD83(NSRS2007) / California Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_"); + add_proj4text (p, 1, + "0=0 +y_0=-4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California Albers\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",34],PARAMETER[\"standard_parallel_2"); + add_srs_wkt (p, 10, + "\",40.5],PARAMETER[\"latitude_of_center\",0],PARAMETER[\""); + add_srs_wkt (p, 11, + "longitude_of_center\",-120],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "0],PARAMETER[\"false_northing\",-4000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"3488\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3489, "epsg", 3489, + "NAD83(NSRS2007) / California zone 1"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.3"); + add_proj4text (p, 1, + "3333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellp"); + add_proj4text (p, 2, "s=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 1\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",41.66666666666666],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",40],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 11, + "\",39.33333333333334],PARAMETER[\"central_meridian\",-12"); + add_srs_wkt (p, 12, + "2],PARAMETER[\"false_easting\",2000000],PARAMETER[\"fals"); + add_srs_wkt (p, 13, + "e_northing\",500000],AUTHORITY[\"EPSG\",\"3489\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3490, "epsg", 3490, + "NAD83(NSRS2007) / California zone 1 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.3"); + add_proj4text (p, 1, + "3333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=5000"); + add_proj4text (p, 2, + "00.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units"); + add_proj4text (p, 3, "=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 1 (ftUS)\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_"); + add_srs_wkt (p, 2, + "Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 3, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 5, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096"); + add_srs_wkt (p, 8, + "012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamber"); + add_srs_wkt (p, 9, + "t_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 10, + "\",41.66666666666666],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 11, + "40],PARAMETER[\"latitude_of_origin\",39.33333333333334],"); + add_srs_wkt (p, 12, + "PARAMETER[\"central_meridian\",-122],PARAMETER[\"false_e"); + add_srs_wkt (p, 13, + "asting\",6561666.667],PARAMETER[\"false_northing\",16404"); + add_srs_wkt (p, 14, + "16.667],AUTHORITY[\"EPSG\",\"3490\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 15, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3491, "epsg", 3491, + "NAD83(NSRS2007) / California zone 2"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y"); + add_proj4text (p, 2, + "_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 2\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",39.83333333333334],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",38.33333333333334],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",37.66666666666666],PARAMETER[\"central"); + add_srs_wkt (p, 12, + "_meridian\",-122],PARAMETER[\"false_easting\",2000000],P"); + add_srs_wkt (p, 13, + "ARAMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 14, "3491\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3492, "epsg", 3492, + "NAD83(NSRS2007) / California zone 2 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.00"); + add_proj4text (p, 2, + "01016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,0,0"); + add_proj4text (p, 3, ",0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 2 (ftUS)\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_"); + add_srs_wkt (p, 2, + "Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 3, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 5, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096"); + add_srs_wkt (p, 8, + "012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamber"); + add_srs_wkt (p, 9, + "t_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 10, + "\",39.83333333333334],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 11, + "38.33333333333334],PARAMETER[\"latitude_of_origin\",37.6"); + add_srs_wkt (p, 12, + "6666666666666],PARAMETER[\"central_meridian\",-122],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_easting\",6561666.667],PARAMETER[\"false_n"); + add_srs_wkt (p, 14, + "orthing\",1640416.667],AUTHORITY[\"EPSG\",\"3492\"],AXIS"); + add_srs_wkt (p, 15, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3493, "epsg", 3493, + "NAD83(NSRS2007) / California zone 3"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +"); + add_proj4text (p, 2, + "ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 3\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",38.43333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",37.06666666666667],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",36.5],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 12, + "120.5],PARAMETER[\"false_easting\",2000000],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_northing\",500000],AUTHORITY[\"EPSG\",\"3493\"],AX"); + add_srs_wkt (p, 14, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3494, "epsg", 3494, + "NAD83(NSRS2007) / California zone 3 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0="); + add_proj4text (p, 2, + "500000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 3, "nits=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 3 (ftUS)\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_"); + add_srs_wkt (p, 2, + "Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 3, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 5, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096"); + add_srs_wkt (p, 8, + "012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamber"); + add_srs_wkt (p, 9, + "t_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 10, + "\",38.43333333333333],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 11, + "37.06666666666667],PARAMETER[\"latitude_of_origin\",36.5"); + add_srs_wkt (p, 12, + "],PARAMETER[\"central_meridian\",-120.5],PARAMETER[\"fal"); + add_srs_wkt (p, 13, + "se_easting\",6561666.667],PARAMETER[\"false_northing\",1"); + add_srs_wkt (p, 14, + "640416.667],AUTHORITY[\"EPSG\",\"3494\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 15, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3495, "epsg", 3495, + "NAD83(NSRS2007) / California zone 4"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.3333333333333"); + add_proj4text (p, 1, + "4 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +tow"); + add_proj4text (p, 2, "gs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 4\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",37.25],PARAMETER[\"standard_par"); + add_srs_wkt (p, 10, + "allel_2\",36],PARAMETER[\"latitude_of_origin\",35.333333"); + add_srs_wkt (p, 11, + "33333334],PARAMETER[\"central_meridian\",-119],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_easting\",2000000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",500000],AUTHORITY[\"EPSG\",\"3495\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 14, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3496, "epsg", 3496, + "NAD83(NSRS2007) / California zone 4 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.3333333333333"); + add_proj4text (p, 1, + "4 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.000101600"); + add_proj4text (p, 2, + "1 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 4 (ftUS)\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_"); + add_srs_wkt (p, 2, + "Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 3, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 5, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096"); + add_srs_wkt (p, 8, + "012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamber"); + add_srs_wkt (p, 9, + "t_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 10, + "\",37.25],PARAMETER[\"standard_parallel_2\",36],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"latitude_of_origin\",35.33333333333334],PARAMETER[\""); + add_srs_wkt (p, 12, + "central_meridian\",-119],PARAMETER[\"false_easting\",656"); + add_srs_wkt (p, 13, + "1666.667],PARAMETER[\"false_northing\",1640416.667],AUTH"); + add_srs_wkt (p, 14, + "ORITY[\"EPSG\",\"3496\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 15, "TH]]"); + p = add_epsg_def (first, last, 3497, "epsg", 3497, + "NAD83(NSRS2007) / California zone 5"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +el"); + add_proj4text (p, 2, "lps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 5\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",35.46666666666667],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",34.03333333333333],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",33.5],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 12, + "118],PARAMETER[\"false_easting\",2000000],PARAMETER[\"fa"); + add_srs_wkt (p, 13, + "lse_northing\",500000],AUTHORITY[\"EPSG\",\"3497\"],AXIS"); + add_srs_wkt (p, 14, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3498, "epsg", 3498, + "NAD83(NSRS2007) / California zone 5 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=50"); + add_proj4text (p, 2, + "0000.0001016001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +uni"); + add_proj4text (p, 3, "ts=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 5 (ftUS)\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_"); + add_srs_wkt (p, 2, + "Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 3, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 5, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096"); + add_srs_wkt (p, 8, + "012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamber"); + add_srs_wkt (p, 9, + "t_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 10, + "\",35.46666666666667],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 11, + "34.03333333333333],PARAMETER[\"latitude_of_origin\",33.5"); + add_srs_wkt (p, 12, + "],PARAMETER[\"central_meridian\",-118],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_easting\",6561666.667],PARAMETER[\"false_northing\",164"); + add_srs_wkt (p, 14, + "0416.667],AUTHORITY[\"EPSG\",\"3498\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 15, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3499, "epsg", 3499, + "NAD83(NSRS2007) / California zone 6"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000"); + add_proj4text (p, 2, + " +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 3, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 6\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",33.88333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",32.78333333333333],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",32.16666666666666],PARAMETER[\"central"); + add_srs_wkt (p, 12, + "_meridian\",-116.25],PARAMETER[\"false_easting\",2000000"); + add_srs_wkt (p, 13, + "],PARAMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"3499\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3500, "epsg", 3500, + "NAD83(NSRS2007) / California zone 6 (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000"); + add_proj4text (p, 2, + ".0001016 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0,"); + add_proj4text (p, 3, "0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / California zone 6 (ftUS)\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_"); + add_srs_wkt (p, 2, + "Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 3, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 5, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096"); + add_srs_wkt (p, 8, + "012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamber"); + add_srs_wkt (p, 9, + "t_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 10, + "\",33.88333333333333],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 11, + "32.78333333333333],PARAMETER[\"latitude_of_origin\",32.1"); + add_srs_wkt (p, 12, + "6666666666666],PARAMETER[\"central_meridian\",-116.25],P"); + add_srs_wkt (p, 13, + "ARAMETER[\"false_easting\",6561666.667],PARAMETER[\"fals"); + add_srs_wkt (p, 14, + "e_northing\",1640416.667],AUTHORITY[\"EPSG\",\"3500\"],A"); + add_srs_wkt (p, 15, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3501, "epsg", 3501, + "NAD83(NSRS2007) / Colorado Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.8333333333"); + add_proj4text (p, 1, + "3334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +el"); + add_proj4text (p, 2, "lps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Colorado Central\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",39.75],PARAMETER[\"standard_par"); + add_srs_wkt (p, 10, + "allel_2\",38.45],PARAMETER[\"latitude_of_origin\",37.833"); + add_srs_wkt (p, 11, + "33333333334],PARAMETER[\"central_meridian\",-105.5],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_easting\",914401.8289],PARAMETER[\"false_n"); + add_srs_wkt (p, 13, + "orthing\",304800.6096],AUTHORITY[\"EPSG\",\"3501\"],AXIS"); + add_srs_wkt (p, 14, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3502, "epsg", 3502, + "NAD83(NSRS2007) / Colorado Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.8333333333"); + add_proj4text (p, 1, + "3334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.60"); + add_proj4text (p, 2, + "96012192 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-f"); + add_proj4text (p, 3, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Colorado Central (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_R"); + add_srs_wkt (p, 2, + "eference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 3, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 5, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 8, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_"); + add_srs_wkt (p, 9, + "Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 10, + ",39.75],PARAMETER[\"standard_parallel_2\",38.45],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"latitude_of_origin\",37.83333333333334],PARAMETER[\""); + add_srs_wkt (p, 12, + "central_meridian\",-105.5],PARAMETER[\"false_easting\",3"); + add_srs_wkt (p, 13, + "000000],PARAMETER[\"false_northing\",1000000],AUTHORITY["); + add_srs_wkt (p, 14, + "\"EPSG\",\"3502\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3503, "epsg", 3503, + "NAD83(NSRS2007) / Colorado North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, + "289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 3, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Colorado North\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",40.78333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",39.71666666666667],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",39.33333333333334],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-105.5],PARAMETER[\"false_easting\",914401.8289"); + add_srs_wkt (p, 13, + "],PARAMETER[\"false_northing\",304800.6096],AUTHORITY[\""); + add_srs_wkt (p, 14, "EPSG\",\"3503\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3504, "epsg", 3504, + "NAD83(NSRS2007) / Colorado North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, + "288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0"); + add_proj4text (p, 3, ",0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Colorado North (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "40.78333333333333],PARAMETER[\"standard_parallel_2\",39."); + add_srs_wkt (p, 11, + "71666666666667],PARAMETER[\"latitude_of_origin\",39.3333"); + add_srs_wkt (p, 12, + "3333333334],PARAMETER[\"central_meridian\",-105.5],PARAM"); + add_srs_wkt (p, 13, + "ETER[\"false_easting\",3000000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 14, + "ng\",1000000],AUTHORITY[\"EPSG\",\"3504\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 15, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3505, "epsg", 3505, + "NAD83(NSRS2007) / Colorado South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, + "289 +y_0=304800.6096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 3, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Colorado South\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",38.43333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",37.23333333333333],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",36.66666666666666],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-105.5],PARAMETER[\"false_easting\",914401.8289"); + add_srs_wkt (p, 13, + "],PARAMETER[\"false_northing\",304800.6096],AUTHORITY[\""); + add_srs_wkt (p, 14, "EPSG\",\"3505\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3506, "epsg", 3506, + "NAD83(NSRS2007) / Colorado South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, + "288036576 +y_0=304800.6096012192 +ellps=GRS80 +towgs84=0"); + add_proj4text (p, 3, ",0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Colorado South (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "38.43333333333333],PARAMETER[\"standard_parallel_2\",37."); + add_srs_wkt (p, 11, + "23333333333333],PARAMETER[\"latitude_of_origin\",36.6666"); + add_srs_wkt (p, 12, + "6666666666],PARAMETER[\"central_meridian\",-105.5],PARAM"); + add_srs_wkt (p, 13, + "ETER[\"false_easting\",3000000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 14, + "ng\",1000000],AUTHORITY[\"EPSG\",\"3506\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 15, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3507, "epsg", 3507, + "NAD83(NSRS2007) / Connecticut"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40"); + add_proj4text (p, 1, + ".83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=1524"); + add_proj4text (p, 2, + "00.3048 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no"); + add_proj4text (p, 3, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Connecticut\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",41.86666666666667],PARAMETER[\"stand"); + add_srs_wkt (p, 10, + "ard_parallel_2\",41.2],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 11, + "40.83333333333334],PARAMETER[\"central_meridian\",-72.75"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_easting\",304800.6096],PARAMETER[\"f"); + add_srs_wkt (p, 13, + "alse_northing\",152400.3048],AUTHORITY[\"EPSG\",\"3507\""); + add_srs_wkt (p, 14, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3508, "epsg", 3508, + "NAD83(NSRS2007) / Connecticut (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40"); + add_proj4text (p, 1, + ".83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_"); + add_proj4text (p, 2, + "0=152400.3048006096 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "); + add_proj4text (p, 3, "+units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Connecticut (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 9, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41.86"); + add_srs_wkt (p, 10, + "666666666667],PARAMETER[\"standard_parallel_2\",41.2],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"latitude_of_origin\",40.83333333333334],PARAME"); + add_srs_wkt (p, 12, + "TER[\"central_meridian\",-72.75],PARAMETER[\"false_easti"); + add_srs_wkt (p, 13, + "ng\",1000000],PARAMETER[\"false_northing\",500000],AUTHO"); + add_srs_wkt (p, 14, + "RITY[\"EPSG\",\"3508\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 15, "H]]"); + p = add_epsg_def (first, last, 3509, "epsg", 3509, + "NAD83(NSRS2007) / Delaware"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999"); + add_proj4text (p, 1, + "995 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0"); + add_proj4text (p, 2, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Delaware\",GEOGCS[\"NAD83(NSR"); + add_srs_wkt (p, 1, + "S2007)\",DATUM[\"NAD83_National_Spatial_Reference_System"); + add_srs_wkt (p, 2, + "_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 5, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4759\""); + add_srs_wkt (p, 7, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",38],PARAMETER[\"central_meridian\",-75.4166666666"); + add_srs_wkt (p, 10, + "6667],PARAMETER[\"scale_factor\",0.999995],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",200000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"3509\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 3510, "epsg", 3510, + "NAD83(NSRS2007) / Delaware (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999"); + add_proj4text (p, 1, + "995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Delaware (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,AU"); + add_srs_wkt (p, 8, + "THORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 9, + "ator\"],PARAMETER[\"latitude_of_origin\",38],PARAMETER[\""); + add_srs_wkt (p, 10, + "central_meridian\",-75.41666666666667],PARAMETER[\"scale"); + add_srs_wkt (p, 11, + "_factor\",0.999995],PARAMETER[\"false_easting\",656166.6"); + add_srs_wkt (p, 12, + "67],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "3510\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3511, "epsg", 3511, + "NAD83(NSRS2007) / Florida East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 2, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Florida East\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",24.33333333333333],PARAMETER[\"central_merid"); + add_srs_wkt (p, 10, + "ian\",-81],PARAMETER[\"scale_factor\",0.999941177],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",200000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"3511\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3512, "epsg", 3512, + "NAD83(NSRS2007) / Florida East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs"); + add_proj4text (p, 2, "84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Florida East (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",24.33333333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"central_meridian\",-81],PARAMETER[\""); + add_srs_wkt (p, 11, + "scale_factor\",0.999941177],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "656166.667],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"3512\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3513, "epsg", 3513, + "NAD83(NSRS2007) / Florida GDL Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_"); + add_proj4text (p, 1, + "0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Florida GDL Albers\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",24],PARAMETER[\"standard_parallel_2"); + add_srs_wkt (p, 10, + "\",31.5],PARAMETER[\"latitude_of_center\",24],PARAMETER["); + add_srs_wkt (p, 11, + "\"longitude_of_center\",-84],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",400000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 13, "G\",\"3513\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3514, "epsg", 3514, + "NAD83(NSRS2007) / Florida North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=2"); + add_proj4text (p, 1, + "9 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Florida North\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",30.75],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 10, + "el_2\",29.58333333333333],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 11, + "\",29],PARAMETER[\"central_meridian\",-84.5],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",600000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"3514\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 3515, "epsg", 3515, + "NAD83(NSRS2007) / Florida North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=2"); + add_proj4text (p, 1, + "9 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Florida North (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 8, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 9, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",3"); + add_srs_wkt (p, 10, + "0.75],PARAMETER[\"standard_parallel_2\",29.5833333333333"); + add_srs_wkt (p, 11, + "3],PARAMETER[\"latitude_of_origin\",29],PARAMETER[\"cent"); + add_srs_wkt (p, 12, + "ral_meridian\",-84.5],PARAMETER[\"false_easting\",196850"); + add_srs_wkt (p, 13, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 14, "3515\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3516, "epsg", 3516, + "NAD83(NSRS2007) / Florida West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 2, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Florida West\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",24.33333333333333],PARAMETER[\"central_merid"); + add_srs_wkt (p, 10, + "ian\",-82],PARAMETER[\"scale_factor\",0.999941177],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",200000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"3516\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3517, "epsg", 3517, + "NAD83(NSRS2007) / Florida West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs"); + add_proj4text (p, 2, "84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Florida West (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",24.33333333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"central_meridian\",-82],PARAMETER[\""); + add_srs_wkt (p, 11, + "scale_factor\",0.999941177],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "656166.667],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"3517\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3518, "epsg", 3518, + "NAD83(NSRS2007) / Georgia East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Georgia East\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",30],PARAMETER[\"central_meridian\",-82.16666"); + add_srs_wkt (p, 10, + "666666667],PARAMETER[\"scale_factor\",0.9999],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",200000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3518\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3519, "epsg", 3519, + "NAD83(NSRS2007) / Georgia East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +towgs84=0,"); + add_proj4text (p, 2, "0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Georgia East (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",30],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"central_meridian\",-82.16666666666667],PARAMETER[\""); + add_srs_wkt (p, 11, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",65616"); + add_srs_wkt (p, 12, + "6.667],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"3519\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3520, "epsg", 3520, + "NAD83(NSRS2007) / Georgia West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Georgia West\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",30],PARAMETER[\"central_meridian\",-84.16666"); + add_srs_wkt (p, 10, + "666666667],PARAMETER[\"scale_factor\",0.9999],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",700000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3520\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3521, "epsg", 3521, + "NAD83(NSRS2007) / Georgia West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +towgs84=0,"); + add_proj4text (p, 2, "0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Georgia West (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",30],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"central_meridian\",-84.16666666666667],PARAMETER[\""); + add_srs_wkt (p, 11, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",22965"); + add_srs_wkt (p, 12, + "83.333],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 13, "\",\"3521\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3522, "epsg", 3522, + "NAD83(NSRS2007) / Idaho Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.99"); + add_proj4text (p, 1, + "99473679999999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Idaho Central\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",41.66666666666666],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",-114],PARAMETER[\"scale_factor\",0.999947368],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 12, + "ing\",0],AUTHORITY[\"EPSG\",\"3522\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 13, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3523, "epsg", 3523, + "NAD83(NSRS2007) / Idaho Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.99"); + add_proj4text (p, 1, + "99473679999999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS8"); + add_proj4text (p, 2, "0 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Idaho Central (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 8, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 9, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",41.6666666"); + add_srs_wkt (p, 10, + "6666666],PARAMETER[\"central_meridian\",-114],PARAMETER["); + add_srs_wkt (p, 11, + "\"scale_factor\",0.999947368],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",1640416.667],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"3523\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3524, "epsg", 3524, + "NAD83(NSRS2007) / Idaho East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666"); + add_proj4text (p, 1, + "666667 +k=0.9999473679999999 +x_0=200000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Idaho East\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",41.66666666666666],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 10, + "n\",-112.1666666666667],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 11, + "947368],PARAMETER[\"false_easting\",200000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3524\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3525, "epsg", 3525, + "NAD83(NSRS2007) / Idaho East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666"); + add_proj4text (p, 1, + "666667 +k=0.9999473679999999 +x_0=200000.0001016002 +y_0"); + add_proj4text (p, 2, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_"); + add_proj4text (p, 3, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Idaho East (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 9, + "cator\"],PARAMETER[\"latitude_of_origin\",41.66666666666"); + add_srs_wkt (p, 10, + "666],PARAMETER[\"central_meridian\",-112.1666666666667],"); + add_srs_wkt (p, 11, + "PARAMETER[\"scale_factor\",0.999947368],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_easting\",656166.667],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"3525\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 3526, "epsg", 3526, + "NAD83(NSRS2007) / Idaho West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0"); + add_proj4text (p, 1, + ".999933333 +x_0=800000 +y_0=0 +ellps=GRS80 +towgs84=0,0,"); + add_proj4text (p, 2, "0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Idaho West\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",41.66666666666666],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 10, + "n\",-115.75],PARAMETER[\"scale_factor\",0.999933333],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",800000],PARAMETER[\"false_north"); + add_srs_wkt (p, 12, + "ing\",0],AUTHORITY[\"EPSG\",\"3526\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 13, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3527, "epsg", 3527, + "NAD83(NSRS2007) / Idaho West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0"); + add_proj4text (p, 1, + ".999933333 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +t"); + add_proj4text (p, 2, "owgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Idaho West (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 9, + "cator\"],PARAMETER[\"latitude_of_origin\",41.66666666666"); + add_srs_wkt (p, 10, + "666],PARAMETER[\"central_meridian\",-115.75],PARAMETER[\""); + add_srs_wkt (p, 11, + "scale_factor\",0.999933333],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "2624666.667],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"3527\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3528, "epsg", 3528, + "NAD83(NSRS2007) / Illinois East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333"); + add_proj4text (p, 1, + "333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Illinois East\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",36.66666666666666],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",-88.33333333333333],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 11, + "999975],PARAMETER[\"false_easting\",300000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3528\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3529, "epsg", 3529, + "NAD83(NSRS2007) / Illinois East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333"); + add_proj4text (p, 1, + "333333 +k=0.9999749999999999 +x_0=300000.0000000001 +y_0"); + add_proj4text (p, 2, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_"); + add_proj4text (p, 3, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Illinois East (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 8, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 9, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",36.6666666"); + add_srs_wkt (p, 10, + "6666666],PARAMETER[\"central_meridian\",-88.333333333333"); + add_srs_wkt (p, 11, + "33],PARAMETER[\"scale_factor\",0.999975],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_easting\",984250.0000000002],PARAMETER[\"false_northi"); + add_srs_wkt (p, 13, + "ng\",0],AUTHORITY[\"EPSG\",\"3529\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 14, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3530, "epsg", 3530, + "NAD83(NSRS2007) / Illinois West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999941177 +x_0=700000 +y_0=0 +ellps=GRS80 +t"); + add_proj4text (p, 2, "owgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Illinois West\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",36.66666666666666],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",-90.16666666666667],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 11, + "999941177],PARAMETER[\"false_easting\",700000],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3530\"],AXIS"); + add_srs_wkt (p, 13, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3531, "epsg", 3531, + "NAD83(NSRS2007) / Illinois West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999941177 +x_0=699999.9999898402 +y_0=0 +ell"); + add_proj4text (p, 2, + "ps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Illinois West (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 8, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 9, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",36.6666666"); + add_srs_wkt (p, 10, + "6666666],PARAMETER[\"central_meridian\",-90.166666666666"); + add_srs_wkt (p, 11, + "67],PARAMETER[\"scale_factor\",0.999941177],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",2296583.333300001],PARAMETER[\"false_nor"); + add_srs_wkt (p, 13, + "thing\",0],AUTHORITY[\"EPSG\",\"3531\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 14, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3532, "epsg", 3532, + "NAD83(NSRS2007) / Indiana East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=100000 +y_0=250000 +ellps=GRS80 +towgs84=0"); + add_proj4text (p, 2, ",0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Indiana East\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",37.5],PARAMETER[\"central_meridian\",-85.666"); + add_srs_wkt (p, 10, + "66666666667],PARAMETER[\"scale_factor\",0.999966667],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",100000],PARAMETER[\"false_north"); + add_srs_wkt (p, 12, + "ing\",250000],AUTHORITY[\"EPSG\",\"3532\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 13, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3533, "epsg", 3533, + "NAD83(NSRS2007) / Indiana East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=99999.99989839978 +y_0=249999.9998983998 +"); + add_proj4text (p, 2, + "ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Indiana East (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",37.5],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"central_meridian\",-85.66666666666667],PARAMETER["); + add_srs_wkt (p, 11, + "\"scale_factor\",0.999966667],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",328083.333],PARAMETER[\"false_northing\",820208.3330000"); + add_srs_wkt (p, 13, + "002],AUTHORITY[\"EPSG\",\"3533\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 14, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3534, "epsg", 3534, + "NAD83(NSRS2007) / Indiana West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=900000 +y_0=250000 +ellps=GRS80 +towgs84=0"); + add_proj4text (p, 2, ",0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Indiana West\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",37.5],PARAMETER[\"central_meridian\",-87.083"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"scale_factor\",0.999966667],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",900000],PARAMETER[\"false_north"); + add_srs_wkt (p, 12, + "ing\",250000],AUTHORITY[\"EPSG\",\"3534\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 13, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3535, "epsg", 3535, + "NAD83(NSRS2007) / Indiana West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=900000 +y_0=249999.9998983998 +ellps=GRS80"); + add_proj4text (p, 2, " +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Indiana West (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",37.5],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"central_meridian\",-87.08333333333333],PARAMETER["); + add_srs_wkt (p, 11, + "\"scale_factor\",0.999966667],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",2952750],PARAMETER[\"false_northing\",820208.3330000002"); + add_srs_wkt (p, 13, + "],AUTHORITY[\"EPSG\",\"3535\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 14, "\",NORTH]]"); + p = add_epsg_def (first, last, 3536, "epsg", 3536, + "NAD83(NSRS2007) / Iowa North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +"); + add_proj4text (p, 2, + "ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Iowa North\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_1\",43.26666666666667],PARAMETER[\"standa"); + add_srs_wkt (p, 10, + "rd_parallel_2\",42.06666666666667],PARAMETER[\"latitude_"); + add_srs_wkt (p, 11, + "of_origin\",41.5],PARAMETER[\"central_meridian\",-93.5],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_easting\",1500000],PARAMETER[\"false_n"); + add_srs_wkt (p, 13, + "orthing\",1000000],AUTHORITY[\"EPSG\",\"3536\"],AXIS[\"X"); + add_srs_wkt (p, 14, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3537, "epsg", 3537, + "NAD83(NSRS2007) / Iowa North (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.99"); + add_proj4text (p, 2, + "99898402 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-f"); + add_proj4text (p, 3, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Iowa North (ft US)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 9, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",43.26"); + add_srs_wkt (p, 10, + "666666666667],PARAMETER[\"standard_parallel_2\",42.06666"); + add_srs_wkt (p, 11, + "666666667],PARAMETER[\"latitude_of_origin\",41.5],PARAME"); + add_srs_wkt (p, 12, + "TER[\"central_meridian\",-93.5],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 13, + "g\",4921250],PARAMETER[\"false_northing\",3280833.333300"); + add_srs_wkt (p, 14, + "001],AUTHORITY[\"EPSG\",\"3537\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 15, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3538, "epsg", 3538, + "NAD83(NSRS2007) / Iowa South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666"); + add_proj4text (p, 1, + "667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Iowa South\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_1\",41.78333333333333],PARAMETER[\"standa"); + add_srs_wkt (p, 10, + "rd_parallel_2\",40.61666666666667],PARAMETER[\"latitude_"); + add_srs_wkt (p, 11, + "of_origin\",40],PARAMETER[\"central_meridian\",-93.5],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 13, + "hing\",0],AUTHORITY[\"EPSG\",\"3538\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 14, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3539, "epsg", 3539, + "NAD83(NSRS2007) / Iowa South (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666"); + add_proj4text (p, 1, + "667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +"); + add_proj4text (p, 2, + "ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Iowa South (ft US)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 9, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41.78"); + add_srs_wkt (p, 10, + "333333333333],PARAMETER[\"standard_parallel_2\",40.61666"); + add_srs_wkt (p, 11, + "666666667],PARAMETER[\"latitude_of_origin\",40],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"central_meridian\",-93.5],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 13, + ",1640416.6667],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 14, + "[\"EPSG\",\"3539\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3540, "epsg", 3540, + "NAD83(NSRS2007) / Kansas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0"); + add_proj4text (p, 2, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Kansas North\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",39.78333333333333],PARAMETER[\"stan"); + add_srs_wkt (p, 10, + "dard_parallel_2\",38.71666666666667],PARAMETER[\"latitud"); + add_srs_wkt (p, 11, + "e_of_origin\",38.33333333333334],PARAMETER[\"central_mer"); + add_srs_wkt (p, 12, + "idian\",-98],PARAMETER[\"false_easting\",400000],PARAMET"); + add_srs_wkt (p, 13, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3540\"],AX"); + add_srs_wkt (p, 14, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3541, "epsg", 3541, + "NAD83(NSRS2007) / Kansas North (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.9999"); + add_proj4text (p, 2, + "8984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=u"); + add_proj4text (p, 3, "s-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Kansas North (ft US)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 8, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 9, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",3"); + add_srs_wkt (p, 10, + "9.78333333333333],PARAMETER[\"standard_parallel_2\",38.7"); + add_srs_wkt (p, 11, + "1666666666667],PARAMETER[\"latitude_of_origin\",38.33333"); + add_srs_wkt (p, 12, + "333333334],PARAMETER[\"central_meridian\",-98],PARAMETER"); + add_srs_wkt (p, 13, + "[\"false_easting\",1312333.3333],PARAMETER[\"false_north"); + add_srs_wkt (p, 14, + "ing\",0],AUTHORITY[\"EPSG\",\"3541\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 15, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3542, "epsg", 3542, + "NAD83(NSRS2007) / Kansas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y"); + add_proj4text (p, 2, + "_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Kansas South\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",38.56666666666667],PARAMETER[\"stan"); + add_srs_wkt (p, 10, + "dard_parallel_2\",37.26666666666667],PARAMETER[\"latitud"); + add_srs_wkt (p, 11, + "e_of_origin\",36.66666666666666],PARAMETER[\"central_mer"); + add_srs_wkt (p, 12, + "idian\",-98.5],PARAMETER[\"false_easting\",400000],PARAM"); + add_srs_wkt (p, 13, + "ETER[\"false_northing\",400000],AUTHORITY[\"EPSG\",\"354"); + add_srs_wkt (p, 14, "2\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3543, "epsg", 3543, + "NAD83(NSRS2007) / Kansas South (ft US)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99"); + add_proj4text (p, 2, + "998984 +y_0=399999.99998984 +ellps=GRS80 +towgs84=0,0,0,"); + add_proj4text (p, 3, "0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Kansas South (ft US)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 8, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 9, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",3"); + add_srs_wkt (p, 10, + "8.56666666666667],PARAMETER[\"standard_parallel_2\",37.2"); + add_srs_wkt (p, 11, + "6666666666667],PARAMETER[\"latitude_of_origin\",36.66666"); + add_srs_wkt (p, 12, + "666666666],PARAMETER[\"central_meridian\",-98.5],PARAMET"); + add_srs_wkt (p, 13, + "ER[\"false_easting\",1312333.3333],PARAMETER[\"false_nor"); + add_srs_wkt (p, 14, + "thing\",1312333.3333],AUTHORITY[\"EPSG\",\"3543\"],AXIS["); + add_srs_wkt (p, 15, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3544, "epsg", 3544, + "NAD83(NSRS2007) / Kentucky North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps="); + add_proj4text (p, 2, "GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Kentucky North\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",37.96666666666667],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",38.96666666666667],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",37.5],PARAMETER[\"central_meridian\",-84."); + add_srs_wkt (p, 12, + "25],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 13, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3544\"],AXIS[\"X\","); + add_srs_wkt (p, 14, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3545, "epsg", 3545, + "NAD83(NSRS2007) / Kentucky North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_"); + add_proj4text (p, 2, + "0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no"); + add_proj4text (p, 3, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Kentucky North (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "37.96666666666667],PARAMETER[\"standard_parallel_2\",38."); + add_srs_wkt (p, 11, + "96666666666667],PARAMETER[\"latitude_of_origin\",37.5],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"central_meridian\",-84.25],PARAMETER[\"false_"); + add_srs_wkt (p, 13, + "easting\",1640416.667],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 14, + "UTHORITY[\"EPSG\",\"3545\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 15, "NORTH]]"); + p = add_epsg_def (first, last, 3546, "epsg", 3546, + "NAD83(NSRS2007) / Kentucky Single Zone"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 "); + add_proj4text (p, 2, + "+y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 3, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Kentucky Single Zone\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"standard_parallel_1\",37.08333333333334],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"standard_parallel_2\",38.66666666666666],PARAMETER[\""); + add_srs_wkt (p, 11, + "latitude_of_origin\",36.33333333333334],PARAMETER[\"cent"); + add_srs_wkt (p, 12, + "ral_meridian\",-85.75],PARAMETER[\"false_easting\",15000"); + add_srs_wkt (p, 13, + "00],PARAMETER[\"false_northing\",1000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 14, "SG\",\"3546\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3547, "epsg", 3547, + "NAD83(NSRS2007) / Kentucky Single Zone (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 "); + add_proj4text (p, 2, + "+y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0"); + add_proj4text (p, 3, ",0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Kentucky Single Zone (ftUS)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spati"); + add_srs_wkt (p, 2, + "al_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 3, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006"); + add_srs_wkt (p, 8, + "096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lam"); + add_srs_wkt (p, 9, + "bert_Conformal_Conic_2SP\"],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 10, + "l_1\",37.08333333333334],PARAMETER[\"standard_parallel_2"); + add_srs_wkt (p, 11, + "\",38.66666666666666],PARAMETER[\"latitude_of_origin\",3"); + add_srs_wkt (p, 12, + "6.33333333333334],PARAMETER[\"central_meridian\",-85.75]"); + add_srs_wkt (p, 13, + ",PARAMETER[\"false_easting\",4921250],PARAMETER[\"false_"); + add_srs_wkt (p, 14, + "northing\",3280833.333],AUTHORITY[\"EPSG\",\"3547\"],AXI"); + add_srs_wkt (p, 15, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3548, "epsg", 3548, + "NAD83(NSRS2007) / Kentucky South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +"); + add_proj4text (p, 2, + "y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Kentucky South\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",37.93333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",36.73333333333333],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",36.33333333333334],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-85.75],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 13, + "AMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\",\"3"); + add_srs_wkt (p, 14, "548\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3549, "epsg", 3549, + "NAD83(NSRS2007) / Kentucky South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0"); + add_proj4text (p, 2, + "001016001 +y_0=500000.0001016001 +ellps=GRS80 +towgs84=0"); + add_proj4text (p, 3, ",0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Kentucky South (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "37.93333333333333],PARAMETER[\"standard_parallel_2\",36."); + add_srs_wkt (p, 11, + "73333333333333],PARAMETER[\"latitude_of_origin\",36.3333"); + add_srs_wkt (p, 12, + "3333333334],PARAMETER[\"central_meridian\",-85.75],PARAM"); + add_srs_wkt (p, 13, + "ETER[\"false_easting\",1640416.667],PARAMETER[\"false_no"); + add_srs_wkt (p, 14, + "rthing\",1640416.667],AUTHORITY[\"EPSG\",\"3549\"],AXIS["); + add_srs_wkt (p, 15, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3550, "epsg", 3550, + "NAD83(NSRS2007) / Louisiana North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps="); + add_proj4text (p, 2, "GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Louisiana North\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_1\",32.66666666666666],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "tandard_parallel_2\",31.16666666666667],PARAMETER[\"lati"); + add_srs_wkt (p, 11, + "tude_of_origin\",30.5],PARAMETER[\"central_meridian\",-9"); + add_srs_wkt (p, 12, + "2.5],PARAMETER[\"false_easting\",1000000],PARAMETER[\"fa"); + add_srs_wkt (p, 13, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"3550\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3551, "epsg", 3551, + "NAD83(NSRS2007) / Louisiana North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=30.5 +lon_0=-92.5 +x_0=999999.9999898402 +y_0"); + add_proj4text (p, 2, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_"); + add_proj4text (p, 3, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Louisiana North (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Re"); + add_srs_wkt (p, 2, + "ference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298."); + add_srs_wkt (p, 3, + "257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "32.66666666666666],PARAMETER[\"standard_parallel_2\",31."); + add_srs_wkt (p, 11, + "16666666666667],PARAMETER[\"latitude_of_origin\",30.5],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"central_meridian\",-92.5],PARAMETER[\"false_e"); + add_srs_wkt (p, 13, + "asting\",3280833.333300001],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 14, + ",0],AUTHORITY[\"EPSG\",\"3551\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 15, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3552, "epsg", 3552, + "NAD83(NSRS2007) / Louisiana South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91"); + add_proj4text (p, 1, + ".33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs8"); + add_proj4text (p, 2, "4=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Louisiana South\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_1\",30.7],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_2\",29.3],PARAMETER[\"latitude_of_origin\",28.5],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"central_meridian\",-91.33333333333333],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_easting\",1000000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"3552\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3553, "epsg", 3553, + "NAD83(NSRS2007) / Louisiana South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91"); + add_proj4text (p, 1, + ".33333333333333 +x_0=999999.9999898402 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Louisiana South (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Re"); + add_srs_wkt (p, 2, + "ference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298."); + add_srs_wkt (p, 3, + "257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "30.7],PARAMETER[\"standard_parallel_2\",29.3],PARAMETER["); + add_srs_wkt (p, 11, + "\"latitude_of_origin\",28.5],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 12, + "n\",-91.33333333333333],PARAMETER[\"false_easting\",3280"); + add_srs_wkt (p, 13, + "833.333300001],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 14, + "[\"EPSG\",\"3553\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3554, "epsg", 3554, + "NAD83(NSRS2007) / Maine CS2000 Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.5 +lon_0=-69.125 +k=0.99998 +x_0=5"); + add_proj4text (p, 1, + "00000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maine CS2000 Central\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",43.5],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-69.125],PARAMETER[\"scale_factor\",0.99998],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3554\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3555, "epsg", 3555, + "NAD83(NSRS2007) / Maine CS2000 East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.83333333333334 +lon_0=-67.875 +k=0"); + add_proj4text (p, 1, + ".99998 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 2, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maine CS2000 East\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",43.83333333333334],PARAMETER[\"central_m"); + add_srs_wkt (p, 10, + "eridian\",-67.875],PARAMETER[\"scale_factor\",0.99998],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",700000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",0],AUTHORITY[\"EPSG\",\"3555\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 13, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3556, "epsg", 3556, + "NAD83(NSRS2007) / Maine CS2000 West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.375 +k=0"); + add_proj4text (p, 1, + ".99998 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 2, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maine CS2000 West\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",42.83333333333334],PARAMETER[\"central_m"); + add_srs_wkt (p, 10, + "eridian\",-70.375],PARAMETER[\"scale_factor\",0.99998],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",300000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",0],AUTHORITY[\"EPSG\",\"3556\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 13, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3557, "epsg", 3557, + "NAD83(NSRS2007) / Maine East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0"); + add_proj4text (p, 2, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maine East\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",43.66666666666666],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 10, + "n\",-68.5],PARAMETER[\"scale_factor\",0.9999],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",300000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3557\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3558, "epsg", 3558, + "NAD83(NSRS2007) / Maine West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +t"); + add_proj4text (p, 2, "owgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maine West\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",42.83333333333334],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 10, + "n\",-70.16666666666667],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 11, + "966667],PARAMETER[\"false_easting\",900000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3558\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3559, "epsg", 3559, + "NAD83(NSRS2007) / Maryland"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666"); + add_proj4text (p, 1, + "666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maryland\",GEOGCS[\"NAD83(NSR"); + add_srs_wkt (p, 1, + "S2007)\",DATUM[\"NAD83_National_Spatial_Reference_System"); + add_srs_wkt (p, 2, + "_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 5, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4759\""); + add_srs_wkt (p, 7, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",39.45],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 10, + ",38.3],PARAMETER[\"latitude_of_origin\",37.6666666666666"); + add_srs_wkt (p, 11, + "6],PARAMETER[\"central_meridian\",-77],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_easting\",400000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 13, + "RITY[\"EPSG\",\"3559\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 14, "H]]"); + p = add_epsg_def (first, last, 3560, "epsg", 3560, + "NAD83 / Utah North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0"); + add_proj4text (p, 2, + "0001016 +y_0=999999.9999898402 +ellps=GRS80 +datum=NAD83"); + add_proj4text (p, 3, " +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Utah North (ftUS)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",41.7833333"); + add_srs_wkt (p, 9, + "3333333],PARAMETER[\"standard_parallel_2\",40.7166666666"); + add_srs_wkt (p, 10, + "6667],PARAMETER[\"latitude_of_origin\",40.33333333333334"); + add_srs_wkt (p, 11, + "],PARAMETER[\"central_meridian\",-111.5],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_easting\",1640416.6667],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 13, + "3280833.333300001],AUTHORITY[\"EPSG\",\"3560\"],AXIS[\"X"); + add_srs_wkt (p, 14, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3561, "epsg", 3561, + "Old Hawaiian / Hawaii zone 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0."); + add_proj4text (p, 1, + "999966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +u"); + add_proj4text (p, 2, "nits=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Old Hawaiian / Hawaii zone 1\",GEOGCS[\"Old Haw"); + add_srs_wkt (p, 1, + "aiian\",DATUM[\"Old_Hawaiian\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6135\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4135\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",18.83333333333"); + add_srs_wkt (p, 9, + "333],PARAMETER[\"central_meridian\",-155.5],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.999966667],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"3561\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3562, "epsg", 3562, + "Old Hawaiian / Hawaii zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ell"); + add_proj4text (p, 2, "ps=clrk66 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Old Hawaiian / Hawaii zone 2\",GEOGCS[\"Old Haw"); + add_srs_wkt (p, 1, + "aiian\",DATUM[\"Old_Hawaiian\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6135\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4135\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",20.33333333333"); + add_srs_wkt (p, 9, + "333],PARAMETER[\"central_meridian\",-156.6666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"scale_factor\",0.999966667],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 12, + "ORITY[\"EPSG\",\"3562\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 3563, "epsg", 3563, + "Old Hawaiian / Hawaii zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99"); + add_proj4text (p, 1, + "999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +units=u"); + add_proj4text (p, 2, "s-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Old Hawaiian / Hawaii zone 3\",GEOGCS[\"Old Haw"); + add_srs_wkt (p, 1, + "aiian\",DATUM[\"Old_Hawaiian\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6135\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4135\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",21.16666666666"); + add_srs_wkt (p, 9, + "667],PARAMETER[\"central_meridian\",-158],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",0.99999],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3"); + add_srs_wkt (p, 12, "563\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3564, "epsg", 3564, + "Old Hawaiian / Hawaii zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0."); + add_proj4text (p, 1, + "99999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +units"); + add_proj4text (p, 2, "=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Old Hawaiian / Hawaii zone 4\",GEOGCS[\"Old Haw"); + add_srs_wkt (p, 1, + "aiian\",DATUM[\"Old_Hawaiian\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6135\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4135\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",21.83333333333"); + add_srs_wkt (p, 9, + "333],PARAMETER[\"central_meridian\",-159.5],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.99999],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "3564\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3565, "epsg", 3565, + "Old Hawaiian / Hawaii zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 "); + add_proj4text (p, 2, "+units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Old Hawaiian / Hawaii zone 5\",GEOGCS[\"Old Haw"); + add_srs_wkt (p, 1, + "aiian\",DATUM[\"Old_Hawaiian\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6135\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4135\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",21.66666666666"); + add_srs_wkt (p, 9, + "667],PARAMETER[\"central_meridian\",-160.1666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"3565\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3566, "epsg", 3566, + "NAD83 / Utah Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=3"); + add_proj4text (p, 1, + "8.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0"); + add_proj4text (p, 2, + "=2000000.00001016 +ellps=GRS80 +datum=NAD83 +units=us-ft"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Utah Central (ftUS)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_"); + add_srs_wkt (p, 8, + "Conic_2SP\"],PARAMETER[\"standard_parallel_1\",40.65],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"standard_parallel_2\",39.01666666666667],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"latitude_of_origin\",38.33333333333334],PARAMETER"); + add_srs_wkt (p, 11, + "[\"central_meridian\",-111.5],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",1640416.6667],PARAMETER[\"false_northing\",6561666.6667"); + add_srs_wkt (p, 13, + "00001],AUTHORITY[\"EPSG\",\"3566\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 14, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3567, "epsg", 3567, + "NAD83 / Utah South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=3"); + add_proj4text (p, 1, + "6.66666666666666 +lon_0=-111.5 +x_0=500000.00001016 +y_0"); + add_proj4text (p, 2, + "=3000000 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Utah South (ftUS)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",38.35],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"standard_parallel_2\",37.21666666666667],PARAME"); + add_srs_wkt (p, 10, + "TER[\"latitude_of_origin\",36.66666666666666],PARAMETER["); + add_srs_wkt (p, 11, + "\"central_meridian\",-111.5],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",1640416.6667],PARAMETER[\"false_northing\",9842500.0000"); + add_srs_wkt (p, 13, + "00002],AUTHORITY[\"EPSG\",\"3567\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 14, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3568, "epsg", 3568, + "NAD83(HARN) / Utah North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0"); + add_proj4text (p, 2, + "0001016 +y_0=999999.9999898402 +ellps=GRS80 +units=us-ft"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Utah North (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",41.78333333333333],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_2\",40.71666666666667],PARAMETER[\"latitude_of_origi"); + add_srs_wkt (p, 11, + "n\",40.33333333333334],PARAMETER[\"central_meridian\",-1"); + add_srs_wkt (p, 12, + "11.5],PARAMETER[\"false_easting\",1640416.6667],PARAMETE"); + add_srs_wkt (p, 13, + "R[\"false_northing\",3280833.333300001],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 14, "\",\"3568\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3569, "epsg", 3569, + "NAD83(HARN) / Utah Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=3"); + add_proj4text (p, 1, + "8.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0"); + add_proj4text (p, 2, + "=2000000.00001016 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Utah Central (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standar"); + add_srs_wkt (p, 9, + "d_parallel_1\",40.65],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 10, + "39.01666666666667],PARAMETER[\"latitude_of_origin\",38.3"); + add_srs_wkt (p, 11, + "3333333333334],PARAMETER[\"central_meridian\",-111.5],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_easting\",1640416.6667],PARAMETER[\"fals"); + add_srs_wkt (p, 13, + "e_northing\",6561666.666700001],AUTHORITY[\"EPSG\",\"356"); + add_srs_wkt (p, 14, "9\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3570, "epsg", 3570, + "NAD83(HARN) / Utah South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=3"); + add_proj4text (p, 1, + "6.66666666666666 +lon_0=-111.5 +x_0=500000.00001016 +y_0"); + add_proj4text (p, 2, "=3000000 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Utah South (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",38.35],PARAMETER[\"standard_parallel_2\",37.2"); + add_srs_wkt (p, 10, + "1666666666667],PARAMETER[\"latitude_of_origin\",36.66666"); + add_srs_wkt (p, 11, + "666666666],PARAMETER[\"central_meridian\",-111.5],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_easting\",1640416.6667],PARAMETER[\"false_no"); + add_srs_wkt (p, 13, + "rthing\",9842500.000000002],AUTHORITY[\"EPSG\",\"3570\"]"); + add_srs_wkt (p, 14, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3571, "epsg", 3571, + "WGS 84 / North Pole LAEA Bering Sea"); + add_proj4text (p, 0, + "+proj=laea +lat_0=90 +lon_0=180 +x_0=0 +y_0=0 +ellps=WGS"); + add_proj4text (p, 1, "84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / North Pole LAEA Bering Sea\",GEOGCS[\""); + add_srs_wkt (p, 1, + "WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,"); + add_srs_wkt (p, 2, + "298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 8, + "of_center\",90],PARAMETER[\"longitude_of_center\",180],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",0],PARAMETER[\"false_northing"); + add_srs_wkt (p, 10, + "\",0],AUTHORITY[\"EPSG\",\"3571\"],AXIS[\"X\",UNKNOWN],A"); + add_srs_wkt (p, 11, "XIS[\"Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3572, "epsg", 3572, + "WGS 84 / North Pole LAEA Alaska"); + add_proj4text (p, 0, + "+proj=laea +lat_0=90 +lon_0=-150 +x_0=0 +y_0=0 +ellps=WG"); + add_proj4text (p, 1, "S84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / North Pole LAEA Alaska\",GEOGCS[\"WGS "); + add_srs_wkt (p, 1, + "84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298."); + add_srs_wkt (p, 2, + "257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"L"); + add_srs_wkt (p, 7, + "ambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_of_c"); + add_srs_wkt (p, 8, + "enter\",90],PARAMETER[\"longitude_of_center\",-150],PARA"); + add_srs_wkt (p, 9, + "METER[\"false_easting\",0],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 10, + "0],AUTHORITY[\"EPSG\",\"3572\"],AXIS[\"X\",UNKNOWN],AXIS"); + add_srs_wkt (p, 11, "[\"Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3573, "epsg", 3573, + "WGS 84 / North Pole LAEA Canada"); + add_proj4text (p, 0, + "+proj=laea +lat_0=90 +lon_0=-100 +x_0=0 +y_0=0 +ellps=WG"); + add_proj4text (p, 1, "S84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / North Pole LAEA Canada\",GEOGCS[\"WGS "); + add_srs_wkt (p, 1, + "84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298."); + add_srs_wkt (p, 2, + "257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"L"); + add_srs_wkt (p, 7, + "ambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_of_c"); + add_srs_wkt (p, 8, + "enter\",90],PARAMETER[\"longitude_of_center\",-100],PARA"); + add_srs_wkt (p, 9, + "METER[\"false_easting\",0],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 10, + "0],AUTHORITY[\"EPSG\",\"3573\"],AXIS[\"X\",UNKNOWN],AXIS"); + add_srs_wkt (p, 11, "[\"Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3574, "epsg", 3574, + "WGS 84 / North Pole LAEA Atlantic"); + add_proj4text (p, 0, + "+proj=laea +lat_0=90 +lon_0=-40 +x_0=0 +y_0=0 +ellps=WGS"); + add_proj4text (p, 1, "84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / North Pole LAEA Atlantic\",GEOGCS[\"WG"); + add_srs_wkt (p, 1, + "S 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,29"); + add_srs_wkt (p, 2, + "8.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "center\",90],PARAMETER[\"longitude_of_center\",-40],PARA"); + add_srs_wkt (p, 9, + "METER[\"false_easting\",0],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 10, + "0],AUTHORITY[\"EPSG\",\"3574\"],AXIS[\"X\",UNKNOWN],AXIS"); + add_srs_wkt (p, 11, "[\"Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3575, "epsg", 3575, + "WGS 84 / North Pole LAEA Europe"); + add_proj4text (p, 0, + "+proj=laea +lat_0=90 +lon_0=10 +x_0=0 +y_0=0 +ellps=WGS8"); + add_proj4text (p, 1, "4 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / North Pole LAEA Europe\",GEOGCS[\"WGS "); + add_srs_wkt (p, 1, + "84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298."); + add_srs_wkt (p, 2, + "257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"L"); + add_srs_wkt (p, 7, + "ambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_of_c"); + add_srs_wkt (p, 8, + "enter\",90],PARAMETER[\"longitude_of_center\",10],PARAME"); + add_srs_wkt (p, 9, + "TER[\"false_easting\",0],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 10, + ",AUTHORITY[\"EPSG\",\"3575\"],AXIS[\"X\",UNKNOWN],AXIS[\""); + add_srs_wkt (p, 11, "Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3576, "epsg", 3576, + "WGS 84 / North Pole LAEA Russia"); + add_proj4text (p, 0, + "+proj=laea +lat_0=90 +lon_0=90 +x_0=0 +y_0=0 +ellps=WGS8"); + add_proj4text (p, 1, "4 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / North Pole LAEA Russia\",GEOGCS[\"WGS "); + add_srs_wkt (p, 1, + "84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298."); + add_srs_wkt (p, 2, + "257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"L"); + add_srs_wkt (p, 7, + "ambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_of_c"); + add_srs_wkt (p, 8, + "enter\",90],PARAMETER[\"longitude_of_center\",90],PARAME"); + add_srs_wkt (p, 9, + "TER[\"false_easting\",0],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 10, + ",AUTHORITY[\"EPSG\",\"3576\"],AXIS[\"X\",UNKNOWN],AXIS[\""); + add_srs_wkt (p, 11, "Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3577, "epsg", 3577, + "GDA94 / Australian Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=132 +x_0"); + add_proj4text (p, 1, + "=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / Australian Albers\",GEOGCS[\"GDA94\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Albers_Conic_"); + add_srs_wkt (p, 8, + "Equal_Area\"],PARAMETER[\"standard_parallel_1\",-18],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"standard_parallel_2\",-36],PARAMETER[\"latitude"); + add_srs_wkt (p, 10, + "_of_center\",0],PARAMETER[\"longitude_of_center\",132],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",0],PARAMETER[\"false_northing"); + add_srs_wkt (p, 12, + "\",0],AUTHORITY[\"EPSG\",\"3577\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 13, "],AXIS[\"Northing\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_12 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 3578, "epsg", 3578, "NAD83 / Yukon Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=61.66666666666666 +lat_2=68 +lat_0=59 +"); + add_proj4text (p, 1, + "lon_0=-132.5 +x_0=500000 +y_0=500000 +ellps=GRS80 +datum"); + add_proj4text (p, 2, "=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Yukon Albers\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Albers_Conic_Equal_Area\"],PARAMETER[\"standard_par"); + add_srs_wkt (p, 8, + "allel_1\",61.66666666666666],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 9, + "el_2\",68],PARAMETER[\"latitude_of_center\",59],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"longitude_of_center\",-132.5],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",500000],PARAMETER[\"false_northing\",500000],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"3578\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 13, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 3579, "epsg", 3579, + "NAD83(CSRS) / Yukon Albers"); + add_proj4text (p, 0, + "+proj=aea +lat_1=61.66666666666666 +lat_2=68 +lat_0=59 +"); + add_proj4text (p, 1, + "lon_0=-132.5 +x_0=500000 +y_0=500000 +ellps=GRS80 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Yukon Albers\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Albers_Conic_Equal_Area\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",61.66666666666666],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"standard_parallel_2\",68],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_center\",59],PARAMETER[\"longitude_of_center\",-132"); + add_srs_wkt (p, 11, + ".5],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",500000],AUTHORITY[\"EPSG\",\"3579\"],AXIS[\""); + add_srs_wkt (p, 13, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3580, "epsg", 3580, "NAD83 / NWT Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=62 +lat_2=70 +lat_0=0 +lon_0=-112 +x_0="); + add_proj4text (p, 1, + "0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / NWT Lambert\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",62],PARAMETER[\"standard_parallel_2\",70],"); + add_srs_wkt (p, 9, + "PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_"); + add_srs_wkt (p, 10, + "meridian\",-112],PARAMETER[\"false_easting\",0],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3580\"],AXI"); + add_srs_wkt (p, 12, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3581, "epsg", 3581, + "NAD83(CSRS) / NWT Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=62 +lat_2=70 +lat_0=0 +lon_0=-112 +x_0="); + add_proj4text (p, 1, "0 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / NWT Lambert\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",62],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",70],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 10, + "\",0],PARAMETER[\"central_meridian\",-112],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",0],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 12, + "ITY[\"EPSG\",\"3581\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 3582, "epsg", 3582, + "NAD83(NSRS2007) / Maryland (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666"); + add_proj4text (p, 1, + "666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS8"); + add_proj4text (p, 2, "0 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maryland (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,AU"); + add_srs_wkt (p, 8, + "THORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conform"); + add_srs_wkt (p, 9, + "al_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",39.45]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"standard_parallel_2\",38.3],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",37.66666666666666],PARAMETER[\"central"); + add_srs_wkt (p, 12, + "_meridian\",-77],PARAMETER[\"false_easting\",1312333.333"); + add_srs_wkt (p, 13, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3"); + add_srs_wkt (p, 14, "582\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3583, "epsg", 3583, + "NAD83(NSRS2007) / Massachusetts Island"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333"); + add_proj4text (p, 1, + "333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Massachusetts Island\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"standard_parallel_1\",41.48333333333333],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"standard_parallel_2\",41.28333333333333],PARAMETER[\""); + add_srs_wkt (p, 11, + "latitude_of_origin\",41],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 12, + "-70.5],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 13, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"3583\"],AXIS[\"X"); + add_srs_wkt (p, 14, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3584, "epsg", 3584, + "NAD83(NSRS2007) / Massachusetts Island (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333"); + add_proj4text (p, 1, + "333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0"); + add_proj4text (p, 2, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_de"); + add_proj4text (p, 3, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Massachusetts Island (ftUS)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spati"); + add_srs_wkt (p, 2, + "al_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 3, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006"); + add_srs_wkt (p, 8, + "096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lam"); + add_srs_wkt (p, 9, + "bert_Conformal_Conic_2SP\"],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 10, + "l_1\",41.48333333333333],PARAMETER[\"standard_parallel_2"); + add_srs_wkt (p, 11, + "\",41.28333333333333],PARAMETER[\"latitude_of_origin\",4"); + add_srs_wkt (p, 12, + "1],PARAMETER[\"central_meridian\",-70.5],PARAMETER[\"fal"); + add_srs_wkt (p, 13, + "se_easting\",1640416.667],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 14, + "],AUTHORITY[\"EPSG\",\"3584\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 15, "\",NORTH]]"); + p = add_epsg_def (first, last, 3585, "epsg", 3585, + "NAD83(NSRS2007) / Massachusetts Mainland"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellp"); + add_proj4text (p, 2, "s=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Massachusetts Mainland\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Re"); + add_srs_wkt (p, 2, + "ference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298."); + add_srs_wkt (p, 3, + "257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 8, + "001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARA"); + add_srs_wkt (p, 9, + "METER[\"standard_parallel_1\",42.68333333333333],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"standard_parallel_2\",41.71666666666667],PARAMETER["); + add_srs_wkt (p, 11, + "\"latitude_of_origin\",41],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 12, + ",-71.5],PARAMETER[\"false_easting\",200000],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_northing\",750000],AUTHORITY[\"EPSG\",\"3585\"],AX"); + add_srs_wkt (p, 14, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3586, "epsg", 3586, + "NAD83(NSRS2007) / Massachusetts Mainland (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=7"); + add_proj4text (p, 2, + "50000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Massachusetts Mainland (ftUS)"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spa"); + add_srs_wkt (p, 2, + "tial_Reference_System_2007\",SPHEROID[\"GRS 1980\",63781"); + add_srs_wkt (p, 3, + "37,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0"); + add_srs_wkt (p, 4, + ",0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 5, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 6, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.30480"); + add_srs_wkt (p, 8, + "06096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"L"); + add_srs_wkt (p, 9, + "ambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_1\",42.68333333333333],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 11, + "_2\",41.71666666666667],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 12, + ",41],PARAMETER[\"central_meridian\",-71.5],PARAMETER[\"f"); + add_srs_wkt (p, 13, + "alse_easting\",656166.667],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 14, + "2460625],AUTHORITY[\"EPSG\",\"3586\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 15, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3587, "epsg", 3587, + "NAD83(NSRS2007) / Michigan Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43"); + add_proj4text (p, 1, + ".31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +"); + add_proj4text (p, 2, + "y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Michigan Central\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",45.7],PARAMETER[\"standard_para"); + add_srs_wkt (p, 10, + "llel_2\",44.18333333333333],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 11, + "in\",43.31666666666667],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 12, + "84.36666666666666],PARAMETER[\"false_easting\",6000000],"); + add_srs_wkt (p, 13, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"358"); + add_srs_wkt (p, 14, "7\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3588, "epsg", 3588, + "NAD83(NSRS2007) / Michigan Central (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43"); + add_proj4text (p, 1, + ".31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.9"); + add_proj4text (p, 2, + "99976001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +uni"); + add_proj4text (p, 3, "ts=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Michigan Central (ft)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9002\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],"); + add_srs_wkt (p, 9, + "PARAMETER[\"standard_parallel_1\",45.7],PARAMETER[\"stan"); + add_srs_wkt (p, 10, + "dard_parallel_2\",44.18333333333333],PARAMETER[\"latitud"); + add_srs_wkt (p, 11, + "e_of_origin\",43.31666666666667],PARAMETER[\"central_mer"); + add_srs_wkt (p, 12, + "idian\",-84.36666666666666],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 13, + "19685039.37],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 14, "EPSG\",\"3588\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3589, "epsg", 3589, + "NAD83(NSRS2007) / Michigan North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_"); + add_proj4text (p, 2, + "0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_def"); + add_proj4text (p, 3, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Michigan North\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",47.08333333333334],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",45.48333333333333],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",44.78333333333333],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-87],PARAMETER[\"false_easting\",8000000],PARAM"); + add_srs_wkt (p, 13, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3589\"],"); + add_srs_wkt (p, 14, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3590, "epsg", 3590, + "NAD83(NSRS2007) / Michigan North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999"); + add_proj4text (p, 2, + "968001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units"); + add_proj4text (p, 3, "=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Michigan North (ft)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9002\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"standard_parallel_1\",47.08333333333334],PARAME"); + add_srs_wkt (p, 10, + "TER[\"standard_parallel_2\",45.48333333333333],PARAMETER"); + add_srs_wkt (p, 11, + "[\"latitude_of_origin\",44.78333333333333],PARAMETER[\"c"); + add_srs_wkt (p, 12, + "entral_meridian\",-87],PARAMETER[\"false_easting\",26246"); + add_srs_wkt (p, 13, + "719.16],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 14, "\",\"3590\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3591, "epsg", 3591, + "NAD83(NSRS2007) / Michigan Oblique Mercator"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=33"); + add_proj4text (p, 1, + "7.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +el"); + add_proj4text (p, 2, "lps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Michigan Oblique Mercator\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial"); + add_srs_wkt (p, 2, + "_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,2"); + add_srs_wkt (p, 3, + "98.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 5, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 6, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9001\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],PARA"); + add_srs_wkt (p, 9, + "METER[\"latitude_of_center\",45.30916666666666],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"longitude_of_center\",-86],PARAMETER[\"azimuth\",337"); + add_srs_wkt (p, 11, + ".25556],PARAMETER[\"rectified_grid_angle\",337.25556],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easti"); + add_srs_wkt (p, 13, + "ng\",2546731.496],PARAMETER[\"false_northing\",-4354009."); + add_srs_wkt (p, 14, + "816],AUTHORITY[\"EPSG\",\"3591\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 15, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3592, "epsg", 3592, + "NAD83(NSRS2007) / Michigan South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41"); + add_proj4text (p, 1, + ".5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps="); + add_proj4text (p, 2, "GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Michigan South\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",43.66666666666666],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",42.1],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 11, + ",41.5],PARAMETER[\"central_meridian\",-84.36666666666666"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_easting\",4000000],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",0],AUTHORITY[\"EPSG\",\"3592\"],AXIS[\"X\",E"); + add_srs_wkt (p, 14, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3593, "epsg", 3593, + "NAD83(NSRS2007) / Michigan South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41"); + add_proj4text (p, 1, + ".5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 "); + add_proj4text (p, 2, + "+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Michigan South (ft)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9002\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"standard_parallel_1\",43.66666666666666],PARAME"); + add_srs_wkt (p, 10, + "TER[\"standard_parallel_2\",42.1],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 11, + "f_origin\",41.5],PARAMETER[\"central_meridian\",-84.3666"); + add_srs_wkt (p, 12, + "6666666666],PARAMETER[\"false_easting\",13123359.58],PAR"); + add_srs_wkt (p, 13, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3593\""); + add_srs_wkt (p, 14, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3594, "epsg", 3594, + "NAD83(NSRS2007) / Minnesota Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=4"); + add_proj4text (p, 1, + "5 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +to"); + add_proj4text (p, 2, "wgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Minnesota Central\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",47.05],PARAMETER[\"standard_par"); + add_srs_wkt (p, 10, + "allel_2\",45.61666666666667],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 11, + "gin\",45],PARAMETER[\"central_meridian\",-94.25],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_easting\",800000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",100000],AUTHORITY[\"EPSG\",\"3594\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 14, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3595, "epsg", 3595, + "NAD83(NSRS2007) / Minnesota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y"); + add_proj4text (p, 2, + "_0=100000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Minnesota North\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_1\",48.63333333333333],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "tandard_parallel_2\",47.03333333333333],PARAMETER[\"lati"); + add_srs_wkt (p, 11, + "tude_of_origin\",46.5],PARAMETER[\"central_meridian\",-9"); + add_srs_wkt (p, 12, + "3.1],PARAMETER[\"false_easting\",800000],PARAMETER[\"fal"); + add_srs_wkt (p, 13, + "se_northing\",100000],AUTHORITY[\"EPSG\",\"3595\"],AXIS["); + add_srs_wkt (p, 14, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3596, "epsg", 3596, + "NAD83(NSRS2007) / Minnesota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps="); + add_proj4text (p, 2, "GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Minnesota South\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_1\",45.21666666666667],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "tandard_parallel_2\",43.78333333333333],PARAMETER[\"lati"); + add_srs_wkt (p, 11, + "tude_of_origin\",43],PARAMETER[\"central_meridian\",-94]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"false_easting\",800000],PARAMETER[\"false_n"); + add_srs_wkt (p, 13, + "orthing\",100000],AUTHORITY[\"EPSG\",\"3596\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3597, "epsg", 3597, + "NAD83(NSRS2007) / Mississippi East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Mississippi East\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",29.5],PARAMETER[\"central_meridian\",-88"); + add_srs_wkt (p, 10, + ".83333333333333],PARAMETER[\"scale_factor\",0.99995],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",300000],PARAMETER[\"false_north"); + add_srs_wkt (p, 12, + "ing\",0],AUTHORITY[\"EPSG\",\"3597\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 13, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3598, "epsg", 3598, + "NAD83(NSRS2007) / Mississippi East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84"); + add_proj4text (p, 2, "=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Mississippi East (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_R"); + add_srs_wkt (p, 2, + "eference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 3, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 5, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 8, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transver"); + add_srs_wkt (p, 9, + "se_Mercator\"],PARAMETER[\"latitude_of_origin\",29.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"central_meridian\",-88.83333333333333],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"scale_factor\",0.99995],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",984250.0000000002],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 13, + "ORITY[\"EPSG\",\"3598\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 14, "TH]]"); + p = add_epsg_def (first, last, 3599, "epsg", 3599, + "NAD83(NSRS2007) / Mississippi West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=700000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Mississippi West\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",29.5],PARAMETER[\"central_meridian\",-90"); + add_srs_wkt (p, 10, + ".33333333333333],PARAMETER[\"scale_factor\",0.99995],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",700000],PARAMETER[\"false_north"); + add_srs_wkt (p, 12, + "ing\",0],AUTHORITY[\"EPSG\",\"3599\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 13, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3600, "epsg", 3600, + "NAD83(NSRS2007) / Mississippi West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +towgs84"); + add_proj4text (p, 2, "=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Mississippi West (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_R"); + add_srs_wkt (p, 2, + "eference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 3, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 5, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 8, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transver"); + add_srs_wkt (p, 9, + "se_Mercator\"],PARAMETER[\"latitude_of_origin\",29.5],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"central_meridian\",-90.33333333333333],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"scale_factor\",0.99995],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",2296583.333],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"3600\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3601, "epsg", 3601, + "NAD83(NSRS2007) / Missouri Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.9"); + add_proj4text (p, 1, + "99933333 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,"); + add_proj4text (p, 2, "0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Missouri Central\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",35.83333333333334],PARAMETER[\"central_m"); + add_srs_wkt (p, 10, + "eridian\",-92.5],PARAMETER[\"scale_factor\",0.999933333]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",500000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",0],AUTHORITY[\"EPSG\",\"3601\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 13, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3602, "epsg", 3602, + "NAD83(NSRS2007) / Missouri East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.9"); + add_proj4text (p, 1, + "99933333 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,"); + add_proj4text (p, 2, "0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Missouri East\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",35.83333333333334],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",-90.5],PARAMETER[\"scale_factor\",0.999933333],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",250000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",0],AUTHORITY[\"EPSG\",\"3602\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3603, "epsg", 3603, + "NAD83(NSRS2007) / Missouri West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.9"); + add_proj4text (p, 1, + "99941177 +x_0=850000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,"); + add_proj4text (p, 2, "0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Missouri West\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",36.16666666666666],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",-94.5],PARAMETER[\"scale_factor\",0.999941177],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",850000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",0],AUTHORITY[\"EPSG\",\"3603\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3604, "epsg", 3604, + "NAD83(NSRS2007) / Montana"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5"); + add_proj4text (p, 1, + " +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Montana\",GEOGCS[\"NAD83(NSRS"); + add_srs_wkt (p, 1, + "2007)\",DATUM[\"NAD83_National_Spatial_Reference_System_"); + add_srs_wkt (p, 2, + "2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4759\"]"); + add_srs_wkt (p, 7, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standar"); + add_srs_wkt (p, 9, + "d_parallel_1\",49],PARAMETER[\"standard_parallel_2\",45]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"latitude_of_origin\",44.25],PARAMETER[\"cen"); + add_srs_wkt (p, 11, + "tral_meridian\",-109.5],PARAMETER[\"false_easting\",6000"); + add_srs_wkt (p, 12, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "3604\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3605, "epsg", 3605, + "NAD83(NSRS2007) / Montana (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5"); + add_proj4text (p, 1, + " +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,"); + add_proj4text (p, 2, "0,0,0,0 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Montana (ft)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"9002\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",49],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 10, + "el_2\",45],PARAMETER[\"latitude_of_origin\",44.25],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"central_meridian\",-109.5],PARAMETER[\"false_east"); + add_srs_wkt (p, 12, + "ing\",1968503.937],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 13, + "RITY[\"EPSG\",\"3605\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 14, "H]]"); + p = add_epsg_def (first, last, 3606, "epsg", 3606, + "NAD83(NSRS2007) / Nebraska"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +"); + add_proj4text (p, 1, + "lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,"); + add_proj4text (p, 2, "0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Nebraska\",GEOGCS[\"NAD83(NSR"); + add_srs_wkt (p, 1, + "S2007)\",DATUM[\"NAD83_National_Spatial_Reference_System"); + add_srs_wkt (p, 2, + "_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 5, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4759\""); + add_srs_wkt (p, 7, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",43],PARAMETER[\"standard_parallel_2\",40"); + add_srs_wkt (p, 10, + "],PARAMETER[\"latitude_of_origin\",39.83333333333334],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"central_meridian\",-100],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"3606\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3607, "epsg", 3607, + "NAD83(NSRS2007) / Nevada Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,"); + add_proj4text (p, 2, "0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Nevada Central\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",34.75],PARAMETER[\"central_meridian\",-116."); + add_srs_wkt (p, 10, + "6666666666667],PARAMETER[\"scale_factor\",0.9999],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 12, + "\",6000000],AUTHORITY[\"EPSG\",\"3607\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 13, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3608, "epsg", 3608, + "NAD83(NSRS2007) / Nevada Central (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +tow"); + add_proj4text (p, 2, "gs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Nevada Central (ft US)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Re"); + add_srs_wkt (p, 2, + "ference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298."); + add_srs_wkt (p, 3, + "257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transvers"); + add_srs_wkt (p, 9, + "e_Mercator\"],PARAMETER[\"latitude_of_origin\",34.75],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"central_meridian\",-116.6666666666667],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "1640416.6667],PARAMETER[\"false_northing\",19685000],AUT"); + add_srs_wkt (p, 13, + "HORITY[\"EPSG\",\"3608\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 14, "RTH]]"); + p = add_epsg_def (first, last, 3609, "epsg", 3609, + "NAD83(NSRS2007) / Nevada East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=200000 +y_0=8000000 +ellps=GRS80 +towgs84=0,0,"); + add_proj4text (p, 2, "0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Nevada East\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",34.75],PARAMETER[\"central_meridian\",-115.58"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"scale_factor\",0.9999],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_easting\",200000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",8000000],AUTHORITY[\"EPSG\",\"3609\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3610, "epsg", 3610, + "NAD83(NSRS2007) / Nevada East (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps="); + add_proj4text (p, 2, "GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Nevada East (ft US)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",34.75],PARA"); + add_srs_wkt (p, 10, + "METER[\"central_meridian\",-115.5833333333333],PARAMETER"); + add_srs_wkt (p, 11, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",65"); + add_srs_wkt (p, 12, + "6166.6667],PARAMETER[\"false_northing\",26246666.6667000"); + add_srs_wkt (p, 13, + "1],AUTHORITY[\"EPSG\",\"3610\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3611, "epsg", 3611, + "NAD83(NSRS2007) / Nevada West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=800000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,"); + add_proj4text (p, 2, "0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Nevada West\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",34.75],PARAMETER[\"central_meridian\",-118.58"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"scale_factor\",0.9999],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_easting\",800000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",4000000],AUTHORITY[\"EPSG\",\"3611\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3612, "epsg", 3612, + "NAD83(NSRS2007) / Nevada West (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps"); + add_proj4text (p, 2, "=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Nevada West (ft US)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",34.75],PARA"); + add_srs_wkt (p, 10, + "METER[\"central_meridian\",-118.5833333333333],PARAMETER"); + add_srs_wkt (p, 11, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",26"); + add_srs_wkt (p, 12, + "24666.6667],PARAMETER[\"false_northing\",13123333.3333],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"3612\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 3613, "epsg", 3613, + "NAD83(NSRS2007) / New Hampshire"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,"); + add_proj4text (p, 2, "0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New Hampshire\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",42.5],PARAMETER[\"central_meridian\",-71.66"); + add_srs_wkt (p, 10, + "666666666667],PARAMETER[\"scale_factor\",0.999966667],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",300000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",0],AUTHORITY[\"EPSG\",\"3613\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3614, "epsg", 3614, + "NAD83(NSRS2007) / New Hampshire (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +tow"); + add_proj4text (p, 2, "gs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New Hampshire (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 8, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 9, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",42.5],PARA"); + add_srs_wkt (p, 10, + "METER[\"central_meridian\",-71.66666666666667],PARAMETER"); + add_srs_wkt (p, 11, + "[\"scale_factor\",0.999966667],PARAMETER[\"false_easting"); + add_srs_wkt (p, 12, + "\",984250.0000000002],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 13, + "THORITY[\"EPSG\",\"3614\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 14, "ORTH]]"); + p = add_epsg_def (first, last, 3615, "epsg", 3615, + "NAD83(NSRS2007) / New Jersey"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0"); + add_proj4text (p, 2, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New Jersey\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",38.83333333333334],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 10, + "n\",-74.5],PARAMETER[\"scale_factor\",0.9999],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",150000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3615\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3616, "epsg", 3616, + "NAD83(NSRS2007) / New Jersey (ft US)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0"); + add_proj4text (p, 2, ",0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New Jersey (ft US)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 9, + "cator\"],PARAMETER[\"latitude_of_origin\",38.83333333333"); + add_srs_wkt (p, 10, + "334],PARAMETER[\"central_meridian\",-74.5],PARAMETER[\"s"); + add_srs_wkt (p, 11, + "cale_factor\",0.9999],PARAMETER[\"false_easting\",492125"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3"); + add_srs_wkt (p, 13, "616\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3617, "epsg", 3617, + "NAD83(NSRS2007) / New Mexico Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=5000"); + add_proj4text (p, 1, + "00 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New Mexico Central\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",31],PARAMETER[\"central_meridian\",-106."); + add_srs_wkt (p, 10, + "25],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_easting\",500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"3617\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 13, "H]]"); + p = add_epsg_def (first, last, 3618, "epsg", 3618, + "NAD83(NSRS2007) / New Mexico Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=5000"); + add_proj4text (p, 1, + "00.0001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 2, " +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New Mexico Central (ftUS)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial"); + add_srs_wkt (p, 2, + "_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,2"); + add_srs_wkt (p, 3, + "98.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 5, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 6, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609"); + add_srs_wkt (p, 8, + "6012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Trans"); + add_srs_wkt (p, 9, + "verse_Mercator\"],PARAMETER[\"latitude_of_origin\",31],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"central_meridian\",-106.25],PARAMETER[\"scale"); + add_srs_wkt (p, 11, + "_factor\",0.9999],PARAMETER[\"false_easting\",1640416.66"); + add_srs_wkt (p, 12, + "7],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "3618\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3619, "epsg", 3619, + "NAD83(NSRS2007) / New Mexico East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999"); + add_proj4text (p, 1, + "909091 +x_0=165000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 2, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New Mexico East\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",31],PARAMETER[\"central_meridian\",-104.3"); + add_srs_wkt (p, 10, + "333333333333],PARAMETER[\"scale_factor\",0.999909091],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",165000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",0],AUTHORITY[\"EPSG\",\"3619\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3620, "epsg", 3620, + "NAD83(NSRS2007) / New Mexico East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999"); + add_proj4text (p, 1, + "909091 +x_0=165000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 2, "0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New Mexico East (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Re"); + add_srs_wkt (p, 2, + "ference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298."); + add_srs_wkt (p, 3, + "257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transvers"); + add_srs_wkt (p, 9, + "e_Mercator\"],PARAMETER[\"latitude_of_origin\",31],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"central_meridian\",-104.3333333333333],PARAMETER["); + add_srs_wkt (p, 11, + "\"scale_factor\",0.999909091],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",541337.5],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 13, "PSG\",\"3620\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3621, "epsg", 3621, + "NAD83(NSRS2007) / New Mexico West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999"); + add_proj4text (p, 1, + "916667 +x_0=830000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 2, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New Mexico West\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 9, + "de_of_origin\",31],PARAMETER[\"central_meridian\",-107.8"); + add_srs_wkt (p, 10, + "333333333333],PARAMETER[\"scale_factor\",0.999916667],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",830000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",0],AUTHORITY[\"EPSG\",\"3621\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3622, "epsg", 3622, + "NAD83(NSRS2007) / New Mexico West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999"); + add_proj4text (p, 1, + "916667 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +towgs"); + add_proj4text (p, 2, "84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New Mexico West (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Re"); + add_srs_wkt (p, 2, + "ference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298."); + add_srs_wkt (p, 3, + "257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transvers"); + add_srs_wkt (p, 9, + "e_Mercator\"],PARAMETER[\"latitude_of_origin\",31],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"central_meridian\",-107.8333333333333],PARAMETER["); + add_srs_wkt (p, 11, + "\"scale_factor\",0.999916667],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",2723091.667],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"3622\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3623, "epsg", 3623, + "NAD83(NSRS2007) / New York Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New York Central\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",40],PARAMETER[\"central_meridian\",-76.5"); + add_srs_wkt (p, 10, + "8333333333333],PARAMETER[\"scale_factor\",0.9999375],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",250000],PARAMETER[\"false_north"); + add_srs_wkt (p, 12, + "ing\",0],AUTHORITY[\"EPSG\",\"3623\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 13, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3624, "epsg", 3624, + "NAD83(NSRS2007) / New York Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +towgs84"); + add_proj4text (p, 2, "=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New York Central (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_R"); + add_srs_wkt (p, 2, + "eference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 3, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 5, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 8, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transver"); + add_srs_wkt (p, 9, + "se_Mercator\"],PARAMETER[\"latitude_of_origin\",40],PARA"); + add_srs_wkt (p, 10, + "METER[\"central_meridian\",-76.58333333333333],PARAMETER"); + add_srs_wkt (p, 11, + "[\"scale_factor\",0.9999375],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",820208.3330000002],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 13, + "ORITY[\"EPSG\",\"3624\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 14, "TH]]"); + p = add_epsg_def (first, last, 3625, "epsg", 3625, + "NAD83(NSRS2007) / New York East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0"); + add_proj4text (p, 2, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New York East\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",38.83333333333334],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",-74.5],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",150000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"3625\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3626, "epsg", 3626, + "NAD83(NSRS2007) / New York East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0"); + add_proj4text (p, 2, ",0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New York East (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 8, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 9, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",38.8333333"); + add_srs_wkt (p, 10, + "3333334],PARAMETER[\"central_meridian\",-74.5],PARAMETER"); + add_srs_wkt (p, 11, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",49"); + add_srs_wkt (p, 12, + "2125],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"3626\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3627, "epsg", 3627, + "NAD83(NSRS2007) / New York Long Island"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0"); + add_proj4text (p, 2, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New York Long Island\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"standard_parallel_1\",41.03333333333333],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"standard_parallel_2\",40.66666666666666],PARAMETER[\""); + add_srs_wkt (p, 11, + "latitude_of_origin\",40.16666666666666],PARAMETER[\"cent"); + add_srs_wkt (p, 12, + "ral_meridian\",-74],PARAMETER[\"false_easting\",300000],"); + add_srs_wkt (p, 13, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"362"); + add_srs_wkt (p, 14, "7\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3628, "epsg", 3628, + "NAD83(NSRS2007) / New York Long Island (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000"); + add_proj4text (p, 2, + "000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units"); + add_proj4text (p, 3, "=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New York Long Island (ftUS)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spati"); + add_srs_wkt (p, 2, + "al_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 3, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006"); + add_srs_wkt (p, 8, + "096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lam"); + add_srs_wkt (p, 9, + "bert_Conformal_Conic_2SP\"],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 10, + "l_1\",41.03333333333333],PARAMETER[\"standard_parallel_2"); + add_srs_wkt (p, 11, + "\",40.66666666666666],PARAMETER[\"latitude_of_origin\",4"); + add_srs_wkt (p, 12, + "0.16666666666666],PARAMETER[\"central_meridian\",-74],PA"); + add_srs_wkt (p, 13, + "RAMETER[\"false_easting\",984250.0000000002],PARAMETER[\""); + add_srs_wkt (p, 14, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3628\"],AXIS[\""); + add_srs_wkt (p, 15, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3629, "epsg", 3629, + "NAD83(NSRS2007) / New York West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=350000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New York West\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",40],PARAMETER[\"central_meridian\",-78.5833"); + add_srs_wkt (p, 10, + "3333333333],PARAMETER[\"scale_factor\",0.9999375],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",350000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 12, + "\",0],AUTHORITY[\"EPSG\",\"3629\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3630, "epsg", 3630, + "NAD83(NSRS2007) / New York West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +towgs84"); + add_proj4text (p, 2, "=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / New York West (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 8, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 9, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",40],PARAME"); + add_srs_wkt (p, 10, + "TER[\"central_meridian\",-78.58333333333333],PARAMETER[\""); + add_srs_wkt (p, 11, + "scale_factor\",0.9999375],PARAMETER[\"false_easting\",11"); + add_srs_wkt (p, 12, + "48291.667],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 13, "PSG\",\"3630\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3631, "epsg", 3631, + "NAD83(NSRS2007) / North Carolina"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps"); + add_proj4text (p, 2, "=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / North Carolina\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",36.16666666666666],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",34.33333333333334],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",33.75],PARAMETER[\"central_meridian\",-79"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_easting\",609601.22],PARAMETER[\"fal"); + add_srs_wkt (p, 13, + "se_northing\",0],AUTHORITY[\"EPSG\",\"3631\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3632, "epsg", 3632, + "NAD83(NSRS2007) / North Carolina (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0="); + add_proj4text (p, 2, + "0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / North Carolina (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "36.16666666666666],PARAMETER[\"standard_parallel_2\",34."); + add_srs_wkt (p, 11, + "33333333333334],PARAMETER[\"latitude_of_origin\",33.75],"); + add_srs_wkt (p, 12, + "PARAMETER[\"central_meridian\",-79],PARAMETER[\"false_ea"); + add_srs_wkt (p, 13, + "sting\",2000000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 14, + "TY[\"EPSG\",\"3632\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 15, "]"); + p = add_epsg_def (first, last, 3633, "epsg", 3633, + "NAD83(NSRS2007) / North Dakota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333"); + add_proj4text (p, 1, + "333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GR"); + add_proj4text (p, 2, "S80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / North Dakota North\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",48.73333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",47.43333333333333],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",47],PARAMETER[\"central_meridian\",-10"); + add_srs_wkt (p, 12, + "0.5],PARAMETER[\"false_easting\",600000],PARAMETER[\"fal"); + add_srs_wkt (p, 13, + "se_northing\",0],AUTHORITY[\"EPSG\",\"3633\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3634, "epsg", 3634, + "NAD83(NSRS2007) / North Dakota North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333"); + add_proj4text (p, 1, + "333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +"); + add_proj4text (p, 2, + "ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / North Dakota North (ft)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_R"); + add_srs_wkt (p, 2, + "eference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 3, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 5, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9002\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],"); + add_srs_wkt (p, 9, + "PARAMETER[\"standard_parallel_1\",48.73333333333333],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"standard_parallel_2\",47.43333333333333],PARAME"); + add_srs_wkt (p, 11, + "TER[\"latitude_of_origin\",47],PARAMETER[\"central_merid"); + add_srs_wkt (p, 12, + "ian\",-100.5],PARAMETER[\"false_easting\",1968503.937],P"); + add_srs_wkt (p, 13, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3634"); + add_srs_wkt (p, 14, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3635, "epsg", 3635, + "NAD83(NSRS2007) / North Dakota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333"); + add_proj4text (p, 1, + "333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +"); + add_proj4text (p, 2, + "y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / North Dakota South\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",47.48333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",46.18333333333333],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",45.66666666666666],PARAMETER[\"central"); + add_srs_wkt (p, 12, + "_meridian\",-100.5],PARAMETER[\"false_easting\",600000],"); + add_srs_wkt (p, 13, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"363"); + add_srs_wkt (p, 14, "5\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3636, "epsg", 3636, + "NAD83(NSRS2007) / North Dakota South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333"); + add_proj4text (p, 1, + "333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9"); + add_proj4text (p, 2, + "999976 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units"); + add_proj4text (p, 3, "=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / North Dakota South (ft)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_R"); + add_srs_wkt (p, 2, + "eference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 3, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 5, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9002\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],"); + add_srs_wkt (p, 9, + "PARAMETER[\"standard_parallel_1\",47.48333333333333],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"standard_parallel_2\",46.18333333333333],PARAME"); + add_srs_wkt (p, 11, + "TER[\"latitude_of_origin\",45.66666666666666],PARAMETER["); + add_srs_wkt (p, 12, + "\"central_meridian\",-100.5],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 13, + ",1968503.937],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 14, + "\"EPSG\",\"3636\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3637, "epsg", 3637, + "NAD83(NSRS2007) / Ohio North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Ohio North\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_1\",41.7],PARAMETER[\"standard_parallel_2"); + add_srs_wkt (p, 10, + "\",40.43333333333333],PARAMETER[\"latitude_of_origin\",3"); + add_srs_wkt (p, 11, + "9.66666666666666],PARAMETER[\"central_meridian\",-82.5],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_easting\",600000],PARAMETER[\"false_no"); + add_srs_wkt (p, 13, + "rthing\",0],AUTHORITY[\"EPSG\",\"3637\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 14, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3638, "epsg", 3638, + "NAD83(NSRS2007) / Ohio South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Ohio South\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_1\",40.03333333333333],PARAMETER[\"standa"); + add_srs_wkt (p, 10, + "rd_parallel_2\",38.73333333333333],PARAMETER[\"latitude_"); + add_srs_wkt (p, 11, + "of_origin\",38],PARAMETER[\"central_meridian\",-82.5],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_easting\",600000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 13, + "hing\",0],AUTHORITY[\"EPSG\",\"3638\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 14, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3639, "epsg", 3639, + "NAD83(NSRS2007) / Oklahoma North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Oklahoma North\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",36.76666666666667],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",35.56666666666667],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",35],PARAMETER[\"central_meridian\",-98],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_easting\",600000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 13, + "thing\",0],AUTHORITY[\"EPSG\",\"3639\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 14, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3640, "epsg", 3640, + "NAD83(NSRS2007) / Oklahoma North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Oklahoma North (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "36.76666666666667],PARAMETER[\"standard_parallel_2\",35."); + add_srs_wkt (p, 11, + "56666666666667],PARAMETER[\"latitude_of_origin\",35],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"central_meridian\",-98],PARAMETER[\"false_easti"); + add_srs_wkt (p, 13, + "ng\",1968500],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 14, + "\"EPSG\",\"3640\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3641, "epsg", 3641, + "NAD83(NSRS2007) / Oklahoma South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0"); + add_proj4text (p, 2, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Oklahoma South\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",35.23333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",33.93333333333333],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",33.33333333333334],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-98],PARAMETER[\"false_easting\",600000],PARAME"); + add_srs_wkt (p, 13, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3641\"],A"); + add_srs_wkt (p, 14, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3642, "epsg", 3642, + "NAD83(NSRS2007) / Oklahoma South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0"); + add_proj4text (p, 2, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_"); + add_proj4text (p, 3, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Oklahoma South (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "35.23333333333333],PARAMETER[\"standard_parallel_2\",33."); + add_srs_wkt (p, 11, + "93333333333333],PARAMETER[\"latitude_of_origin\",33.3333"); + add_srs_wkt (p, 12, + "3333333334],PARAMETER[\"central_meridian\",-98],PARAMETE"); + add_srs_wkt (p, 13, + "R[\"false_easting\",1968500],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 14, + ",0],AUTHORITY[\"EPSG\",\"3642\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 15, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3643, "epsg", 3643, + "NAD83(NSRS2007) / Oregon Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120"); + add_proj4text (p, 1, + ".5 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,"); + add_proj4text (p, 2, "0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Oregon Lambert\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",43],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 10, + "2\",45.5],PARAMETER[\"latitude_of_origin\",41.75],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-120.5],PARAMETER[\"false_easti"); + add_srs_wkt (p, 12, + "ng\",400000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"3643\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3644, "epsg", 3644, + "NAD83(NSRS2007) / Oregon Lambert (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120"); + add_proj4text (p, 1, + ".5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +towgs84=0,0,"); + add_proj4text (p, 2, "0,0,0,0,0 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Oregon Lambert (ft)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9002\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"standard_parallel_1\",43],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",45.5],PARAMETER[\"latitude_of_origin\",41.7"); + add_srs_wkt (p, 11, + "5],PARAMETER[\"central_meridian\",-120.5],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_easting\",1312335.958],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 13, + "0],AUTHORITY[\"EPSG\",\"3644\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3645, "epsg", 3645, + "NAD83(NSRS2007) / Oregon North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Oregon North\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",46],PARAMETER[\"standard_parallel_2"); + add_srs_wkt (p, 10, + "\",44.33333333333334],PARAMETER[\"latitude_of_origin\",4"); + add_srs_wkt (p, 11, + "3.66666666666666],PARAMETER[\"central_meridian\",-120.5]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"false_easting\",2500000],PARAMETER[\"false_"); + add_srs_wkt (p, 13, + "northing\",0],AUTHORITY[\"EPSG\",\"3645\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 14, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3646, "epsg", 3646, + "NAD83(NSRS2007) / Oregon North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 "); + add_proj4text (p, 2, + "+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Oregon North (ft)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "02\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"standard_parallel_1\",46],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 10, + "rallel_2\",44.33333333333334],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 11, + "igin\",43.66666666666666],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 12, + ",-120.5],PARAMETER[\"false_easting\",8202099.738],PARAME"); + add_srs_wkt (p, 13, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3646\"],A"); + add_srs_wkt (p, 14, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3647, "epsg", 3647, + "NAD83(NSRS2007) / Oregon South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Oregon South\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",44],PARAMETER[\"standard_parallel_2"); + add_srs_wkt (p, 10, + "\",42.33333333333334],PARAMETER[\"latitude_of_origin\",4"); + add_srs_wkt (p, 11, + "1.66666666666666],PARAMETER[\"central_meridian\",-120.5]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"false_easting\",1500000],PARAMETER[\"false_"); + add_srs_wkt (p, 13, + "northing\",0],AUTHORITY[\"EPSG\",\"3647\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 14, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3648, "epsg", 3648, + "NAD83(NSRS2007) / Oregon South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 "); + add_proj4text (p, 2, + "+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Oregon South (ft)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "02\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"standard_parallel_1\",44],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 10, + "rallel_2\",42.33333333333334],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 11, + "igin\",41.66666666666666],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 12, + ",-120.5],PARAMETER[\"false_easting\",4921259.843],PARAME"); + add_srs_wkt (p, 13, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3648\"],A"); + add_srs_wkt (p, 14, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3649, "epsg", 3649, + "NAD83(NSRS2007) / Pennsylvania North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=4"); + add_proj4text (p, 1, + "0.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps"); + add_proj4text (p, 2, "=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Pennsylvania North\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",41.95],PARAMETER[\"standard_par"); + add_srs_wkt (p, 10, + "allel_2\",40.88333333333333],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 11, + "gin\",40.16666666666666],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 12, + "-77.75],PARAMETER[\"false_easting\",600000],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3649\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3650, "epsg", 3650, + "NAD83(NSRS2007) / Pennsylvania North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=4"); + add_proj4text (p, 1, + "0.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps"); + add_proj4text (p, 2, "=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Pennsylvania North (ftUS)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial"); + add_srs_wkt (p, 2, + "_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,2"); + add_srs_wkt (p, 3, + "98.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 5, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 6, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609"); + add_srs_wkt (p, 8, + "6012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambe"); + add_srs_wkt (p, 9, + "rt_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 10, + "1\",41.95],PARAMETER[\"standard_parallel_2\",40.88333333"); + add_srs_wkt (p, 11, + "333333],PARAMETER[\"latitude_of_origin\",40.166666666666"); + add_srs_wkt (p, 12, + "66],PARAMETER[\"central_meridian\",-77.75],PARAMETER[\"f"); + add_srs_wkt (p, 13, + "alse_easting\",1968500],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 14, + "AUTHORITY[\"EPSG\",\"3650\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 15, ",NORTH]]"); + p = add_epsg_def (first, last, 3651, "epsg", 3651, + "NAD83(NSRS2007) / Pennsylvania South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +"); + add_proj4text (p, 2, + "y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Pennsylvania South\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",40.96666666666667],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",39.93333333333333],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",39.33333333333334],PARAMETER[\"central"); + add_srs_wkt (p, 12, + "_meridian\",-77.75],PARAMETER[\"false_easting\",600000],"); + add_srs_wkt (p, 13, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"365"); + add_srs_wkt (p, 14, "1\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3652, "epsg", 3652, + "NAD83(NSRS2007) / Pennsylvania South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +"); + add_proj4text (p, 2, + "y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Pennsylvania South (ftUS)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial"); + add_srs_wkt (p, 2, + "_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,2"); + add_srs_wkt (p, 3, + "98.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 5, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 6, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609"); + add_srs_wkt (p, 8, + "6012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambe"); + add_srs_wkt (p, 9, + "rt_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 10, + "1\",40.96666666666667],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 11, + ",39.93333333333333],PARAMETER[\"latitude_of_origin\",39."); + add_srs_wkt (p, 12, + "33333333333334],PARAMETER[\"central_meridian\",-77.75],P"); + add_srs_wkt (p, 13, + "ARAMETER[\"false_easting\",1968500],PARAMETER[\"false_no"); + add_srs_wkt (p, 14, + "rthing\",0],AUTHORITY[\"EPSG\",\"3652\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 15, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3653, "epsg", 3653, + "NAD83(NSRS2007) / Rhode Island"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.9"); + add_proj4text (p, 1, + "9999375 +x_0=100000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0"); + add_proj4text (p, 2, ",0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Rhode Island\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",41.08333333333334],PARAMETER[\"central_merid"); + add_srs_wkt (p, 10, + "ian\",-71.5],PARAMETER[\"scale_factor\",0.99999375],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_easting\",100000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 12, + "ng\",0],AUTHORITY[\"EPSG\",\"3653\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3654, "epsg", 3654, + "NAD83(NSRS2007) / Rhode Island (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.9"); + add_proj4text (p, 1, + "9999375 +x_0=99999.99998983997 +y_0=0 +ellps=GRS80 +towg"); + add_proj4text (p, 2, "s84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Rhode Island (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",41.08333333"); + add_srs_wkt (p, 10, + "333334],PARAMETER[\"central_meridian\",-71.5],PARAMETER["); + add_srs_wkt (p, 11, + "\"scale_factor\",0.99999375],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",328083.3333],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"3654\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3655, "epsg", 3655, + "NAD83(NSRS2007) / South Carolina"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31"); + add_proj4text (p, 1, + ".83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / South Carolina\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",34.83333333333334],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",32.5],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 11, + ",31.83333333333333],PARAMETER[\"central_meridian\",-81],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_easting\",609600],PARAMETER[\"false_no"); + add_srs_wkt (p, 13, + "rthing\",0],AUTHORITY[\"EPSG\",\"3655\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 14, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3656, "epsg", 3656, + "NAD83(NSRS2007) / South Carolina (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31"); + add_proj4text (p, 1, + ".83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / South Carolina (ft)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9002\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"standard_parallel_1\",34.83333333333334],PARAME"); + add_srs_wkt (p, 10, + "TER[\"standard_parallel_2\",32.5],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 11, + "f_origin\",31.83333333333333],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 12, + "an\",-81],PARAMETER[\"false_easting\",2000000],PARAMETER"); + add_srs_wkt (p, 13, + "[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3656\"],AXIS"); + add_srs_wkt (p, 14, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3657, "epsg", 3657, + "NAD83(NSRS2007) / South Dakota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666"); + add_proj4text (p, 1, + "666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_"); + add_proj4text (p, 2, + "0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_def"); + add_proj4text (p, 3, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / South Dakota North\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",45.68333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",44.41666666666666],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",43.83333333333334],PARAMETER[\"central"); + add_srs_wkt (p, 12, + "_meridian\",-100],PARAMETER[\"false_easting\",600000],PA"); + add_srs_wkt (p, 13, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3657\""); + add_srs_wkt (p, 14, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3658, "epsg", 3658, + "NAD83(NSRS2007) / South Dakota North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666"); + add_proj4text (p, 1, + "666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_"); + add_proj4text (p, 2, + "0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no"); + add_proj4text (p, 3, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / South Dakota North (ftUS)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial"); + add_srs_wkt (p, 2, + "_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,2"); + add_srs_wkt (p, 3, + "98.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 5, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 6, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609"); + add_srs_wkt (p, 8, + "6012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambe"); + add_srs_wkt (p, 9, + "rt_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 10, + "1\",45.68333333333333],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 11, + ",44.41666666666666],PARAMETER[\"latitude_of_origin\",43."); + add_srs_wkt (p, 12, + "83333333333334],PARAMETER[\"central_meridian\",-100],PAR"); + add_srs_wkt (p, 13, + "AMETER[\"false_easting\",1968500],PARAMETER[\"false_nort"); + add_srs_wkt (p, 14, + "hing\",0],AUTHORITY[\"EPSG\",\"3658\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 15, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3659, "epsg", 3659, + "NAD83(NSRS2007) / South Dakota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42"); + add_proj4text (p, 1, + ".33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y"); + add_proj4text (p, 2, + "_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_de"); + add_proj4text (p, 3, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / South Dakota South\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",44.4],PARAMETER[\"standard_para"); + add_srs_wkt (p, 10, + "llel_2\",42.83333333333334],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 11, + "in\",42.33333333333334],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 12, + "100.3333333333333],PARAMETER[\"false_easting\",600000],P"); + add_srs_wkt (p, 13, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3659"); + add_srs_wkt (p, 14, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3660, "epsg", 3660, + "NAD83(NSRS2007) / South Dakota South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42"); + add_proj4text (p, 1, + ".33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y"); + add_proj4text (p, 2, + "_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / South Dakota South (ftUS)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial"); + add_srs_wkt (p, 2, + "_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,2"); + add_srs_wkt (p, 3, + "98.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 5, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 6, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609"); + add_srs_wkt (p, 8, + "6012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambe"); + add_srs_wkt (p, 9, + "rt_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 10, + "1\",44.4],PARAMETER[\"standard_parallel_2\",42.833333333"); + add_srs_wkt (p, 11, + "33334],PARAMETER[\"latitude_of_origin\",42.3333333333333"); + add_srs_wkt (p, 12, + "4],PARAMETER[\"central_meridian\",-100.3333333333333],PA"); + add_srs_wkt (p, 13, + "RAMETER[\"false_easting\",1968500],PARAMETER[\"false_nor"); + add_srs_wkt (p, 14, + "thing\",0],AUTHORITY[\"EPSG\",\"3660\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 15, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3661, "epsg", 3661, + "NAD83(NSRS2007) / Tennessee"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=3"); + add_proj4text (p, 1, + "4.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GR"); + add_proj4text (p, 2, "S80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Tennessee\",GEOGCS[\"NAD83(NS"); + add_srs_wkt (p, 1, + "RS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syste"); + add_srs_wkt (p, 2, + "m_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4759"); + add_srs_wkt (p, 7, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_1\",36.41666666666666],PARAMETER[\"standar"); + add_srs_wkt (p, 10, + "d_parallel_2\",35.25],PARAMETER[\"latitude_of_origin\",3"); + add_srs_wkt (p, 11, + "4.33333333333334],PARAMETER[\"central_meridian\",-86],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_easting\",600000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 13, + "hing\",0],AUTHORITY[\"EPSG\",\"3661\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 14, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3662, "epsg", 3662, + "NAD83(NSRS2007) / Tennessee (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=3"); + add_proj4text (p, 1, + "4.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GR"); + add_proj4text (p, 2, "S80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Tennessee (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 9, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",36.41"); + add_srs_wkt (p, 10, + "666666666666],PARAMETER[\"standard_parallel_2\",35.25],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"latitude_of_origin\",34.33333333333334],PARAM"); + add_srs_wkt (p, 12, + "ETER[\"central_meridian\",-86],PARAMETER[\"false_easting"); + add_srs_wkt (p, 13, + "\",1968500],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 14, "EPSG\",\"3662\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3663, "epsg", 3663, + "NAD83(NSRS2007) / Texas Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666"); + add_proj4text (p, 1, + "667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +"); + add_proj4text (p, 2, + "x_0=700000 +y_0=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 3, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas Central\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_S"); + add_srs_wkt (p, 2, + "ystem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",31.88333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",30.11666666666667],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",29.66666666666667],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-100.3333333333333],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 13, + ",700000],PARAMETER[\"false_northing\",3000000],AUTHORITY"); + add_srs_wkt (p, 14, + "[\"EPSG\",\"3663\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3664, "epsg", 3664, + "NAD83(NSRS2007) / Texas Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666"); + add_proj4text (p, 1, + "667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +"); + add_proj4text (p, 2, + "x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +towgs84"); + add_proj4text (p, 3, "=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas Central (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 8, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 9, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",3"); + add_srs_wkt (p, 10, + "1.88333333333333],PARAMETER[\"standard_parallel_2\",30.1"); + add_srs_wkt (p, 11, + "1666666666667],PARAMETER[\"latitude_of_origin\",29.66666"); + add_srs_wkt (p, 12, + "666666667],PARAMETER[\"central_meridian\",-100.333333333"); + add_srs_wkt (p, 13, + "3333],PARAMETER[\"false_easting\",2296583.333],PARAMETER"); + add_srs_wkt (p, 14, + "[\"false_northing\",9842500.000000002],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 15, ",\"3664\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3665, "epsg", 3665, + "NAD83(NSRS2007) / Texas Centric Albers Equal Area"); + add_proj4text (p, 0, + "+proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x"); + add_proj4text (p, 1, + "_0=1500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas Centric Albers Equal Ar"); + add_srs_wkt (p, 1, + "ea\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_S"); + add_srs_wkt (p, 2, + "patial_Reference_System_2007\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 3, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84"); + add_srs_wkt (p, 4, + "[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"G"); + add_srs_wkt (p, 5, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 6, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 8, + "EPSG\",\"9001\"]],PROJECTION[\"Albers_Conic_Equal_Area\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"standard_parallel_1\",27.5],PARAMETER[\"st"); + add_srs_wkt (p, 10, + "andard_parallel_2\",35],PARAMETER[\"latitude_of_center\""); + add_srs_wkt (p, 11, + ",18],PARAMETER[\"longitude_of_center\",-100],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",1500000],PARAMETER[\"false_northing\",60"); + add_srs_wkt (p, 13, + "00000],AUTHORITY[\"EPSG\",\"3665\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 14, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3666, "epsg", 3666, + "NAD83(NSRS2007) / Texas Centric Lambert Conformal"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x"); + add_proj4text (p, 1, + "_0=1500000 +y_0=5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas Centric Lambert Conform"); + add_srs_wkt (p, 1, + "al\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_S"); + add_srs_wkt (p, 2, + "patial_Reference_System_2007\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 3, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84"); + add_srs_wkt (p, 4, + "[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"G"); + add_srs_wkt (p, 5, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 6, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 8, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 9, + "SP\"],PARAMETER[\"standard_parallel_1\",27.5],PARAMETER["); + add_srs_wkt (p, 10, + "\"standard_parallel_2\",35],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 11, + "in\",18],PARAMETER[\"central_meridian\",-100],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_easting\",1500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 13, + "5000000],AUTHORITY[\"EPSG\",\"3666\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 14, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3667, "epsg", 3667, + "NAD83(NSRS2007) / Texas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=3"); + add_proj4text (p, 1, + "4 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +t"); + add_proj4text (p, 2, "owgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas North\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",36.18333333333333],PARAMETER[\"stand"); + add_srs_wkt (p, 10, + "ard_parallel_2\",34.65],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 11, + ",34],PARAMETER[\"central_meridian\",-101.5],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",200000],PARAMETER[\"false_northing\",100"); + add_srs_wkt (p, 13, + "0000],AUTHORITY[\"EPSG\",\"3667\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 14, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3668, "epsg", 3668, + "NAD83(NSRS2007) / Texas North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=3"); + add_proj4text (p, 1, + "4 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.99989"); + add_proj4text (p, 2, + "83998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 9, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",36.18"); + add_srs_wkt (p, 10, + "333333333333],PARAMETER[\"standard_parallel_2\",34.65],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"latitude_of_origin\",34],PARAMETER[\"central_"); + add_srs_wkt (p, 12, + "meridian\",-101.5],PARAMETER[\"false_easting\",656166.66"); + add_srs_wkt (p, 13, + "7],PARAMETER[\"false_northing\",3280833.333],AUTHORITY[\""); + add_srs_wkt (p, 14, "EPSG\",\"3668\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3669, "epsg", 3669, + "NAD83(NSRS2007) / Texas North Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333"); + add_proj4text (p, 1, + "333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y"); + add_proj4text (p, 2, + "_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas North Central\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"standard_parallel_1\",33.96666666666667],PARAMETER"); + add_srs_wkt (p, 10, + "[\"standard_parallel_2\",32.13333333333333],PARAMETER[\""); + add_srs_wkt (p, 11, + "latitude_of_origin\",31.66666666666667],PARAMETER[\"cent"); + add_srs_wkt (p, 12, + "ral_meridian\",-98.5],PARAMETER[\"false_easting\",600000"); + add_srs_wkt (p, 13, + "],PARAMETER[\"false_northing\",2000000],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 14, "\",\"3669\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3670, "epsg", 3670, + "NAD83(NSRS2007) / Texas North Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333"); + add_proj4text (p, 1, + "333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y"); + add_proj4text (p, 2, + "_0=2000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 3, "units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas North Central (ftUS)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatia"); + add_srs_wkt (p, 2, + "l_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,"); + add_srs_wkt (p, 3, + "298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 5, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 6, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060"); + add_srs_wkt (p, 8, + "96012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamb"); + add_srs_wkt (p, 9, + "ert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 10, + "_1\",33.96666666666667],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 11, + ",32.13333333333333],PARAMETER[\"latitude_of_origin\",31."); + add_srs_wkt (p, 12, + "66666666666667],PARAMETER[\"central_meridian\",-98.5],PA"); + add_srs_wkt (p, 13, + "RAMETER[\"false_easting\",1968500],PARAMETER[\"false_nor"); + add_srs_wkt (p, 14, + "thing\",6561666.667],AUTHORITY[\"EPSG\",\"3670\"],AXIS[\""); + add_srs_wkt (p, 15, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3671, "epsg", 3671, + "NAD83(NSRS2007) / Texas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y"); + add_proj4text (p, 2, + "_0=5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas South\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",27.83333333333333],PARAMETER[\"stand"); + add_srs_wkt (p, 10, + "ard_parallel_2\",26.16666666666667],PARAMETER[\"latitude"); + add_srs_wkt (p, 11, + "_of_origin\",25.66666666666667],PARAMETER[\"central_meri"); + add_srs_wkt (p, 12, + "dian\",-98.5],PARAMETER[\"false_easting\",300000],PARAME"); + add_srs_wkt (p, 13, + "TER[\"false_northing\",5000000],AUTHORITY[\"EPSG\",\"367"); + add_srs_wkt (p, 14, "1\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3672, "epsg", 3672, + "NAD83(NSRS2007) / Texas South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.00"); + add_proj4text (p, 2, + "00000001 +y_0=5000000.0001016 +ellps=GRS80 +towgs84=0,0,"); + add_proj4text (p, 3, "0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 9, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",27.83"); + add_srs_wkt (p, 10, + "333333333333],PARAMETER[\"standard_parallel_2\",26.16666"); + add_srs_wkt (p, 11, + "666666667],PARAMETER[\"latitude_of_origin\",25.666666666"); + add_srs_wkt (p, 12, + "66667],PARAMETER[\"central_meridian\",-98.5],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_easting\",984250.0000000002],PARAMETER[\"false_nor"); + add_srs_wkt (p, 14, + "thing\",16404166.667],AUTHORITY[\"EPSG\",\"3672\"],AXIS["); + add_srs_wkt (p, 15, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3673, "epsg", 3673, + "NAD83(NSRS2007) / Texas South Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333"); + add_proj4text (p, 1, + "333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0"); + add_proj4text (p, 2, + "=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas South Central\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"standard_parallel_1\",30.28333333333333],PARAMETER"); + add_srs_wkt (p, 10, + "[\"standard_parallel_2\",28.38333333333333],PARAMETER[\""); + add_srs_wkt (p, 11, + "latitude_of_origin\",27.83333333333333],PARAMETER[\"cent"); + add_srs_wkt (p, 12, + "ral_meridian\",-99],PARAMETER[\"false_easting\",600000],"); + add_srs_wkt (p, 13, + "PARAMETER[\"false_northing\",4000000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"3673\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3674, "epsg", 3674, + "NAD83(NSRS2007) / Texas South Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333"); + add_proj4text (p, 1, + "333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0"); + add_proj4text (p, 2, + "=3999999.9998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +un"); + add_proj4text (p, 3, "its=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Texas South Central (ftUS)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatia"); + add_srs_wkt (p, 2, + "l_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,"); + add_srs_wkt (p, 3, + "298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 5, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 6, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060"); + add_srs_wkt (p, 8, + "96012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamb"); + add_srs_wkt (p, 9, + "ert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 10, + "_1\",30.28333333333333],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 11, + ",28.38333333333333],PARAMETER[\"latitude_of_origin\",27."); + add_srs_wkt (p, 12, + "83333333333333],PARAMETER[\"central_meridian\",-99],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_easting\",1968500],PARAMETER[\"false_north"); + add_srs_wkt (p, 14, + "ing\",13123333.333],AUTHORITY[\"EPSG\",\"3674\"],AXIS[\""); + add_srs_wkt (p, 15, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3675, "epsg", 3675, + "NAD83(NSRS2007) / Utah Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=3"); + add_proj4text (p, 1, + "8.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 "); + add_proj4text (p, 2, + "+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Utah Central\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_1\",40.65],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 10, + "l_2\",39.01666666666667],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 11, + ",38.33333333333334],PARAMETER[\"central_meridian\",-111."); + add_srs_wkt (p, 12, + "5],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",2000000],AUTHORITY[\"EPSG\",\"3675\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3676, "epsg", 3676, + "NAD83(NSRS2007) / Utah Central (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=3"); + add_proj4text (p, 1, + "8.33333333333334 +lon_0=-111.5 +x_0=500000.0001504 +y_0="); + add_proj4text (p, 2, + "1999999.999992 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 3, "s=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Utah Central (ft)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "02\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"standard_parallel_1\",40.65],PARAMETER[\"standard"); + add_srs_wkt (p, 10, + "_parallel_2\",39.01666666666667],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 11, + "_origin\",38.33333333333334],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 12, + "n\",-111.5],PARAMETER[\"false_easting\",1640419.948],PAR"); + add_srs_wkt (p, 13, + "AMETER[\"false_northing\",6561679.79],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"3676\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3677, "epsg", 3677, + "NAD83(NSRS2007) / Utah Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=3"); + add_proj4text (p, 1, + "8.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0"); + add_proj4text (p, 2, + "=2000000.00001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 3, "nits=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Utah Central (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Con"); + add_srs_wkt (p, 9, + "formal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",40"); + add_srs_wkt (p, 10, + ".65],PARAMETER[\"standard_parallel_2\",39.01666666666667"); + add_srs_wkt (p, 11, + "],PARAMETER[\"latitude_of_origin\",38.33333333333334],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"central_meridian\",-111.5],PARAMETER[\"false_e"); + add_srs_wkt (p, 13, + "asting\",1640416.6667],PARAMETER[\"false_northing\",6561"); + add_srs_wkt (p, 14, + "666.666700001],AUTHORITY[\"EPSG\",\"3677\"],AXIS[\"X\",E"); + add_srs_wkt (p, 15, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3678, "epsg", 3678, + "NAD83(NSRS2007) / Utah North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +"); + add_proj4text (p, 2, + "y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Utah North\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_1\",41.78333333333333],PARAMETER[\"standa"); + add_srs_wkt (p, 10, + "rd_parallel_2\",40.71666666666667],PARAMETER[\"latitude_"); + add_srs_wkt (p, 11, + "of_origin\",40.33333333333334],PARAMETER[\"central_merid"); + add_srs_wkt (p, 12, + "ian\",-111.5],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 13, + "TER[\"false_northing\",1000000],AUTHORITY[\"EPSG\",\"367"); + add_srs_wkt (p, 14, "8\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3679, "epsg", 3679, + "NAD83(NSRS2007) / Utah North (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0"); + add_proj4text (p, 2, + "001504 +y_0=999999.9999960001 +ellps=GRS80 +towgs84=0,0,"); + add_proj4text (p, 3, "0,0,0,0,0 +units=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Utah North (ft)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "2\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"standard_parallel_1\",41.78333333333333],PARAMETER"); + add_srs_wkt (p, 10, + "[\"standard_parallel_2\",40.71666666666667],PARAMETER[\""); + add_srs_wkt (p, 11, + "latitude_of_origin\",40.33333333333334],PARAMETER[\"cent"); + add_srs_wkt (p, 12, + "ral_meridian\",-111.5],PARAMETER[\"false_easting\",16404"); + add_srs_wkt (p, 13, + "19.948],PARAMETER[\"false_northing\",3280839.895],AUTHOR"); + add_srs_wkt (p, 14, + "ITY[\"EPSG\",\"3679\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 15, "]]"); + p = add_epsg_def (first, last, 3680, "epsg", 3680, + "NAD83(NSRS2007) / Utah North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.0"); + add_proj4text (p, 2, + "0001016 +y_0=999999.9999898402 +ellps=GRS80 +towgs84=0,0"); + add_proj4text (p, 3, ",0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Utah North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 9, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41.78"); + add_srs_wkt (p, 10, + "333333333333],PARAMETER[\"standard_parallel_2\",40.71666"); + add_srs_wkt (p, 11, + "666666667],PARAMETER[\"latitude_of_origin\",40.333333333"); + add_srs_wkt (p, 12, + "33334],PARAMETER[\"central_meridian\",-111.5],PARAMETER["); + add_srs_wkt (p, 13, + "\"false_easting\",1640416.6667],PARAMETER[\"false_northi"); + add_srs_wkt (p, 14, + "ng\",3280833.333300001],AUTHORITY[\"EPSG\",\"3680\"],AXI"); + add_srs_wkt (p, 15, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3681, "epsg", 3681, + "NAD83(NSRS2007) / Utah South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=3"); + add_proj4text (p, 1, + "6.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 "); + add_proj4text (p, 2, + "+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Utah South\",GEOGCS[\"NAD83(N"); + add_srs_wkt (p, 1, + "SRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Syst"); + add_srs_wkt (p, 2, + "em_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"475"); + add_srs_wkt (p, 7, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_1\",38.35],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 10, + "2\",37.21666666666667],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 11, + "36.66666666666666],PARAMETER[\"central_meridian\",-111.5"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 13, + "northing\",3000000],AUTHORITY[\"EPSG\",\"3681\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3682, "epsg", 3682, + "NAD83(NSRS2007) / Utah South (ft)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=3"); + add_proj4text (p, 1, + "6.66666666666666 +lon_0=-111.5 +x_0=500000.0001504 +y_0="); + add_proj4text (p, 2, + "2999999.999988 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 3, "s=ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Utah South (ft)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"foot\",0.3048,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "2\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"standard_parallel_1\",38.35],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",37.21666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",36.66666666666666],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-111.5],PARAMETER[\"false_easting\",1640419.948],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_northing\",9842519.685],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"3682\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3683, "epsg", 3683, + "NAD83(NSRS2007) / Utah South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=3"); + add_proj4text (p, 1, + "6.66666666666666 +lon_0=-111.5 +x_0=500000.00001016 +y_0"); + add_proj4text (p, 2, + "=3000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-f"); + add_proj4text (p, 3, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Utah South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 9, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",38.35"); + add_srs_wkt (p, 10, + "],PARAMETER[\"standard_parallel_2\",37.21666666666667],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"latitude_of_origin\",36.66666666666666],PARAM"); + add_srs_wkt (p, 12, + "ETER[\"central_meridian\",-111.5],PARAMETER[\"false_east"); + add_srs_wkt (p, 13, + "ing\",1640416.6667],PARAMETER[\"false_northing\",9842500"); + add_srs_wkt (p, 14, + ".000000002],AUTHORITY[\"EPSG\",\"3683\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 15, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3684, "epsg", 3684, + "NAD83(NSRS2007) / Vermont"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0"); + add_proj4text (p, 1, + "=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Vermont\",GEOGCS[\"NAD83(NSRS"); + add_srs_wkt (p, 1, + "2007)\",DATUM[\"NAD83_National_Spatial_Reference_System_"); + add_srs_wkt (p, 2, + "2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4759\"]"); + add_srs_wkt (p, 7, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",42.5],PARAMETER[\"central_meridian\",-72.5],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",0.999964286],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"3684\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3685, "epsg", 3685, + "NAD83(NSRS2007) / Virginia North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +"); + add_proj4text (p, 2, + "ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Virginia North\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",39.2],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 10, + "l_2\",38.03333333333333],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 11, + ",37.66666666666666],PARAMETER[\"central_meridian\",-78.5"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_easting\",3500000],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",2000000],AUTHORITY[\"EPSG\",\"3685\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3686, "epsg", 3686, + "NAD83(NSRS2007) / Virginia North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2"); + add_proj4text (p, 2, + "000000.0001016 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 3, "s=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Virginia North (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "39.2],PARAMETER[\"standard_parallel_2\",38.0333333333333"); + add_srs_wkt (p, 11, + "3],PARAMETER[\"latitude_of_origin\",37.66666666666666],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"central_meridian\",-78.5],PARAMETER[\"false_e"); + add_srs_wkt (p, 13, + "asting\",11482916.667],PARAMETER[\"false_northing\",6561"); + add_srs_wkt (p, 14, + "666.667],AUTHORITY[\"EPSG\",\"3686\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 15, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3687, "epsg", 3687, + "NAD83(NSRS2007) / Virginia South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +"); + add_proj4text (p, 2, + "y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Virginia South\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",37.96666666666667],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",36.76666666666667],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",36.33333333333334],PARAMETER[\"central_me"); + add_srs_wkt (p, 12, + "ridian\",-78.5],PARAMETER[\"false_easting\",3500000],PAR"); + add_srs_wkt (p, 13, + "AMETER[\"false_northing\",1000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 14, "3687\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3688, "epsg", 3688, + "NAD83(NSRS2007) / Virginia South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0"); + add_proj4text (p, 2, + "001016 +y_0=999999.9998983998 +ellps=GRS80 +towgs84=0,0,"); + add_proj4text (p, 3, "0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Virginia South (ftUS)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Ref"); + add_srs_wkt (p, 2, + "erence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "37.96666666666667],PARAMETER[\"standard_parallel_2\",36."); + add_srs_wkt (p, 11, + "76666666666667],PARAMETER[\"latitude_of_origin\",36.3333"); + add_srs_wkt (p, 12, + "3333333334],PARAMETER[\"central_meridian\",-78.5],PARAME"); + add_srs_wkt (p, 13, + "TER[\"false_easting\",11482916.667],PARAMETER[\"false_no"); + add_srs_wkt (p, 14, + "rthing\",3280833.333],AUTHORITY[\"EPSG\",\"3688\"],AXIS["); + add_srs_wkt (p, 15, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3689, "epsg", 3689, + "NAD83(NSRS2007) / Washington North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47"); + add_proj4text (p, 1, + " +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Washington North\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",48.73333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",47.5],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 11, + "in\",47],PARAMETER[\"central_meridian\",-120.83333333333"); + add_srs_wkt (p, 12, + "33],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 13, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3689\"],AXIS[\"X\","); + add_srs_wkt (p, 14, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3690, "epsg", 3690, + "NAD83(NSRS2007) / Washington North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47"); + add_proj4text (p, 1, + " +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0"); + add_proj4text (p, 2, + " +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_de"); + add_proj4text (p, 3, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Washington North (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_R"); + add_srs_wkt (p, 2, + "eference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 3, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 5, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 8, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_"); + add_srs_wkt (p, 9, + "Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 10, + ",48.73333333333333],PARAMETER[\"standard_parallel_2\",47"); + add_srs_wkt (p, 11, + ".5],PARAMETER[\"latitude_of_origin\",47],PARAMETER[\"cen"); + add_srs_wkt (p, 12, + "tral_meridian\",-120.8333333333333],PARAMETER[\"false_ea"); + add_srs_wkt (p, 13, + "sting\",1640416.667],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 14, + "HORITY[\"EPSG\",\"3690\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 15, "RTH]]"); + p = add_epsg_def (first, last, 3691, "epsg", 3691, + "NAD83(NSRS2007) / Washington South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333"); + add_proj4text (p, 1, + "334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +"); + add_proj4text (p, 2, + "y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Washington South\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",47.33333333333334],PARAMETER[\""); + add_srs_wkt (p, 10, + "standard_parallel_2\",45.83333333333334],PARAMETER[\"lat"); + add_srs_wkt (p, 11, + "itude_of_origin\",45.33333333333334],PARAMETER[\"central"); + add_srs_wkt (p, 12, + "_meridian\",-120.5],PARAMETER[\"false_easting\",500000],"); + add_srs_wkt (p, 13, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"369"); + add_srs_wkt (p, 14, "1\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3692, "epsg", 3692, + "NAD83(NSRS2007) / Washington South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333"); + add_proj4text (p, 1, + "334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0"); + add_proj4text (p, 2, + "001016001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +un"); + add_proj4text (p, 3, "its=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Washington South (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_R"); + add_srs_wkt (p, 2, + "eference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 3, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 5, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 8, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_"); + add_srs_wkt (p, 9, + "Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 10, + ",47.33333333333334],PARAMETER[\"standard_parallel_2\",45"); + add_srs_wkt (p, 11, + ".83333333333334],PARAMETER[\"latitude_of_origin\",45.333"); + add_srs_wkt (p, 12, + "33333333334],PARAMETER[\"central_meridian\",-120.5],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_easting\",1640416.667],PARAMETER[\"false_n"); + add_srs_wkt (p, 14, + "orthing\",0],AUTHORITY[\"EPSG\",\"3692\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 15, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3693, "epsg", 3693, + "NAD83(NSRS2007) / West Virginia North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79."); + add_proj4text (p, 1, + "5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / West Virginia North\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"standard_parallel_1\",40.25],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",39],PARAMETER[\"latitude_of_origin\",38.5],"); + add_srs_wkt (p, 11, + "PARAMETER[\"central_meridian\",-79.5],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "easting\",600000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 13, + "ITY[\"EPSG\",\"3693\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 14, "]]"); + p = add_epsg_def (first, last, 3694, "epsg", 3694, + "NAD83(NSRS2007) / West Virginia South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / West Virginia South\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"standard_parallel_1\",38.88333333333333],PARAMETER"); + add_srs_wkt (p, 10, + "[\"standard_parallel_2\",37.48333333333333],PARAMETER[\""); + add_srs_wkt (p, 11, + "latitude_of_origin\",37],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 12, + "-81],PARAMETER[\"false_easting\",600000],PARAMETER[\"fal"); + add_srs_wkt (p, 13, + "se_northing\",0],AUTHORITY[\"EPSG\",\"3694\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3695, "epsg", 3695, + "NAD83(NSRS2007) / Wisconsin Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333"); + add_proj4text (p, 1, + "334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wisconsin Central\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",45.5],PARAMETER[\"standard_para"); + add_srs_wkt (p, 10, + "llel_2\",44.25],PARAMETER[\"latitude_of_origin\",43.8333"); + add_srs_wkt (p, 11, + "3333333334],PARAMETER[\"central_meridian\",-90],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_easting\",600000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"3695\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3696, "epsg", 3696, + "NAD83(NSRS2007) / Wisconsin Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333"); + add_proj4text (p, 1, + "334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wisconsin Central (ftUS)\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_"); + add_srs_wkt (p, 2, + "Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 3, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 5, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096"); + add_srs_wkt (p, 8, + "012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamber"); + add_srs_wkt (p, 9, + "t_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 10, + "\",45.5],PARAMETER[\"standard_parallel_2\",44.25],PARAME"); + add_srs_wkt (p, 11, + "TER[\"latitude_of_origin\",43.83333333333334],PARAMETER["); + add_srs_wkt (p, 12, + "\"central_meridian\",-90],PARAMETER[\"false_easting\",19"); + add_srs_wkt (p, 13, + "68500],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 14, ",\"3696\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3697, "epsg", 3697, + "NAD83(NSRS2007) / Wisconsin North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0"); + add_proj4text (p, 2, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wisconsin North\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_1\",46.76666666666667],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "tandard_parallel_2\",45.56666666666667],PARAMETER[\"lati"); + add_srs_wkt (p, 11, + "tude_of_origin\",45.16666666666666],PARAMETER[\"central_"); + add_srs_wkt (p, 12, + "meridian\",-90],PARAMETER[\"false_easting\",600000],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3697\"]"); + add_srs_wkt (p, 14, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3698, "epsg", 3698, + "NAD83(NSRS2007) / Wisconsin North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0"); + add_proj4text (p, 2, + "=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_"); + add_proj4text (p, 3, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wisconsin North (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Re"); + add_srs_wkt (p, 2, + "ference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298."); + add_srs_wkt (p, 3, + "257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "46.76666666666667],PARAMETER[\"standard_parallel_2\",45."); + add_srs_wkt (p, 11, + "56666666666667],PARAMETER[\"latitude_of_origin\",45.1666"); + add_srs_wkt (p, 12, + "6666666666],PARAMETER[\"central_meridian\",-90],PARAMETE"); + add_srs_wkt (p, 13, + "R[\"false_easting\",1968500],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 14, + ",0],AUTHORITY[\"EPSG\",\"3698\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 15, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3699, "epsg", 3699, + "NAD83(NSRS2007) / Wisconsin South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wisconsin South\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 8, + "],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_1\",44.06666666666667],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "tandard_parallel_2\",42.73333333333333],PARAMETER[\"lati"); + add_srs_wkt (p, 11, + "tude_of_origin\",42],PARAMETER[\"central_meridian\",-90]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"false_easting\",600000],PARAMETER[\"false_n"); + add_srs_wkt (p, 13, + "orthing\",0],AUTHORITY[\"EPSG\",\"3699\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 14, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3700, "epsg", 3700, + "NAD83(NSRS2007) / Wisconsin South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wisconsin South (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Re"); + add_srs_wkt (p, 2, + "ference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298."); + add_srs_wkt (p, 3, + "257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "44.06666666666667],PARAMETER[\"standard_parallel_2\",42."); + add_srs_wkt (p, 11, + "73333333333333],PARAMETER[\"latitude_of_origin\",42],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"central_meridian\",-90],PARAMETER[\"false_easti"); + add_srs_wkt (p, 13, + "ng\",1968500],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 14, + "\"EPSG\",\"3700\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3701, "epsg", 3701, + "NAD83(NSRS2007) / Wisconsin Transverse Mercator"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=520000 +y"); + add_proj4text (p, 1, + "_0=-4480000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wisconsin Transverse Mercator"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spa"); + add_srs_wkt (p, 2, + "tial_Reference_System_2007\",SPHEROID[\"GRS 1980\",63781"); + add_srs_wkt (p, 3, + "37,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0"); + add_srs_wkt (p, 4, + ",0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 5, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 6, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 8, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 9, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",-90],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",520000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 12, + "-4480000],AUTHORITY[\"EPSG\",\"3701\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3702, "epsg", 3702, + "NAD83(NSRS2007) / Wyoming East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 2, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wyoming East\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",40.5],PARAMETER[\"central_meridian\",-105.16"); + add_srs_wkt (p, 10, + "66666666667],PARAMETER[\"scale_factor\",0.9999375],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",200000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"3702\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3703, "epsg", 3703, + "NAD83(NSRS2007) / Wyoming East Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=400000 +y_0=100000 +ellps=GRS80 +towgs84=0,0"); + add_proj4text (p, 2, ",0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wyoming East Central\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",40.5],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-107.3333333333333],PARAMETER[\"scale_factor\",0.999937"); + add_srs_wkt (p, 11, + "5],PARAMETER[\"false_easting\",400000],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_northing\",100000],AUTHORITY[\"EPSG\",\"3703\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3704, "epsg", 3704, + "NAD83(NSRS2007) / Wyoming West Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0"); + add_proj4text (p, 1, + "=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wyoming West Central\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refe"); + add_srs_wkt (p, 2, + "rence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 3, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",40.5],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-108.75],PARAMETER[\"scale_factor\",0.9999375],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_easting\",600000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"3704\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3705, "epsg", 3705, + "NAD83(NSRS2007) / Wyoming West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=800000 +y_0=100000 +ellps=GRS80 +towgs84=0,0"); + add_proj4text (p, 2, ",0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wyoming West\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",40.5],PARAMETER[\"central_meridian\",-110.08"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"scale_factor\",0.9999375],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",800000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",100000],AUTHORITY[\"EPSG\",\"3705\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 13, "],AXIS[\"Y\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_13 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 3706, "epsg", 3706, + "NAD83(NSRS2007) / UTM zone 59N"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 59N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",171],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3706\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3707, "epsg", 3707, + "NAD83(NSRS2007) / UTM zone 60N"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 60N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",177],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3707\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3708, "epsg", 3708, + "NAD83(NSRS2007) / UTM zone 1N"); + add_proj4text (p, 0, + "+proj=utm +zone=1 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 1N\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",-177],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3708\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3709, "epsg", 3709, + "NAD83(NSRS2007) / UTM zone 2N"); + add_proj4text (p, 0, + "+proj=utm +zone=2 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 2N\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",-171],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3709\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3710, "epsg", 3710, + "NAD83(NSRS2007) / UTM zone 3N"); + add_proj4text (p, 0, + "+proj=utm +zone=3 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 3N\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",-165],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3710\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3711, "epsg", 3711, + "NAD83(NSRS2007) / UTM zone 4N"); + add_proj4text (p, 0, + "+proj=utm +zone=4 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 4N\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",-159],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3711\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3712, "epsg", 3712, + "NAD83(NSRS2007) / UTM zone 5N"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 5N\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",-153],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3712\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3713, "epsg", 3713, + "NAD83(NSRS2007) / UTM zone 6N"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 6N\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",-147],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3713\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3714, "epsg", 3714, + "NAD83(NSRS2007) / UTM zone 7N"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 7N\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",-141],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3714\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3715, "epsg", 3715, + "NAD83(NSRS2007) / UTM zone 8N"); + add_proj4text (p, 0, + "+proj=utm +zone=8 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 8N\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",-135],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3715\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3716, "epsg", 3716, + "NAD83(NSRS2007) / UTM zone 9N"); + add_proj4text (p, 0, + "+proj=utm +zone=9 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 9N\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sys"); + add_srs_wkt (p, 2, + "tem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 7, + "59\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",-129],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3716\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3717, "epsg", 3717, + "NAD83(NSRS2007) / UTM zone 10N"); + add_proj4text (p, 0, + "+proj=utm +zone=10 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 10N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-123],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3717\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3718, "epsg", 3718, + "NAD83(NSRS2007) / UTM zone 11N"); + add_proj4text (p, 0, + "+proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 11N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-117],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3718\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3719, "epsg", 3719, + "NAD83(NSRS2007) / UTM zone 12N"); + add_proj4text (p, 0, + "+proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 12N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-111],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3719\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3720, "epsg", 3720, + "NAD83(NSRS2007) / UTM zone 13N"); + add_proj4text (p, 0, + "+proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 13N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-105],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, + "PSG\",\"3720\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3721, "epsg", 3721, + "NAD83(NSRS2007) / UTM zone 14N"); + add_proj4text (p, 0, + "+proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 14N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-99],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3721\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3722, "epsg", 3722, + "NAD83(NSRS2007) / UTM zone 15N"); + add_proj4text (p, 0, + "+proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 15N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-93],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3722\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3723, "epsg", 3723, + "NAD83(NSRS2007) / UTM zone 16N"); + add_proj4text (p, 0, + "+proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 16N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-87],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3723\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3724, "epsg", 3724, + "NAD83(NSRS2007) / UTM zone 17N"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 17N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-81],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3724\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3725, "epsg", 3725, + "NAD83(NSRS2007) / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 18N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-75],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3725\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3726, "epsg", 3726, + "NAD83(NSRS2007) / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / UTM zone 19N\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",-69],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, + "G\",\"3726\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3727, "epsg", 3727, + "Reunion 1947 / TM Reunion"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-21.11666666666667 +lon_0=55.53333333"); + add_proj4text (p, 1, + "333333 +k=1 +x_0=160000 +y_0=50000 +ellps=intl +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Reunion 1947 / TM Reunion\",GEOGCS[\"Reunion 19"); + add_srs_wkt (p, 1, + "47\",DATUM[\"Reunion_1947\",SPHEROID[\"International 192"); + add_srs_wkt (p, 2, + "4\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6626\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4626\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",-21.11666666666667],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "55.53333333333333],PARAMETER[\"scale_factor\",1],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",160000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",50000],AUTHORITY[\"EPSG\",\"3727\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3728, "epsg", 3728, + "NAD83(NSRS2007) / Ohio North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Ohio North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 9, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41.7]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"standard_parallel_2\",40.43333333333333],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"latitude_of_origin\",39.66666666666666],PARAME"); + add_srs_wkt (p, 12, + "TER[\"central_meridian\",-82.5],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 13, + "g\",1968500],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 14, "EPSG\",\"3728\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3729, "epsg", 3729, + "NAD83(NSRS2007) / Ohio South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Ohio South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 9, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",40.03"); + add_srs_wkt (p, 10, + "333333333333],PARAMETER[\"standard_parallel_2\",38.73333"); + add_srs_wkt (p, 11, + "333333333],PARAMETER[\"latitude_of_origin\",38],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"central_meridian\",-82.5],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 13, + ",1968500],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 14, "SG\",\"3729\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3730, "epsg", 3730, + "NAD83(NSRS2007) / Wyoming East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=200000.00001016 +y_0=0 +ellps=GRS80 +towgs84"); + add_proj4text (p, 2, "=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wyoming East (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",40.5],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"central_meridian\",-105.1666666666667],PARAMETER["); + add_srs_wkt (p, 11, + "\"scale_factor\",0.9999375],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "656166.6667],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, "EPSG\",\"3730\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3731, "epsg", 3731, + "NAD83(NSRS2007) / Wyoming East Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=399999.99998984 +y_0=99999.99998983997 +ellp"); + add_proj4text (p, 2, + "s=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wyoming East Central (ftUS)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spati"); + add_srs_wkt (p, 2, + "al_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 3, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006"); + add_srs_wkt (p, 8, + "096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Tra"); + add_srs_wkt (p, 9, + "nsverse_Mercator\"],PARAMETER[\"latitude_of_origin\",40."); + add_srs_wkt (p, 10, + "5],PARAMETER[\"central_meridian\",-107.3333333333333],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"scale_factor\",0.9999375],PARAMETER[\"false_ea"); + add_srs_wkt (p, 12, + "sting\",1312333.3333],PARAMETER[\"false_northing\",32808"); + add_srs_wkt (p, 13, + "3.3333],AUTHORITY[\"EPSG\",\"3731\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 14, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3732, "epsg", 3732, + "NAD83(NSRS2007) / Wyoming West Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0"); + add_proj4text (p, 1, + "=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 2, "s=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wyoming West Central (ftUS)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spati"); + add_srs_wkt (p, 2, + "al_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 3, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006"); + add_srs_wkt (p, 8, + "096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Tra"); + add_srs_wkt (p, 9, + "nsverse_Mercator\"],PARAMETER[\"latitude_of_origin\",40."); + add_srs_wkt (p, 10, + "5],PARAMETER[\"central_meridian\",-108.75],PARAMETER[\"s"); + add_srs_wkt (p, 11, + "cale_factor\",0.9999375],PARAMETER[\"false_easting\",196"); + add_srs_wkt (p, 12, + "8500],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"3732\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3733, "epsg", 3733, + "NAD83(NSRS2007) / Wyoming West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=800000.0000101599 +y_0=99999.99998983997 +el"); + add_proj4text (p, 2, + "lps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Wyoming West (ftUS)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4759\"]],UNIT[\"US survey foot\",0.304800609601219"); + add_srs_wkt (p, 8, + "2,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 9, + "Mercator\"],PARAMETER[\"latitude_of_origin\",40.5],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"central_meridian\",-110.0833333333333],PARAMETER["); + add_srs_wkt (p, 11, + "\"scale_factor\",0.9999375],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "2624666.6667],PARAMETER[\"false_northing\",328083.3333],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"3733\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 3734, "epsg", 3734, + "NAD83 / Ohio North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Ohio North (ftUS)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",41.7],PARA"); + add_srs_wkt (p, 9, + "METER[\"standard_parallel_2\",40.43333333333333],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"latitude_of_origin\",39.66666666666666],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-82.5],PARAMETER[\"false_easting\",19"); + add_srs_wkt (p, 12, + "68500],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"3734\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3735, "epsg", 3735, + "NAD83 / Ohio South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Ohio South (ftUS)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",40.0333333"); + add_srs_wkt (p, 9, + "3333333],PARAMETER[\"standard_parallel_2\",38.7333333333"); + add_srs_wkt (p, 10, + "3333],PARAMETER[\"latitude_of_origin\",38],PARAMETER[\"c"); + add_srs_wkt (p, 11, + "entral_meridian\",-82.5],PARAMETER[\"false_easting\",196"); + add_srs_wkt (p, 12, + "8500],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"3735\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3736, "epsg", 3736, + "NAD83 / Wyoming East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=200000.00001016 +y_0=0 +ellps=GRS80 +datum=N"); + add_proj4text (p, 2, "AD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wyoming East (ftUS)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",40.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-105.1666666666667],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9999375],PARAMETER[\"false_easting\",656166."); + add_srs_wkt (p, 11, + "6667],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"3736\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3737, "epsg", 3737, + "NAD83 / Wyoming East Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=399999.99998984 +y_0=99999.99998983997 +ellp"); + add_proj4text (p, 2, "s=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wyoming East Central (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transvers"); + add_srs_wkt (p, 8, + "e_Mercator\"],PARAMETER[\"latitude_of_origin\",40.5],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",-107.3333333333333],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.9999375],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",1312333.3333],PARAMETER[\"false_northing\",328083.3333]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"3737\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 3738, "epsg", 3738, + "NAD83 / Wyoming West Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0"); + add_proj4text (p, 1, + "=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wyoming West Central (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transvers"); + add_srs_wkt (p, 8, + "e_Mercator\"],PARAMETER[\"latitude_of_origin\",40.5],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",-108.75],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",0.9999375],PARAMETER[\"false_easting\",1968500],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"373"); + add_srs_wkt (p, 12, "8\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3739, "epsg", 3739, + "NAD83 / Wyoming West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=800000.0000101599 +y_0=99999.99998983997 +el"); + add_proj4text (p, 2, "lps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wyoming West (ftUS)\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercato"); + add_srs_wkt (p, 8, + "r\"],PARAMETER[\"latitude_of_origin\",40.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-110.0833333333333],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9999375],PARAMETER[\"false_easting\",2624666"); + add_srs_wkt (p, 11, + ".6667],PARAMETER[\"false_northing\",328083.3333],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"3739\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 13, "]"); + p = add_epsg_def (first, last, 3740, "epsg", 3740, + "NAD83(HARN) / UTM zone 10N"); + add_proj4text (p, 0, "+proj=utm +zone=10 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 10N\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-123],PARAMETER[\"scale_factor\",0.9996],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"3740\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3741, "epsg", 3741, + "NAD83(HARN) / UTM zone 11N"); + add_proj4text (p, 0, "+proj=utm +zone=11 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 11N\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-117],PARAMETER[\"scale_factor\",0.9996],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"3741\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3742, "epsg", 3742, + "NAD83(HARN) / UTM zone 12N"); + add_proj4text (p, 0, "+proj=utm +zone=12 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 12N\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-111],PARAMETER[\"scale_factor\",0.9996],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"3742\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3743, "epsg", 3743, + "NAD83(HARN) / UTM zone 13N"); + add_proj4text (p, 0, "+proj=utm +zone=13 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 13N\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-105],PARAMETER[\"scale_factor\",0.9996],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"3743\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3744, "epsg", 3744, + "NAD83(HARN) / UTM zone 14N"); + add_proj4text (p, 0, "+proj=utm +zone=14 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 14N\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-99],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"3744\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3745, "epsg", 3745, + "NAD83(HARN) / UTM zone 15N"); + add_proj4text (p, 0, "+proj=utm +zone=15 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 15N\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-93],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"3745\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3746, "epsg", 3746, + "NAD83(HARN) / UTM zone 16N"); + add_proj4text (p, 0, "+proj=utm +zone=16 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 16N\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-87],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"3746\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3747, "epsg", 3747, + "NAD83(HARN) / UTM zone 17N"); + add_proj4text (p, 0, "+proj=utm +zone=17 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 17N\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-81],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"3747\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3748, "epsg", 3748, + "NAD83(HARN) / UTM zone 18N"); + add_proj4text (p, 0, "+proj=utm +zone=18 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 18N\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-75],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"3748\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3749, "epsg", 3749, + "NAD83(HARN) / UTM zone 19N"); + add_proj4text (p, 0, "+proj=utm +zone=19 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 19N\",GEOGCS[\"NAD83(HAR"); + add_srs_wkt (p, 1, + "N)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-69],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"3749\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3750, "epsg", 3750, + "NAD83(HARN) / UTM zone 4N"); + add_proj4text (p, 0, "+proj=utm +zone=4 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 4N\",GEOGCS[\"NAD83(HARN"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-159],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"3750\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3751, "epsg", 3751, + "NAD83(HARN) / UTM zone 5N"); + add_proj4text (p, 0, "+proj=utm +zone=5 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / UTM zone 5N\",GEOGCS[\"NAD83(HARN"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-153],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"3751\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3752, "epsg", 3752, + "WGS 84 / Mercator 41 (deprecated)"); + add_proj4text (p, 0, + "+proj=merc +lon_0=100 +lat_ts=-41 +x_0=0 +y_0=0 +ellps=W"); + add_proj4text (p, 1, "GS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / Mercator 41 (deprecated)\",GEOGCS[\"WG"); + add_srs_wkt (p, 1, + "S 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,29"); + add_srs_wkt (p, 2, + "8.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Mercator_1SP\"],PARAMETER[\"latitude_of_origin\",-41],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"central_meridian\",100],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",0],AUTHORITY[\"EPSG\",\"3752\"],AXIS[\"X\",E"); + add_srs_wkt (p, 11, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3753, "epsg", 3753, + "NAD83(HARN) / Ohio North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Ohio North (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",41.7],PARAMETER[\"standard_parallel_2\",40.43"); + add_srs_wkt (p, 10, + "333333333333],PARAMETER[\"latitude_of_origin\",39.666666"); + add_srs_wkt (p, 11, + "66666666],PARAMETER[\"central_meridian\",-82.5],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_easting\",1968500],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"3753\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3754, "epsg", 3754, + "NAD83(HARN) / Ohio South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Ohio South (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",40.03333333333333],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_2\",38.73333333333333],PARAMETER[\"latitude_of_origi"); + add_srs_wkt (p, 11, + "n\",38],PARAMETER[\"central_meridian\",-82.5],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_easting\",1968500],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 13, + "0],AUTHORITY[\"EPSG\",\"3754\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3755, "epsg", 3755, + "NAD83(HARN) / Wyoming East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=200000.00001016 +y_0=0 +ellps=GRS80 +units=u"); + add_proj4text (p, 2, "s-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wyoming East (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",40.5],PARAMETER[\"central_meridian\",-105.16666666"); + add_srs_wkt (p, 10, + "66667],PARAMETER[\"scale_factor\",0.9999375],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",656166.6667],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"3755\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3756, "epsg", 3756, + "NAD83(HARN) / Wyoming East Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=399999.99998984 +y_0=99999.99998983997 +ellp"); + add_proj4text (p, 2, "s=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wyoming East Central (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional"); + add_srs_wkt (p, 2, + "_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey "); + add_srs_wkt (p, 7, + "foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",40.5],PARAMETER[\"central_meridian\",-107.3"); + add_srs_wkt (p, 10, + "333333333333],PARAMETER[\"scale_factor\",0.9999375],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_easting\",1312333.3333],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "northing\",328083.3333],AUTHORITY[\"EPSG\",\"3756\"],AXI"); + add_srs_wkt (p, 13, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3757, "epsg", 3757, + "NAD83(HARN) / Wyoming West Central (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0"); + add_proj4text (p, 1, "=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wyoming West Central (ftUS)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional"); + add_srs_wkt (p, 2, + "_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey "); + add_srs_wkt (p, 7, + "foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",40.5],PARAMETER[\"central_meridian\",-108.7"); + add_srs_wkt (p, 10, + "5],PARAMETER[\"scale_factor\",0.9999375],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_easting\",1968500],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 12, + "THORITY[\"EPSG\",\"3757\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3758, "epsg", 3758, + "NAD83(HARN) / Wyoming West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=800000.0000101599 +y_0=99999.99998983997 +el"); + add_proj4text (p, 2, "lps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Wyoming West (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",40.5],PARAMETER[\"central_meridian\",-110.08333333"); + add_srs_wkt (p, 10, + "33333],PARAMETER[\"scale_factor\",0.9999375],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",2624666.6667],PARAMETER[\"false_northing"); + add_srs_wkt (p, 12, + "\",328083.3333],AUTHORITY[\"EPSG\",\"3758\"],AXIS[\"X\","); + add_srs_wkt (p, 13, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3759, "epsg", 3759, + "NAD83 / Hawaii zone 3 (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99"); + add_proj4text (p, 1, + "999 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +datum=NAD8"); + add_proj4text (p, 2, "3 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Hawaii zone 3 (ftUS)\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",21.16666666666667"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-158],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.99999],PARAMETER[\"false_easting\",1640416.6"); + add_srs_wkt (p, 11, + "667],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"3759\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3760, "epsg", 3760, + "NAD83(HARN) / Hawaii zone 3 (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99"); + add_proj4text (p, 1, + "999 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Hawaii zone 3 (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Networ"); + add_srs_wkt (p, 2, + "k\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",21.16666666666667],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-158],PARAMETER[\"scale_factor\",0.99999],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",1640416.6667],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"3760\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 3761, "epsg", 3761, + "NAD83(CSRS) / UTM zone 22N"); + add_proj4text (p, 0, "+proj=utm +zone=22 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / UTM zone 22N\",GEOGCS[\"NAD83(CSR"); + add_srs_wkt (p, 1, + "S)\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-51],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"3761\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3762, "epsg", 3762, + "WGS 84 / South Georgia Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-54 +lat_2=-54.75 +lat_0=-55 +lon_0=-37"); + add_proj4text (p, 1, + " +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / South Georgia Lambert\",GEOGCS[\"WGS 8"); + add_srs_wkt (p, 1, + "4\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.2"); + add_srs_wkt (p, 2, + "57223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lamb"); + add_srs_wkt (p, 7, + "ert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 8, + "_1\",-54],PARAMETER[\"standard_parallel_2\",-54.75],PARA"); + add_srs_wkt (p, 9, + "METER[\"latitude_of_origin\",-55],PARAMETER[\"central_me"); + add_srs_wkt (p, 10, + "ridian\",-37],PARAMETER[\"false_easting\",0],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3762\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3763, "epsg", 3763, + "ETRS89 / Portugal TM06"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=39.66825833333333 +lon_0=-8.133108333"); + add_proj4text (p, 1, + "333334 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Portugal TM06\",GEOGCS[\"ETRS89\",DATU"); + add_srs_wkt (p, 1, + "M[\"European_Terrestrial_Reference_System_1989\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",39.66825833333333],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-8.133108333333334],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3763\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3764, "epsg", 3764, + "NZGD2000 / Chatham Island Circuit 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-44 +lon_0=-176.5 +k=1 +x_0=400000 +y"); + add_proj4text (p, 1, + "_0=800000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Chatham Island Circuit 2000\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NZGD2000\",DATUM[\"New_Zealand_Geodetic_Datum_2000\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"6167\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "-44],PARAMETER[\"central_meridian\",-176.5],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",400000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",800000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3764\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3765, "epsg", 3765, "HTRS96 / Croatia TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=16.5 +k=0.9999 +x_0=500000 +"); + add_proj4text (p, 1, + "y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"HTRS96 / Croatia TM\",GEOGCS[\"HTRS96\",DATUM[\""); + add_srs_wkt (p, 1, + "Croatian_Terrestrial_Reference_System\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6761\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4761\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 8, + "tor\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",16.5],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "9],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",0],AUTHORITY[\"EPSG\",\"3765\"],AXIS[\"Easti"); + add_srs_wkt (p, 12, "ng\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3766, "epsg", 3766, "HTRS96 / Croatia LCC"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.91666666666666 +lat_2=43.08333333333"); + add_proj4text (p, 1, + "334 +lat_0=0 +lon_0=16.5 +x_0=0 +y_0=0 +ellps=GRS80 +tow"); + add_proj4text (p, 2, "gs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"HTRS96 / Croatia LCC\",GEOGCS[\"HTRS96\",DATUM["); + add_srs_wkt (p, 1, + "\"Croatian_Terrestrial_Reference_System\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6761\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4761\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conform"); + add_srs_wkt (p, 8, + "al_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",45.916"); + add_srs_wkt (p, 9, + "66666666666],PARAMETER[\"standard_parallel_2\",43.083333"); + add_srs_wkt (p, 10, + "33333334],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 11, + "\"central_meridian\",16.5],PARAMETER[\"false_easting\",0"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3"); + add_srs_wkt (p, 13, + "766\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3767, "epsg", 3767, "HTRS96 / UTM zone 33N"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"HTRS96 / UTM zone 33N\",GEOGCS[\"HTRS96\",DATUM"); + add_srs_wkt (p, 1, + "[\"Croatian_Terrestrial_Reference_System\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6761\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4761\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",15],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3767\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3768, "epsg", 3768, "HTRS96 / UTM zone 34N"); + add_proj4text (p, 0, + "+proj=utm +zone=34 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"HTRS96 / UTM zone 34N\",GEOGCS[\"HTRS96\",DATUM"); + add_srs_wkt (p, 1, + "[\"Croatian_Terrestrial_Reference_System\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6761\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4761\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",21],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3768\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3769, "epsg", 3769, + "Bermuda 1957 / UTM zone 20N"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bermuda 1957 / UTM zone 20N\",GEOGCS[\"Bermuda "); + add_srs_wkt (p, 1, + "1957\",DATUM[\"Bermuda_1957\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6216\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4216\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-63],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"3769\"],AXIS[\"Easting\",EAST],AXIS[\"Northin"); + add_srs_wkt (p, 12, "g\",NORTH]]"); + p = add_epsg_def (first, last, 3770, "epsg", 3770, + "BDA2000 / Bermuda 2000 National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=32 +lon_0=-64.75 +k=1 +x_0=550000 +y_"); + add_proj4text (p, 1, + "0=100000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"BDA2000 / Bermuda 2000 National Grid\",GEOGCS[\""); + add_srs_wkt (p, 1, + "BDA2000\",DATUM[\"Bermuda_2000\",SPHEROID[\"WGS 84\",637"); + add_srs_wkt (p, 2, + "8137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6762\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4762\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",32],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",-64.75],PARAMETER[\"scale_factor\",1],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",550000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",100000],AUTHORITY[\"EPSG\",\"3770\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3771, "epsg", 3771, + "NAD27 / Alberta 3TM ref merid 111 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-111 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alberta 3TM ref merid 111 W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD27\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"C"); + add_srs_wkt (p, 2, + "larke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-111],PARAMETER[\"scale_factor\",0.9999],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",0],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"3771\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3772, "epsg", 3772, + "NAD27 / Alberta 3TM ref merid 114 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-114 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alberta 3TM ref merid 114 W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD27\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"C"); + add_srs_wkt (p, 2, + "larke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-114],PARAMETER[\"scale_factor\",0.9999],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",0],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"3772\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3773, "epsg", 3773, + "NAD27 / Alberta 3TM ref merid 117 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-117 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alberta 3TM ref merid 117 W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD27\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"C"); + add_srs_wkt (p, 2, + "larke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-117],PARAMETER[\"scale_factor\",0.9999],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",0],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"3773\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3774, "epsg", 3774, + "NAD27 / Alberta 3TM ref merid 120 W (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alberta 3TM ref merid 120 W (deprecated"); + add_srs_wkt (p, 1, + ")\",GEOGCS[\"NAD27\",DATUM[\"North_American_Datum_1927\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Clarke 1866\",6378206.4,294.9786982139006,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4267\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-120],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9999],PARAMETER[\"false_easting\",0],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",0],AUTHORITY[\"EPSG\",\"3774\"],AXIS[\"Easting"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3775, "epsg", 3775, + "NAD83 / Alberta 3TM ref merid 111 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-111 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alberta 3TM ref merid 111 W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "111],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3775\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 3776, "epsg", 3776, + "NAD83 / Alberta 3TM ref merid 114 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-114 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alberta 3TM ref merid 114 W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "114],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3776\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 3777, "epsg", 3777, + "NAD83 / Alberta 3TM ref merid 117 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-117 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alberta 3TM ref merid 117 W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "117],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3777\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 3778, "epsg", 3778, + "NAD83 / Alberta 3TM ref merid 120 W (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alberta 3TM ref merid 120 W (deprecated"); + add_srs_wkt (p, 1, + ")\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-120],PARAMETER[\"scale_factor\",0.9999],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",0],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 11, + ",AUTHORITY[\"EPSG\",\"3778\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3779, "epsg", 3779, + "NAD83(CSRS) / Alberta 3TM ref merid 111 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-111 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Alberta 3TM ref merid 111 W\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"614"); + add_srs_wkt (p, 4, + "0\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-111],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9999],PARAMETER[\"false_easting\",0],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3779\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3780, "epsg", 3780, + "NAD83(CSRS) / Alberta 3TM ref merid 114 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-114 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Alberta 3TM ref merid 114 W\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"614"); + add_srs_wkt (p, 4, + "0\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-114],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9999],PARAMETER[\"false_easting\",0],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3780\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3781, "epsg", 3781, + "NAD83(CSRS) / Alberta 3TM ref merid 117 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-117 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Alberta 3TM ref merid 117 W\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"614"); + add_srs_wkt (p, 4, + "0\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-117],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9999],PARAMETER[\"false_easting\",0],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3781\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3782, "epsg", 3782, + "NAD83(CSRS) / Alberta 3TM ref merid 120 W (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Alberta 3TM ref merid 120 W (depr"); + add_srs_wkt (p, 1, + "ecated)\",GEOGCS[\"NAD83(CSRS)\",DATUM[\"NAD83_Canadian_"); + add_srs_wkt (p, 2, + "Spatial_Reference_System\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 3, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4617\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",-120],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.9999],PARAMETER[\"false_easting\",0],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3782\""); + add_srs_wkt (p, 12, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3783, "epsg", 3783, + "Pitcairn 2006 / Pitcairn TM 2006"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-25.06855261111111 +lon_0=-130.112967"); + add_proj4text (p, 1, + "1111111 +k=1 +x_0=14200 +y_0=15500 +ellps=WGS84 +towgs84"); + add_proj4text (p, 2, "=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pitcairn 2006 / Pitcairn TM 2006\",GEOGCS[\"Pit"); + add_srs_wkt (p, 1, + "cairn 2006\",DATUM[\"Pitcairn_2006\",SPHEROID[\"WGS 84\""); + add_srs_wkt (p, 2, + ",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6763\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4763\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",-25.06855261111111],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",-130.1129671111111],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",1420"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",15500],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"3783\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORT"); + add_srs_wkt (p, 13, "H]]"); + p = add_epsg_def (first, last, 3784, "epsg", 3784, + "Pitcairn 1967 / UTM zone 9S"); + add_proj4text (p, 0, + "+proj=utm +zone=9 +south +ellps=intl +towgs84=185,165,42"); + add_proj4text (p, 1, ",0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pitcairn 1967 / UTM zone 9S\",GEOGCS[\"Pitcairn"); + add_srs_wkt (p, 1, + " 1967\",DATUM[\"Pitcairn_1967\",SPHEROID[\"International"); + add_srs_wkt (p, 2, + " 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS8"); + add_srs_wkt (p, 3, + "4[185,165,42,0,0,0,0],AUTHORITY[\"EPSG\",\"6729\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4729\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",-129],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 10, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 11, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"3784\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3785, "epsg", 3785, + "Popular Visualisation CRS / Mercator (deprecated)"); + add_proj4text (p, 0, + "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 "); + add_proj4text (p, 1, + "+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext "); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Popular Visualisation CRS / Mercator (deprecate"); + add_srs_wkt (p, 1, + "d)\",GEOGCS[\"Popular Visualisation CRS\",DATUM[\"Popula"); + add_srs_wkt (p, 2, + "r_Visualisation_Datum\",SPHEROID[\"Popular Visualisation"); + add_srs_wkt (p, 3, + " Sphere\",6378137,0,AUTHORITY[\"EPSG\",\"7059\"]],TOWGS8"); + add_srs_wkt (p, 4, + "4[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6055\"]],PRIMEM[\""); + add_srs_wkt (p, 5, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 6, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"4055\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 8, + "EPSG\",\"9001\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",0],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=637"); + add_srs_wkt (p, 12, + "8137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +unit"); + add_srs_wkt (p, 13, + "s=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPS"); + add_srs_wkt (p, 14, "G\",\"3785\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3786, "epsg", 3786, + "World Equidistant Cylindrical (Sphere) (deprecated)"); + add_proj4text (p, 0, + "+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6"); + add_proj4text (p, 1, "371007 +b=6371007 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"World Equidistant Cylindrical (Sphere) (depreca"); + add_srs_wkt (p, 1, + "ted)\",GEOGCS[\"Unspecified datum based upon the GRS 198"); + add_srs_wkt (p, 2, + "0 Authalic Sphere\",DATUM[\"Not_specified_based_on_GRS_1"); + add_srs_wkt (p, 3, + "980_Authalic_Sphere\",SPHEROID[\"GRS 1980 Authalic Spher"); + add_srs_wkt (p, 4, + "e\",6371007,0,AUTHORITY[\"EPSG\",\"7048\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"6047\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4047\"]],U"); + add_srs_wkt (p, 8, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 9, + "[\"Equirectangular\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 10, + "],PARAMETER[\"central_meridian\",0],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, "PSG\",\"3786\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3787, "epsg", 3787, + "MGI / Slovene National Grid (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=-5000000 +ellps=bessel +datum=hermannskogel +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Slovene National Grid (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"MGI\",DATUM[\"Militar_Geographische_Institute\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137"); + add_srs_wkt (p, 4, + ",1.474,5.297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIME"); + add_srs_wkt (p, 5, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 6, + "egree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]]"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 8, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 10, + "l_meridian\",15],PARAMETER[\"scale_factor\",0.9999],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 12, + "ng\",-5000000],AUTHORITY[\"EPSG\",\"3787\"],AXIS[\"Y\",E"); + add_srs_wkt (p, 13, "AST],AXIS[\"X\",NORTH]]"); + p = add_epsg_def (first, last, 3788, "epsg", 3788, + "NZGD2000 / Auckland Islands TM 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=166 +k=1 +x_0=3500000 +y_0=1"); + add_proj4text (p, 1, + "0000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Auckland Islands TM 2000\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NZGD2000\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6167\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",166],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 10, + "tor\",1],PARAMETER[\"false_easting\",3500000],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"3788\""); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3789, "epsg", 3789, + "NZGD2000 / Campbell Island TM 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=169 +k=1 +x_0=3500000 +y_0=1"); + add_proj4text (p, 1, + "0000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Campbell Island TM 2000\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "ZGD2000\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6167\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",169],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 10, + "tor\",1],PARAMETER[\"false_easting\",3500000],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"3789\""); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3790, "epsg", 3790, + "NZGD2000 / Antipodes Islands TM 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=179 +k=1 +x_0=3500000 +y_0=1"); + add_proj4text (p, 1, + "0000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Antipodes Islands TM 2000\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NZGD2000\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6167\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",179],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 10, + "tor\",1],PARAMETER[\"false_easting\",3500000],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"3790\""); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3791, "epsg", 3791, + "NZGD2000 / Raoul Island TM 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-178 +k=1 +x_0=3500000 +y_0="); + add_proj4text (p, 1, + "10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Raoul Island TM 2000\",GEOGCS[\"NZGD"); + add_srs_wkt (p, 1, + "2000\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 4, + "167\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 5, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metr"); + add_srs_wkt (p, 7, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 8, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 9, + "METER[\"central_meridian\",-178],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 10, + "r\",1],PARAMETER[\"false_easting\",3500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"3791\"],"); + add_srs_wkt (p, 12, "AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3793, "epsg", 3793, + "NZGD2000 / Chatham Islands TM 2000"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-176.5 +k=1 +x_0=3500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / Chatham Islands TM 2000\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "ZGD2000\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6167\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",-176.5],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",1],PARAMETER[\"false_easting\",3500000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"379"); + add_srs_wkt (p, 12, + "3\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 3794, "epsg", 3794, + "Slovenia 1996 / Slovene National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Slovenia 1996 / Slovene National Grid\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Slovenia 1996\",DATUM[\"Slovenia_Geodetic_Datum_1996\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"6765\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4765\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",15],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9999],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",-5000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "3794\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 3795, "epsg", 3795, "NAD27 / Cuba Norte"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=23 +lat_2=21.7 +lat_0=22.35 +lon_0=-81 "); + add_proj4text (p, 1, + "+x_0=500000 +y_0=280296.016 +ellps=clrk66 +datum=NAD27 +"); + add_proj4text (p, 2, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Cuba Norte\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "standard_parallel_1\",23],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 9, + "2\",21.7],PARAMETER[\"latitude_of_origin\",22.35],PARAME"); + add_srs_wkt (p, 10, + "TER[\"central_meridian\",-81],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",280296.016],AUTHOR"); + add_srs_wkt (p, 12, + "ITY[\"EPSG\",\"3795\"],AXIS[\"Y\",NORTH],AXIS[\"X\",EAST"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 3796, "epsg", 3796, "NAD27 / Cuba Sur"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=21.3 +lat_2=20.13333333333333 +lat_0=20"); + add_proj4text (p, 1, + ".71666666666667 +lon_0=-76.83333333333333 +x_0=500000 +y"); + add_proj4text (p, 2, + "_0=229126.939 +ellps=clrk66 +datum=NAD27 +units=m +no_de"); + add_proj4text (p, 3, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Cuba Sur\",GEOGCS[\"NAD27\",DATUM[\"Nor"); + add_srs_wkt (p, 1, + "th_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637820"); + add_srs_wkt (p, 2, + "6.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "67\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 8, + "andard_parallel_1\",21.3],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 9, + "2\",20.13333333333333],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 10, + "20.71666666666667],PARAMETER[\"central_meridian\",-76.83"); + add_srs_wkt (p, 11, + "333333333333],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_northing\",229126.939],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "3796\"],AXIS[\"Y\",NORTH],AXIS[\"X\",EAST]]"); + p = add_epsg_def (first, last, 3797, "epsg", 3797, "NAD27 / MTQ Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=50 +lat_2=46 +lat_0=44 +lon_0=-70 +x_0="); + add_proj4text (p, 1, + "800000 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / MTQ Lambert\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "standard_parallel_1\",50],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 9, + "2\",46],PARAMETER[\"latitude_of_origin\",44],PARAMETER[\""); + add_srs_wkt (p, 10, + "central_meridian\",-70],PARAMETER[\"false_easting\",8000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "3797\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3798, "epsg", 3798, "NAD83 / MTQ Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=50 +lat_2=46 +lat_0=44 +lon_0=-70 +x_0="); + add_proj4text (p, 1, + "800000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTQ Lambert\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",50],PARAMETER[\"standard_parallel_2\",46],"); + add_srs_wkt (p, 9, + "PARAMETER[\"latitude_of_origin\",44],PARAMETER[\"central"); + add_srs_wkt (p, 10, + "_meridian\",-70],PARAMETER[\"false_easting\",800000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3798\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3799, "epsg", 3799, + "NAD83(CSRS) / MTQ Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=50 +lat_2=46 +lat_0=44 +lon_0=-70 +x_0="); + add_proj4text (p, 1, "800000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTQ Lambert\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",50],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",46],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 10, + "\",44],PARAMETER[\"central_meridian\",-70],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",800000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"3799\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 3800, "epsg", 3800, + "NAD27 / Alberta 3TM ref merid 120 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alberta 3TM ref merid 120 W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD27\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"C"); + add_srs_wkt (p, 2, + "larke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-120],PARAMETER[\"scale_factor\",0.9999],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",0],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"3800\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3801, "epsg", 3801, + "NAD83 / Alberta 3TM ref merid 120 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alberta 3TM ref merid 120 W\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "120],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3801\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 3802, "epsg", 3802, + "NAD83(CSRS) / Alberta 3TM ref merid 120 W"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-120 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Alberta 3TM ref merid 120 W\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"NAD83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Refer"); + add_srs_wkt (p, 2, + "ence_System\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"614"); + add_srs_wkt (p, 4, + "0\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-120],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9999],PARAMETER[\"false_easting\",0],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"3802\"],AXIS[\"East"); + add_srs_wkt (p, 12, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3812, "epsg", 3812, + "ETRS89 / Belgian Lambert 2008"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666"); + add_proj4text (p, 1, + "666 +lat_0=50.797815 +lon_0=4.359215833333333 +x_0=64932"); + add_proj4text (p, 2, "8 +y_0=665262 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / Belgian Lambert 2008\",GEOGCS[\"ETRS89"); + add_srs_wkt (p, 1, + "\",DATUM[\"European_Terrestrial_Reference_System_1989\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",49.8333333333333"); + add_srs_wkt (p, 9, + "4],PARAMETER[\"standard_parallel_2\",51.16666666666666],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",50.797815],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",4.359215833333333],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "easting\",649328],PARAMETER[\"false_northing\",665262],A"); + add_srs_wkt (p, 13, + "UTHORITY[\"EPSG\",\"3812\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 14, "NORTH]]"); + p = add_epsg_def (first, last, 3814, "epsg", 3814, + "NAD83 / Mississippi TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=32.5 +lon_0=-89.75 +k=0.9998335 +x_0="); + add_proj4text (p, 1, + "500000 +y_0=1300000 +ellps=GRS80 +datum=NAD83 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Mississippi TM\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",32.5],PARAMETER[\"central_meridian\",-89.75],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9998335],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",1300000],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"3814\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 12, "TH]]"); + p = add_epsg_def (first, last, 3815, "epsg", 3815, + "NAD83(HARN) / Mississippi TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=32.5 +lon_0=-89.75 +k=0.9998335 +x_0="); + add_proj4text (p, 1, "500000 +y_0=1300000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Mississippi TM\",GEOGCS[\"NAD83(H"); + add_srs_wkt (p, 1, + "ARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",32.5],PARAMETER[\"central"); + add_srs_wkt (p, 9, + "_meridian\",-89.75],PARAMETER[\"scale_factor\",0.9998335"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "northing\",1300000],AUTHORITY[\"EPSG\",\"3815\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3816, "epsg", 3816, + "NAD83(NSRS2007) / Mississippi TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=32.5 +lon_0=-89.75 +k=0.9998335 +x_0="); + add_proj4text (p, 1, + "500000 +y_0=1300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Mississippi TM\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference_"); + add_srs_wkt (p, 2, + "System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",32.5],PARAMETER[\"central_meridian\",-89.75"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9998335],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",500000],PARAMETER[\"false_northing\",1300000"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"3816\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 13, "\",NORTH]]"); + p = add_epsg_def (first, last, 3819, "epsg", 3819, "HD1909"); + add_proj4text (p, 0, + "+proj=longlat +ellps=bessel +towgs84=595.48,121.69,515.3"); + add_proj4text (p, 1, "5,4.115,-2.9383,0.853,-3.408 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"HD1909\",DATUM[\"Hungarian_Datum_1909\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7004\"]],TOWGS84[595.48,121.69,515.35,4.115,-2.93"); + add_srs_wkt (p, 3, + "83,0.853,-3.408],AUTHORITY[\"EPSG\",\"1024\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, "THORITY[\"EPSG\",\"3819\"]]"); + p = add_epsg_def (first, last, 3821, "epsg", 3821, "TWD67"); + add_proj4text (p, 0, "+proj=longlat +ellps=aust_SA +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"TWD67\",DATUM[\"Taiwan_Datum_1967\",SPHEROID[\""); + add_srs_wkt (p, 1, + "GRS 1967 Modified\",6378160,298.25,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7050\"]],AUTHORITY[\"EPSG\",\"1025\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"3821\"]]"); + p = add_epsg_def (first, last, 3824, "epsg", 3824, "TWD97"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"TWD97\",DATUM[\"Taiwan_Datum_1997\",SPHEROID[\""); + add_srs_wkt (p, 1, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "19\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1026\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"3824\"]]"); + p = add_epsg_def (first, last, 3825, "epsg", 3825, "TWD97 / TM2 zone 119"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=119 +k=0.9999 +x_0=250000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"TWD97 / TM2 zone 119\",GEOGCS[\"TWD97\",DATUM[\""); + add_srs_wkt (p, 1, + "Taiwan_Datum_1997\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 2, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 3, + "0,0],AUTHORITY[\"EPSG\",\"1026\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"3824\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",11"); + add_srs_wkt (p, 9, + "9],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",250000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3825\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 12, "]]"); + p = add_epsg_def (first, last, 3826, "epsg", 3826, "TWD97 / TM2 zone 121"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"TWD97 / TM2 zone 121\",GEOGCS[\"TWD97\",DATUM[\""); + add_srs_wkt (p, 1, + "Taiwan_Datum_1997\",SPHEROID[\"GRS 1980\",6378137,298.25"); + add_srs_wkt (p, 2, + "7222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,"); + add_srs_wkt (p, 3, + "0,0],AUTHORITY[\"EPSG\",\"1026\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"3824\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",12"); + add_srs_wkt (p, 9, + "1],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",250000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3826\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 12, "]]"); + p = add_epsg_def (first, last, 3827, "epsg", 3827, "TWD67 / TM2 zone 119"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=119 +k=0.9999 +x_0=250000 +y"); + add_proj4text (p, 1, "_0=0 +ellps=aust_SA +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"TWD67 / TM2 zone 119\",GEOGCS[\"TWD67\",DATUM[\""); + add_srs_wkt (p, 1, + "Taiwan_Datum_1967\",SPHEROID[\"GRS 1967 Modified\",63781"); + add_srs_wkt (p, 2, + "60,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"1025\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3821\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 7, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 8, + "],PARAMETER[\"central_meridian\",119],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",0.9999],PARAMETER[\"false_easting\",250000],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3827\""); + add_srs_wkt (p, 11, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3828, "epsg", 3828, "TWD67 / TM2 zone 121"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y"); + add_proj4text (p, 1, "_0=0 +ellps=aust_SA +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"TWD67 / TM2 zone 121\",GEOGCS[\"TWD67\",DATUM[\""); + add_srs_wkt (p, 1, + "Taiwan_Datum_1967\",SPHEROID[\"GRS 1967 Modified\",63781"); + add_srs_wkt (p, 2, + "60,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"1025\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3821\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 7, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 8, + "],PARAMETER[\"central_meridian\",121],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",0.9999],PARAMETER[\"false_easting\",250000],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3828\""); + add_srs_wkt (p, 11, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3829, "epsg", 3829, + "Hu Tzu Shan / UTM zone 51N"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +ellps=intl +towgs84=-637,-549,-203,0"); + add_proj4text (p, 1, ",0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Hu Tzu Shan / UTM zone 51N\",GEOGCS[\"Hu Tzu Sh"); + add_srs_wkt (p, 1, + "an 1950\",DATUM[\"Hu_Tzu_Shan_1950\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[-637,-549,-203,0,0,0,0],AUTHORITY[\"EPSG\",\"6236"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4236\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",123],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3829\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3832, "epsg", 3832, "WGS 84 / PDC Mercator"); + add_proj4text (p, 0, + "+proj=merc +lon_0=150 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 1, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / PDC Mercator\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Mercator_1SP\""); + add_srs_wkt (p, 7, + "],PARAMETER[\"central_meridian\",150],PARAMETER[\"scale_"); + add_srs_wkt (p, 8, + "factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"f"); + add_srs_wkt (p, 9, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"3832\"],AXIS[\"E"); + add_srs_wkt (p, 10, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3833, "epsg", 3833, + "Pulkovo 1942(58) / Gauss-Kruger zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=2500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Gauss-Kruger zone 2\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",9],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",2500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3833\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3834, "epsg", 3834, + "Pulkovo 1942(83) / Gauss-Kruger zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=2500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / Gauss-Kruger zone 2\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_83\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",9],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",2500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"3834\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3835, "epsg", 3835, + "Pulkovo 1942(83) / Gauss-Kruger zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=3500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / Gauss-Kruger zone 3\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_83\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",15],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",3500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3835\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 3836, "epsg", 3836, + "Pulkovo 1942(83) / Gauss-Kruger zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / Gauss-Kruger zone 4\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_83\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",21],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",4500000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"3836\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 3837, "epsg", 3837, + "Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 3"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",9],PARAMETER[\"scale_factor\",1],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",3500000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"3837\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3838, "epsg", 3838, + "Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 4"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",12],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",4500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3838\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3839, "epsg", 3839, + "Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 9"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",27],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",9500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3839\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3840, "epsg", 3840, + "Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 1"); + add_srs_wkt (p, 1, + "0\",GEOGCS[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4179\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",30],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",10500000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 11, + ",AUTHORITY[\"EPSG\",\"3840\"],AXIS[\"X\",NORTH],AXIS[\"Y"); + add_srs_wkt (p, 12, "\",EAST]]"); + p = add_epsg_def (first, last, 3841, "epsg", 3841, + "Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 6"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_83\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",18],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",6500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3841\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3842, "epsg", 3842, + "Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 7"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_83\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",18],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",6500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3842\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3843, "epsg", 3843, + "Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 8"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_83\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4178\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",18],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",6500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"3843\"],AXIS[\"X\",NORTH],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",EAST]]"); + p = add_epsg_def (first, last, 3844, "epsg", 3844, + "Pulkovo 1942(58) / Stereo70"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=46 +lon_0=25 +k=0.99975 +x_0=500000 "); + add_proj4text (p, 1, "+y_0=500000 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942(58) / Stereo70\",GEOGCS[\"Pulkovo "); + add_srs_wkt (p, 1, + "1942(58)\",DATUM[\"Pulkovo_1942_58\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4179\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Oblique_Stereographic\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",46],PARAMETER[\"central_meridian\",25],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",0.99975],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",500000],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"3844\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAS"); + add_srs_wkt (p, 12, "T]]"); + p = add_epsg_def (first, last, 3845, "epsg", 3845, + "SWEREF99 / RT90 7.5 gon V emulation"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=11.30625 +k=1.000006 +x_0=15"); + add_proj4text (p, 1, + "00025.141 +y_0=-667.282 +ellps=GRS80 +towgs84=0,0,0,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 / RT90 7.5 gon V emulation\",GEOGCS[\""); + add_srs_wkt (p, 1, + "SWEREF99\",DATUM[\"SWEREF99\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 3, + "0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6619\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4619\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",11.30625],PARAMETER[\"scale_factor\",1.000006],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_easting\",1500025.141],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",-667.282],AUTHORITY[\"EPSG\",\"3845\"],AXIS["); + add_srs_wkt (p, 12, "\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3846, "epsg", 3846, + "SWEREF99 / RT90 5 gon V emulation"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13.55626666666667 +k=1.00000"); + add_proj4text (p, 1, + "58 +x_0=1500044.695 +y_0=-667.13 +ellps=GRS80 +towgs84=0"); + add_proj4text (p, 2, ",0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 / RT90 5 gon V emulation\",GEOGCS[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",DATUM[\"SWEREF99\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6619\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4619\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",13.55626666666667],PARAMETER[\"scale_factor\",1.00"); + add_srs_wkt (p, 10, + "00058],PARAMETER[\"false_easting\",1500044.695],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",-667.13],AUTHORITY[\"EPSG\",\"3846\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3847, "epsg", 3847, + "SWEREF99 / RT90 2.5 gon V emulation"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15.80628452944445 +k=1.00000"); + add_proj4text (p, 1, + "561024 +x_0=1500064.274 +y_0=-667.711 +ellps=GRS80 +towg"); + add_proj4text (p, 2, "s84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 / RT90 2.5 gon V emulation\",GEOGCS[\""); + add_srs_wkt (p, 1, + "SWEREF99\",DATUM[\"SWEREF99\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 3, + "0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6619\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4619\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",15.80628452944445],PARAMETER[\"scale_factor\",1.0"); + add_srs_wkt (p, 10, + "0000561024],PARAMETER[\"false_easting\",1500064.274],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",-667.711],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "3847\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3848, "epsg", 3848, + "SWEREF99 / RT90 0 gon emulation"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18.0563 +k=1.0000054 +x_0=15"); + add_proj4text (p, 1, + "00083.521 +y_0=-668.8440000000001 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 / RT90 0 gon emulation\",GEOGCS[\"SWER"); + add_srs_wkt (p, 1, + "EF99\",DATUM[\"SWEREF99\",SPHEROID[\"GRS 1980\",6378137,"); + add_srs_wkt (p, 2, + "298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0],AUTHORITY[\"EPSG\",\"6619\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4619\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",18.0563],PARAMETER[\"scale_factor\",1.0000054],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",1500083.521],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",-668.844],AUTHORITY[\"EPSG\",\"3848\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3849, "epsg", 3849, + "SWEREF99 / RT90 2.5 gon O emulation"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=20.30631666666667 +k=1.00000"); + add_proj4text (p, 1, + "52 +x_0=1500102.765 +y_0=-670.706 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 / RT90 2.5 gon O emulation\",GEOGCS[\""); + add_srs_wkt (p, 1, + "SWEREF99\",DATUM[\"SWEREF99\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 3, + "0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6619\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4619\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",20.30631666666667],PARAMETER[\"scale_factor\",1.0"); + add_srs_wkt (p, 10, + "000052],PARAMETER[\"false_easting\",1500102.765],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",-670.706],AUTHORITY[\"EPSG\",\"384"); + add_srs_wkt (p, 12, "9\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3850, "epsg", 3850, + "SWEREF99 / RT90 5 gon O emulation"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=22.55633333333333 +k=1.00000"); + add_proj4text (p, 1, + "49 +x_0=1500121.846 +y_0=-672.557 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SWEREF99 / RT90 5 gon O emulation\",GEOGCS[\"SW"); + add_srs_wkt (p, 1, + "EREF99\",DATUM[\"SWEREF99\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6619\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4619\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",22.55633333333333],PARAMETER[\"scale_factor\",1.00"); + add_srs_wkt (p, 10, + "00049],PARAMETER[\"false_easting\",1500121.846],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",-672.557],AUTHORITY[\"EPSG\",\"3850"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3851, "epsg", 3851, "NZGD2000 / NZCS2000"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-37.5 +lat_2=-44.5 +lat_0=-41 +lon_0=17"); + add_proj4text (p, 1, + "3 +x_0=3000000 +y_0=7000000 +ellps=GRS80 +towgs84=0,0,0,"); + add_proj4text (p, 2, "0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD2000 / NZCS2000\",GEOGCS[\"NZGD2000\",DATUM"); + add_srs_wkt (p, 1, + "[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6167\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4167\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",-37.5],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"standard_parallel_2\",-44.5],PARAMETER[\"latitu"); + add_srs_wkt (p, 10, + "de_of_origin\",-41],PARAMETER[\"central_meridian\",173],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_easting\",3000000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",7000000],AUTHORITY[\"EPSG\",\"3851\"],AXIS[\"N"); + add_srs_wkt (p, 13, "orthing\",NORTH],AXIS[\"Easting\",EAST]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_14 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 3852, "epsg", 3852, "RSRGD2000 / DGLC2000"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-76.66666666666667 +lat_2=-79.333333333"); + add_proj4text (p, 1, + "33333 +lat_0=-90 +lon_0=157 +x_0=500000 +y_0=0 +ellps=GR"); + add_proj4text (p, 2, "S80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RSRGD2000 / DGLC2000\",GEOGCS[\"RSRGD2000\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Ross_Sea_Region_Geodetic_Datum_2000\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6764\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4764\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Confo"); + add_srs_wkt (p, 8, + "rmal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",-76."); + add_srs_wkt (p, 9, + "66666666666667],PARAMETER[\"standard_parallel_2\",-79.33"); + add_srs_wkt (p, 10, + "333333333333],PARAMETER[\"latitude_of_origin\",-90],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",157],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"3852\"],AXIS[\"Northing\",NORTH],AXIS[\"Easting"); + add_srs_wkt (p, 14, "\",EAST]]"); + p = add_epsg_def (first, last, 3854, "epsg", 3854, "County ST74"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18.05787 +k=0.99999506 +x_0="); + add_proj4text (p, 1, + "100182.7406 +y_0=-6500620.1207 +ellps=GRS80 +towgs84=0,0"); + add_proj4text (p, 2, ",0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"County ST74\",GEOGCS[\"SWEREF99\",DATUM[\"SWERE"); + add_srs_wkt (p, 1, + "F99\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6619\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4619\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",18.05787],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",0.99999506],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",100182.7406],PARAMETER[\"false_northing\",-6500620."); + add_srs_wkt (p, 11, + "1207],AUTHORITY[\"EPSG\",\"3854\"],AXIS[\"x\",NORTH],AXI"); + add_srs_wkt (p, 12, "S[\"y\",EAST]]"); + p = add_epsg_def (first, last, 3857, "epsg", 3857, + "WGS 84 / Pseudo-Mercator"); + add_proj4text (p, 0, + "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 "); + add_proj4text (p, 1, + "+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext "); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.2572235"); + add_srs_wkt (p, 2, + "63,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"63"); + add_srs_wkt (p, 3, + "26\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Mercator_1"); + add_srs_wkt (p, 7, + "SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scal"); + add_srs_wkt (p, 8, + "e_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "false_northing\",0],EXTENSION[\"PROJ4\",\"+proj=merc +a="); + add_srs_wkt (p, 10, + "6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0="); + add_srs_wkt (p, 11, + "0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs\"],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"3857\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 3889, "epsg", 3889, "IGRS"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGRS\",DATUM[\"Iraqi_Geospatial_Reference_Syste"); + add_srs_wkt (p, 1, + "m\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"1029\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3889\"]]"); + p = add_epsg_def (first, last, 3890, "epsg", 3890, "IGRS / UTM zone 37N"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGRS / UTM zone 37N\",GEOGCS[\"IGRS\",DATUM[\"I"); + add_srs_wkt (p, 1, + "raqi_Geospatial_Reference_System\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1029\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"3889\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",39],PARAMETER[\"scale_factor\",0.9996],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"3890\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3891, "epsg", 3891, "IGRS / UTM zone 38N"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGRS / UTM zone 38N\",GEOGCS[\"IGRS\",DATUM[\"I"); + add_srs_wkt (p, 1, + "raqi_Geospatial_Reference_System\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1029\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"3889\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",45],PARAMETER[\"scale_factor\",0.9996],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"3891\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3892, "epsg", 3892, "IGRS / UTM zone 39N"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"IGRS / UTM zone 39N\",GEOGCS[\"IGRS\",DATUM[\"I"); + add_srs_wkt (p, 1, + "raqi_Geospatial_Reference_System\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1029\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"3889\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 9, + "l_meridian\",51],PARAMETER[\"scale_factor\",0.9996],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"3892\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3893, "epsg", 3893, + "ED50 / Iraq National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.02626833333333 +lon_0=46.5 +k=0.99"); + add_proj4text (p, 1, "94 +x_0=800000 +y_0=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / Iraq National Grid\",GEOGCS[\"ED50\",DAT"); + add_srs_wkt (p, 1, + "UM[\"European_Datum_1950\",SPHEROID[\"International 1924"); + add_srs_wkt (p, 2, + "\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",29.02626833333333],PARAMETER[\"central_meridian\",46."); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",0.9994],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",800000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"3893\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 12, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 3906, "epsg", 3906, "MGI 1901"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"MGI 1901\",DATUM[\"MGI_1901\",SPHEROID[\"Bessel"); + add_srs_wkt (p, 1, + " 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 2, + "4\"]],AUTHORITY[\"EPSG\",\"1031\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"3906\"]]"); + p = add_epsg_def (first, last, 3907, "epsg", 3907, + "MGI 1901 / Balkans zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=5500000 +y"); + add_proj4text (p, 1, "_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI 1901 / Balkans zone 5\",GEOGCS[\"MGI 1901\""); + add_srs_wkt (p, 1, + ",DATUM[\"MGI_1901\",SPHEROID[\"Bessel 1841\",6377397.155"); + add_srs_wkt (p, 2, + ",299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"1031\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3906\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",15],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9999],PARAMETER[\"false_easting\",5500000],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3907"); + add_srs_wkt (p, 11, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3908, "epsg", 3908, + "MGI 1901 / Balkans zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=0.9999 +x_0=6500000 +y"); + add_proj4text (p, 1, "_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI 1901 / Balkans zone 6\",GEOGCS[\"MGI 1901\""); + add_srs_wkt (p, 1, + ",DATUM[\"MGI_1901\",SPHEROID[\"Bessel 1841\",6377397.155"); + add_srs_wkt (p, 2, + ",299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"1031\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3906\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",18],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9999],PARAMETER[\"false_easting\",6500000],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3908"); + add_srs_wkt (p, 11, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3909, "epsg", 3909, + "MGI 1901 / Balkans zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=7500000 +y"); + add_proj4text (p, 1, "_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI 1901 / Balkans zone 7\",GEOGCS[\"MGI 1901\""); + add_srs_wkt (p, 1, + ",DATUM[\"MGI_1901\",SPHEROID[\"Bessel 1841\",6377397.155"); + add_srs_wkt (p, 2, + ",299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"1031\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3906\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",21],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9999],PARAMETER[\"false_easting\",7500000],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3909"); + add_srs_wkt (p, 11, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3910, "epsg", 3910, + "MGI 1901 / Balkans zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=8500000 +y"); + add_proj4text (p, 1, "_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI 1901 / Balkans zone 8\",GEOGCS[\"MGI 1901\""); + add_srs_wkt (p, 1, + ",DATUM[\"MGI_1901\",SPHEROID[\"Bessel 1841\",6377397.155"); + add_srs_wkt (p, 2, + ",299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"1031\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3906\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",24],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9999],PARAMETER[\"false_easting\",8500000],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3910"); + add_srs_wkt (p, 11, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3911, "epsg", 3911, + "MGI 1901 / Slovenia Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI 1901 / Slovenia Grid\",GEOGCS[\"MGI 1901\","); + add_srs_wkt (p, 1, + "DATUM[\"MGI_1901\",SPHEROID[\"Bessel 1841\",6377397.155,"); + add_srs_wkt (p, 2, + "299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"1031\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3906\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",15],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",0.9999],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3911\""); + add_srs_wkt (p, 11, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 3912, "epsg", 3912, + "MGI 1901 / Slovene National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=-5000000 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI 1901 / Slovene National Grid\",GEOGCS[\"MGI"); + add_srs_wkt (p, 1, + " 1901\",DATUM[\"MGI_1901\",SPHEROID[\"Bessel 1841\",6377"); + add_srs_wkt (p, 2, + "397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"1031\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3906"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",0],PARAMETER[\"central_meridian\",15],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",-5000000],AUTHORITY[\""); + add_srs_wkt (p, 11, "EPSG\",\"3912\"],AXIS[\"Y\",EAST],AXIS[\"X\",NORTH]]"); + p = add_epsg_def (first, last, 3920, "epsg", 3920, + "Puerto Rico / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=clrk66 +towgs84=11,72,-101,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Puerto Rico / UTM zone 20N\",GEOGCS[\"Puerto Ri"); + add_srs_wkt (p, 1, + "co\",DATUM[\"Puerto_Rico\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[11,72,-101,0,0,0,0],AUTHORITY[\"EPSG\",\"6139\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4139\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-63],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",0],AUTHORITY[\"EPSG\",\"3920\"],AXIS[\"Easti"); + add_srs_wkt (p, 12, "ng\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3942, "epsg", 3942, "RGF93 / CC42"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.25 +lat_2=42.75 +lat_0=42 +lon_0=3 +"); + add_proj4text (p, 1, + "x_0=1700000 +y_0=1200000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGF93 / CC42\",GEOGCS[\"RGF93\",DATUM[\"Reseau_"); + add_srs_wkt (p, 1, + "Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",41.25],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",42.75],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",42],PARAMETER[\"central_meridian\",3],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",1700000],PARAMETER[\"false_northing\",120"); + add_srs_wkt (p, 12, + "0000],AUTHORITY[\"EPSG\",\"3942\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3943, "epsg", 3943, "RGF93 / CC43"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.25 +lat_2=43.75 +lat_0=43 +lon_0=3 +"); + add_proj4text (p, 1, + "x_0=1700000 +y_0=2200000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGF93 / CC43\",GEOGCS[\"RGF93\",DATUM[\"Reseau_"); + add_srs_wkt (p, 1, + "Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",42.25],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",43.75],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",43],PARAMETER[\"central_meridian\",3],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",1700000],PARAMETER[\"false_northing\",220"); + add_srs_wkt (p, 12, + "0000],AUTHORITY[\"EPSG\",\"3943\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3944, "epsg", 3944, "RGF93 / CC44"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.25 +lat_2=44.75 +lat_0=44 +lon_0=3 +"); + add_proj4text (p, 1, + "x_0=1700000 +y_0=3200000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGF93 / CC44\",GEOGCS[\"RGF93\",DATUM[\"Reseau_"); + add_srs_wkt (p, 1, + "Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",43.25],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",44.75],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",44],PARAMETER[\"central_meridian\",3],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",1700000],PARAMETER[\"false_northing\",320"); + add_srs_wkt (p, 12, + "0000],AUTHORITY[\"EPSG\",\"3944\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3945, "epsg", 3945, "RGF93 / CC45"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.25 +lat_2=45.75 +lat_0=45 +lon_0=3 +"); + add_proj4text (p, 1, + "x_0=1700000 +y_0=4200000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGF93 / CC45\",GEOGCS[\"RGF93\",DATUM[\"Reseau_"); + add_srs_wkt (p, 1, + "Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",44.25],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",45.75],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",45],PARAMETER[\"central_meridian\",3],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",1700000],PARAMETER[\"false_northing\",420"); + add_srs_wkt (p, 12, + "0000],AUTHORITY[\"EPSG\",\"3945\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3946, "epsg", 3946, "RGF93 / CC46"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +"); + add_proj4text (p, 1, + "x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGF93 / CC46\",GEOGCS[\"RGF93\",DATUM[\"Reseau_"); + add_srs_wkt (p, 1, + "Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",45.25],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",46.75],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",46],PARAMETER[\"central_meridian\",3],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",1700000],PARAMETER[\"false_northing\",520"); + add_srs_wkt (p, 12, + "0000],AUTHORITY[\"EPSG\",\"3946\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3947, "epsg", 3947, "RGF93 / CC47"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.25 +lat_2=47.75 +lat_0=47 +lon_0=3 +"); + add_proj4text (p, 1, + "x_0=1700000 +y_0=6200000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGF93 / CC47\",GEOGCS[\"RGF93\",DATUM[\"Reseau_"); + add_srs_wkt (p, 1, + "Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",46.25],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",47.75],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",47],PARAMETER[\"central_meridian\",3],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",1700000],PARAMETER[\"false_northing\",620"); + add_srs_wkt (p, 12, + "0000],AUTHORITY[\"EPSG\",\"3947\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3948, "epsg", 3948, "RGF93 / CC48"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.25 +lat_2=48.75 +lat_0=48 +lon_0=3 +"); + add_proj4text (p, 1, + "x_0=1700000 +y_0=7200000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGF93 / CC48\",GEOGCS[\"RGF93\",DATUM[\"Reseau_"); + add_srs_wkt (p, 1, + "Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",47.25],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",48.75],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",48],PARAMETER[\"central_meridian\",3],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",1700000],PARAMETER[\"false_northing\",720"); + add_srs_wkt (p, 12, + "0000],AUTHORITY[\"EPSG\",\"3948\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3949, "epsg", 3949, "RGF93 / CC49"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.25 +lat_2=49.75 +lat_0=49 +lon_0=3 +"); + add_proj4text (p, 1, + "x_0=1700000 +y_0=8200000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGF93 / CC49\",GEOGCS[\"RGF93\",DATUM[\"Reseau_"); + add_srs_wkt (p, 1, + "Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",48.25],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",49.75],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",49],PARAMETER[\"central_meridian\",3],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",1700000],PARAMETER[\"false_northing\",820"); + add_srs_wkt (p, 12, + "0000],AUTHORITY[\"EPSG\",\"3949\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3950, "epsg", 3950, "RGF93 / CC50"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49.25 +lat_2=50.75 +lat_0=50 +lon_0=3 +"); + add_proj4text (p, 1, + "x_0=1700000 +y_0=9200000 +ellps=GRS80 +towgs84=0,0,0,0,0"); + add_proj4text (p, 2, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGF93 / CC50\",GEOGCS[\"RGF93\",DATUM[\"Reseau_"); + add_srs_wkt (p, 1, + "Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"standard_parallel_1\",49.25],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "tandard_parallel_2\",50.75],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",50],PARAMETER[\"central_meridian\",3],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",1700000],PARAMETER[\"false_northing\",920"); + add_srs_wkt (p, 12, + "0000],AUTHORITY[\"EPSG\",\"3950\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3968, "epsg", 3968, + "NAD83 / Virginia Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37 +lat_2=39.5 +lat_0=36 +lon_0=-79.5 +"); + add_proj4text (p, 1, + "x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Virginia Lambert\",GEOGCS[\"NAD83\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 8, + "ndard_parallel_1\",37],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 9, + ",39.5],PARAMETER[\"latitude_of_origin\",36],PARAMETER[\""); + add_srs_wkt (p, 10, + "central_meridian\",-79.5],PARAMETER[\"false_easting\",0]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"39"); + add_srs_wkt (p, 12, "68\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3969, "epsg", 3969, + "NAD83(HARN) / Virginia Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37 +lat_2=39.5 +lat_0=36 +lon_0=-79.5 +"); + add_proj4text (p, 1, "x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Virginia Lambert\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",37],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",39.5],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",36],PARAMETER[\"central_meridian\",-79.5],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",0],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 12, + "THORITY[\"EPSG\",\"3969\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 3970, "epsg", 3970, + "NAD83(NSRS2007) / Virginia Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37 +lat_2=39.5 +lat_0=36 +lon_0=-79.5 +"); + add_proj4text (p, 1, + "x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Virginia Lambert\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referenc"); + add_srs_wkt (p, 2, + "e_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.257222"); + add_srs_wkt (p, 3, + "101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",37],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 10, + "el_2\",39.5],PARAMETER[\"latitude_of_origin\",36],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-79.5],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"3970\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3975, "epsg", 3975, + "WGS 84 / NSIDC EASE-Grid Global"); + add_proj4text (p, 0, + "+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +ellps=WGS84"); + add_proj4text (p, 1, " +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / NSIDC EASE-Grid Global\",GEOGCS[\"WGS "); + add_srs_wkt (p, 1, + "84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298."); + add_srs_wkt (p, 2, + "257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"C"); + add_srs_wkt (p, 7, + "ylindrical_Equal_Area\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 8, + "\",30],PARAMETER[\"central_meridian\",0],PARAMETER[\"fal"); + add_srs_wkt (p, 9, + "se_easting\",0],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 10, + "Y[\"EPSG\",\"3975\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 11, ""); + p = add_epsg_def (first, last, 3976, "epsg", 3976, + "WGS 84 / NSIDC Sea Ice Polar Stereographic South"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-70 +lon_0=0 +k=1 +x_0=0 "); + add_proj4text (p, 1, "+y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / NSIDC Sea Ice Polar Stereographic Sout"); + add_srs_wkt (p, 1, + "h\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS "); + add_srs_wkt (p, 2, + "84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4326\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Polar_Stereographic\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",-70],PARAMETER[\"central_meridian\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "3976\"],AXIS[\"X\",UNKNOWN],AXIS[\"Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3978, "epsg", 3978, + "NAD83 / Canada Atlas Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0="); + add_proj4text (p, 1, + "0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Canada Atlas Lambert\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "standard_parallel_1\",49],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 9, + "2\",77],PARAMETER[\"latitude_of_origin\",49],PARAMETER[\""); + add_srs_wkt (p, 10, + "central_meridian\",-95],PARAMETER[\"false_easting\",0],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3978"); + add_srs_wkt (p, 12, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3979, "epsg", 3979, + "NAD83(CSRS) / Canada Atlas Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0="); + add_proj4text (p, 1, "0 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / Canada Atlas Lambert\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Reference_Sy"); + add_srs_wkt (p, 2, + "stem\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conforma"); + add_srs_wkt (p, 8, + "l_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",49],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"standard_parallel_2\",77],PARAMETER[\"latitude_"); + add_srs_wkt (p, 10, + "of_origin\",49],PARAMETER[\"central_meridian\",-95],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_easting\",0],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"3979\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 13, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 3985, "epsg", 3985, + "Katanga 1955 / Katanga Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=-6.5 +lat_2=-11.5 +lat_0=9 +lon_0=26 +x"); + add_proj4text (p, 1, + "_0=500000 +y_0=500000 +ellps=clrk66 +towgs84=-103.746,-9"); + add_proj4text (p, 2, ".614,-255.95,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Katanga 1955 / Katanga Lambert\",GEOGCS[\"Katan"); + add_srs_wkt (p, 1, + "ga 1955\",DATUM[\"Katanga_1955\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],TOWGS84[-103.746,-9.614,-255.95,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6695\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4695\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_p"); + add_srs_wkt (p, 9, + "arallel_1\",-6.5],PARAMETER[\"standard_parallel_2\",-11."); + add_srs_wkt (p, 10, + "5],PARAMETER[\"latitude_of_origin\",9],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",26],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "3985\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3986, "epsg", 3986, + "Katanga 1955 / Katanga Gauss zone A"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-9 +lon_0=30 +k=1 +x_0=200000 +y_0=50"); + add_proj4text (p, 1, + "0000 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Katanga 1955 / Katanga Gauss zone A\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Katanga 1955\",DATUM[\"Katanga_1955\",SPHEROID[\"Clarke "); + add_srs_wkt (p, 2, + "1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7008\"]],TOWGS84[-103.746,-9.614,-255.95,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"6695\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4695"); + add_srs_wkt (p, 7, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 9, + "origin\",-9],PARAMETER[\"central_meridian\",30],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",200000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"3986\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3987, "epsg", 3987, + "Katanga 1955 / Katanga Gauss zone B"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-9 +lon_0=28 +k=1 +x_0=200000 +y_0=50"); + add_proj4text (p, 1, + "0000 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Katanga 1955 / Katanga Gauss zone B\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Katanga 1955\",DATUM[\"Katanga_1955\",SPHEROID[\"Clarke "); + add_srs_wkt (p, 2, + "1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7008\"]],TOWGS84[-103.746,-9.614,-255.95,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"6695\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4695"); + add_srs_wkt (p, 7, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 9, + "origin\",-9],PARAMETER[\"central_meridian\",28],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",200000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"3987\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3988, "epsg", 3988, + "Katanga 1955 / Katanga Gauss zone C"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-9 +lon_0=26 +k=1 +x_0=200000 +y_0=50"); + add_proj4text (p, 1, + "0000 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Katanga 1955 / Katanga Gauss zone C\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Katanga 1955\",DATUM[\"Katanga_1955\",SPHEROID[\"Clarke "); + add_srs_wkt (p, 2, + "1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7008\"]],TOWGS84[-103.746,-9.614,-255.95,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"6695\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4695"); + add_srs_wkt (p, 7, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 9, + "origin\",-9],PARAMETER[\"central_meridian\",26],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",200000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"3988\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3989, "epsg", 3989, + "Katanga 1955 / Katanga Gauss zone D"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-9 +lon_0=24 +k=1 +x_0=200000 +y_0=50"); + add_proj4text (p, 1, + "0000 +ellps=clrk66 +towgs84=-103.746,-9.614,-255.95,0,0,"); + add_proj4text (p, 2, "0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Katanga 1955 / Katanga Gauss zone D\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Katanga 1955\",DATUM[\"Katanga_1955\",SPHEROID[\"Clarke "); + add_srs_wkt (p, 2, + "1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7008\"]],TOWGS84[-103.746,-9.614,-255.95,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"6695\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4695"); + add_srs_wkt (p, 7, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 9, + "origin\",-9],PARAMETER[\"central_meridian\",24],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",200000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"3989\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3991, "epsg", 3991, + "Puerto Rico State Plane CS of 1927"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +"); + add_proj4text (p, 2, + "x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +towgs84=11,7"); + add_proj4text (p, 3, "2,-101,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Puerto Rico State Plane CS of 1927\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "uerto Rico\",DATUM[\"Puerto_Rico\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],TOWGS84[11,72,-101,0,0,0,0],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 4, + "139\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 5, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4139\"]],UNIT[\"US s"); + add_srs_wkt (p, 7, + "urvey foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "3\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"standard_parallel_1\",18.43333333333333],PARAMETER"); + add_srs_wkt (p, 10, + "[\"standard_parallel_2\",18.03333333333333],PARAMETER[\""); + add_srs_wkt (p, 11, + "latitude_of_origin\",17.83333333333333],PARAMETER[\"cent"); + add_srs_wkt (p, 12, + "ral_meridian\",-66.43333333333334],PARAMETER[\"false_eas"); + add_srs_wkt (p, 13, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 14, + "[\"EPSG\",\"3991\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3992, "epsg", 3992, + "Puerto Rico / St. Croix"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +"); + add_proj4text (p, 2, + "x_0=152400.3048006096 +y_0=30480.06096012192 +ellps=clrk"); + add_proj4text (p, 3, + "66 +towgs84=11,72,-101,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Puerto Rico / St. Croix\",GEOGCS[\"Puerto Rico\""); + add_srs_wkt (p, 1, + ",DATUM[\"Puerto_Rico\",SPHEROID[\"Clarke 1866\",6378206."); + add_srs_wkt (p, 2, + "4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],TOWGS8"); + add_srs_wkt (p, 3, + "4[11,72,-101,0,0,0,0],AUTHORITY[\"EPSG\",\"6139\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4139\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",18.43333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",18.03333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",17.83333333333333],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-66.43333333333334],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 13, + "0],PARAMETER[\"false_northing\",100000],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 14, "\",\"3992\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3994, "epsg", 3994, "WGS 84 / Mercator 41"); + add_proj4text (p, 0, + "+proj=merc +lon_0=100 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +d"); + add_proj4text (p, 1, "atum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / Mercator 41\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Mercator_1SP\""); + add_srs_wkt (p, 7, + "],PARAMETER[\"central_meridian\",100],PARAMETER[\"scale_"); + add_srs_wkt (p, 8, + "factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"f"); + add_srs_wkt (p, 9, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"3994\"],AXIS[\"X"); + add_srs_wkt (p, 10, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 3995, "epsg", 3995, + "WGS 84 / Arctic Polar Stereographic"); + add_proj4text (p, 0, + "+proj=stere +lat_0=90 +lat_ts=71 +lon_0=0 +k=1 +x_0=0 +y"); + add_proj4text (p, 1, "_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / Arctic Polar Stereographic\",GEOGCS[\""); + add_srs_wkt (p, 1, + "WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,"); + add_srs_wkt (p, 2, + "298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Polar_Stereographic\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",71],PARAMETER[\"central_meridian\",0],PARAMETER[\"sca"); + add_srs_wkt (p, 9, + "le_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"3995\"],AXIS["); + add_srs_wkt (p, 11, "\"X\",UNKNOWN],AXIS[\"Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3996, "epsg", 3996, + "WGS 84 / IBCAO Polar Stereographic"); + add_proj4text (p, 0, + "+proj=stere +lat_0=90 +lat_ts=75 +lon_0=0 +k=1 +x_0=0 +y"); + add_proj4text (p, 1, "_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / IBCAO Polar Stereographic\",GEOGCS[\"W"); + add_srs_wkt (p, 1, + "GS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,2"); + add_srs_wkt (p, 2, + "98.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Polar_Stereographic\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",75],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_northing\",0],AUTHORITY[\"EPSG\",\"3996\"],AXIS[\""); + add_srs_wkt (p, 11, "X\",UNKNOWN],AXIS[\"Y\",UNKNOWN]]"); + p = add_epsg_def (first, last, 3997, "epsg", 3997, + "WGS 84 / Dubai Local TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=55.33333333333334 +k=1 +x_0="); + add_proj4text (p, 1, + "500000 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / Dubai Local TM\",GEOGCS[\"WGS 84\",DAT"); + add_srs_wkt (p, 1, + "UM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.25722356"); + add_srs_wkt (p, 2, + "3,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"632"); + add_srs_wkt (p, 3, + "6\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",55.33333333333334],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "cale_factor\",1],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3997\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 4001, "epsg", 4001, + "Unknown datum based upon the Airy 1830 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=airy +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Airy 1830 ellipsoi"); + add_srs_wkt (p, 1, + "d\",DATUM[\"Not_specified_based_on_Airy_1830_ellipsoid\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Airy 1830\",6377563.396,299.3249646,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7001\"]],AUTHORITY[\"EPSG\",\"6001\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, "]],AUTHORITY[\"EPSG\",\"4001\"]]"); + p = add_epsg_def (first, last, 4002, "epsg", 4002, + "Unknown datum based upon the Airy Modified 1849 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=mod_airy +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Airy Modified 1849"); + add_srs_wkt (p, 1, + " ellipsoid\",DATUM[\"Not_specified_based_on_Airy_Modifie"); + add_srs_wkt (p, 2, + "d_1849_ellipsoid\",SPHEROID[\"Airy Modified 1849\",63773"); + add_srs_wkt (p, 3, + "40.189,299.3249646,AUTHORITY[\"EPSG\",\"7002\"]],AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"6002\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 5, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4002\""); + add_srs_wkt (p, 7, "]]"); + p = add_epsg_def (first, last, 4003, "epsg", 4003, + "Unknown datum based upon the Australian National Spheroid"); + add_proj4text (p, 0, "+proj=longlat +ellps=aust_SA +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Australian Nationa"); + add_srs_wkt (p, 1, + "l Spheroid\",DATUM[\"Not_specified_based_on_Australian_N"); + add_srs_wkt (p, 2, + "ational_Spheroid\",SPHEROID[\"Australian National Sphero"); + add_srs_wkt (p, 3, + "id\",6378160,298.25,AUTHORITY[\"EPSG\",\"7003\"]],AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"6003\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4003"); + add_srs_wkt (p, 7, "\"]]"); + p = add_epsg_def (first, last, 4004, "epsg", 4004, + "Unknown datum based upon the Bessel 1841 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Bessel 1841 ellips"); + add_srs_wkt (p, 1, + "oid\",DATUM[\"Not_specified_based_on_Bessel_1841_ellipso"); + add_srs_wkt (p, 2, + "id\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6004\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "9122\"]],AUTHORITY[\"EPSG\",\"4004\"]]"); + p = add_epsg_def (first, last, 4005, "epsg", 4005, + "Unknown datum based upon the Bessel Modified ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6377492.018 +b=6356173.508712696 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Bessel Modified el"); + add_srs_wkt (p, 1, + "lipsoid\",DATUM[\"Not_specified_based_on_Bessel_Modified"); + add_srs_wkt (p, 2, + "_ellipsoid\",SPHEROID[\"Bessel Modified\",6377492.018,29"); + add_srs_wkt (p, 3, + "9.1528128,AUTHORITY[\"EPSG\",\"7005\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6005\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4005\"]]"); + p = add_epsg_def (first, last, 4006, "epsg", 4006, + "Unknown datum based upon the Bessel Namibia ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=bess_nam +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Bessel Namibia ell"); + add_srs_wkt (p, 1, + "ipsoid\",DATUM[\"Not_specified_based_on_Bessel_Namibia_e"); + add_srs_wkt (p, 2, + "llipsoid\",SPHEROID[\"Bessel Namibia (GLM)\",6377483.865"); + add_srs_wkt (p, 3, + "280419,299.1528128,AUTHORITY[\"EPSG\",\"7046\"]],AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"6006\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 5, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4006\""); + add_srs_wkt (p, 7, "]]"); + p = add_epsg_def (first, last, 4007, "epsg", 4007, + "Unknown datum based upon the Clarke 1858 ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378293.645208759 +b=6356617.987679838 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Clarke 1858 ellips"); + add_srs_wkt (p, 1, + "oid\",DATUM[\"Not_specified_based_on_Clarke_1858_ellipso"); + add_srs_wkt (p, 2, + "id\",SPHEROID[\"Clarke 1858\",6378293.645208759,294.2606"); + add_srs_wkt (p, 3, + "763692569,AUTHORITY[\"EPSG\",\"7007\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6007\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4007\"]]"); + p = add_epsg_def (first, last, 4008, "epsg", 4008, + "Unknown datum based upon the Clarke 1866 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Clarke 1866 ellips"); + add_srs_wkt (p, 1, + "oid\",DATUM[\"Not_specified_based_on_Clarke_1866_ellipso"); + add_srs_wkt (p, 2, + "id\",SPHEROID[\"Clarke 1866\",6378206.4,294.978698213900"); + add_srs_wkt (p, 3, + "6,AUTHORITY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"600"); + add_srs_wkt (p, 4, + "8\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4008\"]]"); + p = add_epsg_def (first, last, 4009, "epsg", 4009, + "Unknown datum based upon the Clarke 1866 Michigan ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378450.047548896 +b=6356826.621488444 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Clarke 1866 Michig"); + add_srs_wkt (p, 1, + "an ellipsoid\",DATUM[\"Not_specified_based_on_Clarke_186"); + add_srs_wkt (p, 2, + "6_Michigan_ellipsoid\",SPHEROID[\"Clarke 1866 Michigan\""); + add_srs_wkt (p, 3, + ",6378450.047548896,294.9786971646739,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"7009\"]],AUTHORITY[\"EPSG\",\"6009\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 5, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 6, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 7, "Y[\"EPSG\",\"4009\"]]"); + p = add_epsg_def (first, last, 4010, "epsg", 4010, + "Unknown datum based upon the Clarke 1880 (Benoit) ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378300.789 +b=6356566.435 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Clarke 1880 (Benoi"); + add_srs_wkt (p, 1, + "t) ellipsoid\",DATUM[\"Not_specified_based_on_Clarke_188"); + add_srs_wkt (p, 2, + "0_Benoit_ellipsoid\",SPHEROID[\"Clarke 1880 (Benoit)\",6"); + add_srs_wkt (p, 3, + "378300.789,293.4663155389802,AUTHORITY[\"EPSG\",\"7010\""); + add_srs_wkt (p, 4, + "]],AUTHORITY[\"EPSG\",\"6010\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 6, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, "\",\"4010\"]]"); + p = add_epsg_def (first, last, 4011, "epsg", 4011, + "Unknown datum based upon the Clarke 1880 (IGN) ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Clarke 1880 (IGN) "); + add_srs_wkt (p, 1, + "ellipsoid\",DATUM[\"Not_specified_based_on_Clarke_1880_I"); + add_srs_wkt (p, 2, + "GN_ellipsoid\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,"); + add_srs_wkt (p, 3, + "293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"6011\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4011\"]"); + add_srs_wkt (p, 7, "]"); + p = add_epsg_def (first, last, 4012, "epsg", 4012, + "Unknown datum based upon the Clarke 1880 (RGS) ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Clarke 1880 (RGS) "); + add_srs_wkt (p, 1, + "ellipsoid\",DATUM[\"Not_specified_based_on_Clarke_1880_R"); + add_srs_wkt (p, 2, + "GS_ellipsoid\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6012\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4012\"]]"); + p = add_epsg_def (first, last, 4013, "epsg", 4013, + "Unknown datum based upon the Clarke 1880 (Arc) ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.145 +b=6356514.966398753 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Clarke 1880 (Arc) "); + add_srs_wkt (p, 1, + "ellipsoid\",DATUM[\"Not_specified_based_on_Clarke_1880_A"); + add_srs_wkt (p, 2, + "rc_ellipsoid\",SPHEROID[\"Clarke 1880 (Arc)\",6378249.14"); + add_srs_wkt (p, 3, + "5,293.4663077,AUTHORITY[\"EPSG\",\"7013\"]],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6013\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4013\"]]"); + p = add_epsg_def (first, last, 4014, "epsg", 4014, + "Unknown datum based upon the Clarke 1880 (SGA 1922) ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356514.996941779 +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Clarke 1880 (SGA 1"); + add_srs_wkt (p, 1, + "922) ellipsoid\",DATUM[\"Not_specified_based_on_Clarke_1"); + add_srs_wkt (p, 2, + "880_SGA_1922_ellipsoid\",SPHEROID[\"Clarke 1880 (SGA 192"); + add_srs_wkt (p, 3, + "2)\",6378249.2,293.46598,AUTHORITY[\"EPSG\",\"7014\"]],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6014\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, "4014\"]]"); + p = add_epsg_def (first, last, 4015, "epsg", 4015, + "Unknown datum based upon the Everest 1830 (1937 Adjustment) ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6377276.345 +b=6356075.41314024 +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Everest 1830 (1937"); + add_srs_wkt (p, 1, + " Adjustment) ellipsoid\",DATUM[\"Not_specified_based_on_"); + add_srs_wkt (p, 2, + "Everest_1830_1937_Adjustment_ellipsoid\",SPHEROID[\"Ever"); + add_srs_wkt (p, 3, + "est 1830 (1937 Adjustment)\",6377276.345,300.8017,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"7015\"]],AUTHORITY[\"EPSG\",\"6015\"]],PR"); + add_srs_wkt (p, 5, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 6, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 7, "\"]],AUTHORITY[\"EPSG\",\"4015\"]]"); + p = add_epsg_def (first, last, 4016, "epsg", 4016, + "Unknown datum based upon the Everest 1830 (1967 Definition) ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=evrstSS +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Everest 1830 (1967"); + add_srs_wkt (p, 1, + " Definition) ellipsoid\",DATUM[\"Not_specified_based_on_"); + add_srs_wkt (p, 2, + "Everest_1830_1967_Definition_ellipsoid\",SPHEROID[\"Ever"); + add_srs_wkt (p, 3, + "est 1830 (1967 Definition)\",6377298.556,300.8017,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"7016\"]],AUTHORITY[\"EPSG\",\"6016\"]],PR"); + add_srs_wkt (p, 5, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 6, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 7, "\"]],AUTHORITY[\"EPSG\",\"4016\"]]"); + p = add_epsg_def (first, last, 4018, "epsg", 4018, + "Unknown datum based upon the Everest 1830 Modified ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6377304.063 +b=6356103.038993155 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Everest 1830 Modif"); + add_srs_wkt (p, 1, + "ied ellipsoid\",DATUM[\"Not_specified_based_on_Everest_1"); + add_srs_wkt (p, 2, + "830_Modified_ellipsoid\",SPHEROID[\"Everest 1830 Modifie"); + add_srs_wkt (p, 3, + "d\",6377304.063,300.8017,AUTHORITY[\"EPSG\",\"7018\"]],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6018\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, "4018\"]]"); + p = add_epsg_def (first, last, 4019, "epsg", 4019, + "Unknown datum based upon the GRS 1980 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the GRS 1980 ellipsoid"); + add_srs_wkt (p, 1, + "\",DATUM[\"Not_specified_based_on_GRS_1980_ellipsoid\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6019\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, "THORITY[\"EPSG\",\"4019\"]]"); + p = add_epsg_def (first, last, 4020, "epsg", 4020, + "Unknown datum based upon the Helmert 1906 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=helmert +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Helmert 1906 ellip"); + add_srs_wkt (p, 1, + "soid\",DATUM[\"Not_specified_based_on_Helmert_1906_ellip"); + add_srs_wkt (p, 2, + "soid\",SPHEROID[\"Helmert 1906\",6378200,298.3,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7020\"]],AUTHORITY[\"EPSG\",\"6020\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, "],AUTHORITY[\"EPSG\",\"4020\"]]"); + p = add_epsg_def (first, last, 4021, "epsg", 4021, + "Unknown datum based upon the Indonesian National Spheroid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378160 +b=6356774.50408554 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Indonesian Nationa"); + add_srs_wkt (p, 1, + "l Spheroid\",DATUM[\"Not_specified_based_on_Indonesian_N"); + add_srs_wkt (p, 2, + "ational_Spheroid\",SPHEROID[\"Indonesian National Sphero"); + add_srs_wkt (p, 3, + "id\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6021\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"402"); + add_srs_wkt (p, 7, "1\"]]"); + p = add_epsg_def (first, last, 4022, "epsg", 4022, + "Unknown datum based upon the International 1924 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the International 1924"); + add_srs_wkt (p, 1, + " ellipsoid\",DATUM[\"Not_specified_based_on_Internationa"); + add_srs_wkt (p, 2, + "l_1924_ellipsoid\",SPHEROID[\"International 1924\",63783"); + add_srs_wkt (p, 3, + "88,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6022\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4022\"]]"); + p = add_epsg_def (first, last, 4023, "epsg", 4023, "MOLDREF99"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"MOLDREF99\",DATUM[\"MOLDREF99\",SPHEROID[\"GRS "); + add_srs_wkt (p, 1, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 2, + "]],AUTHORITY[\"EPSG\",\"1032\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 4, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, "\",\"4023\"]]"); + p = add_epsg_def (first, last, 4024, "epsg", 4024, + "Unknown datum based upon the Krassowsky 1940 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=krass +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Krassowsky 1940 el"); + add_srs_wkt (p, 1, + "lipsoid\",DATUM[\"Not_specified_based_on_Krassowsky_1940"); + add_srs_wkt (p, 2, + "_ellipsoid\",SPHEROID[\"Krassowsky 1940\",6378245,298.3,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6024\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "9122\"]],AUTHORITY[\"EPSG\",\"4024\"]]"); + p = add_epsg_def (first, last, 4025, "epsg", 4025, + "Unknown datum based upon the NWL 9D ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the NWL 9D ellipsoid\""); + add_srs_wkt (p, 1, + ",DATUM[\"Not_specified_based_on_NWL_9D_ellipsoid\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"NWL 9D\",6378145,298.25,AUTHORITY[\"EPSG\",\"7025\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6025\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, "\",\"4025\"]]"); + p = add_epsg_def (first, last, 4026, "epsg", 4026, + "MOLDREF99 / Moldova TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=28.4 +k=0.9999400000000001 +"); + add_proj4text (p, 1, + "x_0=200000 +y_0=-5000000 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MOLDREF99 / Moldova TM\",GEOGCS[\"MOLDREF99\",D"); + add_srs_wkt (p, 1, + "ATUM[\"MOLDREF99\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 2, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"1032\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4023\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",28.4],PARAMETER[\"scale_fa"); + add_srs_wkt (p, 9, + "ctor\",0.99994],PARAMETER[\"false_easting\",200000],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_northing\",-5000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "4026\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 4027, "epsg", 4027, + "Unknown datum based upon the Plessis 1817 ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6376523 +b=6355862.933255573 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Plessis 1817 ellip"); + add_srs_wkt (p, 1, + "soid\",DATUM[\"Not_specified_based_on_Plessis_1817_ellip"); + add_srs_wkt (p, 2, + "soid\",SPHEROID[\"Plessis 1817\",6376523,308.64,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7027\"]],AUTHORITY[\"EPSG\",\"6027\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, "]],AUTHORITY[\"EPSG\",\"4027\"]]"); + p = add_epsg_def (first, last, 4028, "epsg", 4028, + "Unknown datum based upon the Struve 1860 ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378298.3 +b=6356657.142669561 +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Struve 1860 ellips"); + add_srs_wkt (p, 1, + "oid\",DATUM[\"Not_specified_based_on_Struve_1860_ellipso"); + add_srs_wkt (p, 2, + "id\",SPHEROID[\"Struve 1860\",6378298.3,294.73,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7028\"]],AUTHORITY[\"EPSG\",\"6028\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, "],AUTHORITY[\"EPSG\",\"4028\"]]"); + p = add_epsg_def (first, last, 4029, "epsg", 4029, + "Unknown datum based upon the War Office ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378300 +b=6356751.689189189 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the War Office ellipso"); + add_srs_wkt (p, 1, + "id\",DATUM[\"Not_specified_based_on_War_Office_ellipsoid"); + add_srs_wkt (p, 2, + "\",SPHEROID[\"War Office\",6378300,296,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7029\"]],AUTHORITY[\"EPSG\",\"6029\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, "TY[\"EPSG\",\"4029\"]]"); + p = add_epsg_def (first, last, 4030, "epsg", 4030, + "Unknown datum based upon the WGS 84 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS84 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the WGS 84 ellipsoid\""); + add_srs_wkt (p, 1, + ",DATUM[\"Not_specified_based_on_WGS_84_ellipsoid\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7030\"]],AUTHORITY[\"EPSG\",\"6030\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, "Y[\"EPSG\",\"4030\"]]"); + p = add_epsg_def (first, last, 4031, "epsg", 4031, + "Unknown datum based upon the GEM 10C ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS84 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the GEM 10C ellipsoid\""); + add_srs_wkt (p, 1, + ",DATUM[\"Not_specified_based_on_GEM_10C_ellipsoid\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GEM 10C\",6378137,298.257223563,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7031\"]],AUTHORITY[\"EPSG\",\"6031\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, "TY[\"EPSG\",\"4031\"]]"); + p = add_epsg_def (first, last, 4032, "epsg", 4032, + "Unknown datum based upon the OSU86F ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378136.2 +b=6356751.516927429 +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the OSU86F ellipsoid\""); + add_srs_wkt (p, 1, + ",DATUM[\"Not_specified_based_on_OSU86F_ellipsoid\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"OSU86F\",6378136.2,298.257223563,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7032\"]],AUTHORITY[\"EPSG\",\"6032\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, "TY[\"EPSG\",\"4032\"]]"); + p = add_epsg_def (first, last, 4033, "epsg", 4033, + "Unknown datum based upon the OSU91A ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378136.3 +b=6356751.616592146 +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the OSU91A ellipsoid\""); + add_srs_wkt (p, 1, + ",DATUM[\"Not_specified_based_on_OSU91A_ellipsoid\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"OSU91A\",6378136.3,298.257223563,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7033\"]],AUTHORITY[\"EPSG\",\"6033\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, "TY[\"EPSG\",\"4033\"]]"); + p = add_epsg_def (first, last, 4034, "epsg", 4034, + "Unknown datum based upon the Clarke 1880 ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.144808011 +b=6356514.966204134 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Clarke 1880 ellips"); + add_srs_wkt (p, 1, + "oid\",DATUM[\"Not_specified_based_on_Clarke_1880_ellipso"); + add_srs_wkt (p, 2, + "id\",SPHEROID[\"Clarke 1880\",6378249.144808011,293.4663"); + add_srs_wkt (p, 3, + "076556349,AUTHORITY[\"EPSG\",\"7034\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6034\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4034\"]]"); + p = add_epsg_def (first, last, 4035, "epsg", 4035, + "Unknown datum based upon the Authalic Sphere"); + add_proj4text (p, 0, "+proj=longlat +a=6371000 +b=6371000 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Authalic Sphere\","); + add_srs_wkt (p, 1, + "DATUM[\"Not_specified_based_on_Authalic_Sphere\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Sphere\",6371000,0,AUTHORITY[\"EPSG\",\"7035\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6035\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "33,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"40"); + add_srs_wkt (p, 6, "35\"]]"); + p = add_epsg_def (first, last, 4036, "epsg", 4036, + "Unknown datum based upon the GRS 1967 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS67 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the GRS 1967 ellipsoid"); + add_srs_wkt (p, 1, + "\",DATUM[\"Not_specified_based_on_GRS_1967_ellipsoid\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1967\",6378160,298.247167427,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7036\"]],AUTHORITY[\"EPSG\",\"6036\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, "THORITY[\"EPSG\",\"4036\"]]"); + p = add_epsg_def (first, last, 4037, "epsg", 4037, "WGS 84 / TMzn35N"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / TMzn35N\",GEOGCS[\"WGS 84\",DATUM[\"WG"); + add_srs_wkt (p, 1, + "S_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],P"); + add_srs_wkt (p, 3, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 4, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 5, + "2\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 7, + "tor\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"c"); + add_srs_wkt (p, 8, + "entral_meridian\",27],PARAMETER[\"scale_factor\",0.9996]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"false_easting\",500000],PARAMETER[\"false_n"); + add_srs_wkt (p, 10, + "orthing\",0],AUTHORITY[\"EPSG\",\"4037\"],AXIS[\"Northin"); + add_srs_wkt (p, 11, "g\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 4038, "epsg", 4038, "WGS 84 / TMzn36N"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / TMzn36N\",GEOGCS[\"WGS 84\",DATUM[\"WG"); + add_srs_wkt (p, 1, + "S_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],P"); + add_srs_wkt (p, 3, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 4, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 5, + "2\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 7, + "tor\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"c"); + add_srs_wkt (p, 8, + "entral_meridian\",33],PARAMETER[\"scale_factor\",0.9996]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"false_easting\",500000],PARAMETER[\"false_n"); + add_srs_wkt (p, 10, + "orthing\",0],AUTHORITY[\"EPSG\",\"4038\"],AXIS[\"Northin"); + add_srs_wkt (p, 11, "g\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 4041, "epsg", 4041, + "Unknown datum based upon the Average Terrestrial System 1977 ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6378135 +b=6356750.304921594 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Average Terrestria"); + add_srs_wkt (p, 1, + "l System 1977 ellipsoid\",DATUM[\"Not_specified_based_on"); + add_srs_wkt (p, 2, + "_Average_Terrestrial_System_1977_ellipsoid\",SPHEROID[\""); + add_srs_wkt (p, 3, + "Average Terrestrial System 1977\",6378135,298.257,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"7041\"]],AUTHORITY[\"EPSG\",\"6041\"]],PR"); + add_srs_wkt (p, 5, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 6, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 7, "\"]],AUTHORITY[\"EPSG\",\"4041\"]]"); + p = add_epsg_def (first, last, 4042, "epsg", 4042, + "Unknown datum based upon the Everest (1830 Definition) ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6377299.36559538 +b=6356098.359005156 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Everest (1830 Defi"); + add_srs_wkt (p, 1, + "nition) ellipsoid\",DATUM[\"Not_specified_based_on_Evere"); + add_srs_wkt (p, 2, + "st_1830_Definition_ellipsoid\",SPHEROID[\"Everest (1830 "); + add_srs_wkt (p, 3, + "Definition)\",6377299.36559538,300.8017255433552,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"7042\"]],AUTHORITY[\"EPSG\",\"6042\"]],PRI"); + add_srs_wkt (p, 5, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 6, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 7, "]],AUTHORITY[\"EPSG\",\"4042\"]]"); + p = add_epsg_def (first, last, 4043, "epsg", 4043, + "Unknown datum based upon the WGS 72 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS72 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the WGS 72 ellipsoid\""); + add_srs_wkt (p, 1, + ",DATUM[\"Not_specified_based_on_WGS_72_ellipsoid\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6043\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, "\",\"4043\"]]"); + p = add_epsg_def (first, last, 4044, "epsg", 4044, + "Unknown datum based upon the Everest 1830 (1962 Definition) ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6377301.243 +b=6356100.230165384 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Everest 1830 (1962"); + add_srs_wkt (p, 1, + " Definition) ellipsoid\",DATUM[\"Not_specified_based_on_"); + add_srs_wkt (p, 2, + "Everest_1830_1962_Definition_ellipsoid\",SPHEROID[\"Ever"); + add_srs_wkt (p, 3, + "est 1830 (1962 Definition)\",6377301.243,300.8017255,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"7044\"]],AUTHORITY[\"EPSG\",\"6044\"]]"); + add_srs_wkt (p, 5, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, "122\"]],AUTHORITY[\"EPSG\",\"4044\"]]"); + p = add_epsg_def (first, last, 4045, "epsg", 4045, + "Unknown datum based upon the Everest 1830 (1975 Definition) ellipsoid"); + add_proj4text (p, 0, + "+proj=longlat +a=6377299.151 +b=6356098.145120132 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unknown datum based upon the Everest 1830 (1975"); + add_srs_wkt (p, 1, + " Definition) ellipsoid\",DATUM[\"Not_specified_based_on_"); + add_srs_wkt (p, 2, + "Everest_1830_1975_Definition_ellipsoid\",SPHEROID[\"Ever"); + add_srs_wkt (p, 3, + "est 1830 (1975 Definition)\",6377299.151,300.8017255,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"7045\"]],AUTHORITY[\"EPSG\",\"6045\"]]"); + add_srs_wkt (p, 5, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, "122\"]],AUTHORITY[\"EPSG\",\"4045\"]]"); + p = add_epsg_def (first, last, 4046, "epsg", 4046, "RGRDC 2005"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RGRDC 2005\",DATUM[\"Reseau_Geodesique_de_la_RD"); + add_srs_wkt (p, 1, + "C_2005\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"1033\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4046"); + add_srs_wkt (p, 6, "\"]]"); + p = add_epsg_def (first, last, 4047, "epsg", 4047, + "Unspecified datum based upon the GRS 1980 Authalic Sphere"); + add_proj4text (p, 0, "+proj=longlat +a=6371007 +b=6371007 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unspecified datum based upon the GRS 1980 Autha"); + add_srs_wkt (p, 1, + "lic Sphere\",DATUM[\"Not_specified_based_on_GRS_1980_Aut"); + add_srs_wkt (p, 2, + "halic_Sphere\",SPHEROID[\"GRS 1980 Authalic Sphere\",637"); + add_srs_wkt (p, 3, + "1007,0,AUTHORITY[\"EPSG\",\"7048\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6047\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4047\"]]"); + p = add_epsg_def (first, last, 4048, "epsg", 4048, + "RGRDC 2005 / Congo TM zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / Congo TM zone 12\",GEOGCS[\"RGRDC "); + add_srs_wkt (p, 1, + "2005\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "1033\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",12],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"4048\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4049, "epsg", 4049, + "RGRDC 2005 / Congo TM zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=14 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / Congo TM zone 14\",GEOGCS[\"RGRDC "); + add_srs_wkt (p, 1, + "2005\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "1033\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",14],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"4049\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4050, "epsg", 4050, + "RGRDC 2005 / Congo TM zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=16 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / Congo TM zone 16\",GEOGCS[\"RGRDC "); + add_srs_wkt (p, 1, + "2005\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "1033\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",16],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"4050\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4051, "epsg", 4051, + "RGRDC 2005 / Congo TM zone 18"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / Congo TM zone 18\",GEOGCS[\"RGRDC "); + add_srs_wkt (p, 1, + "2005\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "1033\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",18],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"4051\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4052, "epsg", 4052, + "Unspecified datum based upon the Clarke 1866 Authalic Sphere"); + add_proj4text (p, 0, "+proj=longlat +a=6370997 +b=6370997 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unspecified datum based upon the Clarke 1866 Au"); + add_srs_wkt (p, 1, + "thalic Sphere\",DATUM[\"Not_specified_based_on_Clarke_18"); + add_srs_wkt (p, 2, + "66_Authalic_Sphere\",SPHEROID[\"Clarke 1866 Authalic Sph"); + add_srs_wkt (p, 3, + "ere\",6370997,0,AUTHORITY[\"EPSG\",\"7052\"]],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6052\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4052\"]]"); + add_srs_wkt (p, 7, ""); + p = add_epsg_def (first, last, 4053, "epsg", 4053, + "Unspecified datum based upon the International 1924 Authalic Sphere"); + add_proj4text (p, 0, "+proj=longlat +a=6371228 +b=6371228 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unspecified datum based upon the International "); + add_srs_wkt (p, 1, + "1924 Authalic Sphere\",DATUM[\"Not_specified_based_on_In"); + add_srs_wkt (p, 2, + "ternational_1924_Authalic_Sphere\",SPHEROID[\"Internatio"); + add_srs_wkt (p, 3, + "nal 1924 Authalic Sphere\",6371228,0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"7057\"]],AUTHORITY[\"EPSG\",\"6053\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 5, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 6, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 7, "Y[\"EPSG\",\"4053\"]]"); + p = add_epsg_def (first, last, 4054, "epsg", 4054, + "Unspecified datum based upon the Hughes 1980 ellipsoid"); + add_proj4text (p, 0, "+proj=longlat +a=6378273 +b=6356889.449 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Unspecified datum based upon the Hughes 1980 el"); + add_srs_wkt (p, 1, + "lipsoid\",DATUM[\"Not_specified_based_on_Hughes_1980_ell"); + add_srs_wkt (p, 2, + "ipsoid\",SPHEROID[\"Hughes 1980\",6378273,298.2794111230"); + add_srs_wkt (p, 3, + "61,AUTHORITY[\"EPSG\",\"7058\"]],AUTHORITY[\"EPSG\",\"60"); + add_srs_wkt (p, 4, + "54\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4054\"]]"); + p = add_epsg_def (first, last, 4055, "epsg", 4055, + "Popular Visualisation CRS"); + add_proj4text (p, 0, + "+proj=longlat +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0"); + add_proj4text (p, 1, ",0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Popular Visualisation CRS\",DATUM[\"Popular_Vis"); + add_srs_wkt (p, 1, + "ualisation_Datum\",SPHEROID[\"Popular Visualisation Sphe"); + add_srs_wkt (p, 2, + "re\",6378137,0,AUTHORITY[\"EPSG\",\"7059\"]],TOWGS84[0,0"); + add_srs_wkt (p, 3, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6055\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, "TY[\"EPSG\",\"4055\"]]"); + p = add_epsg_def (first, last, 4056, "epsg", 4056, + "RGRDC 2005 / Congo TM zone 20"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=20 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / Congo TM zone 20\",GEOGCS[\"RGRDC "); + add_srs_wkt (p, 1, + "2005\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "1033\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",20],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"4056\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4057, "epsg", 4057, + "RGRDC 2005 / Congo TM zone 22"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=22 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / Congo TM zone 22\",GEOGCS[\"RGRDC "); + add_srs_wkt (p, 1, + "2005\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "1033\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",22],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"4057\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4058, "epsg", 4058, + "RGRDC 2005 / Congo TM zone 24"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / Congo TM zone 24\",GEOGCS[\"RGRDC "); + add_srs_wkt (p, 1, + "2005\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "1033\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",24],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"4058\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4059, "epsg", 4059, + "RGRDC 2005 / Congo TM zone 26"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=26 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / Congo TM zone 26\",GEOGCS[\"RGRDC "); + add_srs_wkt (p, 1, + "2005\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "1033\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",26],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"4059\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4060, "epsg", 4060, + "RGRDC 2005 / Congo TM zone 28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=28 +k=0.9999 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / Congo TM zone 28\",GEOGCS[\"RGRDC "); + add_srs_wkt (p, 1, + "2005\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "1033\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",28],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9999],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"4060\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4061, "epsg", 4061, + "RGRDC 2005 / UTM zone 33S"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / UTM zone 33S\",GEOGCS[\"RGRDC 2005"); + add_srs_wkt (p, 1, + "\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1033\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",15],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"4061\"],AXIS"); + add_srs_wkt (p, 12, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4062, "epsg", 4062, + "RGRDC 2005 / UTM zone 34S"); + add_proj4text (p, 0, + "+proj=utm +zone=34 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / UTM zone 34S\",GEOGCS[\"RGRDC 2005"); + add_srs_wkt (p, 1, + "\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1033\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",21],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"4062\"],AXIS"); + add_srs_wkt (p, 12, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4063, "epsg", 4063, + "RGRDC 2005 / UTM zone 35S"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RGRDC 2005 / UTM zone 35S\",GEOGCS[\"RGRDC 2005"); + add_srs_wkt (p, 1, + "\",DATUM[\"Reseau_Geodesique_de_la_RDC_2005\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "19\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1033\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4046\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",27],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"4063\"],AXIS"); + add_srs_wkt (p, 12, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 4071, "epsg", 4071, "Chua / UTM zone 23S"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Chua / UTM zone 23S\",GEOGCS[\"Chua\",DATUM[\"C"); + add_srs_wkt (p, 1, + "hua\",SPHEROID[\"International 1924\",6378388,297,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6224\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, + "\"]],AUTHORITY[\"EPSG\",\"4224\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 6, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 7, + "or\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"ce"); + add_srs_wkt (p, 8, + "ntral_meridian\",-45],PARAMETER[\"scale_factor\",0.9996]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"false_easting\",500000],PARAMETER[\"false_n"); + add_srs_wkt (p, 10, + "orthing\",10000000],AUTHORITY[\"EPSG\",\"4071\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 4075, "epsg", 4075, "SREF98"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"SREF98\",DATUM[\"Serbian_Reference_Network_1998"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"1034\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4075\"]]"); + p = add_epsg_def (first, last, 4081, "epsg", 4081, "REGCAN95"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"REGCAN95\",DATUM[\"Red_Geodesica_de_Canarias_19"); + add_srs_wkt (p, 1, + "95\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"1035\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4081\"]]"); + add_srs_wkt (p, 6, ""); + p = add_epsg_def (first, last, 4082, "epsg", 4082, + "REGCAN95 / UTM zone 27N"); + add_proj4text (p, 0, + "+proj=utm +zone=27 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"REGCAN95 / UTM zone 27N\",GEOGCS[\"REGCAN95\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Red_Geodesica_de_Canarias_1995\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1035\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4081\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 8, + "tor\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-21],PARAMETER[\"scale_factor\",0.9996"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "northing\",0],AUTHORITY[\"EPSG\",\"4082\"],AXIS[\"Eastin"); + add_srs_wkt (p, 12, "g\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 4083, "epsg", 4083, + "REGCAN95 / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"REGCAN95 / UTM zone 28N\",GEOGCS[\"REGCAN95\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Red_Geodesica_de_Canarias_1995\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 2, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1035\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4081\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 8, + "tor\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-15],PARAMETER[\"scale_factor\",0.9996"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "northing\",0],AUTHORITY[\"EPSG\",\"4083\"],AXIS[\"Eastin"); + add_srs_wkt (p, 12, "g\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 4120, "epsg", 4120, "Greek"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Greek\",DATUM[\"Greek\",SPHEROID[\"Bessel 1841\""); + add_srs_wkt (p, 1, + ",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"6120\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 4, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "4120\"]]"); + p = add_epsg_def (first, last, 4121, "epsg", 4121, "GGRS87"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +datum=GGRS87 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"GGRS87\",DATUM[\"Greek_Geodetic_Reference_Syste"); + add_srs_wkt (p, 1, + "m_1987\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7019\"]],TOWGS84[-199.87,74.79,246.62,"); + add_srs_wkt (p, 3, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6121\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, "\"EPSG\",\"4121\"]]"); + p = add_epsg_def (first, last, 4122, "epsg", 4122, "ATS77"); + add_proj4text (p, 0, + "+proj=longlat +a=6378135 +b=6356750.304921594 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ATS77\",DATUM[\"Average_Terrestrial_System_1977"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"Average Terrestrial System 1977\",6378135,"); + add_srs_wkt (p, 2, + "298.257,AUTHORITY[\"EPSG\",\"7041\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6122\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4122\"]]"); + p = add_epsg_def (first, last, 4123, "epsg", 4123, "KKJ"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"KKJ\",DATUM[\"Kartastokoordinaattijarjestelma_1"); + add_srs_wkt (p, 1, + "966\",SPHEROID[\"International 1924\",6378388,297,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6123\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, "\"]],AUTHORITY[\"EPSG\",\"4123\"]]"); + p = add_epsg_def (first, last, 4124, "epsg", 4124, "RT90"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RT90\",DATUM[\"Rikets_koordinatsystem_1990\",SP"); + add_srs_wkt (p, 1, + "HEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6124\"]],PRIME"); + add_srs_wkt (p, 3, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 4, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 5, "],AUTHORITY[\"EPSG\",\"4124\"]]"); + p = add_epsg_def (first, last, 4125, "epsg", 4125, "Samboja"); + add_proj4text (p, 0, + "+proj=longlat +ellps=bessel +towgs84=-404.78,685.68,45.4"); + add_proj4text (p, 1, "7,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Samboja\",DATUM[\"Samboja\",SPHEROID[\"Bessel 1"); + add_srs_wkt (p, 1, + "841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\""); + add_srs_wkt (p, 2, + "]],TOWGS84[-404.78,685.68,45.47,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6125\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY"); + add_srs_wkt (p, 5, "[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"4125\"]]"); + p = add_epsg_def (first, last, 4126, "epsg", 4126, "LKS94 (ETRS89)"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"LKS94 (ETRS89)\",DATUM[\"Lithuania_1994_ETRS89\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6126\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUT"); + add_srs_wkt (p, 5, "HORITY[\"EPSG\",\"4126\"]]"); + p = add_epsg_def (first, last, 4127, "epsg", 4127, "Tete"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Tete\",DATUM[\"Tete\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 1, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 2, + "],AUTHORITY[\"EPSG\",\"6127\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 4, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"4127\"]]"); + p = add_epsg_def (first, last, 4128, "epsg", 4128, "Madzansua"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Madzansua\",DATUM[\"Madzansua\",SPHEROID[\"Clar"); + add_srs_wkt (p, 1, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7008\"]],AUTHORITY[\"EPSG\",\"6128\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 5, "TY[\"EPSG\",\"4128\"]]"); + p = add_epsg_def (first, last, 4129, "epsg", 4129, "Observatario"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Observatario\",DATUM[\"Observatario\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6129\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4129\"]]"); + p = add_epsg_def (first, last, 4130, "epsg", 4130, "Moznet"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Moznet\",DATUM[\"Moznet_ITRF94\",SPHEROID[\"WGS"); + add_srs_wkt (p, 1, + " 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]"); + add_srs_wkt (p, 2, + "],TOWGS84[0,0,0,-0,-0,-0,0],AUTHORITY[\"EPSG\",\"6130\"]"); + add_srs_wkt (p, 3, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 4, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4130\"]]"); + p = add_epsg_def (first, last, 4131, "epsg", 4131, "Indian 1960"); + add_proj4text (p, 0, + "+proj=longlat +a=6377276.345 +b=6356075.41314024 +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "GEOGCS[\"Indian 1960\",DATUM[\"Indian_1960\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Everest 1830 (1937 Adjustment)\",6377276.345,300.8017,AU"); + add_srs_wkt (p, 2, + "THORITY[\"EPSG\",\"7015\"]],AUTHORITY[\"EPSG\",\"6131\"]"); + add_srs_wkt (p, 3, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 4, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4131\"]]"); + p = add_epsg_def (first, last, 4132, "epsg", 4132, "FD58"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"FD58\",DATUM[\"Final_Datum_1958\",SPHEROID[\"Cl"); + add_srs_wkt (p, 1, + "arke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7012\"]],AUTHORITY[\"EPSG\",\"6132\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 5, "TY[\"EPSG\",\"4132\"]]"); + p = add_epsg_def (first, last, 4133, "epsg", 4133, "EST92"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0.055,-0.541,-0.185,"); + add_proj4text (p, 1, "0.0183,-0.0003,-0.007,-0.014 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"EST92\",DATUM[\"Estonia_1992\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 1, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 2, + "],TOWGS84[0.055,-0.541,-0.185,0.0183,-0.0003,-0.007,-0.0"); + add_srs_wkt (p, 3, + "14],AUTHORITY[\"EPSG\",\"6133\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 5, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, "G\",\"4133\"]]"); + p = add_epsg_def (first, last, 4134, "epsg", 4134, "PSD93"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"PSD93\",DATUM[\"PDO_Survey_Datum_1993\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6134\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4134\"]]"); + p = add_epsg_def (first, last, 4135, "epsg", 4135, "Old Hawaiian"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Old Hawaiian\",DATUM[\"Old_Hawaiian\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6135\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4135\"]]"); + p = add_epsg_def (first, last, 4136, "epsg", 4136, "St. Lawrence Island"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"St. Lawrence Island\",DATUM[\"St_Lawrence_Islan"); + add_srs_wkt (p, 1, + "d\",SPHEROID[\"Clarke 1866\",6378206.4,294.9786982139006"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6136"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4136\"]]"); + p = add_epsg_def (first, last, 4137, "epsg", 4137, "St. Paul Island"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"St. Paul Island\",DATUM[\"St_Paul_Island\",SPHE"); + add_srs_wkt (p, 1, + "ROID[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6137\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, "]],AUTHORITY[\"EPSG\",\"4137\"]]"); + p = add_epsg_def (first, last, 4138, "epsg", 4138, "St. George Island"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"St. George Island\",DATUM[\"St_George_Island\","); + add_srs_wkt (p, 1, + "SPHEROID[\"Clarke 1866\",6378206.4,294.9786982139006,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6138\"]]"); + add_srs_wkt (p, 3, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 4, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 5, "122\"]],AUTHORITY[\"EPSG\",\"4138\"]]"); + p = add_epsg_def (first, last, 4139, "epsg", 4139, "Puerto Rico"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk66 +towgs84=11,72,-101,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Puerto Rico\",DATUM[\"Puerto_Rico\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7008\"]],TOWGS84[11,72,-101,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6139\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4139\"]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_15 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 4140, "epsg", 4140, "NAD83(CSRS98)"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NAD83(CSRS98)\",DATUM[\"NAD83_Canadian_Spatial_"); + add_srs_wkt (p, 1, + "Reference_System\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 2, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 3, + ",0],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 5, + "925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, "\",\"4140\"]]"); + p = add_epsg_def (first, last, 4141, "epsg", 4141, "Israel"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=-48,55,52,0,0,0,0 +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Israel\",DATUM[\"Israel\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 1, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 2, + "GS84[-48,55,52,0,0,0,0],AUTHORITY[\"EPSG\",\"6141\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, "\"]],AUTHORITY[\"EPSG\",\"4141\"]]"); + p = add_epsg_def (first, last, 4142, "epsg", 4142, "Locodjo 1965"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-125,53,467,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Locodjo 1965\",DATUM[\"Locodjo_1965\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7012\"]],TOWGS84[-125,53,467,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6142\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4142\"]]"); + p = add_epsg_def (first, last, 4143, "epsg", 4143, "Abidjan 1987"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-124.76,53,466.79,0"); + add_proj4text (p, 1, ",0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Abidjan 1987\",DATUM[\"Abidjan_1987\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7012\"]],TOWGS84[-124.76,53,466.79,0,0,0,0],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6143\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"414"); + add_srs_wkt (p, 6, "3\"]]"); + p = add_epsg_def (first, last, 4144, "epsg", 4144, "Kalianpur 1937"); + add_proj4text (p, 0, + "+proj=longlat +a=6377276.345 +b=6356075.41314024 +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "GEOGCS[\"Kalianpur 1937\",DATUM[\"Kalianpur_1937\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Everest 1830 (1937 Adjustment)\",6377276.345,300.8"); + add_srs_wkt (p, 2, + "017,AUTHORITY[\"EPSG\",\"7015\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "144\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4144\"]]"); + p = add_epsg_def (first, last, 4145, "epsg", 4145, "Kalianpur 1962"); + add_proj4text (p, 0, + "+proj=longlat +a=6377301.243 +b=6356100.230165384 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Kalianpur 1962\",DATUM[\"Kalianpur_1962\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Everest 1830 (1962 Definition)\",6377301.243,300.8"); + add_srs_wkt (p, 2, + "017255,AUTHORITY[\"EPSG\",\"7044\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"6145\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4145\"]]"); + p = add_epsg_def (first, last, 4146, "epsg", 4146, "Kalianpur 1975"); + add_proj4text (p, 0, + "+proj=longlat +a=6377299.151 +b=6356098.145120132 +towgs"); + add_proj4text (p, 1, "84=295,736,257,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Kalianpur 1975\",DATUM[\"Kalianpur_1975\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Everest 1830 (1975 Definition)\",6377299.151,300.8"); + add_srs_wkt (p, 2, + "017255,AUTHORITY[\"EPSG\",\"7045\"]],TOWGS84[295,736,257"); + add_srs_wkt (p, 3, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 4, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 5, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 6, "[\"EPSG\",\"4146\"]]"); + p = add_epsg_def (first, last, 4147, "epsg", 4147, "Hanoi 1972"); + add_proj4text (p, 0, + "+proj=longlat +ellps=krass +towgs84=-17.51,-108.32,-62.3"); + add_proj4text (p, 1, "9,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Hanoi 1972\",DATUM[\"Hanoi_1972\",SPHEROID[\"Kr"); + add_srs_wkt (p, 1, + "assowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\""); + add_srs_wkt (p, 2, + "]],TOWGS84[-17.51,-108.32,-62.39,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6147\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4147\"]]"); + p = add_epsg_def (first, last, 4148, "epsg", 4148, "Hartebeesthoek94"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Hartebeesthoek94\",DATUM[\"Hartebeesthoek94\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6148\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4148\"]]"); + p = add_epsg_def (first, last, 4149, "epsg", 4149, "CH1903"); + add_proj4text (p, 0, + "+proj=longlat +ellps=bessel +towgs84=674.374,15.056,405."); + add_proj4text (p, 1, "346,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"CH1903\",DATUM[\"CH1903\",SPHEROID[\"Bessel 184"); + add_srs_wkt (p, 1, + "1\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]"); + add_srs_wkt (p, 2, + "],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6149\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4149\"]]"); + p = add_epsg_def (first, last, 4150, "epsg", 4150, "CH1903+"); + add_proj4text (p, 0, + "+proj=longlat +ellps=bessel +towgs84=674.374,15.056,405."); + add_proj4text (p, 1, "346,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"CH1903+\",DATUM[\"CH1903\",SPHEROID[\"Bessel 18"); + add_srs_wkt (p, 1, + "41\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\""); + add_srs_wkt (p, 2, + "]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]]"); + p = add_epsg_def (first, last, 4151, "epsg", 4151, "CHTRF95"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"CHTRF95\",DATUM[\"Swiss_Terrestrial_Reference_F"); + add_srs_wkt (p, 1, + "rame_1995\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6151\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, "151\"]]"); + p = add_epsg_def (first, last, 4152, "epsg", 4152, "NAD83(HARN)"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regio"); + add_srs_wkt (p, 1, + "nal_Network\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 2, + "1,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"615"); + add_srs_wkt (p, 3, + "2\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]]"); + p = add_epsg_def (first, last, 4153, "epsg", 4153, "Rassadiran"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-133.63,-157.5,-158.6"); + add_proj4text (p, 1, "2,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Rassadiran\",DATUM[\"Rassadiran\",SPHEROID[\"In"); + add_srs_wkt (p, 1, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 2, + "\"]],TOWGS84[-133.63,-157.5,-158.62,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6153\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4153\"]]"); + p = add_epsg_def (first, last, 4154, "epsg", 4154, "ED50(ED77)"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ED50(ED77)\",DATUM[\"European_Datum_1950_1977\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6154\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4154\"]]"); + p = add_epsg_def (first, last, 4155, "epsg", 4155, "Dabola 1981"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-83,37,12"); + add_proj4text (p, 1, "4,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Dabola 1981\",DATUM[\"Dabola_1981\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Clarke 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7011\"]],TOWGS84[-83,37,124,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6155\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4155"); + add_srs_wkt (p, 6, "\"]]"); + p = add_epsg_def (first, last, 4156, "epsg", 4156, "S-JTSK"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"S-JTSK\",DATUM[\"Jednotne_Trigonometricke_Site_"); + add_srs_wkt (p, 1, + "Katastralni\",SPHEROID[\"Bessel 1841\",6377397.155,299.1"); + add_srs_wkt (p, 2, + "528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"6156\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4156\"]]"); + p = add_epsg_def (first, last, 4157, "epsg", 4157, "Mount Dillon"); + add_proj4text (p, 0, + "+proj=longlat +a=6378293.645208759 +b=6356617.987679838 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Mount Dillon\",DATUM[\"Mount_Dillon\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1858\",6378293.645208759,294.2606763692569,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7007\"]],AUTHORITY[\"EPSG\",\"6157\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, "22\"]],AUTHORITY[\"EPSG\",\"4157\"]]"); + p = add_epsg_def (first, last, 4158, "epsg", 4158, "Naparima 1955"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Naparima 1955\",DATUM[\"Naparima_1955\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7022\"]],AUTHORITY[\"EPSG\",\"6158\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 3, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 4, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"4158\"]]"); + p = add_epsg_def (first, last, 4159, "epsg", 4159, "ELD79"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ELD79\",DATUM[\"European_Libyan_Datum_1979\",SP"); + add_srs_wkt (p, 1, + "HEROID[\"International 1924\",6378388,297,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6159\"]],PRIMEM[\"G"); + add_srs_wkt (p, 3, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 4, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 5, "HORITY[\"EPSG\",\"4159\"]]"); + p = add_epsg_def (first, last, 4160, "epsg", 4160, "Chos Malal 1914"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Chos Malal 1914\",DATUM[\"Chos_Malal_1914\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],AUTHORITY[\"EPSG\",\"6160\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4160\"]]"); + p = add_epsg_def (first, last, 4161, "epsg", 4161, "Pampa del Castillo"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=27.5,14,186.4,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Pampa del Castillo\",DATUM[\"Pampa_del_Castillo"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7022\"]],TOWGS84[27.5,14,186.4,0,0,0,0],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6161\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"41"); + add_srs_wkt (p, 6, "61\"]]"); + p = add_epsg_def (first, last, 4162, "epsg", 4162, "Korean 1985"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Korean 1985\",DATUM[\"Korean_Datum_1985\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6162\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4162\"]]"); + p = add_epsg_def (first, last, 4163, "epsg", 4163, "Yemen NGN96"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Yemen NGN96\",DATUM[\"Yemen_National_Geodetic_N"); + add_srs_wkt (p, 1, + "etwork_1996\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6163\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, "163\"]]"); + p = add_epsg_def (first, last, 4164, "epsg", 4164, "South Yemen"); + add_proj4text (p, 0, + "+proj=longlat +ellps=krass +towgs84=-76,-138,67,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"South Yemen\",DATUM[\"South_Yemen\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 2, + "4\"]],TOWGS84[-76,-138,67,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6164\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4164\"]]"); + p = add_epsg_def (first, last, 4165, "epsg", 4165, "Bissau"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-173,253,27,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Bissau\",DATUM[\"Bissau\",SPHEROID[\"Internatio"); + add_srs_wkt (p, 1, + "nal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOW"); + add_srs_wkt (p, 2, + "GS84[-173,253,27,0,0,0,0],AUTHORITY[\"EPSG\",\"6165\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, "22\"]],AUTHORITY[\"EPSG\",\"4165\"]]"); + p = add_epsg_def (first, last, 4166, "epsg", 4166, "Korean 1995"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Korean 1995\",DATUM[\"Korean_Datum_1995\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "166\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4166\"]]"); + p = add_epsg_def (first, last, 4167, "epsg", 4167, "NZGD2000"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NZGD2000\",DATUM[\"New_Zealand_Geodetic_Datum_2"); + add_srs_wkt (p, 1, + "000\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6167\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]"); + add_srs_wkt (p, 6, "]"); + p = add_epsg_def (first, last, 4168, "epsg", 4168, "Accra"); + add_proj4text (p, 0, + "+proj=longlat +a=6378300 +b=6356751.689189189 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Accra\",DATUM[\"Accra\",SPHEROID[\"War Office\""); + add_srs_wkt (p, 1, + ",6378300,296,AUTHORITY[\"EPSG\",\"7029\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 2, + "PSG\",\"6168\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 4, "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4168\"]]"); + p = add_epsg_def (first, last, 4169, "epsg", 4169, "American Samoa 1962"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk66 +towgs84=-115,118,426,0,0,0,"); + add_proj4text (p, 1, "0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"American Samoa 1962\",DATUM[\"American_Samoa_19"); + add_srs_wkt (p, 1, + "62\",SPHEROID[\"Clarke 1866\",6378206.4,294.978698213900"); + add_srs_wkt (p, 2, + "6,AUTHORITY[\"EPSG\",\"7008\"]],TOWGS84[-115,118,426,0,0"); + add_srs_wkt (p, 3, + ",0,0],AUTHORITY[\"EPSG\",\"6169\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, "PSG\",\"4169\"]]"); + p = add_epsg_def (first, last, 4170, "epsg", 4170, "SIRGAS 1995"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"SIRGAS 1995\",DATUM[\"Sistema_de_Referencia_Geo"); + add_srs_wkt (p, 1, + "centrico_para_America_del_Sur_1995\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6170\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, "]],AUTHORITY[\"EPSG\",\"4170\"]]"); + p = add_epsg_def (first, last, 4171, "epsg", 4171, "RGF93"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RGF93\",DATUM[\"Reseau_Geodesique_Francais_1993"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6171\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4171\"]]"); + p = add_epsg_def (first, last, 4172, "epsg", 4172, "POSGAR"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"POSGAR\",DATUM[\"Posiciones_Geodesicas_Argentin"); + add_srs_wkt (p, 1, + "as\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6172\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"4172\"]]"); + p = add_epsg_def (first, last, 4173, "epsg", 4173, "IRENET95"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IRENET95\",DATUM[\"IRENET95\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 1, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 2, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6173\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, "\"]],AUTHORITY[\"EPSG\",\"4173\"]]"); + p = add_epsg_def (first, last, 4174, "epsg", 4174, "Sierra Leone 1924"); + add_proj4text (p, 0, + "+proj=longlat +a=6378300 +b=6356751.689189189 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Sierra Leone 1924\",DATUM[\"Sierra_Leone_Colony"); + add_srs_wkt (p, 1, + "_1924\",SPHEROID[\"War Office\",6378300,296,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7029\"]],AUTHORITY[\"EPSG\",\"6174\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4174\"]]"); + p = add_epsg_def (first, last, 4175, "epsg", 4175, "Sierra Leone 1968"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-88,4,101,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Sierra Leone 1968\",DATUM[\"Sierra_Leone_1968\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7012\"]],TOWGS84[-88,4,101,0,0,0,0],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6175\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, "175\"]]"); + p = add_epsg_def (first, last, 4176, "epsg", 4176, "Australian Antarctic"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Australian Antarctic\",DATUM[\"Australian_Antar"); + add_srs_wkt (p, 1, + "ctic_Datum_1998\",SPHEROID[\"GRS 1980\",6378137,298.2572"); + add_srs_wkt (p, 2, + "22101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,"); + add_srs_wkt (p, 3, + "0],AUTHORITY[\"EPSG\",\"6176\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, "\",\"4176\"]]"); + p = add_epsg_def (first, last, 4178, "epsg", 4178, "Pulkovo 1942(83)"); + add_proj4text (p, 0, + "+proj=longlat +ellps=krass +towgs84=24,-123,-94,0.02,-0."); + add_proj4text (p, 1, "25,-0.13,1.1 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Pulkovo 1942(83)\",DATUM[\"Pulkovo_1942_83\",SP"); + add_srs_wkt (p, 1, + "HEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7024\"]],AUTHORITY[\"EPSG\",\"6178\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4178\"]]"); + p = add_epsg_def (first, last, 4179, "epsg", 4179, "Pulkovo 1942(58)"); + add_proj4text (p, 0, + "+proj=longlat +ellps=krass +towgs84=33.4,-146.6,-76.3,-0"); + add_proj4text (p, 1, ".359,-0.053,0.844,-0.84 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Pulkovo 1942(58)\",DATUM[\"Pulkovo_1942_58\",SP"); + add_srs_wkt (p, 1, + "HEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7024\"]],AUTHORITY[\"EPSG\",\"6179\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4179\"]]"); + p = add_epsg_def (first, last, 4180, "epsg", 4180, "EST97"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"EST97\",DATUM[\"Estonia_1997\",SPHEROID[\"GRS 1"); + add_srs_wkt (p, 1, + "980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]"); + add_srs_wkt (p, 2, + "],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6180\"]],P"); + add_srs_wkt (p, 3, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 4, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 5, "2\"]],AUTHORITY[\"EPSG\",\"4180\"]]"); + p = add_epsg_def (first, last, 4181, "epsg", 4181, "Luxembourg 1930"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-193,13.7,-39.3,-0.41"); + add_proj4text (p, 1, ",-2.933,2.688,0.43 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Luxembourg 1930\",DATUM[\"Luxembourg_1930\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],TOWGS84[-193,13.7,-39.3,-0.41,-2.933,2.68"); + add_srs_wkt (p, 3, + "8,0.43],AUTHORITY[\"EPSG\",\"6181\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, "EPSG\",\"4181\"]]"); + p = add_epsg_def (first, last, 4182, "epsg", 4182, + "Azores Occidental 1939"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Azores Occidental 1939\",DATUM[\"Azores_Occiden"); + add_srs_wkt (p, 1, + "tal_Islands_1939\",SPHEROID[\"International 1924\",63783"); + add_srs_wkt (p, 2, + "88,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"6182\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4182\"]]"); + p = add_epsg_def (first, last, 4183, "epsg", 4183, "Azores Central 1948"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-104,167,-38,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Azores Central 1948\",DATUM[\"Azores_Central_Is"); + add_srs_wkt (p, 1, + "lands_1948\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-104,167,-38,0,0,"); + add_srs_wkt (p, 3, + "0,0],AUTHORITY[\"EPSG\",\"6183\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, "SG\",\"4183\"]]"); + p = add_epsg_def (first, last, 4184, "epsg", 4184, "Azores Oriental 1940"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-203,141,53,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Azores Oriental 1940\",DATUM[\"Azores_Oriental_"); + add_srs_wkt (p, 1, + "Islands_1940\",SPHEROID[\"International 1924\",6378388,2"); + add_srs_wkt (p, 2, + "97,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-203,141,53,0,0"); + add_srs_wkt (p, 3, + ",0,0],AUTHORITY[\"EPSG\",\"6184\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, "PSG\",\"4184\"]]"); + p = add_epsg_def (first, last, 4185, "epsg", 4185, "Madeira 1936"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Madeira 1936\",DATUM[\"Madeira_1936\",SPHEROID["); + add_srs_wkt (p, 1, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],AUTHORITY[\"EPSG\",\"6185\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "74532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4185\"]]"); + p = add_epsg_def (first, last, 4188, "epsg", 4188, "OSNI 1952"); + add_proj4text (p, 0, + "+proj=longlat +ellps=airy +towgs84=482.5,-130.6,564.6,-1"); + add_proj4text (p, 1, ".042,-0.214,-0.631,8.15 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"OSNI 1952\",DATUM[\"OSNI_1952\",SPHEROID[\"Airy"); + add_srs_wkt (p, 1, + " 1830\",6377563.396,299.3249646,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 2, + "1\"]],TOWGS84[482.5,-130.6,564.6,-1.042,-0.214,-0.631,8."); + add_srs_wkt (p, 3, + "15],AUTHORITY[\"EPSG\",\"6188\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 5, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, "G\",\"4188\"]]"); + p = add_epsg_def (first, last, 4189, "epsg", 4189, "REGVEN"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"REGVEN\",DATUM[\"Red_Geodesica_Venezolana\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6189\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4189\"]]"); + p = add_epsg_def (first, last, 4190, "epsg", 4190, "POSGAR 98"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"POSGAR 98\",DATUM[\"Posiciones_Geodesicas_Argen"); + add_srs_wkt (p, 1, + "tinas_1998\",SPHEROID[\"GRS 1980\",6378137,298.257222101"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6190"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4190\"]]"); + p = add_epsg_def (first, last, 4191, "epsg", 4191, "Albanian 1987"); + add_proj4text (p, 0, "+proj=longlat +ellps=krass +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Albanian 1987\",DATUM[\"Albanian_1987\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7024\"]],AUTHORITY[\"EPSG\",\"6191\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"4191\"]]"); + p = add_epsg_def (first, last, 4192, "epsg", 4192, "Douala 1948"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-206.1,-174.7,-87.7,0"); + add_proj4text (p, 1, ",0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Douala 1948\",DATUM[\"Douala_1948\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],TOWGS84[-206.1,-174.7,-87.7,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6192\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4192\"]]"); + p = add_epsg_def (first, last, 4193, "epsg", 4193, "Manoca 1962"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-70.9,-15"); + add_proj4text (p, 1, "1.8,-41.4,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Manoca 1962\",DATUM[\"Manoca_1962\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Clarke 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7011\"]],TOWGS84[-70.9,-151.8,-41.4,0,0,0,0"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6193\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, ",\"4193\"]]"); + p = add_epsg_def (first, last, 4194, "epsg", 4194, "Qornoq 1927"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Qornoq 1927\",DATUM[\"Qornoq_1927\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],AUTHORITY[\"EPSG\",\"6194\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4194\"]]"); + p = add_epsg_def (first, last, 4195, "epsg", 4195, "Scoresbysund 1952"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=105,326,-102.5,0,0,0."); + add_proj4text (p, 1, "814,-0.6 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Scoresbysund 1952\",DATUM[\"Scoresbysund_1952\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7022\"]],TOWGS84[105,326,-102.5,0,0,0.814,-0.6]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6195\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, ",\"4195\"]]"); + p = add_epsg_def (first, last, 4196, "epsg", 4196, "Ammassalik 1958"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-45,417,-3.5,0,0,0.81"); + add_proj4text (p, 1, "4,-0.6 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Ammassalik 1958\",DATUM[\"Ammassalik_1958\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],TOWGS84[-45,417,-3.5,0,0,0.814,-0.6],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6196\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"41"); + add_srs_wkt (p, 6, "96\"]]"); + p = add_epsg_def (first, last, 4197, "epsg", 4197, "Garoua"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Garoua\",DATUM[\"Garoua\",SPHEROID[\"Clarke 188"); + add_srs_wkt (p, 1, + "0 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\""); + add_srs_wkt (p, 2, + "]],AUTHORITY[\"EPSG\",\"6197\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 4, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, "\",\"4197\"]]"); + p = add_epsg_def (first, last, 4198, "epsg", 4198, "Kousseri"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Kousseri\",DATUM[\"Kousseri\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 1, + " 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "012\"]],AUTHORITY[\"EPSG\",\"6198\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 3, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 4, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4198\"]]"); + p = add_epsg_def (first, last, 4199, "epsg", 4199, "Egypt 1930"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Egypt 1930\",DATUM[\"Egypt_1930\",SPHEROID[\"In"); + add_srs_wkt (p, 1, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 2, + "\"]],AUTHORITY[\"EPSG\",\"6199\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 3, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 4, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 5, "SG\",\"4199\"]]"); + p = add_epsg_def (first, last, 4200, "epsg", 4200, "Pulkovo 1995"); + add_proj4text (p, 0, + "+proj=longlat +ellps=krass +towgs84=24.82,-131.21,-82.66"); + add_proj4text (p, 1, ",-0,-0,0.16,-0.12 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "4200\"]]"); + p = add_epsg_def (first, last, 4201, "epsg", 4201, "Adindan"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Adindan\",DATUM[\"Adindan\",SPHEROID[\"Clarke 1"); + add_srs_wkt (p, 1, + "880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 2, + "2\"]],AUTHORITY[\"EPSG\",\"6201\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4201\"]]"); + p = add_epsg_def (first, last, 4202, "epsg", 4202, "AGD66"); + add_proj4text (p, 0, "+proj=longlat +ellps=aust_SA +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"AGD66\",DATUM[\"Australian_Geodetic_Datum_1966\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"Australian National Spheroid\",6378160,298.2"); + add_srs_wkt (p, 2, + "5,AUTHORITY[\"EPSG\",\"7003\"]],AUTHORITY[\"EPSG\",\"620"); + add_srs_wkt (p, 3, + "2\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4202\"]]"); + p = add_epsg_def (first, last, 4203, "epsg", 4203, "AGD84"); + add_proj4text (p, 0, "+proj=longlat +ellps=aust_SA +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"AGD84\",DATUM[\"Australian_Geodetic_Datum_1984\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"Australian National Spheroid\",6378160,298.2"); + add_srs_wkt (p, 2, + "5,AUTHORITY[\"EPSG\",\"7003\"]],AUTHORITY[\"EPSG\",\"620"); + add_srs_wkt (p, 3, + "3\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4203\"]]"); + p = add_epsg_def (first, last, 4204, "epsg", 4204, "Ain el Abd"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Ain el Abd\",DATUM[\"Ain_el_Abd_1970\",SPHEROID"); + add_srs_wkt (p, 1, + "[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],AUTHORITY[\"EPSG\",\"6204\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"4204\"]]"); + p = add_epsg_def (first, last, 4205, "epsg", 4205, "Afgooye"); + add_proj4text (p, 0, + "+proj=longlat +ellps=krass +towgs84=-43,-163,45,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Afgooye\",DATUM[\"Afgooye\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 1, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 2, + "WGS84[-43,-163,45,0,0,0,0],AUTHORITY[\"EPSG\",\"6205\"]]"); + add_srs_wkt (p, 3, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 4, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 5, "122\"]],AUTHORITY[\"EPSG\",\"4205\"]]"); + p = add_epsg_def (first, last, 4206, "epsg", 4206, "Agadez"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Agadez\",DATUM[\"Agadez\",SPHEROID[\"Clarke 188"); + add_srs_wkt (p, 1, + "0 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7011\"]],AUTHORITY[\"EPSG\",\"6206\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 5, "TY[\"EPSG\",\"4206\"]]"); + p = add_epsg_def (first, last, 4207, "epsg", 4207, "Lisbon"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Lisbon\",DATUM[\"Lisbon_1937\",SPHEROID[\"Inter"); + add_srs_wkt (p, 1, + "national 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]"); + add_srs_wkt (p, 2, + "],AUTHORITY[\"EPSG\",\"6207\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 4, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"4207\"]]"); + p = add_epsg_def (first, last, 4208, "epsg", 4208, "Aratu"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Aratu\",DATUM[\"Aratu\",SPHEROID[\"Internationa"); + add_srs_wkt (p, 1, + "l 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"6208\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 4, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"420"); + add_srs_wkt (p, 5, "8\"]]"); + p = add_epsg_def (first, last, 4209, "epsg", 4209, "Arc 1950"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.145 +b=6356514.966398753 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Arc 1950\",DATUM[\"Arc_1950\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 1, + " 1880 (Arc)\",6378249.145,293.4663077,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7013\"]],AUTHORITY[\"EPSG\",\"6209\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 5, "TY[\"EPSG\",\"4209\"]]"); + p = add_epsg_def (first, last, 4210, "epsg", 4210, "Arc 1960"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Arc 1960\",DATUM[\"Arc_1960\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 1, + " 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "012\"]],AUTHORITY[\"EPSG\",\"6210\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 3, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 4, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4210\"]]"); + p = add_epsg_def (first, last, 4211, "epsg", 4211, "Batavia"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Batavia\",DATUM[\"Batavia\",SPHEROID[\"Bessel 1"); + add_srs_wkt (p, 1, + "841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\""); + add_srs_wkt (p, 2, + "]],AUTHORITY[\"EPSG\",\"6211\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 4, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, "\",\"4211\"]]"); + p = add_epsg_def (first, last, 4212, "epsg", 4212, "Barbados 1938"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=31.95,300.99,419.19"); + add_proj4text (p, 1, ",0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Barbados 1938\",DATUM[\"Barbados_1938\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7012\"]],TOWGS84[31.95,300.99,419.19,0,0,0,0],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6212\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "4212\"]]"); + p = add_epsg_def (first, last, 4213, "epsg", 4213, "Beduaram"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-106,-87,"); + add_proj4text (p, 1, "188,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Beduaram\",DATUM[\"Beduaram\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 1, + " 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7011\"]],TOWGS84[-106,-87,188,0,0,0,0],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6213\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4213\"]]"); + add_srs_wkt (p, 6, ""); + p = add_epsg_def (first, last, 4214, "epsg", 4214, "Beijing 1954"); + add_proj4text (p, 0, "+proj=longlat +ellps=krass +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 3, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 4, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4214\"]]"); + p = add_epsg_def (first, last, 4215, "epsg", 4215, "Belge 1950"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Belge 1950\",DATUM[\"Reseau_National_Belge_1950"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6215\"]],PRIME"); + add_srs_wkt (p, 3, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 4, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 5, "],AUTHORITY[\"EPSG\",\"4215\"]]"); + p = add_epsg_def (first, last, 4216, "epsg", 4216, "Bermuda 1957"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Bermuda 1957\",DATUM[\"Bermuda_1957\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6216\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4216\"]]"); + p = add_epsg_def (first, last, 4218, "epsg", 4218, "Bogota 1975"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=307,304,-318,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Bogota 1975\",DATUM[\"Bogota_1975\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],TOWGS84[307,304,-318,0,0,0,0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"6218\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4218\"]]"); + p = add_epsg_def (first, last, 4219, "epsg", 4219, "Bukit Rimpah"); + add_proj4text (p, 0, + "+proj=longlat +ellps=bessel +towgs84=-384,664,-48,0,0,0,"); + add_proj4text (p, 1, "0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Bukit Rimpah\",DATUM[\"Bukit_Rimpah\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 2, + "\",\"7004\"]],TOWGS84[-384,664,-48,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6219\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4219\"]]"); + p = add_epsg_def (first, last, 4220, "epsg", 4220, "Camacupa"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Camacupa\",DATUM[\"Camacupa\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 1, + " 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "012\"]],AUTHORITY[\"EPSG\",\"6220\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 3, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 4, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4220\"]]"); + p = add_epsg_def (first, last, 4221, "epsg", 4221, "Campo Inchauspe"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Campo Inchauspe\",DATUM[\"Campo_Inchauspe\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],AUTHORITY[\"EPSG\",\"6221\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4221\"]]"); + p = add_epsg_def (first, last, 4222, "epsg", 4222, "Cape"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.145 +b=6356514.966398753 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Cape\",DATUM[\"Cape\",SPHEROID[\"Clarke 1880 (A"); + add_srs_wkt (p, 1, + "rc)\",6378249.145,293.4663077,AUTHORITY[\"EPSG\",\"7013\""); + add_srs_wkt (p, 2, + "]],AUTHORITY[\"EPSG\",\"6222\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 4, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, "\",\"4222\"]]"); + p = add_epsg_def (first, last, 4223, "epsg", 4223, "Carthage"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +datum=carthage +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Carthage\",DATUM[\"Carthage\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 1, + " 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7011\"]],AUTHORITY[\"EPSG\",\"6223\"]],PRIMEM[\"G"); + add_srs_wkt (p, 3, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 4, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 5, "HORITY[\"EPSG\",\"4223\"]]"); + p = add_epsg_def (first, last, 4224, "epsg", 4224, "Chua"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Chua\",DATUM[\"Chua\",SPHEROID[\"International "); + add_srs_wkt (p, 1, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"6224\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4224\""); + add_srs_wkt (p, 5, "]]"); + p = add_epsg_def (first, last, 4225, "epsg", 4225, "Corrego Alegre"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Corrego Alegre\",DATUM[\"Corrego_Alegre\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7022\"]],TOWGS84[-206,172,-6,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6225\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4225\"]]"); + p = add_epsg_def (first, last, 4226, "epsg", 4226, "Cote d'Ivoire"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Cote d'Ivoire\",DATUM[\"Cote_d_Ivoire\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Clarke 1880 (IGN)\",6378249.2,293.4660212936265,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7011\"]],AUTHORITY[\"EPSG\",\"6226\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"910"); + add_srs_wkt (p, 5, "8\"]],AUTHORITY[\"EPSG\",\"4226\"]]"); + p = add_epsg_def (first, last, 4227, "epsg", 4227, "Deir ez Zor"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Deir ez Zor\",DATUM[\"Deir_ez_Zor\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Clarke 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7011\"]],AUTHORITY[\"EPSG\",\"6227\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, "]],AUTHORITY[\"EPSG\",\"4227\"]]"); + p = add_epsg_def (first, last, 4228, "epsg", 4228, "Douala"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Douala\",DATUM[\"Douala\",SPHEROID[\"Clarke 188"); + add_srs_wkt (p, 1, + "0 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7011\"]],AUTHORITY[\"EPSG\",\"6228\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"4228\"]]"); + p = add_epsg_def (first, last, 4229, "epsg", 4229, "Egypt 1907"); + add_proj4text (p, 0, "+proj=longlat +ellps=helmert +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Egypt 1907\",DATUM[\"Egypt_1907\",SPHEROID[\"He"); + add_srs_wkt (p, 1, + "lmert 1906\",6378200,298.3,AUTHORITY[\"EPSG\",\"7020\"]]"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"6229\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 4, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"4229\"]]"); + p = add_epsg_def (first, last, 4230, "epsg", 4230, "ED50"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ED50\",DATUM[\"European_Datum_1950\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],AUTHORITY[\"EPSG\",\"6230\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4230\"]]"); + p = add_epsg_def (first, last, 4231, "epsg", 4231, "ED87"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ED87\",DATUM[\"European_Datum_1987\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],AUTHORITY[\"EPSG\",\"6231\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4231\"]]"); + p = add_epsg_def (first, last, 4232, "epsg", 4232, "Fahud"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Fahud\",DATUM[\"Fahud\",SPHEROID[\"Clarke 1880 "); + add_srs_wkt (p, 1, + "(RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]"); + add_srs_wkt (p, 2, + "],AUTHORITY[\"EPSG\",\"6232\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 4, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"4232\"]]"); + p = add_epsg_def (first, last, 4233, "epsg", 4233, "Gandajika 1970"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-133,-321,50,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Gandajika 1970\",DATUM[\"Gandajika_1970\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7022\"]],TOWGS84[-133,-321,50,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6233\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4233\"]]"); + p = add_epsg_def (first, last, 4234, "epsg", 4234, "Garoua"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Garoua\",DATUM[\"Garoua\",SPHEROID[\"Clarke 188"); + add_srs_wkt (p, 1, + "0 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7011\"]],AUTHORITY[\"EPSG\",\"6234\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"4234\"]]"); + p = add_epsg_def (first, last, 4235, "epsg", 4235, "Guyane Francaise"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Guyane Francaise\",DATUM[\"Guyane_Francaise\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"International 1924\",6378388,297,AUTHORITY[\"E"); + add_srs_wkt (p, 2, + "PSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6235\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUT"); + add_srs_wkt (p, 5, "HORITY[\"EPSG\",\"4235\"]]"); + p = add_epsg_def (first, last, 4236, "epsg", 4236, "Hu Tzu Shan 1950"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-637,-549,-203,0,0,0,"); + add_proj4text (p, 1, "0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Hu Tzu Shan 1950\",DATUM[\"Hu_Tzu_Shan_1950\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"International 1924\",6378388,297,AUTHORITY[\"E"); + add_srs_wkt (p, 2, + "PSG\",\"7022\"]],TOWGS84[-637,-549,-203,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6236\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4236\""); + add_srs_wkt (p, 6, "]]"); + p = add_epsg_def (first, last, 4237, "epsg", 4237, "HD72"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS67 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"HD72\",DATUM[\"Hungarian_Datum_1972\",SPHEROID["); + add_srs_wkt (p, 1, + "\"GRS 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7036\"]],AUTHORITY[\"EPSG\",\"6237\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"4237\"]]"); + p = add_epsg_def (first, last, 4238, "epsg", 4238, "ID74"); + add_proj4text (p, 0, + "+proj=longlat +a=6378160 +b=6356774.50408554 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ID74\",DATUM[\"Indonesian_Datum_1974\",SPHEROID"); + add_srs_wkt (p, 1, + "[\"Indonesian National Spheroid\",6378160,298.247,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7021\"]],AUTHORITY[\"EPSG\",\"6238\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, "\"]],AUTHORITY[\"EPSG\",\"4238\"]]"); + p = add_epsg_def (first, last, 4239, "epsg", 4239, "Indian 1954"); + add_proj4text (p, 0, + "+proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs8"); + add_proj4text (p, 1, "4=217,823,299,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Indian 1954\",DATUM[\"Indian_1954\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Everest 1830 (1937 Adjustment)\",6377276.345,300.8017,AU"); + add_srs_wkt (p, 2, + "THORITY[\"EPSG\",\"7015\"]],TOWGS84[217,823,299,0,0,0,0]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6239\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, ",\"4239\"]]"); + p = add_epsg_def (first, last, 4240, "epsg", 4240, "Indian 1975"); + add_proj4text (p, 0, + "+proj=longlat +a=6377276.345 +b=6356075.41314024 +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "GEOGCS[\"Indian 1975\",DATUM[\"Indian_1975\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Everest 1830 (1937 Adjustment)\",6377276.345,300.8017,AU"); + add_srs_wkt (p, 2, + "THORITY[\"EPSG\",\"7015\"]],AUTHORITY[\"EPSG\",\"6240\"]"); + add_srs_wkt (p, 3, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 4, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4240\"]]"); + p = add_epsg_def (first, last, 4241, "epsg", 4241, "Jamaica 1875"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.144808011 +b=6356514.966204134 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Jamaica 1875\",DATUM[\"Jamaica_1875\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1880\",6378249.144808011,293.4663076556349,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7034\"]],AUTHORITY[\"EPSG\",\"6241\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, "22\"]],AUTHORITY[\"EPSG\",\"4241\"]]"); + p = add_epsg_def (first, last, 4242, "epsg", 4242, "JAD69"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"JAD69\",DATUM[\"Jamaica_1969\",SPHEROID[\"Clark"); + add_srs_wkt (p, 1, + "e 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7008\"]],AUTHORITY[\"EPSG\",\"6242\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 3, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 4, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"4242\"]]"); + p = add_epsg_def (first, last, 4243, "epsg", 4243, "Kalianpur 1880"); + add_proj4text (p, 0, + "+proj=longlat +a=6377299.36559538 +b=6356098.359005156 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Kalianpur 1880\",DATUM[\"Kalianpur_1880\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Everest (1830 Definition)\",6377299.36559538,300.8"); + add_srs_wkt (p, 2, + "017255433552,AUTHORITY[\"EPSG\",\"7042\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6243\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4243\"]]"); + p = add_epsg_def (first, last, 4244, "epsg", 4244, "Kandawala"); + add_proj4text (p, 0, + "+proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs8"); + add_proj4text (p, 1, "4=-97,787,86,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Kandawala\",DATUM[\"Kandawala\",SPHEROID[\"Ever"); + add_srs_wkt (p, 1, + "est 1830 (1937 Adjustment)\",6377276.345,300.8017,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7015\"]],TOWGS84[-97,787,86,0,0,0,0],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6244\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, "44\"]]"); + p = add_epsg_def (first, last, 4245, "epsg", 4245, "Kertau 1968"); + add_proj4text (p, 0, + "+proj=longlat +a=6377304.063 +b=6356103.038993155 +towgs"); + add_proj4text (p, 1, "84=-11,851,5,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Kertau 1968\",DATUM[\"Kertau_1968\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Everest 1830 Modified\",6377304.063,300.8017,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7018\"]],TOWGS84[-11,851,5,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6245\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4245\"]]"); + p = add_epsg_def (first, last, 4246, "epsg", 4246, "KOC"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-294.7,-200.1,525.5"); + add_proj4text (p, 1, ",0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"KOC\",DATUM[\"Kuwait_Oil_Company\",SPHEROID[\"C"); + add_srs_wkt (p, 1, + "larke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7012\"]],TOWGS84[-294.7,-200.1,525.5,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6246\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4246\""); + add_srs_wkt (p, 6, "]]"); + p = add_epsg_def (first, last, 4247, "epsg", 4247, "La Canoa"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-273.5,110.6,-357.9,0"); + add_proj4text (p, 1, ",0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"La Canoa\",DATUM[\"La_Canoa\",SPHEROID[\"Intern"); + add_srs_wkt (p, 1, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 2, + ",TOWGS84[-273.5,110.6,-357.9,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6247\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4247\"]]"); + p = add_epsg_def (first, last, 4248, "epsg", 4248, "PSAD56"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"PSAD56\",DATUM[\"Provisional_South_American_Dat"); + add_srs_wkt (p, 1, + "um_1956\",SPHEROID[\"International 1924\",6378388,297,AU"); + add_srs_wkt (p, 2, + "THORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6248\"]"); + add_srs_wkt (p, 3, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 4, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4248\"]]"); + p = add_epsg_def (first, last, 4249, "epsg", 4249, "Lake"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Lake\",DATUM[\"Lake\",SPHEROID[\"International "); + add_srs_wkt (p, 1, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"6249\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4249\""); + add_srs_wkt (p, 5, "]]"); + p = add_epsg_def (first, last, 4250, "epsg", 4250, "Leigon"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-130,29,364,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Leigon\",DATUM[\"Leigon\",SPHEROID[\"Clarke 188"); + add_srs_wkt (p, 1, + "0 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\""); + add_srs_wkt (p, 2, + "]],TOWGS84[-130,29,364,0,0,0,0],AUTHORITY[\"EPSG\",\"625"); + add_srs_wkt (p, 3, + "0\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4250\"]]"); + p = add_epsg_def (first, last, 4251, "epsg", 4251, "Liberia 1964"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-90,40,88,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Liberia 1964\",DATUM[\"Liberia_1964\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7012\"]],TOWGS84[-90,40,88,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6251\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4251\"]]"); + p = add_epsg_def (first, last, 4252, "epsg", 4252, "Lome"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Lome\",DATUM[\"Lome\",SPHEROID[\"Clarke 1880 (I"); + add_srs_wkt (p, 1, + "GN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "011\"]],AUTHORITY[\"EPSG\",\"6252\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 3, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 4, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4252\"]]"); + p = add_epsg_def (first, last, 4253, "epsg", 4253, "Luzon 1911"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Luzon 1911\",DATUM[\"Luzon_1911\",SPHEROID[\"Cl"); + add_srs_wkt (p, 1, + "arke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 2, + "\",\"7008\"]],AUTHORITY[\"EPSG\",\"6253\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 3, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4253\"]]"); + p = add_epsg_def (first, last, 4254, "epsg", 4254, "Hito XVIII 1963"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Hito XVIII 1963\",DATUM[\"Hito_XVIII_1963\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],AUTHORITY[\"EPSG\",\"6254\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4254\"]]"); + p = add_epsg_def (first, last, 4255, "epsg", 4255, "Herat North"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-333,-222,114,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Herat North\",DATUM[\"Herat_North\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],TOWGS84[-333,-222,114,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6255\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4255\"]]"); + p = add_epsg_def (first, last, 4256, "epsg", 4256, "Mahe 1971"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=41,-220,-134,0,0,0,"); + add_proj4text (p, 1, "0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Mahe 1971\",DATUM[\"Mahe_1971\",SPHEROID[\"Clar"); + add_srs_wkt (p, 1, + "ke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7012\"]],TOWGS84[41,-220,-134,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6256\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4256\"]]"); + p = add_epsg_def (first, last, 4257, "epsg", 4257, "Makassar"); + add_proj4text (p, 0, + "+proj=longlat +ellps=bessel +towgs84=-587.8,519.75,145.7"); + add_proj4text (p, 1, "6,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Makassar\",DATUM[\"Makassar\",SPHEROID[\"Bessel"); + add_srs_wkt (p, 1, + " 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 2, + "4\"]],TOWGS84[-587.8,519.75,145.76,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6257\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4257\"]]"); + p = add_epsg_def (first, last, 4258, "epsg", 4258, "ETRS89"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ETRS89\",DATUM[\"European_Terrestrial_Reference"); + add_srs_wkt (p, 1, + "_System_1989\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 2, + "01,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"62"); + add_srs_wkt (p, 3, + "58\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4258\"]]"); + p = add_epsg_def (first, last, 4259, "epsg", 4259, "Malongo 1987"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Malongo 1987\",DATUM[\"Malongo_1987\",SPHEROID["); + add_srs_wkt (p, 1, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],AUTHORITY[\"EPSG\",\"6259\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"4259\"]]"); + p = add_epsg_def (first, last, 4260, "epsg", 4260, "Manoca"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-70.9,-151.8,-41.4,"); + add_proj4text (p, 1, "0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Manoca\",DATUM[\"Manoca\",SPHEROID[\"Clarke 188"); + add_srs_wkt (p, 1, + "0 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\""); + add_srs_wkt (p, 2, + "]],TOWGS84[-70.9,-151.8,-41.4,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6260\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"4260\"]]"); + p = add_epsg_def (first, last, 4261, "epsg", 4261, "Merchich"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=31,146,47"); + add_proj4text (p, 1, ",0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Merchich\",DATUM[\"Merchich\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 1, + " 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7011\"]],TOWGS84[31,146,47,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6261\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4261\"]]"); + p = add_epsg_def (first, last, 4262, "epsg", 4262, "Massawa"); + add_proj4text (p, 0, + "+proj=longlat +ellps=bessel +towgs84=639,405,60,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Massawa\",DATUM[\"Massawa\",SPHEROID[\"Bessel 1"); + add_srs_wkt (p, 1, + "841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\""); + add_srs_wkt (p, 2, + "]],TOWGS84[639,405,60,0,0,0,0],AUTHORITY[\"EPSG\",\"6262"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4262\"]]"); + p = add_epsg_def (first, last, 4263, "epsg", 4263, "Minna"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Minna\",DATUM[\"Minna\",SPHEROID[\"Clarke 1880 "); + add_srs_wkt (p, 1, + "(RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]"); + add_srs_wkt (p, 2, + "],AUTHORITY[\"EPSG\",\"6263\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 4, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"4263\"]]"); + p = add_epsg_def (first, last, 4264, "epsg", 4264, "Mhast"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-252.95,-4.11,-96.38,"); + add_proj4text (p, 1, "0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Mhast\",DATUM[\"Mhast\",SPHEROID[\"Internationa"); + add_srs_wkt (p, 1, + "l 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS"); + add_srs_wkt (p, 2, + "84[-252.95,-4.11,-96.38,0,0,0,0],AUTHORITY[\"EPSG\",\"62"); + add_srs_wkt (p, 3, + "64\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4264\"]]"); + p = add_epsg_def (first, last, 4265, "epsg", 4265, "Monte Mario"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Monte Mario\",DATUM[\"Monte_Mario\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],AUTHORITY[\"EPSG\",\"6265\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4265\"]]"); + p = add_epsg_def (first, last, 4266, "epsg", 4266, "M'poraloko"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"M'poraloko\",DATUM[\"M_poraloko\",SPHEROID[\"Cl"); + add_srs_wkt (p, 1, + "arke 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORITY["); + add_srs_wkt (p, 2, + "\"EPSG\",\"7011\"]],AUTHORITY[\"EPSG\",\"6266\"]],PRIMEM"); + add_srs_wkt (p, 3, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 4, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 5, ",AUTHORITY[\"EPSG\",\"4266\"]]"); + p = add_epsg_def (first, last, 4267, "epsg", 4267, "NAD27"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +datum=NAD27 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NAD27\",DATUM[\"North_American_Datum_1927\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, "\"]],AUTHORITY[\"EPSG\",\"4267\"]]"); + p = add_epsg_def (first, last, 4268, "epsg", 4268, "NAD27 Michigan"); + add_proj4text (p, 0, + "+proj=longlat +a=6378450.047548896 +b=6356826.621488444 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NAD27 Michigan\",DATUM[\"NAD_Michigan\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Clarke 1866 Michigan\",6378450.047548896,294.9786971"); + add_srs_wkt (p, 2, + "646739,AUTHORITY[\"EPSG\",\"7009\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"6268\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4268\"]]"); + p = add_epsg_def (first, last, 4269, "epsg", 4269, "NAD83"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4269\"]]"); + p = add_epsg_def (first, last, 4270, "epsg", 4270, "Nahrwan 1967"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Nahrwan 1967\",DATUM[\"Nahrwan_1967\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6270\"]],PRIMEM[\"G"); + add_srs_wkt (p, 3, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 4, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 5, "HORITY[\"EPSG\",\"4270\"]]"); + p = add_epsg_def (first, last, 4271, "epsg", 4271, "Naparima 1972"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Naparima 1972\",DATUM[\"Naparima_1972\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7022\"]],AUTHORITY[\"EPSG\",\"6271\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 3, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 4, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"4271\"]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_16 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ + struct epsg_defs *p; +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + p = add_epsg_def (first, last, 4272, "epsg", 4272, "NZGD49"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +datum=nzgd49 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NZGD49\",DATUM[\"New_Zealand_Geodetic_Datum_194"); + add_srs_wkt (p, 1, + "9\",SPHEROID[\"International 1924\",6378388,297,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7022\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0"); + add_srs_wkt (p, 3, + ".1,1.024,-4.5993],AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, "THORITY[\"EPSG\",\"4272\"]]"); + p = add_epsg_def (first, last, 4273, "epsg", 4273, "NGO 1948"); + add_proj4text (p, 0, + "+proj=longlat +a=6377492.018 +b=6356173.508712696 +towgs"); + add_proj4text (p, 1, "84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NGO 1948\",DATUM[\"NGO_1948\",SPHEROID[\"Bessel"); + add_srs_wkt (p, 1, + " Modified\",6377492.018,299.1528128,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7005\"]],TOWGS84[278.3,93,474.5,7.889,0.05,-6.61,6.21],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6273\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "4273\"]]"); + p = add_epsg_def (first, last, 4274, "epsg", 4274, "Datum 73"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Datum 73\",DATUM[\"Datum_73\",SPHEROID[\"Intern"); + add_srs_wkt (p, 1, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"6274\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 4, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"4274\"]]"); + p = add_epsg_def (first, last, 4275, "epsg", 4275, "NTF"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,"); + add_proj4text (p, 1, "320,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NTF\",DATUM[\"Nouvelle_Triangulation_Francaise\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660212936"); + add_srs_wkt (p, 2, + "265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60,320,0"); + add_srs_wkt (p, 3, + ",0,0,0],AUTHORITY[\"EPSG\",\"6275\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, "EPSG\",\"4275\"]]"); + p = add_epsg_def (first, last, 4276, "epsg", 4276, "NSWC 9Z-2"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NSWC 9Z-2\",DATUM[\"NSWC_9Z_2\",SPHEROID[\"NWL "); + add_srs_wkt (p, 1, + "9D\",6378145,298.25,AUTHORITY[\"EPSG\",\"7025\"]],AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"6276\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4276"); + add_srs_wkt (p, 5, "\"]]"); + p = add_epsg_def (first, last, 4277, "epsg", 4277, "OSGB 1936"); + add_proj4text (p, 0, "+proj=longlat +ellps=airy +datum=OSGB36 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"OSGB 1936\",DATUM[\"OSGB_1936\",SPHEROID[\"Airy"); + add_srs_wkt (p, 1, + " 1830\",6377563.396,299.3249646,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 2, + "1\"]],AUTHORITY[\"EPSG\",\"6277\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4277\"]]"); + p = add_epsg_def (first, last, 4278, "epsg", 4278, "OSGB70"); + add_proj4text (p, 0, "+proj=longlat +ellps=airy +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"OSGB70\",DATUM[\"OSGB_1970_SN\",SPHEROID[\"Airy"); + add_srs_wkt (p, 1, + " 1830\",6377563.396,299.3249646,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 2, + "1\"]],AUTHORITY[\"EPSG\",\"6278\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4278\"]]"); + p = add_epsg_def (first, last, 4279, "epsg", 4279, "OS(SN)80"); + add_proj4text (p, 0, "+proj=longlat +ellps=airy +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"OS(SN)80\",DATUM[\"OS_SN_1980\",SPHEROID[\"Airy"); + add_srs_wkt (p, 1, + " 1830\",6377563.396,299.3249646,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 2, + "1\"]],AUTHORITY[\"EPSG\",\"6279\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4279\"]]"); + p = add_epsg_def (first, last, 4280, "epsg", 4280, "Padang"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Padang\",DATUM[\"Padang_1884\",SPHEROID[\"Besse"); + add_srs_wkt (p, 1, + "l 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "04\"]],AUTHORITY[\"EPSG\",\"6280\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4280\"]]"); + p = add_epsg_def (first, last, 4281, "epsg", 4281, "Palestine 1923"); + add_proj4text (p, 0, + "+proj=longlat +a=6378300.789 +b=6356566.435 +towgs84=-27"); + add_proj4text (p, 1, + "5.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Palestine 1923\",DATUM[\"Palestine_1923\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Clarke 1880 (Benoit)\",6378300.789,293.46631553898"); + add_srs_wkt (p, 2, + "02,AUTHORITY[\"EPSG\",\"7010\"]],TOWGS84[-275.722,94.782"); + add_srs_wkt (p, 3, + "4,340.894,-8.001,-4.42,-11.821,1],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 4, + "281\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 5, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4281\"]]"); + p = add_epsg_def (first, last, 4282, "epsg", 4282, "Pointe Noire"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Pointe Noire\",DATUM[\"Congo_1960_Pointe_Noire\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660212936"); + add_srs_wkt (p, 2, + "265,AUTHORITY[\"EPSG\",\"7011\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "282\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4282\"]]"); + p = add_epsg_def (first, last, 4283, "epsg", 4283, "GDA94"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"GDA94\",DATUM[\"Geocentric_Datum_of_Australia_1"); + add_srs_wkt (p, 1, + "994\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6283\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4283\"]"); + add_srs_wkt (p, 6, "]"); + p = add_epsg_def (first, last, 4284, "epsg", 4284, "Pulkovo 1942"); + add_proj4text (p, 0, "+proj=longlat +ellps=krass +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "4284\"]]"); + p = add_epsg_def (first, last, 4285, "epsg", 4285, "Qatar 1974"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Qatar 1974\",DATUM[\"Qatar_1974\",SPHEROID[\"In"); + add_srs_wkt (p, 1, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 2, + "\"]],AUTHORITY[\"EPSG\",\"6285\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 3, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 4, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 5, "SG\",\"4285\"]]"); + p = add_epsg_def (first, last, 4286, "epsg", 4286, "Qatar 1948"); + add_proj4text (p, 0, "+proj=longlat +ellps=helmert +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Qatar 1948\",DATUM[\"Qatar_1948\",SPHEROID[\"He"); + add_srs_wkt (p, 1, + "lmert 1906\",6378200,298.3,AUTHORITY[\"EPSG\",\"7020\"]]"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"6286\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 4, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"4286\"]]"); + p = add_epsg_def (first, last, 4287, "epsg", 4287, "Qornoq"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=164,138,-189,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Qornoq\",DATUM[\"Qornoq\",SPHEROID[\"Internatio"); + add_srs_wkt (p, 1, + "nal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOW"); + add_srs_wkt (p, 2, + "GS84[164,138,-189,0,0,0,0],AUTHORITY[\"EPSG\",\"6287\"]]"); + add_srs_wkt (p, 3, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 4, + "IT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, "08\"]],AUTHORITY[\"EPSG\",\"4287\"]]"); + p = add_epsg_def (first, last, 4288, "epsg", 4288, "Loma Quintana"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Loma Quintana\",DATUM[\"Loma_Quintana\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7022\"]],AUTHORITY[\"EPSG\",\"6288\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 3, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 4, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"4288\"]]"); + p = add_epsg_def (first, last, 4289, "epsg", 4289, "Amersfoort"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Amersfoort\",DATUM[\"Amersfoort\",SPHEROID[\"Be"); + add_srs_wkt (p, 1, + "ssel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7004\"]],AUTHORITY[\"EPSG\",\"6289\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"4289\"]]"); + p = add_epsg_def (first, last, 4291, "epsg", 4291, "SAD69"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS67 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"SAD69\",DATUM[\"South_American_Datum_1969\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"GRS 1967\",6378160,298.247167427,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7036\"]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHOR"); + add_srs_wkt (p, 5, "ITY[\"EPSG\",\"4291\"]]"); + p = add_epsg_def (first, last, 4292, "epsg", 4292, "Sapper Hill 1943"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-355,21,72,0,0,0,0 +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Sapper Hill 1943\",DATUM[\"Sapper_Hill_1943\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"International 1924\",6378388,297,AUTHORITY[\"E"); + add_srs_wkt (p, 2, + "PSG\",\"7022\"]],TOWGS84[-355,21,72,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6292\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4292\"]]"); + p = add_epsg_def (first, last, 4293, "epsg", 4293, "Schwarzeck"); + add_proj4text (p, 0, "+proj=longlat +ellps=bess_nam +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Schwarzeck\",DATUM[\"Schwarzeck\",SPHEROID[\"Be"); + add_srs_wkt (p, 1, + "ssel Namibia (GLM)\",6377483.865280419,299.1528128,AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"7046\"]],AUTHORITY[\"EPSG\",\"6293\"]],P"); + add_srs_wkt (p, 3, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 4, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 5, "2\"]],AUTHORITY[\"EPSG\",\"4293\"]]"); + p = add_epsg_def (first, last, 4294, "epsg", 4294, "Segora"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Segora\",DATUM[\"Segora\",SPHEROID[\"Bessel 184"); + add_srs_wkt (p, 1, + "1\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]"); + add_srs_wkt (p, 2, + "],AUTHORITY[\"EPSG\",\"6294\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 4, + "5199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"4294\"]]"); + p = add_epsg_def (first, last, 4295, "epsg", 4295, "Serindung"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Serindung\",DATUM[\"Serindung\",SPHEROID[\"Bess"); + add_srs_wkt (p, 1, + "el 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "004\"]],AUTHORITY[\"EPSG\",\"6295\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 3, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 4, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4295\"]]"); + p = add_epsg_def (first, last, 4296, "epsg", 4296, "Sudan"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Sudan\",DATUM[\"Sudan\",SPHEROID[\"Clarke 1880 "); + add_srs_wkt (p, 1, + "(IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7011\"]],AUTHORITY[\"EPSG\",\"6296\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "74532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4296\"]]"); + p = add_epsg_def (first, last, 4297, "epsg", 4297, "Tananarive"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-189,-242,-91,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Tananarive\",DATUM[\"Tananarive_1925\",SPHEROID"); + add_srs_wkt (p, 1, + "[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],TOWGS84[-189,-242,-91,0,0,0,0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6297\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4297\"]]"); + p = add_epsg_def (first, last, 4298, "epsg", 4298, "Timbalai 1948"); + add_proj4text (p, 0, "+proj=longlat +ellps=evrstSS +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Timbalai 1948\",DATUM[\"Timbalai_1948\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Everest 1830 (1967 Definition)\",6377298.556,300.801"); + add_srs_wkt (p, 2, + "7,AUTHORITY[\"EPSG\",\"7016\"]],AUTHORITY[\"EPSG\",\"629"); + add_srs_wkt (p, 3, + "8\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4298\"]]"); + p = add_epsg_def (first, last, 4299, "epsg", 4299, "TM65"); + add_proj4text (p, 0, "+proj=longlat +ellps=mod_airy +datum=ire65 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"TM65\",DATUM[\"TM65\",SPHEROID[\"Airy Modified "); + add_srs_wkt (p, 1, + "1849\",6377340.189,299.3249646,AUTHORITY[\"EPSG\",\"7002"); + add_srs_wkt (p, 2, + "\"]],AUTHORITY[\"EPSG\",\"6299\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 3, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 4, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 5, "SG\",\"4299\"]]"); + p = add_epsg_def (first, last, 4300, "epsg", 4300, "TM75"); + add_proj4text (p, 0, "+proj=longlat +ellps=mod_airy +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"TM75\",DATUM[\"Geodetic_Datum_of_1965\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Airy Modified 1849\",6377340.189,299.3249646,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7002\"]],AUTHORITY[\"EPSG\",\"6300\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, "]],AUTHORITY[\"EPSG\",\"4300\"]]"); + p = add_epsg_def (first, last, 4301, "epsg", 4301, "Tokyo"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\""); + add_srs_wkt (p, 1, + ",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 4, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "4301\"]]"); + p = add_epsg_def (first, last, 4302, "epsg", 4302, "Trinidad 1903"); + add_proj4text (p, 0, + "+proj=longlat +a=6378293.645208759 +b=6356617.987679838 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Trinidad 1903\",DATUM[\"Trinidad_1903\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Clarke 1858\",6378293.645208759,294.2606763692569,AU"); + add_srs_wkt (p, 2, + "THORITY[\"EPSG\",\"7007\"]],AUTHORITY[\"EPSG\",\"6302\"]"); + add_srs_wkt (p, 3, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 4, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4302\"]]"); + p = add_epsg_def (first, last, 4303, "epsg", 4303, "TC(1948)"); + add_proj4text (p, 0, "+proj=longlat +ellps=helmert +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"TC(1948)\",DATUM[\"Trucial_Coast_1948\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Helmert 1906\",6378200,298.3,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "20\"]],AUTHORITY[\"EPSG\",\"6303\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4303\"]]"); + p = add_epsg_def (first, last, 4304, "epsg", 4304, "Voirol 1875"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-73,-247,"); + add_proj4text (p, 1, "227,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Voirol 1875\",DATUM[\"Voirol_1875\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Clarke 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7011\"]],TOWGS84[-73,-247,227,0,0,0,0],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6304\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"43"); + add_srs_wkt (p, 6, "04\"]]"); + p = add_epsg_def (first, last, 4306, "epsg", 4306, "Bern 1938"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Bern 1938\",DATUM[\"Bern_1938\",SPHEROID[\"Bess"); + add_srs_wkt (p, 1, + "el 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "004\"]],AUTHORITY[\"EPSG\",\"6306\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 3, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 4, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4306\"]]"); + p = add_epsg_def (first, last, 4307, "epsg", 4307, "Nord Sahara 1959"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Nord Sahara 1959\",DATUM[\"Nord_Sahara_1959\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6307\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, "\"]],AUTHORITY[\"EPSG\",\"4307\"]]"); + p = add_epsg_def (first, last, 4308, "epsg", 4308, "RT38"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RT38\",DATUM[\"Stockholm_1938\",SPHEROID[\"Bess"); + add_srs_wkt (p, 1, + "el 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "004\"]],AUTHORITY[\"EPSG\",\"6308\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 3, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 4, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4308\"]]"); + p = add_epsg_def (first, last, 4309, "epsg", 4309, "Yacare"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-155,171,37,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Yacare\",DATUM[\"Yacare\",SPHEROID[\"Internatio"); + add_srs_wkt (p, 1, + "nal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOW"); + add_srs_wkt (p, 2, + "GS84[-155,171,37,0,0,0,0],AUTHORITY[\"EPSG\",\"6309\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, "22\"]],AUTHORITY[\"EPSG\",\"4309\"]]"); + p = add_epsg_def (first, last, 4310, "epsg", 4310, "Yoff"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Yoff\",DATUM[\"Yoff\",SPHEROID[\"Clarke 1880 (I"); + add_srs_wkt (p, 1, + "GN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "011\"]],AUTHORITY[\"EPSG\",\"6310\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 3, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 4, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4310\"]]"); + p = add_epsg_def (first, last, 4311, "epsg", 4311, "Zanderij"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-265,120,-358,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Zanderij\",DATUM[\"Zanderij\",SPHEROID[\"Intern"); + add_srs_wkt (p, 1, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 2, + ",TOWGS84[-265,120,-358,0,0,0,0],AUTHORITY[\"EPSG\",\"631"); + add_srs_wkt (p, 3, + "1\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4311\"]]"); + p = add_epsg_def (first, last, 4312, "epsg", 4312, "MGI"); + add_proj4text (p, 0, + "+proj=longlat +ellps=bessel +datum=hermannskogel +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "GEOGCS[\"MGI\",DATUM[\"Militar_Geographische_Institute\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7004\"]],TOWGS84[577.326,90.129,463.919,5"); + add_srs_wkt (p, 3, + ".137,1.474,5.297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108"); + add_srs_wkt (p, 6, "\"]],AUTHORITY[\"EPSG\",\"4312\"]]"); + p = add_epsg_def (first, last, 4313, "epsg", 4313, "Belge 1972"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=106.869,-52.2978,103."); + add_proj4text (p, 1, "724,-0.33657,0.456955,-1.84218,1 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Belge 1972\",DATUM[\"Reseau_National_Belge_1972"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7022\"]],TOWGS84[106.869,-52.2978,103.724,-0"); + add_srs_wkt (p, 3, + ".33657,0.456955,-1.84218,1],AUTHORITY[\"EPSG\",\"6313\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "9122\"]],AUTHORITY[\"EPSG\",\"4313\"]]"); + p = add_epsg_def (first, last, 4314, "epsg", 4314, "DHDN"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +datum=potsdam +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"DHDN\",DATUM[\"Deutsches_Hauptdreiecksnetz\",SP"); + add_srs_wkt (p, 1, + "HEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6314\"]],PRIME"); + add_srs_wkt (p, 3, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 4, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 5, "],AUTHORITY[\"EPSG\",\"4314\"]]"); + p = add_epsg_def (first, last, 4315, "epsg", 4315, "Conakry 1905"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-23,259,-"); + add_proj4text (p, 1, "9,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Conakry 1905\",DATUM[\"Conakry_1905\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1880 (IGN)\",6378249.2,293.4660212936265,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7011\"]],TOWGS84[-23,259,-9,0,0,0,0],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6315\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"43"); + add_srs_wkt (p, 6, "15\"]]"); + p = add_epsg_def (first, last, 4316, "epsg", 4316, "Dealul Piscului 1930"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Dealul Piscului 1930\",DATUM[\"Dealul_Piscului_"); + add_srs_wkt (p, 1, + "1930\",SPHEROID[\"International 1924\",6378388,297,AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6316\"]],P"); + add_srs_wkt (p, 3, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 4, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 5, "2\"]],AUTHORITY[\"EPSG\",\"4316\"]]"); + p = add_epsg_def (first, last, 4317, "epsg", 4317, "Dealul Piscului 1970"); + add_proj4text (p, 0, "+proj=longlat +ellps=krass +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Dealul Piscului 1970\",DATUM[\"Dealul_Piscului_"); + add_srs_wkt (p, 1, + "1970\",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6317\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, "\"]],AUTHORITY[\"EPSG\",\"4317\"]]"); + p = add_epsg_def (first, last, 4318, "epsg", 4318, "NGN"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=-3.2,-5.7,2.8,0,0,0,"); + add_proj4text (p, 1, "0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NGN\",DATUM[\"National_Geodetic_Network\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7030\"]],TOWGS84[-3.2,-5.7,2.8,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6318\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4318\"]]"); + p = add_epsg_def (first, last, 4319, "epsg", 4319, "KUDAMS"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"KUDAMS\",DATUM[\"Kuwait_Utility\",SPHEROID[\"GR"); + add_srs_wkt (p, 1, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 2, + "\"]],AUTHORITY[\"EPSG\",\"6319\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 3, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 4, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 5, "SG\",\"4319\"]]"); + p = add_epsg_def (first, last, 4322, "epsg", 4322, "WGS 72"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS72 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"WGS 72\",DATUM[\"WGS_1972\",SPHEROID[\"WGS 72\""); + add_srs_wkt (p, 1, + ",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],AUTHORITY["); + add_srs_wkt (p, 2, + "\"EPSG\",\"6322\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4322\"]]"); + add_srs_wkt (p, 5, ""); + p = add_epsg_def (first, last, 4324, "epsg", 4324, "WGS 72BE"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0"); + add_proj4text (p, 1, ".38 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"WGS 72BE\",DATUM[\"WGS_1972_Transit_Broadcast_E"); + add_srs_wkt (p, 1, + "phemeris\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORITY["); + add_srs_wkt (p, 2, + "\"EPSG\",\"7043\"]],TOWGS84[0,0,1.9,0,0,0.814,-0.38],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6324\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, "324\"]]"); + +#endif /* loading unconditionally the 4326 EPSG def */ + p = add_epsg_def (first, last, 4326, "epsg", 4326, "WGS 84"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\""); + add_srs_wkt (p, 1, + ",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 4, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 5, "326\"]]"); +#if OMIT_EPSG == 0 /* resuming conditional EPSG initialization */ + + p = add_epsg_def (first, last, 4600, "epsg", 4600, "Anguilla 1957"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Anguilla 1957\",DATUM[\"Anguilla_1957\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6600\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4600\"]]"); + p = add_epsg_def (first, last, 4601, "epsg", 4601, "Antigua 1943"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Antigua 1943\",DATUM[\"Antigua_1943\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6601\"]],PRIMEM[\"G"); + add_srs_wkt (p, 3, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 4, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 5, "HORITY[\"EPSG\",\"4601\"]]"); + p = add_epsg_def (first, last, 4602, "epsg", 4602, "Dominica 1945"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=725,685,536,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Dominica 1945\",DATUM[\"Dominica_1945\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7012\"]],TOWGS84[725,685,536,0,0,0,0],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6602\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4602\"]"); + add_srs_wkt (p, 6, "]"); + p = add_epsg_def (first, last, 4603, "epsg", 4603, "Grenada 1953"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=72,213.7,93,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Grenada 1953\",DATUM[\"Grenada_1953\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7012\"]],TOWGS84[72,213.7,93,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6603\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4603\"]]"); + p = add_epsg_def (first, last, 4604, "epsg", 4604, "Montserrat 1958"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=174,359,365,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Montserrat 1958\",DATUM[\"Montserrat_1958\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7012\"]],TOWGS84[174,359,365,0,0,0,0],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6604\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"460"); + add_srs_wkt (p, 6, "4\"]]"); + p = add_epsg_def (first, last, 4605, "epsg", 4605, "St. Kitts 1955"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"St. Kitts 1955\",DATUM[\"St_Kitts_1955\",SPHERO"); + add_srs_wkt (p, 1, + "ID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6605\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4605\"]]"); + p = add_epsg_def (first, last, 4606, "epsg", 4606, "St. Lucia 1955"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-149,128,296,0,0,0,"); + add_proj4text (p, 1, "0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"St. Lucia 1955\",DATUM[\"St_Lucia_1955\",SPHERO"); + add_srs_wkt (p, 1, + "ID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7012\"]],TOWGS84[-149,128,296,0,0,0,0],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6606\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4606\"]"); + add_srs_wkt (p, 6, "]"); + p = add_epsg_def (first, last, 4607, "epsg", 4607, "St. Vincent 1945"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=195.671,332.517,274"); + add_proj4text (p, 1, ".607,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"St. Vincent 1945\",DATUM[\"St_Vincent_1945\",SP"); + add_srs_wkt (p, 1, + "HEROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7012\"]],TOWGS84[195.671,332.517,274.607,0"); + add_srs_wkt (p, 3, + ",0,0,0],AUTHORITY[\"EPSG\",\"6607\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, "EPSG\",\"4607\"]]"); + p = add_epsg_def (first, last, 4608, "epsg", 4608, "NAD27(76)"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NAD27(76)\",DATUM[\"North_American_Datum_1927_1"); + add_srs_wkt (p, 1, + "976\",SPHEROID[\"Clarke 1866\",6378206.4,294.97869821390"); + add_srs_wkt (p, 2, + "06,AUTHORITY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"66"); + add_srs_wkt (p, 3, + "08\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4608\"]]"); + p = add_epsg_def (first, last, 4609, "epsg", 4609, "NAD27(CGQ77)"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NAD27(CGQ77)\",DATUM[\"North_American_Datum_192"); + add_srs_wkt (p, 1, + "7_CGQ77\",SPHEROID[\"Clarke 1866\",6378206.4,294.9786982"); + add_srs_wkt (p, 2, + "139006,AUTHORITY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"6609\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4609\"]]"); + p = add_epsg_def (first, last, 4610, "epsg", 4610, "Xian 1980"); + add_proj4text (p, 0, + "+proj=longlat +a=6378140 +b=6356755.288157528 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Xian 1980\",DATUM[\"Xian_1980\",SPHEROID[\"Xian"); + add_srs_wkt (p, 1, + " 1980\",6378140,298.257,AUTHORITY[\"EPSG\",\"7049\"]],AU"); + add_srs_wkt (p, 2, + "THORITY[\"EPSG\",\"6610\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 4, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "4610\"]]"); + p = add_epsg_def (first, last, 4611, "epsg", 4611, "Hong Kong 1980"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-162.619,-276.959,-16"); + add_proj4text (p, 1, "1.764,0.067753,-2.24365,-1.15883,-1.09425 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Hong Kong 1980\",DATUM[\"Hong_Kong_1980\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7022\"]],TOWGS84[-162.619,-276.959,-161.764,0.067753,"); + add_srs_wkt (p, 3, + "-2.24365,-1.15883,-1.09425],AUTHORITY[\"EPSG\",\"6611\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "9122\"]],AUTHORITY[\"EPSG\",\"4611\"]]"); + p = add_epsg_def (first, last, 4612, "epsg", 4612, "JGD2000"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"JGD2000\",DATUM[\"Japanese_Geodetic_Datum_2000\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6612\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4612\"]]"); + p = add_epsg_def (first, last, 4613, "epsg", 4613, "Segara"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Segara\",DATUM[\"Gunung_Segara\",SPHEROID[\"Bes"); + add_srs_wkt (p, 1, + "sel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7004\"]],AUTHORITY[\"EPSG\",\"6613\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"4613\"]]"); + p = add_epsg_def (first, last, 4614, "epsg", 4614, "QND95"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-119.425,-303.659,-11"); + add_proj4text (p, 1, ".0006,1.1643,0.174458,1.09626,3.65706 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"QND95\",DATUM[\"Qatar_National_Datum_1995\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],TOWGS84[-119.425,-303.659,-11.0006,1.1643"); + add_srs_wkt (p, 3, + ",0.174458,1.09626,3.65706],AUTHORITY[\"EPSG\",\"6614\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, "122\"]],AUTHORITY[\"EPSG\",\"4614\"]]"); + p = add_epsg_def (first, last, 4615, "epsg", 4615, "Porto Santo"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-499,-249,314,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Porto Santo\",DATUM[\"Porto_Santo_1936\",SPHERO"); + add_srs_wkt (p, 1, + "ID[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7022\"]],TOWGS84[-499,-249,314,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6615\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4615\"]]"); + p = add_epsg_def (first, last, 4616, "epsg", 4616, "Selvagem Grande"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Selvagem Grande\",DATUM[\"Selvagem_Grande\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],AUTHORITY[\"EPSG\",\"6616\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4616\"]]"); + p = add_epsg_def (first, last, 4617, "epsg", 4617, "NAD83(CSRS)"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NAD83(CSRS)\",DATUM[\"NAD83_Canadian_Spatial_Re"); + add_srs_wkt (p, 1, + "ference_System\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 2, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6140\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4617\"]]"); + p = add_epsg_def (first, last, 4618, "epsg", 4618, "SAD69"); + add_proj4text (p, 0, "+proj=longlat +ellps=aust_SA +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"SAD69\",DATUM[\"South_American_Datum_1969\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"GRS 1967 Modified\",6378160,298.25,AUTHORITY[\"E"); + add_srs_wkt (p, 2, + "PSG\",\"7050\"]],AUTHORITY[\"EPSG\",\"6618\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4618\"]]"); + p = add_epsg_def (first, last, 4619, "epsg", 4619, "SWEREF99"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"SWEREF99\",DATUM[\"SWEREF99\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 1, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 2, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6619\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, "\"]],AUTHORITY[\"EPSG\",\"4619\"]]"); + p = add_epsg_def (first, last, 4620, "epsg", 4620, "Point 58"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-106,-129,165,0,0,0"); + add_proj4text (p, 1, ",0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Point 58\",DATUM[\"Point_58\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 1, + " 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "012\"]],TOWGS84[-106,-129,165,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6620\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4620\"]]"); + p = add_epsg_def (first, last, 4621, "epsg", 4621, "Fort Marigot"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=137,248,-430,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Fort Marigot\",DATUM[\"Fort_Marigot\",SPHEROID["); + add_srs_wkt (p, 1, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],TOWGS84[137,248,-430,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6621\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4621\"]]"); + p = add_epsg_def (first, last, 4622, "epsg", 4622, "Guadeloupe 1948"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Guadeloupe 1948\",DATUM[\"Guadeloupe_1948\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],AUTHORITY[\"EPSG\",\"6622\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4622\"]]"); + p = add_epsg_def (first, last, 4623, "epsg", 4623, "CSG67"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-186,230,110,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"CSG67\",DATUM[\"Centre_Spatial_Guyanais_1967\","); + add_srs_wkt (p, 1, + "SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7022\"]],TOWGS84[-186,230,110,0,0,0,0],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6623\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4623\"]"); + add_srs_wkt (p, 6, "]"); + p = add_epsg_def (first, last, 4624, "epsg", 4624, "RGFG95"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=2,2,-2,0,0,0,0 +no_d"); + add_proj4text (p, 1, "efs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RGFG95\",DATUM[\"Reseau_Geodesique_Francais_Guy"); + add_srs_wkt (p, 1, + "ane_1995\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[2,2,-2,0,0,0,0],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6624\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, "624\"]]"); + p = add_epsg_def (first, last, 4625, "epsg", 4625, "Martinique 1938"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Martinique 1938\",DATUM[\"Martinique_1938\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],AUTHORITY[\"EPSG\",\"6625\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4625\"]]"); + p = add_epsg_def (first, last, 4626, "epsg", 4626, "Reunion 1947"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Reunion 1947\",DATUM[\"Reunion_1947\",SPHEROID["); + add_srs_wkt (p, 1, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],AUTHORITY[\"EPSG\",\"6626\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"4626\"]]"); + p = add_epsg_def (first, last, 4627, "epsg", 4627, "RGR92"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RGR92\",DATUM[\"Reseau_Geodesique_de_la_Reunion"); + add_srs_wkt (p, 1, + "_1992\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6627\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4627\""); + add_srs_wkt (p, 6, "]]"); + p = add_epsg_def (first, last, 4628, "epsg", 4628, "Tahiti 52"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=162,117,154,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Tahiti 52\",DATUM[\"Tahiti_52\",SPHEROID[\"Inte"); + add_srs_wkt (p, 1, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 2, + "]],TOWGS84[162,117,154,0,0,0,0],AUTHORITY[\"EPSG\",\"662"); + add_srs_wkt (p, 3, + "8\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4628\"]]"); + p = add_epsg_def (first, last, 4629, "epsg", 4629, "Tahaa 54"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Tahaa 54\",DATUM[\"Tahaa_54\",SPHEROID[\"Intern"); + add_srs_wkt (p, 1, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"6629\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 4, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"4629\"]]"); + p = add_epsg_def (first, last, 4630, "epsg", 4630, "IGN72 Nuku Hiva"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGN72 Nuku Hiva\",DATUM[\"IGN72_Nuku_Hiva\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],AUTHORITY[\"EPSG\",\"6630\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4630\"]]"); + p = add_epsg_def (first, last, 4631, "epsg", 4631, "K0 1949"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=145,-187,103,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"K0 1949\",DATUM[\"K0_1949\",SPHEROID[\"Internat"); + add_srs_wkt (p, 1, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 2, + "OWGS84[145,-187,103,0,0,0,0],AUTHORITY[\"EPSG\",\"6631\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4631\"]]"); + p = add_epsg_def (first, last, 4632, "epsg", 4632, "Combani 1950"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-382,-59,-262,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Combani 1950\",DATUM[\"Combani_1950\",SPHEROID["); + add_srs_wkt (p, 1, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],TOWGS84[-382,-59,-262,0,0,0,0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6632\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4632\"]]"); + p = add_epsg_def (first, last, 4633, "epsg", 4633, "IGN56 Lifou"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGN56 Lifou\",DATUM[\"IGN56_Lifou\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],AUTHORITY[\"EPSG\",\"6633\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4633\"]]"); + p = add_epsg_def (first, last, 4634, "epsg", 4634, "IGN72 Grand Terre"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGN72 Grand Terre\",DATUM[\"IGN72_Grande_Terre\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6634\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUT"); + add_srs_wkt (p, 5, "HORITY[\"EPSG\",\"4634\"]]"); + p = add_epsg_def (first, last, 4635, "epsg", 4635, "ST87 Ouvea"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-122.383,-188.696,103"); + add_proj4text (p, 1, ".344,3.5107,-4.9668,-5.7047,4.4798 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ST87 Ouvea\",DATUM[\"ST87_Ouvea\",SPHEROID[\"In"); + add_srs_wkt (p, 1, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 2, + "\"]],TOWGS84[-122.383,-188.696,103.344,3.5107,-4.9668,-5"); + add_srs_wkt (p, 3, + ".7047,4.4798],AUTHORITY[\"EPSG\",\"6635\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, "RITY[\"EPSG\",\"4635\"]]"); + p = add_epsg_def (first, last, 4636, "epsg", 4636, "Petrels 1972"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=365,194,166,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Petrels 1972\",DATUM[\"Petrels_1972\",SPHEROID["); + add_srs_wkt (p, 1, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],TOWGS84[365,194,166,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6636\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4636\"]]"); + p = add_epsg_def (first, last, 4637, "epsg", 4637, "Perroud 1950"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=325,154,172,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Perroud 1950\",DATUM[\"Pointe_Geologie_Perroud_"); + add_srs_wkt (p, 1, + "1950\",SPHEROID[\"International 1924\",6378388,297,AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"7022\"]],TOWGS84[325,154,172,0,0,0,0],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6637\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "4637\"]]"); + p = add_epsg_def (first, last, 4638, "epsg", 4638, + "Saint Pierre et Miquelon 1950"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk66 +towgs84=30,430,368,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Saint Pierre et Miquelon 1950\",DATUM[\"Saint_P"); + add_srs_wkt (p, 1, + "ierre_et_Miquelon_1950\",SPHEROID[\"Clarke 1866\",637820"); + add_srs_wkt (p, 2, + "6.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],TOWG"); + add_srs_wkt (p, 3, + "S84[30,430,368,0,0,0,0],AUTHORITY[\"EPSG\",\"6638\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, "\"]],AUTHORITY[\"EPSG\",\"4638\"]]"); + p = add_epsg_def (first, last, 4639, "epsg", 4639, "MOP78"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"MOP78\",DATUM[\"MOP78\",SPHEROID[\"Internationa"); + add_srs_wkt (p, 1, + "l 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"6639\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 4, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"463"); + add_srs_wkt (p, 5, "9\"]]"); + p = add_epsg_def (first, last, 4640, "epsg", 4640, "RRAF 1991"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RRAF 1991\",DATUM[\"Reseau_de_Reference_des_Ant"); + add_srs_wkt (p, 1, + "illes_Francaises_1991\",SPHEROID[\"WGS 84\",6378137,298."); + add_srs_wkt (p, 2, + "257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 3, + "0,0,0],AUTHORITY[\"EPSG\",\"6640\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, "PSG\",\"4640\"]]"); + p = add_epsg_def (first, last, 4641, "epsg", 4641, "IGN53 Mare"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGN53 Mare\",DATUM[\"IGN53_Mare\",SPHEROID[\"In"); + add_srs_wkt (p, 1, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 2, + "\"]],AUTHORITY[\"EPSG\",\"6641\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 3, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 4, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 5, "SG\",\"4641\"]]"); + p = add_epsg_def (first, last, 4642, "epsg", 4642, "ST84 Ile des Pins"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ST84 Ile des Pins\",DATUM[\"ST84_Ile_des_Pins\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6642\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4642\"]]"); + p = add_epsg_def (first, last, 4643, "epsg", 4643, "ST71 Belep"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-480.26,-438.32,-643."); + add_proj4text (p, 1, "429,16.3119,20.1721,-4.0349,-111.7 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ST71 Belep\",DATUM[\"ST71_Belep\",SPHEROID[\"In"); + add_srs_wkt (p, 1, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 2, + "\"]],TOWGS84[-480.26,-438.32,-643.429,16.3119,20.1721,-4"); + add_srs_wkt (p, 3, + ".0349,-111.7],AUTHORITY[\"EPSG\",\"6643\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, "RITY[\"EPSG\",\"4643\"]]"); + p = add_epsg_def (first, last, 4644, "epsg", 4644, "NEA74 Noumea"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NEA74 Noumea\",DATUM[\"NEA74_Noumea\",SPHEROID["); + add_srs_wkt (p, 1, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],AUTHORITY[\"EPSG\",\"6644\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"4644\"]]"); + p = add_epsg_def (first, last, 4645, "epsg", 4645, "RGNC 1991"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=0,0,0,0,0,0,0 +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "GEOGCS[\"RGNC 1991\",DATUM[\"Reseau_Geodesique_Nouvelle_"); + add_srs_wkt (p, 1, + "Caledonie_1991\",SPHEROID[\"International 1924\",6378388"); + add_srs_wkt (p, 2, + ",297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6645\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, ",\"4645\"]]"); + p = add_epsg_def (first, last, 4646, "epsg", 4646, "Grand Comoros"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Grand Comoros\",DATUM[\"Grand_Comoros\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7022\"]],AUTHORITY[\"EPSG\",\"6646\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 3, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 4, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"4646\"]]"); + p = add_epsg_def (first, last, 4657, "epsg", 4657, "Reykjavik 1900"); + add_proj4text (p, 0, + "+proj=longlat +a=6377019.27 +b=6355762.5391 +towgs84=-28"); + add_proj4text (p, 1, ",199,5,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Reykjavik 1900\",DATUM[\"Reykjavik_1900\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Danish 1876\",6377019.27,300,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7051\"]],TOWGS84[-28,199,5,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6657\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4657\"]]"); + p = add_epsg_def (first, last, 4658, "epsg", 4658, "Hjorsey 1955"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-73,46,-86,0,0,0,0 +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Hjorsey 1955\",DATUM[\"Hjorsey_1955\",SPHEROID["); + add_srs_wkt (p, 1, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],TOWGS84[-73,46,-86,0,0,0,0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"6658\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4658\"]]"); + p = add_epsg_def (first, last, 4659, "epsg", 4659, "ISN93"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ISN93\",DATUM[\"Islands_Network_1993\",SPHEROID"); + add_srs_wkt (p, 1, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"665"); + add_srs_wkt (p, 3, + "9\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4659\"]]"); + p = add_epsg_def (first, last, 4660, "epsg", 4660, "Helle 1954"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=982.609,552.753,-540."); + add_proj4text (p, 1, "873,32.3934,-153.257,-96.2266,16.805 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Helle 1954\",DATUM[\"Helle_1954\",SPHEROID[\"In"); + add_srs_wkt (p, 1, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 2, + "\"]],TOWGS84[982.609,552.753,-540.873,32.3934,-153.257,-"); + add_srs_wkt (p, 3, + "96.2266,16.805],AUTHORITY[\"EPSG\",\"6660\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, "HORITY[\"EPSG\",\"4660\"]]"); + p = add_epsg_def (first, last, 4661, "epsg", 4661, "LKS92"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"LKS92\",DATUM[\"Latvia_1992\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 1, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 2, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6661\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 4, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 5, "\"]],AUTHORITY[\"EPSG\",\"4661\"]]"); + p = add_epsg_def (first, last, 4662, "epsg", 4662, "IGN72 Grande Terre"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGN72 Grande Terre\",DATUM[\"IGN72_Grande_Terre"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6634\"]],PRIME"); + add_srs_wkt (p, 3, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 4, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 5, "],AUTHORITY[\"EPSG\",\"4662\"]]"); + p = add_epsg_def (first, last, 4663, "epsg", 4663, "Porto Santo 1995"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Porto Santo 1995\",DATUM[\"Porto_Santo_1995\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"International 1924\",6378388,297,AUTHORITY[\"E"); + add_srs_wkt (p, 2, + "PSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6663\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 4, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 5, "THORITY[\"EPSG\",\"4663\"]]"); + p = add_epsg_def (first, last, 4664, "epsg", 4664, "Azores Oriental 1995"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Azores Oriental 1995\",DATUM[\"Azores_Oriental_"); + add_srs_wkt (p, 1, + "Islands_1995\",SPHEROID[\"International 1924\",6378388,2"); + add_srs_wkt (p, 2, + "97,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"66"); + add_srs_wkt (p, 3, + "64\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4664\"]]"); + p = add_epsg_def (first, last, 4665, "epsg", 4665, "Azores Central 1995"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Azores Central 1995\",DATUM[\"Azores_Central_Is"); + add_srs_wkt (p, 1, + "lands_1995\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6665"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4665\"]]"); + p = add_epsg_def (first, last, 4666, "epsg", 4666, "Lisbon 1890"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Lisbon 1890\",DATUM[\"Lisbon_1890\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7004\"]],AUTHORITY[\"EPSG\",\"6666\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 5, "TY[\"EPSG\",\"4666\"]]"); + p = add_epsg_def (first, last, 4667, "epsg", 4667, "IKBD-92"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IKBD-92\",DATUM[\"Iraq_Kuwait_Boundary_Datum_19"); + add_srs_wkt (p, 1, + "92\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6667\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4667\"]]"); + p = add_epsg_def (first, last, 4668, "epsg", 4668, "ED79"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-86,-98,-119,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ED79\",DATUM[\"European_Datum_1979\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],TOWGS84[-86,-98,-119,0,0,0,0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"6668\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4668\"]]"); + p = add_epsg_def (first, last, 4669, "epsg", 4669, "LKS94"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"LKS94\",DATUM[\"Lithuania_1994_ETRS89\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "126\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4669\"]]"); + p = add_epsg_def (first, last, 4670, "epsg", 4670, "IGM95"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGM95\",DATUM[\"Istituto_Geografico_Militaire_1"); + add_srs_wkt (p, 1, + "995\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6670\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4670\"]]"); + p = add_epsg_def (first, last, 4671, "epsg", 4671, "Voirol 1879"); + add_proj4text (p, 0, "+proj=longlat +a=6378249.2 +b=6356515 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Voirol 1879\",DATUM[\"Voirol_1879\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Clarke 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7011\"]],AUTHORITY[\"EPSG\",\"6671\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, "]],AUTHORITY[\"EPSG\",\"4671\"]]"); + p = add_epsg_def (first, last, 4672, "epsg", 4672, "Chatham Islands 1971"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=175,-38,113,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Chatham Islands 1971\",DATUM[\"Chatham_Islands_"); + add_srs_wkt (p, 1, + "Datum_1971\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[175,-38,113,0,0,0"); + add_srs_wkt (p, 3, + ",0],AUTHORITY[\"EPSG\",\"6672\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 5, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, "G\",\"4672\"]]"); + p = add_epsg_def (first, last, 4673, "epsg", 4673, "Chatham Islands 1979"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=174.05,-25.49,112.57,"); + add_proj4text (p, 1, "-0,-0,0.554,0.2263 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Chatham Islands 1979\",DATUM[\"Chatham_Islands_"); + add_srs_wkt (p, 1, + "Datum_1979\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[174.05,-25.49,112"); + add_srs_wkt (p, 3, + ".57,-0,-0,0.554,0.2263],AUTHORITY[\"EPSG\",\"6673\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, "\"]],AUTHORITY[\"EPSG\",\"4673\"]]"); + p = add_epsg_def (first, last, 4674, "epsg", 4674, "SIRGAS 2000"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"SIRGAS 2000\",DATUM[\"Sistema_de_Referencia_Geo"); + add_srs_wkt (p, 1, + "centrico_para_America_del_Sur_2000\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6674\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, "]],AUTHORITY[\"EPSG\",\"4674\"]]"); + p = add_epsg_def (first, last, 4675, "epsg", 4675, "Guam 1963"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk66 +towgs84=-100,-248,259,0,0,0"); + add_proj4text (p, 1, ",0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Guam 1963\",DATUM[\"Guam_1963\",SPHEROID[\"Clar"); + add_srs_wkt (p, 1, + "ke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7008\"]],TOWGS84[-100,-248,259,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6675\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4675\"]]"); + p = add_epsg_def (first, last, 4676, "epsg", 4676, "Vientiane 1982"); + add_proj4text (p, 0, "+proj=longlat +ellps=krass +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Vientiane 1982\",DATUM[\"Vientiane_1982\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7024\"]],AUTHORITY[\"EPSG\",\"6676\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 5, "TY[\"EPSG\",\"4676\"]]"); + p = add_epsg_def (first, last, 4677, "epsg", 4677, "Lao 1993"); + add_proj4text (p, 0, "+proj=longlat +ellps=krass +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Lao 1993\",DATUM[\"Lao_1993\",SPHEROID[\"Krasso"); + add_srs_wkt (p, 1, + "wsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"6677\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 4, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, "\"4677\"]]"); + p = add_epsg_def (first, last, 4678, "epsg", 4678, "Lao 1997"); + add_proj4text (p, 0, + "+proj=longlat +ellps=krass +towgs84=44.585,-131.212,-39."); + add_proj4text (p, 1, "544,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Lao 1997\",DATUM[\"Lao_National_Datum_1997\",SP"); + add_srs_wkt (p, 1, + "HEROID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7024\"]],TOWGS84[44.585,-131.212,-39.544,0,0,0,0],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6678\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, "\"4678\"]]"); + p = add_epsg_def (first, last, 4679, "epsg", 4679, "Jouik 1961"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-80.01,253.26,291.1"); + add_proj4text (p, 1, "9,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Jouik 1961\",DATUM[\"Jouik_1961\",SPHEROID[\"Cl"); + add_srs_wkt (p, 1, + "arke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7012\"]],TOWGS84[-80.01,253.26,291.19,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6679\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4679"); + add_srs_wkt (p, 6, "\"]]"); + p = add_epsg_def (first, last, 4680, "epsg", 4680, "Nouakchott 1965"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=124.5,-63.5,-281,0,"); + add_proj4text (p, 1, "0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Nouakchott 1965\",DATUM[\"Nouakchott_1965\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7012\"]],TOWGS84[124.5,-63.5,-281,0,0,0,0],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6680\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, "\"4680\"]]"); + p = add_epsg_def (first, last, 4681, "epsg", 4681, "Mauritania 1999"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Mauritania 1999\",DATUM[\"Mauritania_1999\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6681\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, "]],AUTHORITY[\"EPSG\",\"4681\"]]"); + p = add_epsg_def (first, last, 4682, "epsg", 4682, "Gulshan 303"); + add_proj4text (p, 0, + "+proj=longlat +a=6377276.345 +b=6356075.41314024 +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "GEOGCS[\"Gulshan 303\",DATUM[\"Gulshan_303\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Everest 1830 (1937 Adjustment)\",6377276.345,300.8017,AU"); + add_srs_wkt (p, 2, + "THORITY[\"EPSG\",\"7015\"]],AUTHORITY[\"EPSG\",\"6682\"]"); + add_srs_wkt (p, 3, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 4, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4682\"]]"); + p = add_epsg_def (first, last, 4683, "epsg", 4683, "PRS92"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk66 +towgs84=-127.62,-67.24,-47."); + add_proj4text (p, 1, "04,-3.068,4.903,1.578,-1.06 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"PRS92\",DATUM[\"Philippine_Reference_System_199"); + add_srs_wkt (p, 1, + "2\",SPHEROID[\"Clarke 1866\",6378206.4,294.9786982139006"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7008\"]],TOWGS84[-127.62,-67.24,-4"); + add_srs_wkt (p, 3, + "7.04,-3.068,4.903,1.578,-1.06],AUTHORITY[\"EPSG\",\"6683"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4683\"]]"); + p = add_epsg_def (first, last, 4684, "epsg", 4684, "Gan 1970"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-133,-321,50,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Gan 1970\",DATUM[\"Gan_1970\",SPHEROID[\"Intern"); + add_srs_wkt (p, 1, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 2, + ",TOWGS84[-133,-321,50,0,0,0,0],AUTHORITY[\"EPSG\",\"6684"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4684\"]]"); + p = add_epsg_def (first, last, 4685, "epsg", 4685, "Gandajika"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Gandajika\",DATUM[\"Gandajika\",SPHEROID[\"Inte"); + add_srs_wkt (p, 1, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 2, + "]],AUTHORITY[\"EPSG\",\"6685\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 4, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, "\",\"4685\"]]"); + p = add_epsg_def (first, last, 4686, "epsg", 4686, "MAGNA-SIRGAS"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"MAGNA-SIRGAS\",DATUM[\"Marco_Geocentrico_Nacion"); + add_srs_wkt (p, 1, + "al_de_Referencia\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 2, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 3, + ",0],AUTHORITY[\"EPSG\",\"6686\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 5, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, "G\",\"4686\"]]"); + p = add_epsg_def (first, last, 4687, "epsg", 4687, "RGPF"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RGPF\",DATUM[\"Reseau_Geodesique_de_la_Polynesi"); + add_srs_wkt (p, 1, + "e_Francaise\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 2, + "1,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"668"); + add_srs_wkt (p, 3, + "7\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4687\"]]"); + p = add_epsg_def (first, last, 4688, "epsg", 4688, "Fatu Iva 72"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=347.103,1078.12,2623."); + add_proj4text (p, 1, "92,-33.8875,70.6773,-9.3943,186.074 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Fatu Iva 72\",DATUM[\"Fatu_Iva_72\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],TOWGS84[347.103,1078.12,2623.92,-33.8875,70.6773,"); + add_srs_wkt (p, 3, + "-9.3943,186.074],AUTHORITY[\"EPSG\",\"6688\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, "THORITY[\"EPSG\",\"4688\"]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_17 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 4689, "epsg", 4689, "IGN63 Hiva Oa"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGN63 Hiva Oa\",DATUM[\"IGN63_Hiva_Oa\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7022\"]],AUTHORITY[\"EPSG\",\"6689\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 3, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 4, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"4689\"]]"); + p = add_epsg_def (first, last, 4690, "epsg", 4690, "Tahiti 79"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Tahiti 79\",DATUM[\"Tahiti_79\",SPHEROID[\"Inte"); + add_srs_wkt (p, 1, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 2, + "]],AUTHORITY[\"EPSG\",\"6690\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 4, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, "\",\"4690\"]]"); + p = add_epsg_def (first, last, 4691, "epsg", 4691, "Moorea 87"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=215.525,149.593,176.2"); + add_proj4text (p, 1, "29,-3.2624,-1.692,-1.1571,10.4773 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Moorea 87\",DATUM[\"Moorea_87\",SPHEROID[\"Inte"); + add_srs_wkt (p, 1, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 2, + "]],TOWGS84[215.525,149.593,176.229,-3.2624,-1.692,-1.157"); + add_srs_wkt (p, 3, + "1,10.4773],AUTHORITY[\"EPSG\",\"6691\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, "Y[\"EPSG\",\"4691\"]]"); + p = add_epsg_def (first, last, 4692, "epsg", 4692, "Maupiti 83"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=217.037,86.959,23.956"); + add_proj4text (p, 1, ",0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Maupiti 83\",DATUM[\"Maupiti_83\",SPHEROID[\"In"); + add_srs_wkt (p, 1, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 2, + "\"]],TOWGS84[217.037,86.959,23.956,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6692\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4692\"]]"); + p = add_epsg_def (first, last, 4693, "epsg", 4693, "Nakhl-e Ghanem"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,-0.15,0.68,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Nakhl-e Ghanem\",DATUM[\"Nakhl_e_Ghanem\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7030\"]],TOWGS84[0,-0.15,0.68,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6693\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4693\"]]"); + p = add_epsg_def (first, last, 4694, "epsg", 4694, "POSGAR 94"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"POSGAR 94\",DATUM[\"Posiciones_Geodesicas_Argen"); + add_srs_wkt (p, 1, + "tinas_1994\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6694\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"46"); + add_srs_wkt (p, 6, "94\"]]"); + p = add_epsg_def (first, last, 4695, "epsg", 4695, "Katanga 1955"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk66 +towgs84=-103.746,-9.614,-25"); + add_proj4text (p, 1, "5.95,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Katanga 1955\",DATUM[\"Katanga_1955\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7008\"]],TOWGS84[-103.746,-9.614,-255.95,0,0,0,"); + add_srs_wkt (p, 3, + "0],AUTHORITY[\"EPSG\",\"6695\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, "\",\"4695\"]]"); + p = add_epsg_def (first, last, 4696, "epsg", 4696, "Kasai 1953"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Kasai 1953\",DATUM[\"Kasai_1953\",SPHEROID[\"Cl"); + add_srs_wkt (p, 1, + "arke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7012\"]],AUTHORITY[\"EPSG\",\"6696\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 5, "TY[\"EPSG\",\"4696\"]]"); + p = add_epsg_def (first, last, 4697, "epsg", 4697, + "IGC 1962 6th Parallel South"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGC 1962 6th Parallel South\",DATUM[\"IGC_1962_"); + add_srs_wkt (p, 1, + "Arc_of_the_6th_Parallel_South\",SPHEROID[\"Clarke 1880 ("); + add_srs_wkt (p, 2, + "RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6697\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, ",\"4697\"]]"); + p = add_epsg_def (first, last, 4698, "epsg", 4698, "IGN 1962 Kerguelen"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=145,-187,103,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGN 1962 Kerguelen\",DATUM[\"IGN_1962_Kerguelen"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7022\"]],TOWGS84[145,-187,103,0,0,0,0],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6698\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"469"); + add_srs_wkt (p, 6, "8\"]]"); + p = add_epsg_def (first, last, 4699, "epsg", 4699, "Le Pouce 1934"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-770.1,158.4,-498.2"); + add_proj4text (p, 1, ",0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Le Pouce 1934\",DATUM[\"Le_Pouce_1934\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7012\"]],TOWGS84[-770.1,158.4,-498.2,0,0,0,0],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6699\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "4699\"]]"); + p = add_epsg_def (first, last, 4700, "epsg", 4700, "IGN Astro 1960"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGN Astro 1960\",DATUM[\"IGN_Astro_1960\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY["); + add_srs_wkt (p, 2, + "\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6700\"]],PRIMEM"); + add_srs_wkt (p, 3, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 4, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 5, ",AUTHORITY[\"EPSG\",\"4700\"]]"); + p = add_epsg_def (first, last, 4701, "epsg", 4701, "IGCB 1955"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-79.9,-158,-168.9,0"); + add_proj4text (p, 1, ",0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"IGCB 1955\",DATUM[\"Institut_Geographique_du_Co"); + add_srs_wkt (p, 1, + "ngo_Belge_1955\",SPHEROID[\"Clarke 1880 (RGS)\",6378249."); + add_srs_wkt (p, 2, + "145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],TOWGS84[-79.9,"); + add_srs_wkt (p, 3, + "-158,-168.9,0,0,0,0],AUTHORITY[\"EPSG\",\"6701\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, "],AUTHORITY[\"EPSG\",\"4701\"]]"); + p = add_epsg_def (first, last, 4702, "epsg", 4702, "Mauritania 1999"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Mauritania 1999\",DATUM[\"Mauritania_1999\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6702\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4702\"]]"); + p = add_epsg_def (first, last, 4703, "epsg", 4703, "Mhast 1951"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Mhast 1951\",DATUM[\"Missao_Hidrografico_Angola"); + add_srs_wkt (p, 1, + "_y_Sao_Tome_1951\",SPHEROID[\"Clarke 1880 (RGS)\",637824"); + add_srs_wkt (p, 2, + "9.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6703\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4703\"]]"); + p = add_epsg_def (first, last, 4704, "epsg", 4704, "Mhast (onshore)"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Mhast (onshore)\",DATUM[\"Mhast_onshore\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7022\"]],AUTHORITY[\"EPSG\",\"6704\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 5, "TY[\"EPSG\",\"4704\"]]"); + p = add_epsg_def (first, last, 4705, "epsg", 4705, "Mhast (offshore)"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Mhast (offshore)\",DATUM[\"Mhast_offshore\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],AUTHORITY[\"EPSG\",\"6705\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 3, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 4, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4705\"]]"); + p = add_epsg_def (first, last, 4706, "epsg", 4706, + "Egypt Gulf of Suez S-650 TL"); + add_proj4text (p, 0, + "+proj=longlat +ellps=helmert +towgs84=-146.21,112.63,4.0"); + add_proj4text (p, 1, "5,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Egypt Gulf of Suez S-650 TL\",DATUM[\"Egypt_Gul"); + add_srs_wkt (p, 1, + "f_of_Suez_S_650_TL\",SPHEROID[\"Helmert 1906\",6378200,2"); + add_srs_wkt (p, 2, + "98.3,AUTHORITY[\"EPSG\",\"7020\"]],TOWGS84[-146.21,112.6"); + add_srs_wkt (p, 3, + "3,4.05,0,0,0,0],AUTHORITY[\"EPSG\",\"6706\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, "HORITY[\"EPSG\",\"4706\"]]"); + p = add_epsg_def (first, last, 4707, "epsg", 4707, "Tern Island 1961"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=114,-116,-333,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Tern Island 1961\",DATUM[\"Tern_Island_1961\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"International 1924\",6378388,297,AUTHORITY[\"E"); + add_srs_wkt (p, 2, + "PSG\",\"7022\"]],TOWGS84[114,-116,-333,0,0,0,0],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6707\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4707\"]"); + add_srs_wkt (p, 6, "]"); + p = add_epsg_def (first, last, 4708, "epsg", 4708, "Cocos Islands 1965"); + add_proj4text (p, 0, + "+proj=longlat +ellps=aust_SA +towgs84=-491,-22,435,0,0,0"); + add_proj4text (p, 1, ",0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Cocos Islands 1965\",DATUM[\"Cocos_Islands_1965"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"Australian National Spheroid\",6378160,298"); + add_srs_wkt (p, 2, + ".25,AUTHORITY[\"EPSG\",\"7003\"]],TOWGS84[-491,-22,435,0"); + add_srs_wkt (p, 3, + ",0,0,0],AUTHORITY[\"EPSG\",\"6708\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, "EPSG\",\"4708\"]]"); + p = add_epsg_def (first, last, 4709, "epsg", 4709, "Iwo Jima 1945"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=145,75,-272,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Iwo Jima 1945\",DATUM[\"Iwo_Jima_1945\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7022\"]],TOWGS84[145,75,-272,0,0,0,0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6709\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4709\"]]"); + p = add_epsg_def (first, last, 4710, "epsg", 4710, "St. Helena 1971"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-320,550,-494,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"St. Helena 1971\",DATUM[\"St_Helena_1971\",SPHE"); + add_srs_wkt (p, 1, + "ROID[\"International 1924\",6378388,297,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 2, + "\",\"7022\"]],TOWGS84[-320,550,-494,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6710\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4710\"]]"); + p = add_epsg_def (first, last, 4711, "epsg", 4711, "Marcus Island 1952"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=124,-234,-25,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Marcus Island 1952\",DATUM[\"Marcus_Island_1952"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7022\"]],TOWGS84[124,-234,-25,0,0,0,0],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6711\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"471"); + add_srs_wkt (p, 6, "1\"]]"); + p = add_epsg_def (first, last, 4712, "epsg", 4712, "Ascension Island 1958"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-205,107,53,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Ascension Island 1958\",DATUM[\"Ascension_Islan"); + add_srs_wkt (p, 1, + "d_1958\",SPHEROID[\"International 1924\",6378388,297,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7022\"]],TOWGS84[-205,107,53,0,0,0,0],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6712\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, "\"4712\"]]"); + p = add_epsg_def (first, last, 4713, "epsg", 4713, "Ayabelle Lighthouse"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=-79,-129,145,0,0,0,"); + add_proj4text (p, 1, "0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Ayabelle Lighthouse\",DATUM[\"Ayabelle_Lighthou"); + add_srs_wkt (p, 1, + "se\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7012\"]],TOWGS84[-79,-129,145,0,0,0"); + add_srs_wkt (p, 3, + ",0],AUTHORITY[\"EPSG\",\"6713\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 5, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 6, "G\",\"4713\"]]"); + p = add_epsg_def (first, last, 4714, "epsg", 4714, "Bellevue"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-127,-769,472,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Bellevue\",DATUM[\"Bellevue\",SPHEROID[\"Intern"); + add_srs_wkt (p, 1, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 2, + ",TOWGS84[-127,-769,472,0,0,0,0],AUTHORITY[\"EPSG\",\"671"); + add_srs_wkt (p, 3, + "4\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4714\"]]"); + p = add_epsg_def (first, last, 4715, "epsg", 4715, "Camp Area Astro"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-104,-129,239,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Camp Area Astro\",DATUM[\"Camp_Area_Astro\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"International 1924\",6378388,297,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7022\"]],TOWGS84[-104,-129,239,0,0,0,0],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6715\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4715\"]]"); + add_srs_wkt (p, 6, ""); + p = add_epsg_def (first, last, 4716, "epsg", 4716, "Phoenix Islands 1966"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=298,-304,-375,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Phoenix Islands 1966\",DATUM[\"Phoenix_Islands_"); + add_srs_wkt (p, 1, + "1966\",SPHEROID[\"International 1924\",6378388,297,AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"7022\"]],TOWGS84[298,-304,-375,0,0,0,0],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6716\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, "\"4716\"]]"); + p = add_epsg_def (first, last, 4717, "epsg", 4717, "Cape Canaveral"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk66 +towgs84=-2,151,181,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Cape Canaveral\",DATUM[\"Cape_Canaveral\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7008\"]],TOWGS84[-2,151,181,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6717\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4717"); + add_srs_wkt (p, 6, "\"]]"); + p = add_epsg_def (first, last, 4718, "epsg", 4718, "Solomon 1968"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Solomon 1968\",DATUM[\"Solomon_1968\",SPHEROID["); + add_srs_wkt (p, 1, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],AUTHORITY[\"EPSG\",\"6718\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"4718\"]]"); + p = add_epsg_def (first, last, 4719, "epsg", 4719, "Easter Island 1967"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=211,147,111,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Easter Island 1967\",DATUM[\"Easter_Island_1967"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7022\"]],TOWGS84[211,147,111,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6719\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4719"); + add_srs_wkt (p, 6, "\"]]"); + p = add_epsg_def (first, last, 4720, "epsg", 4720, "Fiji 1986"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS72 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Fiji 1986\",DATUM[\"Fiji_Geodetic_Datum_1986\","); + add_srs_wkt (p, 1, + "SPHEROID[\"WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7043\"]],AUTHORITY[\"EPSG\",\"6720\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 3, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 4, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 5, "\"EPSG\",\"4720\"]]"); + p = add_epsg_def (first, last, 4721, "epsg", 4721, "Fiji 1956"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=265.025,384.929,-194."); + add_proj4text (p, 1, "046,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Fiji 1956\",DATUM[\"Fiji_1956\",SPHEROID[\"Inte"); + add_srs_wkt (p, 1, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 2, + "]],TOWGS84[265.025,384.929,-194.046,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6721\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4721\"]]"); + p = add_epsg_def (first, last, 4722, "epsg", 4722, "South Georgia 1968"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-794,119,-298,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"South Georgia 1968\",DATUM[\"South_Georgia_1968"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"International 1924\",6378388,297,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7022\"]],TOWGS84[-794,119,-298,0,0,0,0],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6722\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 6, "22\"]]"); + p = add_epsg_def (first, last, 4723, "epsg", 4723, "Grand Cayman 1959"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk66 +towgs84=67.8,106.1,138.8,0,"); + add_proj4text (p, 1, "0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Grand Cayman 1959\",DATUM[\"Grand_Cayman_1959\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"Clarke 1866\",6378206.4,294.9786982139006,AU"); + add_srs_wkt (p, 2, + "THORITY[\"EPSG\",\"7008\"]],TOWGS84[67.8,106.1,138.8,0,0"); + add_srs_wkt (p, 3, + ",0,0],AUTHORITY[\"EPSG\",\"6723\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, "PSG\",\"4723\"]]"); + p = add_epsg_def (first, last, 4724, "epsg", 4724, "Diego Garcia 1969"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=208,-435,-229,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Diego Garcia 1969\",DATUM[\"Diego_Garcia_1969\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7022\"]],TOWGS84[208,-435,-229,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6724\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4724\""); + add_srs_wkt (p, 6, "]]"); + p = add_epsg_def (first, last, 4725, "epsg", 4725, "Johnston Island 1961"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=189,-79,-202,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Johnston Island 1961\",DATUM[\"Johnston_Island_"); + add_srs_wkt (p, 1, + "1961\",SPHEROID[\"International 1924\",6378388,297,AUTHO"); + add_srs_wkt (p, 2, + "RITY[\"EPSG\",\"7022\"]],TOWGS84[189,-79,-202,0,0,0,0],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6725\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, "4725\"]]"); + p = add_epsg_def (first, last, 4726, "epsg", 4726, "Little Cayman 1961"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Little Cayman 1961\",DATUM[\"Little_Cayman_1961"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"Clarke 1866\",6378206.4,294.9786982139006,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6726\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4726\"]]"); + p = add_epsg_def (first, last, 4727, "epsg", 4727, "Midway 1961"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Midway 1961\",DATUM[\"Midway_1961\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],AUTHORITY[\"EPSG\",\"6727\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4727\"]]"); + p = add_epsg_def (first, last, 4728, "epsg", 4728, + "Pico de las Nieves 1984"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-307,-92,127,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Pico de las Nieves 1984\",DATUM[\"Pico_de_las_N"); + add_srs_wkt (p, 1, + "ieves_1984\",SPHEROID[\"International 1924\",6378388,297"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-307,-92,127,0,0,"); + add_srs_wkt (p, 3, + "0,0],AUTHORITY[\"EPSG\",\"6728\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, "SG\",\"4728\"]]"); + p = add_epsg_def (first, last, 4729, "epsg", 4729, "Pitcairn 1967"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=185,165,42,0,0,0,0 +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Pitcairn 1967\",DATUM[\"Pitcairn_1967\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7022\"]],TOWGS84[185,165,42,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6729\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4729\"]]"); + p = add_epsg_def (first, last, 4730, "epsg", 4730, "Santo 1965"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=170,42,84,0,0,0,0 +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Santo 1965\",DATUM[\"Santo_1965\",SPHEROID[\"In"); + add_srs_wkt (p, 1, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 2, + "\"]],TOWGS84[170,42,84,0,0,0,0],AUTHORITY[\"EPSG\",\"673"); + add_srs_wkt (p, 3, + "0\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4730\"]]"); + p = add_epsg_def (first, last, 4731, "epsg", 4731, "Viti Levu 1916"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=51,391,-36,0,0,0,0 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Viti Levu 1916\",DATUM[\"Viti_Levu_1916\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY["); + add_srs_wkt (p, 2, + "\"EPSG\",\"7012\"]],TOWGS84[51,391,-36,0,0,0,0],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6731\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4731\"]"); + add_srs_wkt (p, 6, "]"); + p = add_epsg_def (first, last, 4732, "epsg", 4732, "Marshall Islands 1960"); + add_proj4text (p, 0, + "+proj=longlat +a=6378270 +b=6356794.343434343 +towgs84=1"); + add_proj4text (p, 1, "02,52,-38,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Marshall Islands 1960\",DATUM[\"Marshall_Island"); + add_srs_wkt (p, 1, + "s_1960\",SPHEROID[\"Hough 1960\",6378270,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7053\"]],TOWGS84[102,52,-38,0,0,0,0],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6732\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4732\"]]"); + add_srs_wkt (p, 6, ""); + p = add_epsg_def (first, last, 4733, "epsg", 4733, "Wake Island 1952"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=276,-57,149,0,0,0,0 +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Wake Island 1952\",DATUM[\"Wake_Island_1952\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"International 1924\",6378388,297,AUTHORITY[\"E"); + add_srs_wkt (p, 2, + "PSG\",\"7022\"]],TOWGS84[276,-57,149,0,0,0,0],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6733\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4733\"]]"); + add_srs_wkt (p, 6, ""); + p = add_epsg_def (first, last, 4734, "epsg", 4734, "Tristan 1968"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-632,438,-609,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Tristan 1968\",DATUM[\"Tristan_1968\",SPHEROID["); + add_srs_wkt (p, 1, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7022\"]],TOWGS84[-632,438,-609,0,0,0,0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6734\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4734\"]]"); + p = add_epsg_def (first, last, 4735, "epsg", 4735, "Kusaie 1951"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=647,1777,-1124,0,0,0,"); + add_proj4text (p, 1, "0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Kusaie 1951\",DATUM[\"Kusaie_1951\",SPHEROID[\""); + add_srs_wkt (p, 1, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "22\"]],TOWGS84[647,1777,-1124,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6735\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4735\"]]"); + p = add_epsg_def (first, last, 4736, "epsg", 4736, "Deception Island"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=260,12,-147,0,0,0,0"); + add_proj4text (p, 1, " +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Deception Island\",DATUM[\"Deception_Island\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7012\"]],TOWGS84[260,12,-147,0,0,0,0],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6736\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, "736\"]]"); + p = add_epsg_def (first, last, 4737, "epsg", 4737, "Korea 2000"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Korea 2000\",DATUM[\"Geocentric_datum_of_Korea\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6737\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4737\"]]"); + p = add_epsg_def (first, last, 4738, "epsg", 4738, "Hong Kong 1963"); + add_proj4text (p, 0, + "+proj=longlat +a=6378293.645208759 +b=6356617.987679838 "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Hong Kong 1963\",DATUM[\"Hong_Kong_1963\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Clarke 1858\",6378293.645208759,294.2606763692569,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7007\"]],AUTHORITY[\"EPSG\",\"6738\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4738\"]]"); + p = add_epsg_def (first, last, 4739, "epsg", 4739, "Hong Kong 1963(67)"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-156,-271,-189,0,0,0,"); + add_proj4text (p, 1, "0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Hong Kong 1963(67)\",DATUM[\"Hong_Kong_1963_67\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7022\"]],TOWGS84[-156,-271,-189,0,0,0,0],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6739\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4739"); + add_srs_wkt (p, 6, "\"]]"); + p = add_epsg_def (first, last, 4740, "epsg", 4740, "PZ-90"); + add_proj4text (p, 0, + "+proj=longlat +a=6378136 +b=6356751.361745712 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"PZ-90\",DATUM[\"Parametrop_Zemp_1990\",SPHEROID"); + add_srs_wkt (p, 1, + "[\"PZ-90\",6378136,298.257839303,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 2, + "54\"]],AUTHORITY[\"EPSG\",\"6740\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 3, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 4, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"4740\"]]"); + p = add_epsg_def (first, last, 4741, "epsg", 4741, "FD54"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"FD54\",DATUM[\"Faroe_Datum_1954\",SPHEROID[\"In"); + add_srs_wkt (p, 1, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 2, + "\"]],AUTHORITY[\"EPSG\",\"6741\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 3, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 4, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 5, "SG\",\"4741\"]]"); + p = add_epsg_def (first, last, 4742, "epsg", 4742, "GDM2000"); + add_proj4text (p, 0, "+proj=longlat +ellps=GRS80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"GDM2000\",DATUM[\"Geodetic_Datum_of_Malaysia_20"); + add_srs_wkt (p, 1, + "00\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6742\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, "]],AUTHORITY[\"EPSG\",\"4742\"]]"); + p = add_epsg_def (first, last, 4743, "epsg", 4743, "Karbala 1979"); + add_proj4text (p, 0, + "+proj=longlat +ellps=clrk80 +towgs84=84.1,-320.1,218.7,0"); + add_proj4text (p, 1, ",0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Karbala 1979\",DATUM[\"Karbala_1979\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7012\"]],TOWGS84[84.1,-320.1,218.7,0,0,0,0],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6743\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"474"); + add_srs_wkt (p, 6, "3\"]]"); + p = add_epsg_def (first, last, 4744, "epsg", 4744, "Nahrwan 1934"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Nahrwan 1934\",DATUM[\"Nahrwan_1934\",SPHEROID["); + add_srs_wkt (p, 1, + "\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6744\"]],PRIMEM[\"G"); + add_srs_wkt (p, 3, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 4, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 5, "HORITY[\"EPSG\",\"4744\"]]"); + p = add_epsg_def (first, last, 4745, "epsg", 4745, "RD/83"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RD/83\",DATUM[\"Rauenberg_Datum_83\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7004\"]],AUTHORITY[\"EPSG\",\"6745\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 3, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 4, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 5, "TY[\"EPSG\",\"4745\"]]"); + p = add_epsg_def (first, last, 4746, "epsg", 4746, "PD/83"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"PD/83\",DATUM[\"Potsdam_Datum_83\",SPHEROID[\"B"); + add_srs_wkt (p, 1, + "essel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 2, + "\"7004\"]],AUTHORITY[\"EPSG\",\"6746\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 3, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 4, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"4746\"]]"); + p = add_epsg_def (first, last, 4747, "epsg", 4747, "GR96"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"GR96\",DATUM[\"Greenland_1996\",SPHEROID[\"GRS "); + add_srs_wkt (p, 1, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 2, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6747\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, "22\"]],AUTHORITY[\"EPSG\",\"4747\"]]"); + p = add_epsg_def (first, last, 4748, "epsg", 4748, "Vanua Levu 1915"); + add_proj4text (p, 0, + "+proj=longlat +a=6378306.3696 +b=6356571.996 +towgs84=51"); + add_proj4text (p, 1, ",391,-36,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Vanua Levu 1915\",DATUM[\"Vanua_Levu_1915\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"Clarke 1880 (international foot)\",6378306.3696,"); + add_srs_wkt (p, 2, + "293.4663076556349,AUTHORITY[\"EPSG\",\"7055\"]],TOWGS84["); + add_srs_wkt (p, 3, + "51,391,-36,0,0,0,0],AUTHORITY[\"EPSG\",\"6748\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, ",AUTHORITY[\"EPSG\",\"4748\"]]"); + p = add_epsg_def (first, last, 4749, "epsg", 4749, "RGNC91-93"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RGNC91-93\",DATUM[\"Reseau_Geodesique_de_Nouvel"); + add_srs_wkt (p, 1, + "le_Caledonie_91_93\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 2, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0"); + add_srs_wkt (p, 3, + ",0,0],AUTHORITY[\"EPSG\",\"6749\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, "PSG\",\"4749\"]]"); + p = add_epsg_def (first, last, 4750, "epsg", 4750, "ST87 Ouvea"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=-56.263,16.136,-22.8"); + add_proj4text (p, 1, "56,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"ST87 Ouvea\",DATUM[\"ST87_Ouvea\",SPHEROID[\"WG"); + add_srs_wkt (p, 1, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 2, + "]],TOWGS84[-56.263,16.136,-22.856,0,0,0,0],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6750\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4750\"]]"); + p = add_epsg_def (first, last, 4751, "epsg", 4751, "Kertau (RSO)"); + add_proj4text (p, 0, + "+proj=longlat +a=6377295.664 +b=6356094.667915204 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Kertau (RSO)\",DATUM[\"Kertau_RSO\",SPHEROID[\""); + add_srs_wkt (p, 1, + "Everest 1830 (RSO 1969)\",6377295.664,300.8017,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7056\"]],AUTHORITY[\"EPSG\",\"6751\"]],PRIME"); + add_srs_wkt (p, 3, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 4, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 5, "],AUTHORITY[\"EPSG\",\"4751\"]]"); + p = add_epsg_def (first, last, 4752, "epsg", 4752, "Viti Levu 1912"); + add_proj4text (p, 0, + "+proj=longlat +a=6378306.3696 +b=6356571.996 +towgs84=51"); + add_proj4text (p, 1, ",391,-36,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Viti Levu 1912\",DATUM[\"Viti_Levu_1912\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Clarke 1880 (international foot)\",6378306.3696,29"); + add_srs_wkt (p, 2, + "3.4663076556349,AUTHORITY[\"EPSG\",\"7055\"]],TOWGS84[51"); + add_srs_wkt (p, 3, + ",391,-36,0,0,0,0],AUTHORITY[\"EPSG\",\"6752\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, "THORITY[\"EPSG\",\"4752\"]]"); + p = add_epsg_def (first, last, 4753, "epsg", 4753, "fk89"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"fk89\",DATUM[\"fk89\",SPHEROID[\"International "); + add_srs_wkt (p, 1, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"6753\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4753\""); + add_srs_wkt (p, 5, "]]"); + p = add_epsg_def (first, last, 4754, "epsg", 4754, "LGD2006"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-208.406,-109.878,-2."); + add_proj4text (p, 1, "5764,0,0,0,0 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"LGD2006\",DATUM[\"Libyan_Geodetic_Datum_2006\","); + add_srs_wkt (p, 1, + "SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7022\"]],TOWGS84[-208.406,-109.878,-2.5764,0,0,"); + add_srs_wkt (p, 3, + "0,0],AUTHORITY[\"EPSG\",\"6754\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, "SG\",\"4754\"]]"); + p = add_epsg_def (first, last, 4755, "epsg", 4755, "DGN95"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"DGN95\",DATUM[\"Datum_Geodesi_Nasional_1995\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPS"); + add_srs_wkt (p, 2, + "G\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6755\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4755\"]]"); + p = add_epsg_def (first, last, 4756, "epsg", 4756, "VN-2000"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS84 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"VN-2000\",DATUM[\"Vietnam_2000\",SPHEROID[\"WGS"); + add_srs_wkt (p, 1, + " 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]"); + add_srs_wkt (p, 2, + "],AUTHORITY[\"EPSG\",\"6756\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 4, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"4756\"]]"); + p = add_epsg_def (first, last, 4757, "epsg", 4757, "SVY21"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS84 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"SVY21\",DATUM[\"SVY21\",SPHEROID[\"WGS 84\",637"); + add_srs_wkt (p, 1, + "8137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"6757\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4757\""); + add_srs_wkt (p, 5, "]]"); + p = add_epsg_def (first, last, 4758, "epsg", 4758, "JAD2001"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"JAD2001\",DATUM[\"Jamaica_2001\",SPHEROID[\"WGS"); + add_srs_wkt (p, 1, + " 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]"); + add_srs_wkt (p, 2, + "],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6758\"]],P"); + add_srs_wkt (p, 3, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 4, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 5, "2\"]],AUTHORITY[\"EPSG\",\"4758\"]]"); + p = add_epsg_def (first, last, 4759, "epsg", 4759, "NAD83(NSRS2007)"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatia"); + add_srs_wkt (p, 1, + "l_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,"); + add_srs_wkt (p, 2, + "298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, "Y[\"EPSG\",\"4759\"]]"); + p = add_epsg_def (first, last, 4760, "epsg", 4760, "WGS 66"); + add_proj4text (p, 0, "+proj=longlat +ellps=WGS66 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"WGS 66\",DATUM[\"World_Geodetic_System_1966\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"NWL 9D\",6378145,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 2, + "025\"]],AUTHORITY[\"EPSG\",\"6760\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 3, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 4, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"4760\"]]"); + p = add_epsg_def (first, last, 4761, "epsg", 4761, "HTRS96"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"HTRS96\",DATUM[\"Croatian_Terrestrial_Reference"); + add_srs_wkt (p, 1, + "_System\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 2, + "THORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6761\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"476"); + add_srs_wkt (p, 6, "1\"]]"); + p = add_epsg_def (first, last, 4762, "epsg", 4762, "BDA2000"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"BDA2000\",DATUM[\"Bermuda_2000\",SPHEROID[\"WGS"); + add_srs_wkt (p, 1, + " 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]"); + add_srs_wkt (p, 2, + "],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6762\"]],P"); + add_srs_wkt (p, 3, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 4, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 5, "2\"]],AUTHORITY[\"EPSG\",\"4762\"]]"); + p = add_epsg_def (first, last, 4763, "epsg", 4763, "Pitcairn 2006"); + add_proj4text (p, 0, + "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Pitcairn 2006\",DATUM[\"Pitcairn_2006\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 2, + "7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"676"); + add_srs_wkt (p, 3, + "3\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4763\"]]"); + p = add_epsg_def (first, last, 4764, "epsg", 4764, "RSRGD2000"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RSRGD2000\",DATUM[\"Ross_Sea_Region_Geodetic_Da"); + add_srs_wkt (p, 1, + "tum_2000\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6764\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"47"); + add_srs_wkt (p, 6, "64\"]]"); + p = add_epsg_def (first, last, 4765, "epsg", 4765, "Slovenia 1996"); + add_proj4text (p, 0, + "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Slovenia 1996\",DATUM[\"Slovenia_Geodetic_Datum"); + add_srs_wkt (p, 1, + "_1996\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6765\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4765\""); + add_srs_wkt (p, 6, "]]"); + p = add_epsg_def (first, last, 4801, "epsg", 4801, "Bern 1898 (Bern)"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +pm=bern +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Bern 1898 (Bern)\",DATUM[\"CH1903_Bern\",SPHERO"); + add_srs_wkt (p, 1, + "ID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"E"); + add_srs_wkt (p, 2, + "PSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6801\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Bern\",7.439583333333333,AUTHORITY[\"EPSG\",\"8907\"]],U"); + add_srs_wkt (p, 4, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4801\"]]"); + p = add_epsg_def (first, last, 4802, "epsg", 4802, "Bogota 1975 (Bogota)"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +pm=bogota +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Bogota 1975 (Bogota)\",DATUM[\"Bogota_1975_Bogo"); + add_srs_wkt (p, 1, + "ta\",SPHEROID[\"International 1924\",6378388,297,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6802\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Bogota\",-74.08091666666667,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 4, + "904\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4802\"]]"); + p = add_epsg_def (first, last, 4803, "epsg", 4803, "Lisbon (Lisbon)"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +pm=lisbon +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Lisbon (Lisbon)\",DATUM[\"Lisbon_1937_Lisbon\","); + add_srs_wkt (p, 1, + "SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6803\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Lisbon\",-9.131906111111112,AUTHORITY[\"EPSG\",\"8902\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9122\"]],AUTHORITY[\"EPSG\",\"4803\"]]"); + p = add_epsg_def (first, last, 4804, "epsg", 4804, "Makassar (Jakarta)"); + add_proj4text (p, 0, + "+proj=longlat +ellps=bessel +towgs84=-587.8,519.75,145.7"); + add_proj4text (p, 1, "6,0,0,0,0 +pm=jakarta +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Makassar (Jakarta)\",DATUM[\"Makassar_Jakarta\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7004\"]],TOWGS84[-587.8,519.75,145.76,0,0"); + add_srs_wkt (p, 3, + ",0,0],AUTHORITY[\"EPSG\",\"6804\"]],PRIMEM[\"Jakarta\",1"); + add_srs_wkt (p, 4, + "06.8077194444444,AUTHORITY[\"EPSG\",\"8908\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, ",AUTHORITY[\"EPSG\",\"4804\"]]"); + p = add_epsg_def (first, last, 4805, "epsg", 4805, "MGI (Ferro)"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +pm=ferro +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"MGI (Ferro)\",DATUM[\"Militar_Geographische_Ins"); + add_srs_wkt (p, 1, + "titut_Ferro\",SPHEROID[\"Bessel 1841\",6377397.155,299.1"); + add_srs_wkt (p, 2, + "528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"6805\"]],PRIMEM[\"Ferro\",-17.66666666666667,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8909\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4805"); + add_srs_wkt (p, 6, "\"]]"); + p = add_epsg_def (first, last, 4806, "epsg", 4806, "Monte Mario (Rome)"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +pm=rome +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Monte Mario (Rome)\",DATUM[\"Monte_Mario_Rome\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 2, + "EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6806\"]],PRIMEM[\""); + add_srs_wkt (p, 3, + "Rome\",12.45233333333333,AUTHORITY[\"EPSG\",\"8906\"]],U"); + add_srs_wkt (p, 4, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4806\"]]"); + p = add_epsg_def (first, last, 4807, "epsg", 4807, "NTF (Paris)"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,"); + add_proj4text (p, 1, "320,0,0,0,0 +pm=paris +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NTF (Paris)\",DATUM[\"Nouvelle_Triangulation_Fr"); + add_srs_wkt (p, 1, + "ancaise_Paris\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2"); + add_srs_wkt (p, 2, + ",293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[-168,-60,320,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Paris\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"grad\",0.01570796326794897,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, "05\"]],AUTHORITY[\"EPSG\",\"4807\"]]"); + p = add_epsg_def (first, last, 4808, "epsg", 4808, "Padang (Jakarta)"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +pm=jakarta +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Padang (Jakarta)\",DATUM[\"Padang_1884_Jakarta\""); + add_srs_wkt (p, 1, + ",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6808\"]],PR"); + add_srs_wkt (p, 3, + "IMEM[\"Jakarta\",106.8077194444444,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8908\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4808\"]]"); + p = add_epsg_def (first, last, 4809, "epsg", 4809, "Belge 1950 (Brussels)"); + add_proj4text (p, 0, "+proj=longlat +ellps=intl +pm=brussels +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Belge 1950 (Brussels)\",DATUM[\"Reseau_National"); + add_srs_wkt (p, 1, + "_Belge_1950_Brussels\",SPHEROID[\"International 1924\",6"); + add_srs_wkt (p, 2, + "378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6809\"]],PRIMEM[\"Brussels\",4.367975,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8910\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4809\"]"); + add_srs_wkt (p, 6, "]"); + p = add_epsg_def (first, last, 4810, "epsg", 4810, "Tananarive (Paris)"); + add_proj4text (p, 0, + "+proj=longlat +ellps=intl +towgs84=-189,-242,-91,0,0,0,0"); + add_proj4text (p, 1, " +pm=paris +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Tananarive (Paris)\",DATUM[\"Tananarive_1925_Pa"); + add_srs_wkt (p, 1, + "ris\",SPHEROID[\"International 1924\",6378388,297,AUTHOR"); + add_srs_wkt (p, 2, + "ITY[\"EPSG\",\"7022\"]],TOWGS84[-189,-242,-91,0,0,0,0],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6810\"]],PRIMEM[\"Paris\",2.33722917"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\",0.015707963"); + add_srs_wkt (p, 5, + "26794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, ",\"4810\"]]"); + p = add_epsg_def (first, last, 4811, "epsg", 4811, "Voirol 1875 (Paris)"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +towgs84=-73,-247,"); + add_proj4text (p, 1, "227,0,0,0,0 +pm=paris +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Voirol 1875 (Paris)\",DATUM[\"Voirol_1875_Paris"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.46602129"); + add_srs_wkt (p, 2, + "36265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-73,-247,227"); + add_srs_wkt (p, 3, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6811\"]],PRIMEM[\"Paris\""); + add_srs_wkt (p, 4, + ",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\","); + add_srs_wkt (p, 5, + "0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHOR"); + add_srs_wkt (p, 6, "ITY[\"EPSG\",\"4811\"]]"); + p = add_epsg_def (first, last, 4813, "epsg", 4813, "Batavia (Jakarta)"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +pm=jakarta +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Batavia (Jakarta)\",DATUM[\"Batavia_Jakarta\",S"); + add_srs_wkt (p, 1, + "PHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6813\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Jakarta\",106.8077194444444,AUTHORITY[\"EPSG\",\"89"); + add_srs_wkt (p, 4, + "08\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"E"); + add_srs_wkt (p, 5, "PSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4813\"]]"); + p = add_epsg_def (first, last, 4814, "epsg", 4814, "RT38 (Stockholm)"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +pm=stockholm +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"RT38 (Stockholm)\",DATUM[\"Stockholm_1938_Stock"); + add_srs_wkt (p, 1, + "holm\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6814\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Stockholm\",18.05827777777778,AUTHORITY[\"EP"); + add_srs_wkt (p, 4, + "SG\",\"8911\"]],UNIT[\"degree\",0.01745329251994328,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4814\"]]"); + p = add_epsg_def (first, last, 4815, "epsg", 4815, "Greek (Athens)"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +pm=athens +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Greek (Athens)\",DATUM[\"Greek_Athens\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6815\"]],PRIMEM[\"A"); + add_srs_wkt (p, 3, + "thens\",23.7163375,AUTHORITY[\"EPSG\",\"8912\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, "]],AUTHORITY[\"EPSG\",\"4815\"]]"); + p = add_epsg_def (first, last, 4816, "epsg", 4816, "Carthage (Paris)"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +pm=paris +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "GEOGCS[\"Carthage (Paris)\",DATUM[\"Carthage_Paris\",SPH"); + add_srs_wkt (p, 1, + "EROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660212936265,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7011\"]],AUTHORITY[\"EPSG\",\"6816\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Paris\",2.33722917,AUTHORITY[\"EPSG\",\"8903"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"grad\",0.01570796326794897,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, ",\"9105\"]],AUTHORITY[\"EPSG\",\"4816\"]]"); + p = add_epsg_def (first, last, 4817, "epsg", 4817, "NGO 1948 (Oslo)"); + add_proj4text (p, 0, + "+proj=longlat +a=6377492.018 +b=6356173.508712696 +towgs"); + add_proj4text (p, 1, + "84=278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "GEOGCS[\"NGO 1948 (Oslo)\",DATUM[\"NGO_1948_Oslo\",SPHER"); + add_srs_wkt (p, 1, + "OID[\"Bessel Modified\",6377492.018,299.1528128,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7005\"]],TOWGS84[278.3,93,474.5,7.889,0.05,"); + add_srs_wkt (p, 3, + "-6.61,6.21],AUTHORITY[\"EPSG\",\"6817\"]],PRIMEM[\"Oslo\""); + add_srs_wkt (p, 4, + ",10.72291666666667,AUTHORITY[\"EPSG\",\"8913\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, "]],AUTHORITY[\"EPSG\",\"4817\"]]"); + p = add_epsg_def (first, last, 4818, "epsg", 4818, "S-JTSK (Ferro)"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +pm=ferro +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"S-JTSK (Ferro)\",DATUM[\"S_JTSK_Ferro\",SPHEROI"); + add_srs_wkt (p, 1, + "D[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EP"); + add_srs_wkt (p, 2, + "SG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6818\"]],PRIMEM[\"F"); + add_srs_wkt (p, 3, + "erro\",-17.66666666666667,AUTHORITY[\"EPSG\",\"8909\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, "9122\"]],AUTHORITY[\"EPSG\",\"4818\"]]"); + p = add_epsg_def (first, last, 4819, "epsg", 4819, + "Nord Sahara 1959 (Paris)"); + add_proj4text (p, 0, "+proj=longlat +ellps=clrk80 +pm=paris +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Nord Sahara 1959 (Paris)\",DATUM[\"Nord_Sahara_"); + add_srs_wkt (p, 1, + "1959_Paris\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,"); + add_srs_wkt (p, 2, + "293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6819\"]],PRIMEM[\"Paris\",2.33722917,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8903\"]],UNIT[\"grad\",0.01570796326794897,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9105\"]],AUTHORITY[\"EPSG\",\"4819\"]]"); + p = add_epsg_def (first, last, 4820, "epsg", 4820, "Segara (Jakarta)"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +pm=jakarta +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Segara (Jakarta)\",DATUM[\"Gunung_Segara_Jakart"); + add_srs_wkt (p, 1, + "a\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6820\"]]"); + add_srs_wkt (p, 3, + ",PRIMEM[\"Jakarta\",106.8077194444444,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8908\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4820\"]]"); + p = add_epsg_def (first, last, 4821, "epsg", 4821, "Voirol 1879 (Paris)"); + add_proj4text (p, 0, + "+proj=longlat +a=6378249.2 +b=6356515 +pm=paris +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "GEOGCS[\"Voirol 1879 (Paris)\",DATUM[\"Voirol_1879_Paris"); + add_srs_wkt (p, 1, + "\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.46602129"); + add_srs_wkt (p, 2, + "36265,AUTHORITY[\"EPSG\",\"7011\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6821\"]],PRIMEM[\"Paris\",2.33722917,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8903\"]],UNIT[\"grad\",0.01570796326794897,AUTHORITY[\""); + add_srs_wkt (p, 5, "EPSG\",\"9105\"]],AUTHORITY[\"EPSG\",\"4821\"]]"); + p = add_epsg_def (first, last, 4901, "epsg", 4901, "unnamed ellipse"); + add_proj4text (p, 0, + "+proj=longlat +a=6376523 +b=6355862.933255573 +pm=2.3372"); + add_proj4text (p, 1, "291666985 +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"unnamed ellipse\",DATUM[\"unknown\",SPHEROID[\""); + add_srs_wkt (p, 1, + "unnamed\",6376523,308.6399999999991]],PRIMEM[\"unnamed\""); + add_srs_wkt (p, 2, + ",2.3372291666985],UNIT[\"degree\",0.0174532925199433],AU"); + add_srs_wkt (p, 3, "THORITY[\"EPSG\",\"4901\"]]"); + p = add_epsg_def (first, last, 4902, "epsg", 4902, "NDG (Paris)"); + add_proj4text (p, 0, + "+proj=longlat +a=6376523 +b=6355862.933255573 +pm=paris "); + add_proj4text (p, 1, "+no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"NDG (Paris)\",DATUM[\"Nord_de_Guerre_Paris\",SP"); + add_srs_wkt (p, 1, + "HEROID[\"Plessis 1817\",6376523,308.64,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 2, + ",\"7027\"]],AUTHORITY[\"EPSG\",\"6902\"]],PRIMEM[\"Paris"); + add_srs_wkt (p, 3, + "\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\""); + add_srs_wkt (p, 4, + ",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHO"); + add_srs_wkt (p, 5, "RITY[\"EPSG\",\"4902\"]]"); + p = add_epsg_def (first, last, 4903, "epsg", 4903, "Madrid 1870 (Madrid)"); + add_proj4text (p, 0, + "+proj=longlat +a=6378298.3 +b=6356657.142669561 +pm=madr"); + add_proj4text (p, 1, "id +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Madrid 1870 (Madrid)\",DATUM[\"Madrid_1870_Madr"); + add_srs_wkt (p, 1, + "id\",SPHEROID[\"Struve 1860\",6378298.3,294.73,AUTHORITY"); + add_srs_wkt (p, 2, + "[\"EPSG\",\"7028\"]],AUTHORITY[\"EPSG\",\"6903\"]],PRIME"); + add_srs_wkt (p, 3, + "M[\"Madrid\",-3.687938888888889,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "5\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4903\"]]"); + p = add_epsg_def (first, last, 4904, "epsg", 4904, "Lisbon 1890 (Lisbon)"); + add_proj4text (p, 0, "+proj=longlat +ellps=bessel +pm=lisbon +no_defs"); + add_srs_wkt (p, 0, + "GEOGCS[\"Lisbon 1890 (Lisbon)\",DATUM[\"Lisbon_1890_Lisb"); + add_srs_wkt (p, 1, + "on\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AU"); + add_srs_wkt (p, 2, + "THORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6904\"]"); + add_srs_wkt (p, 3, + "],PRIMEM[\"Lisbon\",-9.131906111111112,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8902\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4904\"]]"); + p = add_epsg_def (first, last, 20004, "epsg", 20004, + "Pulkovo 1995 / Gauss-Kruger zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 4\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",21],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",4500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"20004\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20005, "epsg", 20005, + "Pulkovo 1995 / Gauss-Kruger zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 5\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",27],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",5500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"20005\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20006, "epsg", 20006, + "Pulkovo 1995 / Gauss-Kruger zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=6500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 6\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",33],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",6500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"20006\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20007, "epsg", 20007, + "Pulkovo 1995 / Gauss-Kruger zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=7500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 7\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",39],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",7500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"20007\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20008, "epsg", 20008, + "Pulkovo 1995 / Gauss-Kruger zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 8\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",45],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",8500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"20008\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20009, "epsg", 20009, + "Pulkovo 1995 / Gauss-Kruger zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 9\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",51],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",9500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"20009\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20010, "epsg", 20010, + "Pulkovo 1995 / Gauss-Kruger zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=10500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 10\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",57],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",10500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2001"); + add_srs_wkt (p, 12, "0\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20011, "epsg", 20011, + "Pulkovo 1995 / Gauss-Kruger zone 11"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=11500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 11\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",63],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",11500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2001"); + add_srs_wkt (p, 12, "1\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20012, "epsg", 20012, + "Pulkovo 1995 / Gauss-Kruger zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=12500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 12\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",69],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",12500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2001"); + add_srs_wkt (p, 12, "2\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20013, "epsg", 20013, + "Pulkovo 1995 / Gauss-Kruger zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 13\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",75],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",13500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2001"); + add_srs_wkt (p, 12, "3\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20014, "epsg", 20014, + "Pulkovo 1995 / Gauss-Kruger zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 14\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",81],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",14500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2001"); + add_srs_wkt (p, 12, "4\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20015, "epsg", 20015, + "Pulkovo 1995 / Gauss-Kruger zone 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 15\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",87],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",15500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2001"); + add_srs_wkt (p, 12, "5\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20016, "epsg", 20016, + "Pulkovo 1995 / Gauss-Kruger zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 16\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",93],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",16500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2001"); + add_srs_wkt (p, 12, "6\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20017, "epsg", 20017, + "Pulkovo 1995 / Gauss-Kruger zone 17"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 17\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",99],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",17500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2001"); + add_srs_wkt (p, 12, "7\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20018, "epsg", 20018, + "Pulkovo 1995 / Gauss-Kruger zone 18"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 18\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",105],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",18500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "18\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20019, "epsg", 20019, + "Pulkovo 1995 / Gauss-Kruger zone 19"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 19\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",111],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",19500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "19\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20020, "epsg", 20020, + "Pulkovo 1995 / Gauss-Kruger zone 20"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 20\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",117],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",20500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "20\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20021, "epsg", 20021, + "Pulkovo 1995 / Gauss-Kruger zone 21"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 21\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",123],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",21500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "21\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20022, "epsg", 20022, + "Pulkovo 1995 / Gauss-Kruger zone 22"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 22\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",129],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",22500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "22\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20023, "epsg", 20023, + "Pulkovo 1995 / Gauss-Kruger zone 23"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 23\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",135],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",23500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "23\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20024, "epsg", 20024, + "Pulkovo 1995 / Gauss-Kruger zone 24"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=24500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 24\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",141],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",24500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "24\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20025, "epsg", 20025, + "Pulkovo 1995 / Gauss-Kruger zone 25"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=25500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 25\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",147],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",25500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "25\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20026, "epsg", 20026, + "Pulkovo 1995 / Gauss-Kruger zone 26"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=26500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 26\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",26500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "26\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20027, "epsg", 20027, + "Pulkovo 1995 / Gauss-Kruger zone 27"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=27500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 27\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",159],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",27500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "27\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20028, "epsg", 20028, + "Pulkovo 1995 / Gauss-Kruger zone 28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=28500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 28\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",165],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",28500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "28\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20029, "epsg", 20029, + "Pulkovo 1995 / Gauss-Kruger zone 29"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=29500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 29\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",171],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",29500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "29\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20030, "epsg", 20030, + "Pulkovo 1995 / Gauss-Kruger zone 30"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=30500000 +y_0="); + add_proj4text (p, 1, + "0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,"); + add_proj4text (p, 2, "-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 30\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",177],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",30500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "30\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_18 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 20031, "epsg", 20031, + "Pulkovo 1995 / Gauss-Kruger zone 31"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=31500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16"); + add_proj4text (p, 2, ",-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 31\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",-177],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",31500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "31\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20032, "epsg", 20032, + "Pulkovo 1995 / Gauss-Kruger zone 32"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=32500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16"); + add_proj4text (p, 2, ",-0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger zone 32\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4200\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",0],PARAMETER[\"central_meridian\",-171],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",1],PARAMETER[\"false_easting\",32500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"200"); + add_srs_wkt (p, 12, "32\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20064, "epsg", 20064, + "Pulkovo 1995 / Gauss-Kruger 4N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 4N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",21],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "20064\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20065, "epsg", 20065, + "Pulkovo 1995 / Gauss-Kruger 5N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 5N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",27],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "20065\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20066, "epsg", 20066, + "Pulkovo 1995 / Gauss-Kruger 6N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 6N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",33],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "20066\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20067, "epsg", 20067, + "Pulkovo 1995 / Gauss-Kruger 7N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 7N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",39],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "20067\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20068, "epsg", 20068, + "Pulkovo 1995 / Gauss-Kruger 8N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 8N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",45],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "20068\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20069, "epsg", 20069, + "Pulkovo 1995 / Gauss-Kruger 9N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 9N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",51],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",5000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "20069\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20070, "epsg", 20070, + "Pulkovo 1995 / Gauss-Kruger 10N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 10N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",57],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"20070\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20071, "epsg", 20071, + "Pulkovo 1995 / Gauss-Kruger 11N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 11N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",63],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"20071\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20072, "epsg", 20072, + "Pulkovo 1995 / Gauss-Kruger 12N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 12N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",69],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"20072\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20073, "epsg", 20073, + "Pulkovo 1995 / Gauss-Kruger 13N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 13N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",75],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"20073\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20074, "epsg", 20074, + "Pulkovo 1995 / Gauss-Kruger 14N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 14N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",81],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"20074\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20075, "epsg", 20075, + "Pulkovo 1995 / Gauss-Kruger 15N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 15N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",87],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"20075\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20076, "epsg", 20076, + "Pulkovo 1995 / Gauss-Kruger 16N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 16N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",93],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"20076\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20077, "epsg", 20077, + "Pulkovo 1995 / Gauss-Kruger 17N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, + "ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0."); + add_proj4text (p, 2, "12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 17N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",99],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"20077\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20078, "epsg", 20078, + "Pulkovo 1995 / Gauss-Kruger 18N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 18N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",105],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20078\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20079, "epsg", 20079, + "Pulkovo 1995 / Gauss-Kruger 19N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 19N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",111],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20079\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20080, "epsg", 20080, + "Pulkovo 1995 / Gauss-Kruger 20N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 20N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",117],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20080\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20081, "epsg", 20081, + "Pulkovo 1995 / Gauss-Kruger 21N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 21N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",123],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20081\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20082, "epsg", 20082, + "Pulkovo 1995 / Gauss-Kruger 22N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 22N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",129],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20082\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20083, "epsg", 20083, + "Pulkovo 1995 / Gauss-Kruger 23N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 23N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",135],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20083\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20084, "epsg", 20084, + "Pulkovo 1995 / Gauss-Kruger 24N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 24N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",141],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20084\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20085, "epsg", 20085, + "Pulkovo 1995 / Gauss-Kruger 25N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 25N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",147],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20085\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20086, "epsg", 20086, + "Pulkovo 1995 / Gauss-Kruger 26N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 26N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",153],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20086\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20087, "epsg", 20087, + "Pulkovo 1995 / Gauss-Kruger 27N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 27N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",159],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20087\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20088, "epsg", 20088, + "Pulkovo 1995 / Gauss-Kruger 28N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 28N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",165],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20088\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20089, "epsg", 20089, + "Pulkovo 1995 / Gauss-Kruger 29N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 29N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",171],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20089\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20090, "epsg", 20090, + "Pulkovo 1995 / Gauss-Kruger 30N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-0"); + add_proj4text (p, 2, ".12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 30N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",177],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20090\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20091, "epsg", 20091, + "Pulkovo 1995 / Gauss-Kruger 31N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 31N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-177],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20091\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20092, "epsg", 20092, + "Pulkovo 1995 / Gauss-Kruger 32N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, + " +ellps=krass +towgs84=24.82,-131.21,-82.66,-0,-0,0.16,-"); + add_proj4text (p, 2, "0.12 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1995 / Gauss-Kruger 32N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1995\",DATUM[\"Pulkovo_1995\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[24.82,-131.21,-82.66,-0,-0,0.16,-0.12],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6200\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4200\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-171],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"20092\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 20135, "epsg", 20135, + "Adindan / UTM zone 35N"); + add_proj4text (p, 0, "+proj=utm +zone=35 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Adindan / UTM zone 35N\",GEOGCS[\"Adindan\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Adindan\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 2, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6201\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4201\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 7, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 8, + "],PARAMETER[\"central_meridian\",27],PARAMETER[\"scale_f"); + add_srs_wkt (p, 9, + "actor\",0.9996],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"20135\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20136, "epsg", 20136, + "Adindan / UTM zone 36N"); + add_proj4text (p, 0, "+proj=utm +zone=36 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Adindan / UTM zone 36N\",GEOGCS[\"Adindan\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Adindan\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 2, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6201\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4201\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 7, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 8, + "],PARAMETER[\"central_meridian\",33],PARAMETER[\"scale_f"); + add_srs_wkt (p, 9, + "actor\",0.9996],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"20136\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20137, "epsg", 20137, + "Adindan / UTM zone 37N"); + add_proj4text (p, 0, "+proj=utm +zone=37 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Adindan / UTM zone 37N\",GEOGCS[\"Adindan\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Adindan\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 2, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6201\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4201\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 7, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 8, + "],PARAMETER[\"central_meridian\",39],PARAMETER[\"scale_f"); + add_srs_wkt (p, 9, + "actor\",0.9996],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"20137\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20138, "epsg", 20138, + "Adindan / UTM zone 38N"); + add_proj4text (p, 0, "+proj=utm +zone=38 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Adindan / UTM zone 38N\",GEOGCS[\"Adindan\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Adindan\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.14"); + add_srs_wkt (p, 2, + "5,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"6201\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4201\"]],UNIT["); + add_srs_wkt (p, 6, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 7, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 8, + "],PARAMETER[\"central_meridian\",45],PARAMETER[\"scale_f"); + add_srs_wkt (p, 9, + "actor\",0.9996],PARAMETER[\"false_easting\",500000],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"20138\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20248, "epsg", 20248, "AGD66 / AMG zone 48"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 48\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "05],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20248\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20249, "epsg", 20249, "AGD66 / AMG zone 49"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 49\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "11],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20249\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20250, "epsg", 20250, "AGD66 / AMG zone 50"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 50\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "17],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20250\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20251, "epsg", 20251, "AGD66 / AMG zone 51"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 51\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "23],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20251\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20252, "epsg", 20252, "AGD66 / AMG zone 52"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 52\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "29],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20252\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20253, "epsg", 20253, "AGD66 / AMG zone 53"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 53\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "35],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20253\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20254, "epsg", 20254, "AGD66 / AMG zone 54"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 54\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "41],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20254\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20255, "epsg", 20255, "AGD66 / AMG zone 55"); + add_proj4text (p, 0, + "+proj=utm +zone=55 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 55\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "47],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20255\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20256, "epsg", 20256, "AGD66 / AMG zone 56"); + add_proj4text (p, 0, + "+proj=utm +zone=56 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 56\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "53],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20256\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20257, "epsg", 20257, "AGD66 / AMG zone 57"); + add_proj4text (p, 0, + "+proj=utm +zone=57 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 57\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "59],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20257\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20258, "epsg", 20258, "AGD66 / AMG zone 58"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD66 / AMG zone 58\",GEOGCS[\"AGD66\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1966\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6202\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4202\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "65],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20258\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20348, "epsg", 20348, "AGD84 / AMG zone 48"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 48\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "05],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20348\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20349, "epsg", 20349, "AGD84 / AMG zone 49"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 49\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "11],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20349\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20350, "epsg", 20350, "AGD84 / AMG zone 50"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 50\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "17],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20350\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20351, "epsg", 20351, "AGD84 / AMG zone 51"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 51\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "23],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20351\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20352, "epsg", 20352, "AGD84 / AMG zone 52"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 52\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "29],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20352\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20353, "epsg", 20353, "AGD84 / AMG zone 53"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 53\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "35],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20353\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20354, "epsg", 20354, "AGD84 / AMG zone 54"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 54\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "41],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20354\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20355, "epsg", 20355, "AGD84 / AMG zone 55"); + add_proj4text (p, 0, + "+proj=utm +zone=55 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 55\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "47],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20355\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20356, "epsg", 20356, "AGD84 / AMG zone 56"); + add_proj4text (p, 0, + "+proj=utm +zone=56 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 56\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "53],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20356\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20357, "epsg", 20357, "AGD84 / AMG zone 57"); + add_proj4text (p, 0, + "+proj=utm +zone=57 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 57\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "59],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20357\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20358, "epsg", 20358, "AGD84 / AMG zone 58"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"AGD84 / AMG zone 58\",GEOGCS[\"AGD84\",DATUM[\""); + add_srs_wkt (p, 1, + "Australian_Geodetic_Datum_1984\",SPHEROID[\"Australian N"); + add_srs_wkt (p, 2, + "ational Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "003\"]],AUTHORITY[\"EPSG\",\"6203\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4203\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "65],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",10000000"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"20358\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20436, "epsg", 20436, + "Ain el Abd / UTM zone 36N"); + add_proj4text (p, 0, "+proj=utm +zone=36 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Ain el Abd / UTM zone 36N\",GEOGCS[\"Ain el Abd"); + add_srs_wkt (p, 1, + "\",DATUM[\"Ain_el_Abd_1970\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6204\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4204\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",33],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "20436\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 20437, "epsg", 20437, + "Ain el Abd / UTM zone 37N"); + add_proj4text (p, 0, "+proj=utm +zone=37 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Ain el Abd / UTM zone 37N\",GEOGCS[\"Ain el Abd"); + add_srs_wkt (p, 1, + "\",DATUM[\"Ain_el_Abd_1970\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6204\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4204\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",39],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "20437\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 20438, "epsg", 20438, + "Ain el Abd / UTM zone 38N"); + add_proj4text (p, 0, "+proj=utm +zone=38 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Ain el Abd / UTM zone 38N\",GEOGCS[\"Ain el Abd"); + add_srs_wkt (p, 1, + "\",DATUM[\"Ain_el_Abd_1970\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6204\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4204\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",45],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "20438\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 20439, "epsg", 20439, + "Ain el Abd / UTM zone 39N"); + add_proj4text (p, 0, "+proj=utm +zone=39 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Ain el Abd / UTM zone 39N\",GEOGCS[\"Ain el Abd"); + add_srs_wkt (p, 1, + "\",DATUM[\"Ain_el_Abd_1970\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6204\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4204\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",51],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "20439\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 20440, "epsg", 20440, + "Ain el Abd / UTM zone 40N"); + add_proj4text (p, 0, "+proj=utm +zone=40 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Ain el Abd / UTM zone 40N\",GEOGCS[\"Ain el Abd"); + add_srs_wkt (p, 1, + "\",DATUM[\"Ain_el_Abd_1970\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6204\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4204\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",57],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "20440\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 20499, "epsg", 20499, + "Ain el Abd / Bahrain Grid"); + add_proj4text (p, 0, "+proj=utm +zone=39 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Ain el Abd / Bahrain Grid\",GEOGCS[\"Ain el Abd"); + add_srs_wkt (p, 1, + "\",DATUM[\"Ain_el_Abd_1970\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6204\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4204\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",51],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "20499\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 20538, "epsg", 20538, + "Afgooye / UTM zone 38N"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +ellps=krass +towgs84=-43,-163,45,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Afgooye / UTM zone 38N\",GEOGCS[\"Afgooye\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Afgooye\",SPHEROID[\"Krassowsky 1940\",6378245,298."); + add_srs_wkt (p, 2, + "3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[-43,-163,45,0,0,"); + add_srs_wkt (p, 3, + "0,0],AUTHORITY[\"EPSG\",\"6205\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4205\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",45"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"20538\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 12, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 20539, "epsg", 20539, + "Afgooye / UTM zone 39N"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +ellps=krass +towgs84=-43,-163,45,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Afgooye / UTM zone 39N\",GEOGCS[\"Afgooye\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Afgooye\",SPHEROID[\"Krassowsky 1940\",6378245,298."); + add_srs_wkt (p, 2, + "3,AUTHORITY[\"EPSG\",\"7024\"]],TOWGS84[-43,-163,45,0,0,"); + add_srs_wkt (p, 3, + "0,0],AUTHORITY[\"EPSG\",\"6205\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4205\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",51"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"20539\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 12, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 20790, "epsg", 20790, + "Lisbon (Lisbon) / Portuguese National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=39.66666666666666 +lon_0=1 +k=1 +x_0="); + add_proj4text (p, 1, + "200000 +y_0=300000 +ellps=intl +pm=lisbon +units=m +no_d"); + add_proj4text (p, 2, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"Lisbon (Lisbon) / Portuguese National Grid\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"Lisbon (Lisbon)\",DATUM[\"Lisbon_1937_Lisbon\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"International 1924\",6378388,297,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6803\"]],PRIMEM[\"L"); + add_srs_wkt (p, 4, + "isbon\",-9.131906111111112,AUTHORITY[\"EPSG\",\"8902\"]]"); + add_srs_wkt (p, 5, + ",UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"9122\"]],AUTHORITY[\"EPSG\",\"4803\"]],UNIT[\"metre\","); + add_srs_wkt (p, 7, + "1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_"); + add_srs_wkt (p, 8, + "Mercator\"],PARAMETER[\"latitude_of_origin\",39.66666666"); + add_srs_wkt (p, 9, + "666666],PARAMETER[\"central_meridian\",1],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",200000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",300000],AUTHORITY[\"EPSG\",\"20"); + add_srs_wkt (p, 12, "790\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 20791, "epsg", 20791, + "Lisbon (Lisbon) / Portuguese Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=39.66666666666666 +lon_0=1 +k=1 +x_0="); + add_proj4text (p, 1, "0 +y_0=0 +ellps=intl +pm=lisbon +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Lisbon (Lisbon) / Portuguese Grid\",GEOGCS[\"Li"); + add_srs_wkt (p, 1, + "sbon (Lisbon)\",DATUM[\"Lisbon_1937_Lisbon\",SPHEROID[\""); + add_srs_wkt (p, 2, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "22\"]],AUTHORITY[\"EPSG\",\"6803\"]],PRIMEM[\"Lisbon\",-"); + add_srs_wkt (p, 4, + "9.131906111111112,AUTHORITY[\"EPSG\",\"8902\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4803\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",39.66666666666666],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"central_meridian\",1],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",0],AUTHORITY[\"EPSG\",\"20791\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 20822, "epsg", 20822, + "Aratu / UTM zone 22S"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Aratu / UTM zone 22S\",GEOGCS[\"Aratu\",DATUM[\""); + add_srs_wkt (p, 1, + "Aratu\",SPHEROID[\"International 1924\",6378388,297,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6208\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, + "22\"]],AUTHORITY[\"EPSG\",\"4208\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 7, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 8, + "central_meridian\",-51],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"20822\"],AXIS"); + add_srs_wkt (p, 11, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20823, "epsg", 20823, + "Aratu / UTM zone 23S"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Aratu / UTM zone 23S\",GEOGCS[\"Aratu\",DATUM[\""); + add_srs_wkt (p, 1, + "Aratu\",SPHEROID[\"International 1924\",6378388,297,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6208\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, + "22\"]],AUTHORITY[\"EPSG\",\"4208\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 7, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 8, + "central_meridian\",-45],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"20823\"],AXIS"); + add_srs_wkt (p, 11, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20824, "epsg", 20824, + "Aratu / UTM zone 24S"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Aratu / UTM zone 24S\",GEOGCS[\"Aratu\",DATUM[\""); + add_srs_wkt (p, 1, + "Aratu\",SPHEROID[\"International 1924\",6378388,297,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6208\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, + "22\"]],AUTHORITY[\"EPSG\",\"4208\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 7, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 8, + "central_meridian\",-39],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"20824\"],AXIS"); + add_srs_wkt (p, 11, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 20934, "epsg", 20934, + "Arc 1950 / UTM zone 34S"); + add_proj4text (p, 0, + "+proj=utm +zone=34 +south +a=6378249.145 +b=6356514.9663"); + add_proj4text (p, 1, "98753 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Arc 1950 / UTM zone 34S\",GEOGCS[\"Arc 1950\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Arc_1950\",SPHEROID[\"Clarke 1880 (Arc)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.4663077,AUTHORITY[\"EPSG\",\"7013\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6209\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4209\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",21],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"20934\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 20935, "epsg", 20935, + "Arc 1950 / UTM zone 35S"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +south +a=6378249.145 +b=6356514.9663"); + add_proj4text (p, 1, "98753 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Arc 1950 / UTM zone 35S\",GEOGCS[\"Arc 1950\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Arc_1950\",SPHEROID[\"Clarke 1880 (Arc)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.4663077,AUTHORITY[\"EPSG\",\"7013\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6209\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4209\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",27],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"20935\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 20936, "epsg", 20936, + "Arc 1950 / UTM zone 36S"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +south +a=6378249.145 +b=6356514.9663"); + add_proj4text (p, 1, "98753 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Arc 1950 / UTM zone 36S\",GEOGCS[\"Arc 1950\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Arc_1950\",SPHEROID[\"Clarke 1880 (Arc)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.4663077,AUTHORITY[\"EPSG\",\"7013\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6209\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4209\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",33],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"20936\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 21035, "epsg", 21035, + "Arc 1960 / UTM zone 35S"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +south +ellps=clrk80 +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Arc 1960 / UTM zone 35S\",GEOGCS[\"Arc 1960\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Arc_1960\",SPHEROID[\"Clarke 1880 (RGS)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6210\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4210\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",27],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, + "\"21035\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORT"); + add_srs_wkt (p, 12, "H]]"); + p = add_epsg_def (first, last, 21036, "epsg", 21036, + "Arc 1960 / UTM zone 36S"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +south +ellps=clrk80 +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Arc 1960 / UTM zone 36S\",GEOGCS[\"Arc 1960\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Arc_1960\",SPHEROID[\"Clarke 1880 (RGS)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6210\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4210\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",33],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, + "\"21036\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORT"); + add_srs_wkt (p, 12, "H]]"); + p = add_epsg_def (first, last, 21037, "epsg", 21037, + "Arc 1960 / UTM zone 37S"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +south +ellps=clrk80 +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Arc 1960 / UTM zone 37S\",GEOGCS[\"Arc 1960\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Arc_1960\",SPHEROID[\"Clarke 1880 (RGS)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6210\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4210\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",39],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, + "\"21037\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORT"); + add_srs_wkt (p, 12, "H]]"); + p = add_epsg_def (first, last, 21095, "epsg", 21095, + "Arc 1960 / UTM zone 35N"); + add_proj4text (p, 0, "+proj=utm +zone=35 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Arc 1960 / UTM zone 35N\",GEOGCS[\"Arc 1960\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Arc_1960\",SPHEROID[\"Clarke 1880 (RGS)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6210\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4210\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",27],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"21095"); + add_srs_wkt (p, 11, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 21096, "epsg", 21096, + "Arc 1960 / UTM zone 36N"); + add_proj4text (p, 0, "+proj=utm +zone=36 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Arc 1960 / UTM zone 36N\",GEOGCS[\"Arc 1960\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Arc_1960\",SPHEROID[\"Clarke 1880 (RGS)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6210\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4210\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",33],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"21096"); + add_srs_wkt (p, 11, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 21097, "epsg", 21097, + "Arc 1960 / UTM zone 37N"); + add_proj4text (p, 0, "+proj=utm +zone=37 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Arc 1960 / UTM zone 37N\",GEOGCS[\"Arc 1960\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Arc_1960\",SPHEROID[\"Clarke 1880 (RGS)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6210\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4210\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",39],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"21097"); + add_srs_wkt (p, 11, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 21100, "epsg", 21100, + "Batavia (Jakarta) / NEIEZ (deprecated)"); + add_proj4text (p, 0, + "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 "); + add_proj4text (p, 1, "+ellps=bessel +pm=jakarta +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Batavia (Jakarta) / NEIEZ (deprecated)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Batavia (Jakarta)\",DATUM[\"Batavia_Jakarta\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6813\"]],PRIMEM[\"J"); + add_srs_wkt (p, 4, + "akarta\",106.8077194444444,AUTHORITY[\"EPSG\",\"8908\"]]"); + add_srs_wkt (p, 5, + ",UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"9122\"]],AUTHORITY[\"EPSG\",\"4813\"]],UNIT[\"metre\","); + add_srs_wkt (p, 7, + "1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Mercator_1S"); + add_srs_wkt (p, 8, + "P\"],PARAMETER[\"central_meridian\",110],PARAMETER[\"sca"); + add_srs_wkt (p, 9, + "le_factor\",0.997],PARAMETER[\"false_easting\",3900000],"); + add_srs_wkt (p, 10, + "PARAMETER[\"false_northing\",900000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"21100\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 21148, "epsg", 21148, + "Batavia / UTM zone 48S"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +south +ellps=bessel +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Batavia / UTM zone 48S\",GEOGCS[\"Batavia\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Batavia\",SPHEROID[\"Bessel 1841\",6377397.155,299."); + add_srs_wkt (p, 2, + "1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6211\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4211\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",105],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 9, + "tor\",0.9996],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"21"); + add_srs_wkt (p, 11, + "148\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 21149, "epsg", 21149, + "Batavia / UTM zone 49S"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +south +ellps=bessel +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Batavia / UTM zone 49S\",GEOGCS[\"Batavia\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Batavia\",SPHEROID[\"Bessel 1841\",6377397.155,299."); + add_srs_wkt (p, 2, + "1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6211\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4211\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",111],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 9, + "tor\",0.9996],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"21"); + add_srs_wkt (p, 11, + "149\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 21150, "epsg", 21150, + "Batavia / UTM zone 50S"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +ellps=bessel +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Batavia / UTM zone 50S\",GEOGCS[\"Batavia\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Batavia\",SPHEROID[\"Bessel 1841\",6377397.155,299."); + add_srs_wkt (p, 2, + "1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6211\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4211\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",117],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 9, + "tor\",0.9996],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"21"); + add_srs_wkt (p, 11, + "150\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 21291, "epsg", 21291, + "Barbados 1938 / British West Indies Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x"); + add_proj4text (p, 1, + "_0=400000 +y_0=0 +ellps=clrk80 +towgs84=31.95,300.99,419"); + add_proj4text (p, 2, ".19,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Barbados 1938 / British West Indies Grid\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Barbados 1938\",DATUM[\"Barbados_1938\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7012\"]],TOWGS84[31.95,300.99,419.19,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6212\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"421"); + add_srs_wkt (p, 7, + "2\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",-62],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",0.9995],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "400000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, + "\",\"21291\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 13, "ORTH]]"); + p = add_epsg_def (first, last, 21292, "epsg", 21292, + "Barbados 1938 / Barbados National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=13.17638888888889 +lon_0=-59.55972222"); + add_proj4text (p, 1, + "222222 +k=0.9999986 +x_0=30000 +y_0=75000 +ellps=clrk80 "); + add_proj4text (p, 2, + "+towgs84=31.95,300.99,419.19,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Barbados 1938 / Barbados National Grid\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Barbados 1938\",DATUM[\"Barbados_1938\",SPHEROID[\"Cl"); + add_srs_wkt (p, 2, + "arke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7012\"]],TOWGS84[31.95,300.99,419.19,0,0,0,0],AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"6212\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 5, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4212\""); + add_srs_wkt (p, 7, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 9, + "igin\",13.17638888888889],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 10, + ",-59.55972222222222],PARAMETER[\"scale_factor\",0.999998"); + add_srs_wkt (p, 11, + "6],PARAMETER[\"false_easting\",30000],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "northing\",75000],AUTHORITY[\"EPSG\",\"21292\"],AXIS[\"E"); + add_srs_wkt (p, 13, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 21413, "epsg", 21413, + "Beijing 1954 / Gauss-Kruger zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 13\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",75],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",135"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21413\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21414, "epsg", 21414, + "Beijing 1954 / Gauss-Kruger zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 14\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",81],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",145"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21414\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21415, "epsg", 21415, + "Beijing 1954 / Gauss-Kruger zone 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 15\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",87],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",155"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21415\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21416, "epsg", 21416, + "Beijing 1954 / Gauss-Kruger zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 16\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",93],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",165"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21416\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21417, "epsg", 21417, + "Beijing 1954 / Gauss-Kruger zone 17"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 17\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",99],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",175"); + add_srs_wkt (p, 10, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21417\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21418, "epsg", 21418, + "Beijing 1954 / Gauss-Kruger zone 18"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 18\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",105],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",18"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"21418\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21419, "epsg", 21419, + "Beijing 1954 / Gauss-Kruger zone 19"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 19\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",111],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",19"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"21419\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21420, "epsg", 21420, + "Beijing 1954 / Gauss-Kruger zone 20"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 20\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",117],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",20"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"21420\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21421, "epsg", 21421, + "Beijing 1954 / Gauss-Kruger zone 21"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 21\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",123],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",21"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"21421\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21422, "epsg", 21422, + "Beijing 1954 / Gauss-Kruger zone 22"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 22\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",129],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",22"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"21422\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21423, "epsg", 21423, + "Beijing 1954 / Gauss-Kruger zone 23"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger zone 23\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",135],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",23"); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"21423\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21453, "epsg", 21453, + "Beijing 1954 / Gauss-Kruger CM 75E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 75E\",GEOGCS[\"B"); + add_srs_wkt (p, 1, + "eijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",75],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"21453\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21454, "epsg", 21454, + "Beijing 1954 / Gauss-Kruger CM 81E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 81E\",GEOGCS[\"B"); + add_srs_wkt (p, 1, + "eijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",81],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"21454\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21455, "epsg", 21455, + "Beijing 1954 / Gauss-Kruger CM 87E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 87E\",GEOGCS[\"B"); + add_srs_wkt (p, 1, + "eijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",87],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"21455\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21456, "epsg", 21456, + "Beijing 1954 / Gauss-Kruger CM 93E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 93E\",GEOGCS[\"B"); + add_srs_wkt (p, 1, + "eijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",93],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"21456\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21457, "epsg", 21457, + "Beijing 1954 / Gauss-Kruger CM 99E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 99E\",GEOGCS[\"B"); + add_srs_wkt (p, 1, + "eijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",99],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 10, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"21457\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21458, "epsg", 21458, + "Beijing 1954 / Gauss-Kruger CM 105E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 105E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",105],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21458\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21459, "epsg", 21459, + "Beijing 1954 / Gauss-Kruger CM 111E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 111E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",111],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21459\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21460, "epsg", 21460, + "Beijing 1954 / Gauss-Kruger CM 117E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 117E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",117],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21460\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21461, "epsg", 21461, + "Beijing 1954 / Gauss-Kruger CM 123E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 123E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",123],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21461\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21462, "epsg", 21462, + "Beijing 1954 / Gauss-Kruger CM 129E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 129E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",129],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21462\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21463, "epsg", 21463, + "Beijing 1954 / Gauss-Kruger CM 135E"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger CM 135E\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",135],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"21463\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21473, "epsg", 21473, + "Beijing 1954 / Gauss-Kruger 13N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 13N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",7"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"21473\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21474, "epsg", 21474, + "Beijing 1954 / Gauss-Kruger 14N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 14N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",8"); + add_srs_wkt (p, 9, + "1],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"21474\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21475, "epsg", 21475, + "Beijing 1954 / Gauss-Kruger 15N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 15N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",8"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"21475\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21476, "epsg", 21476, + "Beijing 1954 / Gauss-Kruger 16N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 16N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"21476\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21477, "epsg", 21477, + "Beijing 1954 / Gauss-Kruger 17N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 17N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 9, + "9],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"21477\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21478, "epsg", 21478, + "Beijing 1954 / Gauss-Kruger 18N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 18N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "05],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"21478\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21479, "epsg", 21479, + "Beijing 1954 / Gauss-Kruger 19N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 19N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "11],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"21479\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21480, "epsg", 21480, + "Beijing 1954 / Gauss-Kruger 20N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 20N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "17],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"21480\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21481, "epsg", 21481, + "Beijing 1954 / Gauss-Kruger 21N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 21N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "23],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"21481\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21482, "epsg", 21482, + "Beijing 1954 / Gauss-Kruger 22N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 22N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "29],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"21482\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21483, "epsg", 21483, + "Beijing 1954 / Gauss-Kruger 23N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Beijing 1954 / Gauss-Kruger 23N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Beijing 1954\",DATUM[\"Beijing_1954\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],AUTHORITY[\"EPSG\",\"6214\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4214\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 9, + "35],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"21483\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 21500, "epsg", 21500, + "Belge 1950 (Brussels) / Belge Lambert 50"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666"); + add_proj4text (p, 1, + "666 +lat_0=90 +lon_0=0 +x_0=150000 +y_0=5400000 +ellps=i"); + add_proj4text (p, 2, "ntl +pm=brussels +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Belge 1950 (Brussels) / Belge Lambert 50\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Belge 1950 (Brussels)\",DATUM[\"Reseau_National_Bel"); + add_srs_wkt (p, 2, + "ge_1950_Brussels\",SPHEROID[\"International 1924\",63783"); + add_srs_wkt (p, 3, + "88,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6809\"]],PRIMEM[\"Brussels\",4.367975,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 5, + "\",\"8910\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4809\"]],UN"); + add_srs_wkt (p, 7, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",49.83333333333334],PARAMETER[\"standard_paral"); + add_srs_wkt (p, 10, + "lel_2\",51.16666666666666],PARAMETER[\"latitude_of_origi"); + add_srs_wkt (p, 11, + "n\",90],PARAMETER[\"central_meridian\",0],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_easting\",150000],PARAMETER[\"false_northing\",54000"); + add_srs_wkt (p, 13, + "00],AUTHORITY[\"EPSG\",\"21500\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 14, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 21780, "epsg", 21780, + "Bern 1898 (Bern) / LV03C"); + add_proj4text (p, 0, + "+proj=somerc +lat_0=46.95240555555556 +lon_0=0 +k_0=1 +x"); + add_proj4text (p, 1, + "_0=0 +y_0=0 +ellps=bessel +pm=bern +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bern 1898 (Bern) / LV03C\",GEOGCS[\"Bern 1898 ("); + add_srs_wkt (p, 1, + "Bern)\",DATUM[\"CH1903_Bern\",SPHEROID[\"Bessel 1841\",6"); + add_srs_wkt (p, 2, + "377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6801\"]],PRIMEM[\"Bern\",7.43958333333"); + add_srs_wkt (p, 4, + "3333,AUTHORITY[\"EPSG\",\"8907\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4801\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "9001\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"latitude_of_center\",46.95240555555556],PARAMETER[\""); + add_srs_wkt (p, 9, + "longitude_of_center\",0],PARAMETER[\"azimuth\",90],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 11, + "or\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_northing\",0],AUTHORITY[\"EPSG\",\"21780\"],AXIS[\"Y\","); + add_srs_wkt (p, 13, "EAST],AXIS[\"X\",NORTH]]"); + p = add_epsg_def (first, last, 21781, "epsg", 21781, "CH1903 / LV03"); + add_proj4text (p, 0, + "+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333"); + add_proj4text (p, 1, + "333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +tow"); + add_proj4text (p, 2, + "gs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"CH1903 / LV03\",GEOGCS[\"CH1903\",DATUM[\"CH190"); + add_srs_wkt (p, 1, + "3\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.34"); + add_srs_wkt (p, 3, + "6,0,0,0,0],AUTHORITY[\"EPSG\",\"6149\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4149\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_center\",46.95240555555556],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"longitude_of_center\",7.439583333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",6"); + add_srs_wkt (p, 12, + "00000],PARAMETER[\"false_northing\",200000],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"21781\"],AXIS[\"Y\",EAST],AXIS[\"X\",NORTH]]"); + p = add_epsg_def (first, last, 21782, "epsg", 21782, "CH1903 / LV03C-G"); + add_proj4text (p, 0, + "+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333"); + add_proj4text (p, 1, + "333333 +k_0=1 +x_0=0 +y_0=0 +ellps=bessel +towgs84=674.3"); + add_proj4text (p, 2, "74,15.056,405.346,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"CH1903 / LV03C-G\",GEOGCS[\"CH1903\",DATUM[\"CH"); + add_srs_wkt (p, 1, + "1903\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405"); + add_srs_wkt (p, 3, + ".346,0,0,0,0],AUTHORITY[\"EPSG\",\"6149\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4149\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],"); + add_srs_wkt (p, 8, + "PARAMETER[\"latitude_of_center\",46.95240555555556],PARA"); + add_srs_wkt (p, 9, + "METER[\"longitude_of_center\",7.439583333333333],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90"); + add_srs_wkt (p, 11, + "],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"21782\"],AXIS[\"Y\",EAST],AXIS[\"X\",NORTH]]"); + p = add_epsg_def (first, last, 21817, "epsg", 21817, + "Bogota 1975 / UTM zone 17N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=intl +towgs84=307,304,-318,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bogota 1975 / UTM zone 17N (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Bogota 1975\",DATUM[\"Bogota_1975\",SPHEROID[\"Inter"); + add_srs_wkt (p, 2, + "national 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[307,304,-318,0,0,0,0],AUTHORITY[\"EPSG\",\"621"); + add_srs_wkt (p, 4, + "8\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4218\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-81],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"21817\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 21818, "epsg", 21818, + "Bogota 1975 / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=intl +towgs84=307,304,-318,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bogota 1975 / UTM zone 18N\",GEOGCS[\"Bogota 19"); + add_srs_wkt (p, 1, + "75\",DATUM[\"Bogota_1975\",SPHEROID[\"International 1924"); + add_srs_wkt (p, 2, + "\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[307"); + add_srs_wkt (p, 3, + ",304,-318,0,0,0,0],AUTHORITY[\"EPSG\",\"6218\"]],PRIMEM["); + add_srs_wkt (p, 4, + "\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"deg"); + add_srs_wkt (p, 5, + "ree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"4218\"]],UNIT[\"metre\",1,AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"]"); + add_srs_wkt (p, 8, + ",PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central"); + add_srs_wkt (p, 9, + "_meridian\",-75],PARAMETER[\"scale_factor\",0.9996],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",500000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",0],AUTHORITY[\"EPSG\",\"21818\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 21891, "epsg", 21891, + "Bogota 1975 / Colombia West zone (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-77.08091666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs"); + add_proj4text (p, 2, "84=307,304,-318,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bogota 1975 / Colombia West zone (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"Bogota 1975\",DATUM[\"Bogota_1975\",SPHEROID[\""); + add_srs_wkt (p, 2, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "22\"]],TOWGS84[307,304,-318,0,0,0,0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6218\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4218\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",4.59"); + add_srs_wkt (p, 9, + "9047222222222],PARAMETER[\"central_meridian\",-77.080916"); + add_srs_wkt (p, 10, + "66666667],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",1000000],PARAMETER[\"false_northing\",100000"); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"21891\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 21892, "epsg", 21892, + "Bogota 1975 / Colombia Bogota zone (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-74.08091666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs"); + add_proj4text (p, 2, "84=307,304,-318,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bogota 1975 / Colombia Bogota zone (deprecated)"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Bogota 1975\",DATUM[\"Bogota_1975\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7022\"]],TOWGS84[307,304,-318,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6218\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4218\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",4.59"); + add_srs_wkt (p, 9, + "9047222222222],PARAMETER[\"central_meridian\",-74.080916"); + add_srs_wkt (p, 10, + "66666667],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",1000000],PARAMETER[\"false_northing\",100000"); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"21892\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 21893, "epsg", 21893, + "Bogota 1975 / Colombia East Central zone (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-71.08091666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs"); + add_proj4text (p, 2, "84=307,304,-318,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bogota 1975 / Colombia East Central zone (depre"); + add_srs_wkt (p, 1, + "cated)\",GEOGCS[\"Bogota 1975\",DATUM[\"Bogota_1975\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"International 1924\",6378388,297,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7022\"]],TOWGS84[307,304,-318,0,0,0,0],AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"6218\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 5, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4218\"]]"); + add_srs_wkt (p, 7, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 9, + "in\",4.599047222222222],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 10, + "71.08091666666667],PARAMETER[\"scale_factor\",1],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",1000000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 12, + "\",1000000],AUTHORITY[\"EPSG\",\"21893\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 13, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 21894, "epsg", 21894, + "Bogota 1975 / Colombia East (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-68.08091666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs"); + add_proj4text (p, 2, "84=307,304,-318,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bogota 1975 / Colombia East (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Bogota 1975\",DATUM[\"Bogota_1975\",SPHEROID[\"Inte"); + add_srs_wkt (p, 2, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[307,304,-318,0,0,0,0],AUTHORITY[\"EPSG\",\"62"); + add_srs_wkt (p, 4, + "18\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4218\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",4.59904722"); + add_srs_wkt (p, 9, + "2222222],PARAMETER[\"central_meridian\",-68.080916666666"); + add_srs_wkt (p, 10, + "67],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",1000000],PARAMETER[\"false_northing\",1000000],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"21894\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 13, "ORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_19 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 21896, "epsg", 21896, + "Bogota 1975 / Colombia West zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-77.08091666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs"); + add_proj4text (p, 2, "84=307,304,-318,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bogota 1975 / Colombia West zone\",GEOGCS[\"Bog"); + add_srs_wkt (p, 1, + "ota 1975\",DATUM[\"Bogota_1975\",SPHEROID[\"Internationa"); + add_srs_wkt (p, 2, + "l 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS"); + add_srs_wkt (p, 3, + "84[307,304,-318,0,0,0,0],AUTHORITY[\"EPSG\",\"6218\"]],P"); + add_srs_wkt (p, 4, + "RIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT"); + add_srs_wkt (p, 5, + "[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"912"); + add_srs_wkt (p, 6, + "2\"]],AUTHORITY[\"EPSG\",\"4218\"]],UNIT[\"metre\",1,AUT"); + add_srs_wkt (p, 7, + "HORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merca"); + add_srs_wkt (p, 8, + "tor\"],PARAMETER[\"latitude_of_origin\",4.59904722222222"); + add_srs_wkt (p, 9, + "2],PARAMETER[\"central_meridian\",-77.08091666666667],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "1000000],PARAMETER[\"false_northing\",1000000],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"21896\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 21897, "epsg", 21897, + "Bogota 1975 / Colombia Bogota zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-74.08091666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs"); + add_proj4text (p, 2, "84=307,304,-318,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bogota 1975 / Colombia Bogota zone\",GEOGCS[\"B"); + add_srs_wkt (p, 1, + "ogota 1975\",DATUM[\"Bogota_1975\",SPHEROID[\"Internatio"); + add_srs_wkt (p, 2, + "nal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[307,304,-318,0,0,0,0],AUTHORITY[\"EPSG\",\"6218\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4218\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",4.599047222222"); + add_srs_wkt (p, 9, + "222],PARAMETER[\"central_meridian\",-74.08091666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",1000000],PARAMETER[\"false_northing\",1000000],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"21897\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]"); + add_srs_wkt (p, 13, "]"); + p = add_epsg_def (first, last, 21898, "epsg", 21898, + "Bogota 1975 / Colombia East Central zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-71.08091666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs"); + add_proj4text (p, 2, "84=307,304,-318,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bogota 1975 / Colombia East Central zone\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Bogota 1975\",DATUM[\"Bogota_1975\",SPHEROID[\"Inte"); + add_srs_wkt (p, 2, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[307,304,-318,0,0,0,0],AUTHORITY[\"EPSG\",\"62"); + add_srs_wkt (p, 4, + "18\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4218\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",4.59904722"); + add_srs_wkt (p, 9, + "2222222],PARAMETER[\"central_meridian\",-71.080916666666"); + add_srs_wkt (p, 10, + "67],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",1000000],PARAMETER[\"false_northing\",1000000],AUT"); + add_srs_wkt (p, 12, + "HORITY[\"EPSG\",\"21898\"],AXIS[\"X\",NORTH],AXIS[\"Y\","); + add_srs_wkt (p, 13, "EAST]]"); + p = add_epsg_def (first, last, 21899, "epsg", 21899, + "Bogota 1975 / Colombia East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.599047222222222 +lon_0=-68.08091666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=1000000 +y_0=1000000 +ellps=intl +towgs"); + add_proj4text (p, 2, "84=307,304,-318,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Bogota 1975 / Colombia East\",GEOGCS[\"Bogota 1"); + add_srs_wkt (p, 1, + "975\",DATUM[\"Bogota_1975\",SPHEROID[\"International 192"); + add_srs_wkt (p, 2, + "4\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[30"); + add_srs_wkt (p, 3, + "7,304,-318,0,0,0,0],AUTHORITY[\"EPSG\",\"6218\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4218\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",4.599047222222222],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"central_meridian\",-68.08091666666667],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",10000"); + add_srs_wkt (p, 11, + "00],PARAMETER[\"false_northing\",1000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 12, "SG\",\"21899\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22032, "epsg", 22032, + "Camacupa / UTM zone 32S"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +south +ellps=clrk80 +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Camacupa / UTM zone 32S\",GEOGCS[\"Camacupa\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Camacupa\",SPHEROID[\"Clarke 1880 (RGS)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6220\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4220\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",0.9996],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "22032\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 22033, "epsg", 22033, + "Camacupa / UTM zone 33S"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +south +ellps=clrk80 +units=m +no_def"); + add_proj4text (p, 1, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Camacupa / UTM zone 33S\",GEOGCS[\"Camacupa\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Camacupa\",SPHEROID[\"Clarke 1880 (RGS)\",6378249"); + add_srs_wkt (p, 2, + ".145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6220\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4220\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",15],PARAMETER[\"scale"); + add_srs_wkt (p, 9, + "_factor\",0.9996],PARAMETER[\"false_easting\",500000],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, + "\"22033\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORT"); + add_srs_wkt (p, 12, "H]]"); + p = add_epsg_def (first, last, 22091, "epsg", 22091, + "Camacupa / TM 11.30 SE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=11.5 +k=0.9996 +x_0=500000 +"); + add_proj4text (p, 1, "y_0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Camacupa / TM 11.30 SE\",GEOGCS[\"Camacupa\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Camacupa\",SPHEROID[\"Clarke 1880 (RGS)\",6378249."); + add_srs_wkt (p, 2, + "145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6220\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4220\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",11.5],PARAMETER[\"scal"); + add_srs_wkt (p, 9, + "e_factor\",0.9996],PARAMETER[\"false_easting\",500000],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",10000000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, + ",\"22091\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NOR"); + add_srs_wkt (p, 12, "TH]]"); + p = add_epsg_def (first, last, 22092, "epsg", 22092, "Camacupa / TM 12 SE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=10000000 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Camacupa / TM 12 SE\",GEOGCS[\"Camacupa\",DATUM"); + add_srs_wkt (p, 1, + "[\"Camacupa\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145"); + add_srs_wkt (p, 2, + ",293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6220\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4220\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",12],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"220"); + add_srs_wkt (p, 11, + "92\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22171, "epsg", 22171, + "POSGAR 98 / Argentina 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 98 / Argentina 1\",GEOGCS[\"POSGAR 98\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1998\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6190\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4190\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",-90],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 9, + "n\",-72],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",1500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"22171\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 12, "AST]]"); + p = add_epsg_def (first, last, 22172, "epsg", 22172, + "POSGAR 98 / Argentina 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 98 / Argentina 2\",GEOGCS[\"POSGAR 98\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1998\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6190\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4190\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",-90],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 9, + "n\",-69],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",2500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"22172\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 12, "AST]]"); + p = add_epsg_def (first, last, 22173, "epsg", 22173, + "POSGAR 98 / Argentina 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-66 +k=1 +x_0=3500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 98 / Argentina 3\",GEOGCS[\"POSGAR 98\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1998\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6190\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4190\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",-90],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 9, + "n\",-66],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",3500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"22173\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 12, "AST]]"); + p = add_epsg_def (first, last, 22174, "epsg", 22174, + "POSGAR 98 / Argentina 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-63 +k=1 +x_0=4500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 98 / Argentina 4\",GEOGCS[\"POSGAR 98\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1998\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6190\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4190\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",-90],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 9, + "n\",-63],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",4500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"22174\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 12, "AST]]"); + p = add_epsg_def (first, last, 22175, "epsg", 22175, + "POSGAR 98 / Argentina 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 98 / Argentina 5\",GEOGCS[\"POSGAR 98\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1998\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6190\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4190\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",-90],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 9, + "n\",-60],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",5500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"22175\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 12, "AST]]"); + p = add_epsg_def (first, last, 22176, "epsg", 22176, + "POSGAR 98 / Argentina 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-57 +k=1 +x_0=6500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 98 / Argentina 6\",GEOGCS[\"POSGAR 98\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1998\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6190\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4190\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",-90],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 9, + "n\",-57],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",6500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"22176\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 12, "AST]]"); + p = add_epsg_def (first, last, 22177, "epsg", 22177, + "POSGAR 98 / Argentina 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-54 +k=1 +x_0=7500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 98 / Argentina 7\",GEOGCS[\"POSGAR 98\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1998\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6190\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4190\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",-90],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 9, + "n\",-54],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",7500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"22177\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 12, "AST]]"); + p = add_epsg_def (first, last, 22181, "epsg", 22181, + "POSGAR 94 / Argentina 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 94 / Argentina 1\",GEOGCS[\"POSGAR 94\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1994\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6694"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4694\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",-90],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"central_meridian\",-72],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",1],PARAMETER[\"false_easting\",1500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"22181\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22182, "epsg", 22182, + "POSGAR 94 / Argentina 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 94 / Argentina 2\",GEOGCS[\"POSGAR 94\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1994\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6694"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4694\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",-90],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"central_meridian\",-69],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",1],PARAMETER[\"false_easting\",2500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"22182\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22183, "epsg", 22183, + "POSGAR 94 / Argentina 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-66 +k=1 +x_0=3500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 94 / Argentina 3\",GEOGCS[\"POSGAR 94\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1994\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6694"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4694\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",-90],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"central_meridian\",-66],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",1],PARAMETER[\"false_easting\",3500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"22183\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22184, "epsg", 22184, + "POSGAR 94 / Argentina 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-63 +k=1 +x_0=4500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 94 / Argentina 4\",GEOGCS[\"POSGAR 94\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1994\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6694"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4694\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",-90],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"central_meridian\",-63],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",1],PARAMETER[\"false_easting\",4500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"22184\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22185, "epsg", 22185, + "POSGAR 94 / Argentina 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 94 / Argentina 5\",GEOGCS[\"POSGAR 94\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1994\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6694"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4694\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",-90],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"central_meridian\",-60],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",1],PARAMETER[\"false_easting\",5500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"22185\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22186, "epsg", 22186, + "POSGAR 94 / Argentina 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-57 +k=1 +x_0=6500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 94 / Argentina 6\",GEOGCS[\"POSGAR 94\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1994\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6694"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4694\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",-90],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"central_meridian\",-57],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",1],PARAMETER[\"false_easting\",6500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"22186\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22187, "epsg", 22187, + "POSGAR 94 / Argentina 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-54 +k=1 +x_0=7500000 +y_0"); + add_proj4text (p, 1, + "=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"POSGAR 94 / Argentina 7\",GEOGCS[\"POSGAR 94\","); + add_srs_wkt (p, 1, + "DATUM[\"Posiciones_Geodesicas_Argentinas_1994\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6694"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4694\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",-90],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"central_meridian\",-54],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",1],PARAMETER[\"false_easting\",7500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"22187\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22191, "epsg", 22191, + "Campo Inchauspe / Argentina 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Campo Inchauspe / Argentina 1\",GEOGCS[\"Campo "); + add_srs_wkt (p, 1, + "Inchauspe\",DATUM[\"Campo_Inchauspe\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6221\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4221\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",-90],PARAMETER[\"central_meridian\",-72],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",1500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"22191\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22192, "epsg", 22192, + "Campo Inchauspe / Argentina 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-69 +k=1 +x_0=2500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Campo Inchauspe / Argentina 2\",GEOGCS[\"Campo "); + add_srs_wkt (p, 1, + "Inchauspe\",DATUM[\"Campo_Inchauspe\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6221\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4221\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",-90],PARAMETER[\"central_meridian\",-69],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",2500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"22192\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22193, "epsg", 22193, + "Campo Inchauspe / Argentina 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-66 +k=1 +x_0=3500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Campo Inchauspe / Argentina 3\",GEOGCS[\"Campo "); + add_srs_wkt (p, 1, + "Inchauspe\",DATUM[\"Campo_Inchauspe\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6221\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4221\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",-90],PARAMETER[\"central_meridian\",-66],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",3500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"22193\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22194, "epsg", 22194, + "Campo Inchauspe / Argentina 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-63 +k=1 +x_0=4500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Campo Inchauspe / Argentina 4\",GEOGCS[\"Campo "); + add_srs_wkt (p, 1, + "Inchauspe\",DATUM[\"Campo_Inchauspe\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6221\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4221\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",-90],PARAMETER[\"central_meridian\",-63],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",4500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"22194\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22195, "epsg", 22195, + "Campo Inchauspe / Argentina 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Campo Inchauspe / Argentina 5\",GEOGCS[\"Campo "); + add_srs_wkt (p, 1, + "Inchauspe\",DATUM[\"Campo_Inchauspe\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6221\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4221\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",-90],PARAMETER[\"central_meridian\",-60],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",5500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"22195\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22196, "epsg", 22196, + "Campo Inchauspe / Argentina 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-57 +k=1 +x_0=6500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Campo Inchauspe / Argentina 6\",GEOGCS[\"Campo "); + add_srs_wkt (p, 1, + "Inchauspe\",DATUM[\"Campo_Inchauspe\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6221\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4221\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",-90],PARAMETER[\"central_meridian\",-57],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",6500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"22196\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22197, "epsg", 22197, + "Campo Inchauspe / Argentina 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-90 +lon_0=-54 +k=1 +x_0=7500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Campo Inchauspe / Argentina 7\",GEOGCS[\"Campo "); + add_srs_wkt (p, 1, + "Inchauspe\",DATUM[\"Campo_Inchauspe\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"6221\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 5, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 6, + "\"4221\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]"); + add_srs_wkt (p, 7, + "],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitu"); + add_srs_wkt (p, 8, + "de_of_origin\",-90],PARAMETER[\"central_meridian\",-54],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",7500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, "SG\",\"22197\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 22234, "epsg", 22234, "Cape / UTM zone 34S"); + add_proj4text (p, 0, + "+proj=utm +zone=34 +south +a=6378249.145 +b=6356514.9663"); + add_proj4text (p, 1, "98753 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Cape / UTM zone 34S\",GEOGCS[\"Cape\",DATUM[\"C"); + add_srs_wkt (p, 1, + "ape\",SPHEROID[\"Clarke 1880 (Arc)\",6378249.145,293.466"); + add_srs_wkt (p, 2, + "3077,AUTHORITY[\"EPSG\",\"7013\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6222\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4222\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",21],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 9, + "\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"22234"); + add_srs_wkt (p, 11, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22235, "epsg", 22235, "Cape / UTM zone 35S"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +south +a=6378249.145 +b=6356514.9663"); + add_proj4text (p, 1, "98753 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Cape / UTM zone 35S\",GEOGCS[\"Cape\",DATUM[\"C"); + add_srs_wkt (p, 1, + "ape\",SPHEROID[\"Clarke 1880 (Arc)\",6378249.145,293.466"); + add_srs_wkt (p, 2, + "3077,AUTHORITY[\"EPSG\",\"7013\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6222\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4222\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",27],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 9, + "\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"22235"); + add_srs_wkt (p, 11, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22236, "epsg", 22236, "Cape / UTM zone 36S"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +south +a=6378249.145 +b=6356514.9663"); + add_proj4text (p, 1, "98753 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Cape / UTM zone 36S\",GEOGCS[\"Cape\",DATUM[\"C"); + add_srs_wkt (p, 1, + "ape\",SPHEROID[\"Clarke 1880 (Arc)\",6378249.145,293.466"); + add_srs_wkt (p, 2, + "3077,AUTHORITY[\"EPSG\",\"7013\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6222\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4222\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",33],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 9, + "\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_northing\",10000000],AUTHORITY[\"EPSG\",\"22236"); + add_srs_wkt (p, 11, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22332, "epsg", 22332, + "Carthage / UTM zone 32N"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +a=6378249.2 +b=6356515 +datum=cartha"); + add_proj4text (p, 1, "ge +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Carthage / UTM zone 32N\",GEOGCS[\"Carthage\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Carthage\",SPHEROID[\"Clarke 1880 (IGN)\",6378249"); + add_srs_wkt (p, 2, + ".2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6223\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"422"); + add_srs_wkt (p, 6, + "3\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, + ",\"22332\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NOR"); + add_srs_wkt (p, 12, "TH]]"); + p = add_epsg_def (first, last, 22391, "epsg", 22391, + "Carthage / Nord Tunisie"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36 +lat_0=36 +lon_0=9.9 +k_0=0.99962554"); + add_proj4text (p, 1, + "4 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +datum"); + add_proj4text (p, 2, "=carthage +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Carthage / Nord Tunisie\",GEOGCS[\"Carthage\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Carthage\",SPHEROID[\"Clarke 1880 (IGN)\",6378249"); + add_srs_wkt (p, 2, + ".2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6223\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"422"); + add_srs_wkt (p, 6, + "3\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",36],PARAMETER[\"central_meridian\",9.9"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.999625544],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",500000],PARAMETER[\"false_northing\",30000"); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"22391\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 22392, "epsg", 22392, + "Carthage / Sud Tunisie"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=9.9 +k_0=0.9996"); + add_proj4text (p, 1, + "25769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +d"); + add_proj4text (p, 2, "atum=carthage +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Carthage / Sud Tunisie\",GEOGCS[\"Carthage\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Carthage\",SPHEROID[\"Clarke 1880 (IGN)\",6378249."); + add_srs_wkt (p, 2, + "2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6223\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4223"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lati"); + add_srs_wkt (p, 8, + "tude_of_origin\",33.3],PARAMETER[\"central_meridian\",9."); + add_srs_wkt (p, 9, + "9],PARAMETER[\"scale_factor\",0.999625769],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",500000],PARAMETER[\"false_northing\",3000"); + add_srs_wkt (p, 11, + "00],AUTHORITY[\"EPSG\",\"22392\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 22521, "epsg", 22521, + "Corrego Alegre / UTM zone 21S"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +south +ellps=intl +towgs84=-206,172,"); + add_proj4text (p, 1, "-6,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Corrego Alegre / UTM zone 21S\",GEOGCS[\"Correg"); + add_srs_wkt (p, 1, + "o Alegre\",DATUM[\"Corrego_Alegre\",SPHEROID[\"Internati"); + add_srs_wkt (p, 2, + "onal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[-206,172,-6,0,0,0,0],AUTHORITY[\"EPSG\",\"6225\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4225\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-57],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"22521\"],AXIS"); + add_srs_wkt (p, 12, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22522, "epsg", 22522, + "Corrego Alegre / UTM zone 22S"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +south +ellps=intl +towgs84=-206,172,"); + add_proj4text (p, 1, "-6,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Corrego Alegre / UTM zone 22S\",GEOGCS[\"Correg"); + add_srs_wkt (p, 1, + "o Alegre\",DATUM[\"Corrego_Alegre\",SPHEROID[\"Internati"); + add_srs_wkt (p, 2, + "onal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[-206,172,-6,0,0,0,0],AUTHORITY[\"EPSG\",\"6225\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4225\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-51],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"22522\"],AXIS"); + add_srs_wkt (p, 12, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22523, "epsg", 22523, + "Corrego Alegre / UTM zone 23S"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +south +ellps=intl +towgs84=-206,172,"); + add_proj4text (p, 1, "-6,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Corrego Alegre / UTM zone 23S\",GEOGCS[\"Correg"); + add_srs_wkt (p, 1, + "o Alegre\",DATUM[\"Corrego_Alegre\",SPHEROID[\"Internati"); + add_srs_wkt (p, 2, + "onal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[-206,172,-6,0,0,0,0],AUTHORITY[\"EPSG\",\"6225\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4225\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-45],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"22523\"],AXIS"); + add_srs_wkt (p, 12, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22524, "epsg", 22524, + "Corrego Alegre / UTM zone 24S"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +south +ellps=intl +towgs84=-206,172,"); + add_proj4text (p, 1, "-6,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Corrego Alegre / UTM zone 24S\",GEOGCS[\"Correg"); + add_srs_wkt (p, 1, + "o Alegre\",DATUM[\"Corrego_Alegre\",SPHEROID[\"Internati"); + add_srs_wkt (p, 2, + "onal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[-206,172,-6,0,0,0,0],AUTHORITY[\"EPSG\",\"6225\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4225\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-39],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"22524\"],AXIS"); + add_srs_wkt (p, 12, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22525, "epsg", 22525, + "Corrego Alegre / UTM zone 25S"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +south +ellps=intl +towgs84=-206,172,"); + add_proj4text (p, 1, "-6,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Corrego Alegre / UTM zone 25S\",GEOGCS[\"Correg"); + add_srs_wkt (p, 1, + "o Alegre\",DATUM[\"Corrego_Alegre\",SPHEROID[\"Internati"); + add_srs_wkt (p, 2, + "onal 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[-206,172,-6,0,0,0,0],AUTHORITY[\"EPSG\",\"6225\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 5, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 6, + "122\"]],AUTHORITY[\"EPSG\",\"4225\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-33],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"22525\"],AXIS"); + add_srs_wkt (p, 12, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22700, "epsg", 22700, + "Deir ez Zor / Levant Zone"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.65 +lat_0=34.65 +lon_0=37.35 +k_0=0."); + add_proj4text (p, 1, + "9996256 +x_0=300000 +y_0=300000 +a=6378249.2 +b=6356515 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Deir ez Zor / Levant Zone\",GEOGCS[\"Deir ez Zo"); + add_srs_wkt (p, 1, + "r\",DATUM[\"Deir_ez_Zor\",SPHEROID[\"Clarke 1880 (IGN)\""); + add_srs_wkt (p, 2, + ",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6227\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4227\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"latitude_of_origin\",34.65],PARAMETER[\"central_mer"); + add_srs_wkt (p, 9, + "idian\",37.35],PARAMETER[\"scale_factor\",0.9996256],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",300000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",300000],AUTHORITY[\"EPSG\",\"22700\"],AXIS[\"X\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 22770, "epsg", 22770, + "Deir ez Zor / Syria Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.65 +lat_0=34.65 +lon_0=37.35 +k_0=0."); + add_proj4text (p, 1, + "9996256 +x_0=300000 +y_0=300000 +a=6378249.2 +b=6356515 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Deir ez Zor / Syria Lambert\",GEOGCS[\"Deir ez "); + add_srs_wkt (p, 1, + "Zor\",DATUM[\"Deir_ez_Zor\",SPHEROID[\"Clarke 1880 (IGN)"); + add_srs_wkt (p, 2, + "\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6227\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4227\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",34.65],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",37.35],PARAMETER[\"scale_factor\",0.9996256],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",300000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",300000],AUTHORITY[\"EPSG\",\"22770\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 22780, "epsg", 22780, + "Deir ez Zor / Levant Stereographic"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=34.2 +lon_0=39.15 +k=0.9995341 +x_0="); + add_proj4text (p, 1, "0 +y_0=0 +a=6378249.2 +b=6356515 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Deir ez Zor / Levant Stereographic\",GEOGCS[\"D"); + add_srs_wkt (p, 1, + "eir ez Zor\",DATUM[\"Deir_ez_Zor\",SPHEROID[\"Clarke 188"); + add_srs_wkt (p, 2, + "0 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7011\"]],AUTHORITY[\"EPSG\",\"6227\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4227\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Oblique_Stereographic\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",34.2],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",39.15],PARAMETER[\"scale_factor\",0.9995341],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",0],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"22780\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 22832, "epsg", 22832, + "Douala / UTM zone 32N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +a=6378249.2 +b=6356515 +units=m +no_"); + add_proj4text (p, 1, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Douala / UTM zone 32N (deprecated)\",GEOGCS[\"D"); + add_srs_wkt (p, 1, + "ouala\",DATUM[\"Douala\",SPHEROID[\"Clarke 1880 (IGN)\","); + add_srs_wkt (p, 2, + "6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6228\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "5199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4228\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",9],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"22832\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 22991, "epsg", 22991, + "Egypt 1907 / Blue Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=35 +k=1 +x_0=300000 +y_0=11"); + add_proj4text (p, 1, "00000 +ellps=helmert +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Egypt 1907 / Blue Belt\",GEOGCS[\"Egypt 1907\","); + add_srs_wkt (p, 1, + "DATUM[\"Egypt_1907\",SPHEROID[\"Helmert 1906\",6378200,2"); + add_srs_wkt (p, 2, + "98.3,AUTHORITY[\"EPSG\",\"7020\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6229\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4229\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",30],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"central_meridian\",35],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 9, + "r\",1],PARAMETER[\"false_easting\",300000],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_northing\",1100000],AUTHORITY[\"EPSG\",\"22991\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22992, "epsg", 22992, + "Egypt 1907 / Red Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=31 +k=1 +x_0=615000 +y_0=81"); + add_proj4text (p, 1, "0000 +ellps=helmert +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Egypt 1907 / Red Belt\",GEOGCS[\"Egypt 1907\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Egypt_1907\",SPHEROID[\"Helmert 1906\",6378200,29"); + add_srs_wkt (p, 2, + "8.3,AUTHORITY[\"EPSG\",\"7020\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "229\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4229\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 7, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",30],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",31],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 9, + "\",1],PARAMETER[\"false_easting\",615000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",810000],AUTHORITY[\"EPSG\",\"22992\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22993, "epsg", 22993, + "Egypt 1907 / Purple Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=27 +k=1 +x_0=700000 +y_0=20"); + add_proj4text (p, 1, "0000 +ellps=helmert +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Egypt 1907 / Purple Belt\",GEOGCS[\"Egypt 1907\""); + add_srs_wkt (p, 1, + ",DATUM[\"Egypt_1907\",SPHEROID[\"Helmert 1906\",6378200,"); + add_srs_wkt (p, 2, + "298.3,AUTHORITY[\"EPSG\",\"7020\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6229\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4229\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",30],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"central_meridian\",27],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 9, + "r\",1],PARAMETER[\"false_easting\",700000],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_northing\",200000],AUTHORITY[\"EPSG\",\"22993\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 22994, "epsg", 22994, + "Egypt 1907 / Extended Purple Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=27 +k=1 +x_0=700000 +y_0=12"); + add_proj4text (p, 1, "00000 +ellps=helmert +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Egypt 1907 / Extended Purple Belt\",GEOGCS[\"Eg"); + add_srs_wkt (p, 1, + "ypt 1907\",DATUM[\"Egypt_1907\",SPHEROID[\"Helmert 1906\""); + add_srs_wkt (p, 2, + ",6378200,298.3,AUTHORITY[\"EPSG\",\"7020\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6229\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4229\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",30],PARAMETER[\"central_meridian\",27],PARAMETER[\"sc"); + add_srs_wkt (p, 9, + "ale_factor\",1],PARAMETER[\"false_easting\",700000],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_northing\",1200000],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 11, + "2994\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 23028, "epsg", 23028, "ED50 / UTM zone 28N"); + add_proj4text (p, 0, "+proj=utm +zone=28 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 28N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",-15],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 9, + "tor\",0.9996],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23028\"],"); + add_srs_wkt (p, 11, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23029, "epsg", 23029, "ED50 / UTM zone 29N"); + add_proj4text (p, 0, "+proj=utm +zone=29 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 29N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",-9],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23029\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23030, "epsg", 23030, "ED50 / UTM zone 30N"); + add_proj4text (p, 0, "+proj=utm +zone=30 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 30N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",-3],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23030\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23031, "epsg", 23031, "ED50 / UTM zone 31N"); + add_proj4text (p, 0, "+proj=utm +zone=31 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 31N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",3],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 9, + "r\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23031\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23032, "epsg", 23032, "ED50 / UTM zone 32N"); + add_proj4text (p, 0, "+proj=utm +zone=32 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 32N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",9],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 9, + "r\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23032\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23033, "epsg", 23033, "ED50 / UTM zone 33N"); + add_proj4text (p, 0, "+proj=utm +zone=33 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 33N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",15],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23033\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23034, "epsg", 23034, "ED50 / UTM zone 34N"); + add_proj4text (p, 0, "+proj=utm +zone=34 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 34N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",21],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23034\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23035, "epsg", 23035, "ED50 / UTM zone 35N"); + add_proj4text (p, 0, "+proj=utm +zone=35 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 35N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",27],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23035\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23036, "epsg", 23036, "ED50 / UTM zone 36N"); + add_proj4text (p, 0, "+proj=utm +zone=36 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 36N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",33],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23036\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23037, "epsg", 23037, "ED50 / UTM zone 37N"); + add_proj4text (p, 0, "+proj=utm +zone=37 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 37N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",39],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23037\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23038, "epsg", 23038, "ED50 / UTM zone 38N"); + add_proj4text (p, 0, "+proj=utm +zone=38 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / UTM zone 38N\",GEOGCS[\"ED50\",DATUM[\"E"); + add_srs_wkt (p, 1, + "uropean_Datum_1950\",SPHEROID[\"International 1924\",637"); + add_srs_wkt (p, 2, + "8388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",45],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23038\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23090, "epsg", 23090, "ED50 / TM 0 N"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=0 +k=0.9996 +x_0=500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / TM 0 N\",GEOGCS[\"ED50\",DATUM[\"Europea"); + add_srs_wkt (p, 1, + "n_Datum_1950\",SPHEROID[\"International 1924\",6378388,2"); + add_srs_wkt (p, 2, + "97,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"62"); + add_srs_wkt (p, 3, + "30\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",0],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"23090\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23095, "epsg", 23095, "ED50 / TM 5 NE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=5 +k=0.9996 +x_0=500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ED50 / TM 5 NE\",GEOGCS[\"ED50\",DATUM[\"Europe"); + add_srs_wkt (p, 1, + "an_Datum_1950\",SPHEROID[\"International 1924\",6378388,"); + add_srs_wkt (p, 2, + "297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "230\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4230\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 7, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARA"); + add_srs_wkt (p, 8, + "METER[\"central_meridian\",5],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 9, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_northing\",0],AUTHORITY[\"EPSG\",\"23095\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23239, "epsg", 23239, + "Fahud / UTM zone 39N"); + add_proj4text (p, 0, "+proj=utm +zone=39 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Fahud / UTM zone 39N\",GEOGCS[\"Fahud\",DATUM[\""); + add_srs_wkt (p, 1, + "Fahud\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.4"); + add_srs_wkt (p, 2, + "65,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"62"); + add_srs_wkt (p, 3, + "32\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4232\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",51],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 9, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"23239\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23240, "epsg", 23240, + "Fahud / UTM zone 40N"); + add_proj4text (p, 0, "+proj=utm +zone=40 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Fahud / UTM zone 40N\",GEOGCS[\"Fahud\",DATUM[\""); + add_srs_wkt (p, 1, + "Fahud\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.4"); + add_srs_wkt (p, 2, + "65,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"62"); + add_srs_wkt (p, 3, + "32\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4232\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",57],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 9, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"23240\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23433, "epsg", 23433, + "Garoua / UTM zone 33N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +a=6378249.2 +b=6356515 +units=m +no_"); + add_proj4text (p, 1, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Garoua / UTM zone 33N (deprecated)\",GEOGCS[\"G"); + add_srs_wkt (p, 1, + "aroua\",DATUM[\"Garoua\",SPHEROID[\"Clarke 1880 (IGN)\","); + add_srs_wkt (p, 2, + "6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6234\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "5199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4234\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",15],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"23433\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 23700, "epsg", 23700, "HD72 / EOV"); + add_proj4text (p, 0, + "+proj=somerc +lat_0=47.14439372222222 +lon_0=19.04857177"); + add_proj4text (p, 1, + "777778 +k_0=0.99993 +x_0=650000 +y_0=200000 +ellps=GRS67"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"HD72 / EOV\",GEOGCS[\"HD72\",DATUM[\"Hungarian_"); + add_srs_wkt (p, 1, + "Datum_1972\",SPHEROID[\"GRS 1967\",6378160,298.247167427"); + add_srs_wkt (p, 2, + ",AUTHORITY[\"EPSG\",\"7036\"]],AUTHORITY[\"EPSG\",\"6237"); + add_srs_wkt (p, 3, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 4, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4237\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Hotine_Obl"); + add_srs_wkt (p, 7, + "ique_Mercator\"],PARAMETER[\"latitude_of_center\",47.144"); + add_srs_wkt (p, 8, + "39372222222],PARAMETER[\"longitude_of_center\",19.048571"); + add_srs_wkt (p, 9, + "77777778],PARAMETER[\"azimuth\",90],PARAMETER[\"rectifie"); + add_srs_wkt (p, 10, + "d_grid_angle\",90],PARAMETER[\"scale_factor\",0.99993],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",650000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",200000],AUTHORITY[\"EPSG\",\"23700\"],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"X\",NORTH]]"); + p = add_epsg_def (first, last, 23830, "epsg", 23830, + "DGN95 / Indonesia TM-3 zone 46.2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=94.5 +k=0.9999 +x_0=200000 +"); + add_proj4text (p, 1, + "y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 46.2\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",94.5],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "99],PARAMETER[\"false_easting\",200000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",1500000],AUTHORITY[\"EPSG\",\"23830\"],AXIS"); + add_srs_wkt (p, 12, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23831, "epsg", 23831, + "DGN95 / Indonesia TM-3 zone 47.1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=97.5 +k=0.9999 +x_0=200000 +"); + add_proj4text (p, 1, + "y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 47.1\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",97.5],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "99],PARAMETER[\"false_easting\",200000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",1500000],AUTHORITY[\"EPSG\",\"23831\"],AXIS"); + add_srs_wkt (p, 12, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23832, "epsg", 23832, + "DGN95 / Indonesia TM-3 zone 47.2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=100.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 47.2\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",100.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23832\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23833, "epsg", 23833, + "DGN95 / Indonesia TM-3 zone 48.1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=103.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 48.1\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",103.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23833\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23834, "epsg", 23834, + "DGN95 / Indonesia TM-3 zone 48.2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=106.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 48.2\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",106.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23834\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23835, "epsg", 23835, + "DGN95 / Indonesia TM-3 zone 49.1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=109.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 49.1\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",109.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23835\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23836, "epsg", 23836, + "DGN95 / Indonesia TM-3 zone 49.2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=112.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 49.2\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",112.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23836\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23837, "epsg", 23837, + "DGN95 / Indonesia TM-3 zone 50.1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=115.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 50.1\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",115.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23837\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23838, "epsg", 23838, + "DGN95 / Indonesia TM-3 zone 50.2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=118.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 50.2\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",118.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23838\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23839, "epsg", 23839, + "DGN95 / Indonesia TM-3 zone 51.1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=121.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 51.1\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",121.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23839\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23840, "epsg", 23840, + "DGN95 / Indonesia TM-3 zone 51.2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=124.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 51.2\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",124.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23840\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23841, "epsg", 23841, + "DGN95 / Indonesia TM-3 zone 52.1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=127.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 52.1\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",127.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23841\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23842, "epsg", 23842, + "DGN95 / Indonesia TM-3 zone 52.2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=130.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 52.2\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",130.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23842\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23843, "epsg", 23843, + "DGN95 / Indonesia TM-3 zone 53.1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=133.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 53.1\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",133.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23843\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23844, "epsg", 23844, + "DGN95 / Indonesia TM-3 zone 53.2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=136.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 53.2\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",136.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23844\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23845, "epsg", 23845, + "DGN95 / Indonesia TM-3 zone 54.1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=139.5 +k=0.9999 +x_0=200000 "); + add_proj4text (p, 1, + "+y_0=1500000 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / Indonesia TM-3 zone 54.1\",GEOGCS[\"DGN"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Datum_Geodesi_Nasional_1995\",SPHEROID[\"WG"); + add_srs_wkt (p, 2, + "S 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\""); + add_srs_wkt (p, 3, + "]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 8, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",139.5],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "999],PARAMETER[\"false_easting\",200000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",1500000],AUTHORITY[\"EPSG\",\"23845\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 23846, "epsg", 23846, "ID74 / UTM zone 46N"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +a=6378160 +b=6356774.50408554 +units"); + add_proj4text (p, 1, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 46N\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",93],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, + "G\",\"23846\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 23847, "epsg", 23847, "ID74 / UTM zone 47N"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +a=6378160 +b=6356774.50408554 +units"); + add_proj4text (p, 1, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 47N\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",99],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, + "G\",\"23847\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 23848, "epsg", 23848, "ID74 / UTM zone 48N"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +a=6378160 +b=6356774.50408554 +units"); + add_proj4text (p, 1, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 48N\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",105],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"23848\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 23849, "epsg", 23849, "ID74 / UTM zone 49N"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +a=6378160 +b=6356774.50408554 +units"); + add_proj4text (p, 1, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 49N\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",111],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"23849\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 23850, "epsg", 23850, "ID74 / UTM zone 50N"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +a=6378160 +b=6356774.50408554 +units"); + add_proj4text (p, 1, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 50N\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",117],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"23850\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 23851, "epsg", 23851, "ID74 / UTM zone 51N"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +a=6378160 +b=6356774.50408554 +units"); + add_proj4text (p, 1, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 51N\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",123],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"23851\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 23852, "epsg", 23852, "ID74 / UTM zone 52N"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +a=6378160 +b=6356774.50408554 +units"); + add_proj4text (p, 1, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 52N\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",129],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"23852\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 23853, "epsg", 23853, + "ID74 / UTM zone 53N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +a=6378160 +b=6356774.50408554 +units"); + add_proj4text (p, 1, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 53N (deprecated)\",GEOGCS[\"ID7"); + add_srs_wkt (p, 1, + "4\",DATUM[\"Indonesian_Datum_1974\",SPHEROID[\"Indonesia"); + add_srs_wkt (p, 2, + "n National Spheroid\",6378160,298.247,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7021\"]],AUTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",135],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"23853\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23866, "epsg", 23866, + "DGN95 / UTM zone 46N"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 46N\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",93],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"23866\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23867, "epsg", 23867, + "DGN95 / UTM zone 47N"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 47N\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",99],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"23867\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23868, "epsg", 23868, + "DGN95 / UTM zone 48N"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 48N\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",105],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"23868\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23869, "epsg", 23869, + "DGN95 / UTM zone 49N"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 49N\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",111],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"23869\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23870, "epsg", 23870, + "DGN95 / UTM zone 50N"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 50N\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",117],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"23870\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23871, "epsg", 23871, + "DGN95 / UTM zone 51N"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 51N\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",123],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"23871\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23872, "epsg", 23872, + "DGN95 / UTM zone 52N"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 52N\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",129],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"23872\"],AXIS[\"Easting\",EAST],A"); + add_srs_wkt (p, 12, "XIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23877, "epsg", 23877, + "DGN95 / UTM zone 47S"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +south +ellps=WGS84 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 47S\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",99],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",100"); + add_srs_wkt (p, 11, + "00000],AUTHORITY[\"EPSG\",\"23877\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23878, "epsg", 23878, + "DGN95 / UTM zone 48S"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +south +ellps=WGS84 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 48S\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",105],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",1"); + add_srs_wkt (p, 11, + "0000000],AUTHORITY[\"EPSG\",\"23878\"],AXIS[\"Easting\","); + add_srs_wkt (p, 12, "EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23879, "epsg", 23879, + "DGN95 / UTM zone 49S"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +south +ellps=WGS84 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 49S\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",111],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",1"); + add_srs_wkt (p, 11, + "0000000],AUTHORITY[\"EPSG\",\"23879\"],AXIS[\"Easting\","); + add_srs_wkt (p, 12, "EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23880, "epsg", 23880, + "DGN95 / UTM zone 50S"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +ellps=WGS84 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 50S\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",117],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",1"); + add_srs_wkt (p, 11, + "0000000],AUTHORITY[\"EPSG\",\"23880\"],AXIS[\"Easting\","); + add_srs_wkt (p, 12, "EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23881, "epsg", 23881, + "DGN95 / UTM zone 51S"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +south +ellps=WGS84 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 51S\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",123],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",1"); + add_srs_wkt (p, 11, + "0000000],AUTHORITY[\"EPSG\",\"23881\"],AXIS[\"Easting\","); + add_srs_wkt (p, 12, "EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23882, "epsg", 23882, + "DGN95 / UTM zone 52S"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +south +ellps=WGS84 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 52S\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",129],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",1"); + add_srs_wkt (p, 11, + "0000000],AUTHORITY[\"EPSG\",\"23882\"],AXIS[\"Easting\","); + add_srs_wkt (p, 12, "EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23883, "epsg", 23883, + "DGN95 / UTM zone 53S"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +south +ellps=WGS84 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 53S\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",135],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",1"); + add_srs_wkt (p, 11, + "0000000],AUTHORITY[\"EPSG\",\"23883\"],AXIS[\"Easting\","); + add_srs_wkt (p, 12, "EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23884, "epsg", 23884, + "DGN95 / UTM zone 54S"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +south +ellps=WGS84 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DGN95 / UTM zone 54S\",GEOGCS[\"DGN95\",DATUM[\""); + add_srs_wkt (p, 1, + "Datum_Geodesi_Nasional_1995\",SPHEROID[\"WGS 84\",637813"); + add_srs_wkt (p, 2, + "7,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,"); + add_srs_wkt (p, 3, + "0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6755\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4755\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",141],PARAMETER[\"scale_factor\",0.9996],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",1"); + add_srs_wkt (p, 11, + "0000000],AUTHORITY[\"EPSG\",\"23884\"],AXIS[\"Easting\","); + add_srs_wkt (p, 12, "EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23886, "epsg", 23886, + "ID74 / UTM zone 46S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +south +a=6378160 +b=6356774.50408554"); + add_proj4text (p, 1, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 46S (deprecated)\",GEOGCS[\"ID7"); + add_srs_wkt (p, 1, + "4\",DATUM[\"Indonesian_Datum_1974\",SPHEROID[\"Indonesia"); + add_srs_wkt (p, 2, + "n National Spheroid\",6378160,298.247,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7021\"]],AUTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",93],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",100"); + add_srs_wkt (p, 11, + "00000],AUTHORITY[\"EPSG\",\"23886\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23887, "epsg", 23887, "ID74 / UTM zone 47S"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +south +a=6378160 +b=6356774.50408554"); + add_proj4text (p, 1, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 47S\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",99],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",10000000],AUTHORIT"); + add_srs_wkt (p, 11, + "Y[\"EPSG\",\"23887\"],AXIS[\"Easting\",EAST],AXIS[\"Nort"); + add_srs_wkt (p, 12, "hing\",NORTH]]"); + p = add_epsg_def (first, last, 23888, "epsg", 23888, "ID74 / UTM zone 48S"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +south +a=6378160 +b=6356774.50408554"); + add_proj4text (p, 1, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 48S\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",105],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",10000000],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"23888\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 23889, "epsg", 23889, "ID74 / UTM zone 49S"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +south +a=6378160 +b=6356774.50408554"); + add_proj4text (p, 1, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 49S\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",111],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",10000000],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"23889\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 23890, "epsg", 23890, "ID74 / UTM zone 50S"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +a=6378160 +b=6356774.50408554"); + add_proj4text (p, 1, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 50S\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",117],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",10000000],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"23890\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 23891, "epsg", 23891, "ID74 / UTM zone 51S"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +south +a=6378160 +b=6356774.50408554"); + add_proj4text (p, 1, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 51S\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",123],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",10000000],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"23891\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 23892, "epsg", 23892, "ID74 / UTM zone 52S"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +south +a=6378160 +b=6356774.50408554"); + add_proj4text (p, 1, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 52S\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",129],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",10000000],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"23892\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 23893, "epsg", 23893, "ID74 / UTM zone 53S"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +south +a=6378160 +b=6356774.50408554"); + add_proj4text (p, 1, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 53S\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",135],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",10000000],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"23893\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 23894, "epsg", 23894, "ID74 / UTM zone 54S"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +south +a=6378160 +b=6356774.50408554"); + add_proj4text (p, 1, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ID74 / UTM zone 54S\",GEOGCS[\"ID74\",DATUM[\"I"); + add_srs_wkt (p, 1, + "ndonesian_Datum_1974\",SPHEROID[\"Indonesian National Sp"); + add_srs_wkt (p, 2, + "heroid\",6378160,298.247,AUTHORITY[\"EPSG\",\"7021\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6238\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4238\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",141],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",10000000],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"23894\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 23946, "epsg", 23946, + "Indian 1954 / UTM zone 46N"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +a=6377276.345 +b=6356075.41314024 +t"); + add_proj4text (p, 1, "owgs84=217,823,299,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Indian 1954 / UTM zone 46N\",GEOGCS[\"Indian 19"); + add_srs_wkt (p, 1, + "54\",DATUM[\"Indian_1954\",SPHEROID[\"Everest 1830 (1937"); + add_srs_wkt (p, 2, + " Adjustment)\",6377276.345,300.8017,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7015\"]],TOWGS84[217,823,299,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6239\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4239\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",93],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23946\"],A"); + add_srs_wkt (p, 12, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23947, "epsg", 23947, + "Indian 1954 / UTM zone 47N"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +a=6377276.345 +b=6356075.41314024 +t"); + add_proj4text (p, 1, "owgs84=217,823,299,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Indian 1954 / UTM zone 47N\",GEOGCS[\"Indian 19"); + add_srs_wkt (p, 1, + "54\",DATUM[\"Indian_1954\",SPHEROID[\"Everest 1830 (1937"); + add_srs_wkt (p, 2, + " Adjustment)\",6377276.345,300.8017,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7015\"]],TOWGS84[217,823,299,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6239\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4239\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",99],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",0.9996],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23947\"],A"); + add_srs_wkt (p, 12, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 23948, "epsg", 23948, + "Indian 1954 / UTM zone 48N"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +a=6377276.345 +b=6356075.41314024 +t"); + add_proj4text (p, 1, "owgs84=217,823,299,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Indian 1954 / UTM zone 48N\",GEOGCS[\"Indian 19"); + add_srs_wkt (p, 1, + "54\",DATUM[\"Indian_1954\",SPHEROID[\"Everest 1830 (1937"); + add_srs_wkt (p, 2, + " Adjustment)\",6377276.345,300.8017,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7015\"]],TOWGS84[217,823,299,0,0,0,0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6239\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4239\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",105],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 10, + "tor\",0.9996],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"23948\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24047, "epsg", 24047, + "Indian 1975 / UTM zone 47N"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +a=6377276.345 +b=6356075.41314024 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Indian 1975 / UTM zone 47N\",GEOGCS[\"Indian 19"); + add_srs_wkt (p, 1, + "75\",DATUM[\"Indian_1975\",SPHEROID[\"Everest 1830 (1937"); + add_srs_wkt (p, 2, + " Adjustment)\",6377276.345,300.8017,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7015\"]],AUTHORITY[\"EPSG\",\"6240\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4240\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",99],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"24047\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24048, "epsg", 24048, + "Indian 1975 / UTM zone 48N"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +a=6377276.345 +b=6356075.41314024 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Indian 1975 / UTM zone 48N\",GEOGCS[\"Indian 19"); + add_srs_wkt (p, 1, + "75\",DATUM[\"Indian_1975\",SPHEROID[\"Everest 1830 (1937"); + add_srs_wkt (p, 2, + " Adjustment)\",6377276.345,300.8017,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7015\"]],AUTHORITY[\"EPSG\",\"6240\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4240\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",105],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_easting\",500000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"24048\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24100, "epsg", 24100, + "Jamaica 1875 / Jamaica (Old Grid)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=167"); + add_proj4text (p, 1, + "638.49597 +y_0=121918.90616 +a=6378249.144808011 +b=6356"); + add_proj4text (p, 2, "514.966204134 +to_meter=0.3047972654 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Jamaica 1875 / Jamaica (Old Grid)\",GEOGCS[\"Ja"); + add_srs_wkt (p, 1, + "maica 1875\",DATUM[\"Jamaica_1875\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "80\",6378249.144808011,293.4663076556349,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7034\"]],AUTHORITY[\"EPSG\",\"6241\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4241\"]],UNIT[\"Clarke's foot\",0.304797"); + add_srs_wkt (p, 7, + "2654,AUTHORITY[\"EPSG\",\"9005\"]],PROJECTION[\"Lambert_"); + add_srs_wkt (p, 8, + "Conformal_Conic_1SP\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "18],PARAMETER[\"central_meridian\",-77],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",1],PARAMETER[\"false_easting\",550000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",400000],AUTHORITY[\"EPSG\",\"2410"); + add_srs_wkt (p, 12, + "0\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24200, "epsg", 24200, + "JAD69 / Jamaica National Grid"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=250"); + add_proj4text (p, 1, "000 +y_0=150000 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"JAD69 / Jamaica National Grid\",GEOGCS[\"JAD69\""); + add_srs_wkt (p, 1, + ",DATUM[\"Jamaica_1969\",SPHEROID[\"Clarke 1866\",6378206"); + add_srs_wkt (p, 2, + ".4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6242\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"424"); + add_srs_wkt (p, 6, + "2\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",18],PARAMETER[\"central_meridian\",-77"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",250000],PARAMETER[\"false_northing\",150000],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"24200\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 12, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 24305, "epsg", 24305, + "Kalianpur 1937 / UTM zone 45N"); + add_proj4text (p, 0, + "+proj=utm +zone=45 +a=6377276.345 +b=6356075.41314024 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1937 / UTM zone 45N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1937\",DATUM[\"Kalianpur_1937\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1937 Adjustment)\",6377276.345,300.8017,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7015\"]],AUTHORITY[\"EPSG\",\"6144\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4144\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",87],PARAMETER[\"scale_factor\",0.9996],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"24305\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24306, "epsg", 24306, + "Kalianpur 1937 / UTM zone 46N"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +a=6377276.345 +b=6356075.41314024 +u"); + add_proj4text (p, 1, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1937 / UTM zone 46N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1937\",DATUM[\"Kalianpur_1937\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1937 Adjustment)\",6377276.345,300.8017,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7015\"]],AUTHORITY[\"EPSG\",\"6144\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4144\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",93],PARAMETER[\"scale_factor\",0.9996],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"24306\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24311, "epsg", 24311, + "Kalianpur 1962 / UTM zone 41N"); + add_proj4text (p, 0, + "+proj=utm +zone=41 +a=6377301.243 +b=6356100.230165384 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1962 / UTM zone 41N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1962\",DATUM[\"Kalianpur_1962\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1962 Definition)\",6377301.243,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7044\"]],AUTHORITY[\"EPSG\",\"6145\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4145\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",63],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 11, + "hing\",0],AUTHORITY[\"EPSG\",\"24311\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24312, "epsg", 24312, + "Kalianpur 1962 / UTM zone 42N"); + add_proj4text (p, 0, + "+proj=utm +zone=42 +a=6377301.243 +b=6356100.230165384 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1962 / UTM zone 42N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1962\",DATUM[\"Kalianpur_1962\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1962 Definition)\",6377301.243,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7044\"]],AUTHORITY[\"EPSG\",\"6145\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4145\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",69],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 11, + "hing\",0],AUTHORITY[\"EPSG\",\"24312\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24313, "epsg", 24313, + "Kalianpur 1962 / UTM zone 43N"); + add_proj4text (p, 0, + "+proj=utm +zone=43 +a=6377301.243 +b=6356100.230165384 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1962 / UTM zone 43N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1962\",DATUM[\"Kalianpur_1962\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1962 Definition)\",6377301.243,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7044\"]],AUTHORITY[\"EPSG\",\"6145\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4145\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",75],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 11, + "hing\",0],AUTHORITY[\"EPSG\",\"24313\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24342, "epsg", 24342, + "Kalianpur 1975 / UTM zone 42N"); + add_proj4text (p, 0, + "+proj=utm +zone=42 +a=6377299.151 +b=6356098.145120132 +"); + add_proj4text (p, 1, "towgs84=295,736,257,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / UTM zone 42N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1975 Definition)\",6377299.151,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"414"); + add_srs_wkt (p, 7, + "6\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",69],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"24342\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 24343, "epsg", 24343, + "Kalianpur 1975 / UTM zone 43N"); + add_proj4text (p, 0, + "+proj=utm +zone=43 +a=6377299.151 +b=6356098.145120132 +"); + add_proj4text (p, 1, "towgs84=295,736,257,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / UTM zone 43N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1975 Definition)\",6377299.151,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"414"); + add_srs_wkt (p, 7, + "6\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",75],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"24343\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 24344, "epsg", 24344, + "Kalianpur 1975 / UTM zone 44N"); + add_proj4text (p, 0, + "+proj=utm +zone=44 +a=6377299.151 +b=6356098.145120132 +"); + add_proj4text (p, 1, "towgs84=295,736,257,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / UTM zone 44N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1975 Definition)\",6377299.151,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"414"); + add_srs_wkt (p, 7, + "6\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",81],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"24344\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NOR"); + add_srs_wkt (p, 13, "TH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_20 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 24345, "epsg", 24345, + "Kalianpur 1975 / UTM zone 45N"); + add_proj4text (p, 0, + "+proj=utm +zone=45 +a=6377299.151 +b=6356098.145120132 +"); + add_proj4text (p, 1, "towgs84=295,736,257,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / UTM zone 45N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1975 Definition)\",6377299.151,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"414"); + add_srs_wkt (p, 7, + "6\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",87],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"24345\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 24346, "epsg", 24346, + "Kalianpur 1975 / UTM zone 46N"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +a=6377299.151 +b=6356098.145120132 +"); + add_proj4text (p, 1, "towgs84=295,736,257,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / UTM zone 46N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1975 Definition)\",6377299.151,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"414"); + add_srs_wkt (p, 7, + "6\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",93],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"24346\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 24347, "epsg", 24347, + "Kalianpur 1975 / UTM zone 47N"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +a=6377299.151 +b=6356098.145120132 +"); + add_proj4text (p, 1, "towgs84=295,736,257,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / UTM zone 47N\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1975 Definition)\",6377299.151,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"414"); + add_srs_wkt (p, 7, + "6\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",99],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"24347\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 24370, "epsg", 24370, + "Kalianpur 1880 / India zone 0"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.5 +lat_0=39.5 +lon_0=68 +k_0=0.99846"); + add_proj4text (p, 1, + "154 +x_0=2153865.73916853 +y_0=2368292.194628102 +a=6377"); + add_proj4text (p, 2, + "299.36559538 +b=6356098.359005156 +to_meter=0.9143985307"); + add_proj4text (p, 3, "444408 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1880 / India zone 0\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1880\",DATUM[\"Kalianpur_1880\",SPHEROID[\"Everest ("); + add_srs_wkt (p, 2, + "1830 Definition)\",6377299.36559538,300.8017255433552,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7042\"]],AUTHORITY[\"EPSG\",\"6243\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4243\"]],UNIT[\"Indian yar"); + add_srs_wkt (p, 7, + "d\",0.9143985307444408,AUTHORITY[\"EPSG\",\"9084\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",39.5],PARAMETER[\"central_meridian\",6"); + add_srs_wkt (p, 10, + "8],PARAMETER[\"scale_factor\",0.99846154],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_easting\",2355500],PARAMETER[\"false_northing\",2590"); + add_srs_wkt (p, 12, + "000],AUTHORITY[\"EPSG\",\"24370\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 13, "],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24371, "epsg", 24371, + "Kalianpur 1880 / India zone I"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878"); + add_proj4text (p, 1, + "641 +x_0=2743195.592233322 +y_0=914398.5307444407 +a=637"); + add_proj4text (p, 2, + "7299.36559538 +b=6356098.359005156 +to_meter=0.914398530"); + add_proj4text (p, 3, "7444408 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1880 / India zone I\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1880\",DATUM[\"Kalianpur_1880\",SPHEROID[\"Everest ("); + add_srs_wkt (p, 2, + "1830 Definition)\",6377299.36559538,300.8017255433552,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7042\"]],AUTHORITY[\"EPSG\",\"6243\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4243\"]],UNIT[\"Indian yar"); + add_srs_wkt (p, 7, + "d\",0.9143985307444408,AUTHORITY[\"EPSG\",\"9084\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",32.5],PARAMETER[\"central_meridian\",6"); + add_srs_wkt (p, 10, + "8],PARAMETER[\"scale_factor\",0.99878641],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_easting\",3000000],PARAMETER[\"false_northing\",1000"); + add_srs_wkt (p, 12, + "000],AUTHORITY[\"EPSG\",\"24371\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 13, "],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24372, "epsg", 24372, + "Kalianpur 1880 / India zone IIa"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 "); + add_proj4text (p, 1, + "+x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299"); + add_proj4text (p, 2, + ".36559538 +b=6356098.359005156 +to_meter=0.9143985307444"); + add_proj4text (p, 3, "408 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1880 / India zone IIa\",GEOGCS[\"Kali"); + add_srs_wkt (p, 1, + "anpur 1880\",DATUM[\"Kalianpur_1880\",SPHEROID[\"Everest"); + add_srs_wkt (p, 2, + " (1830 Definition)\",6377299.36559538,300.8017255433552,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7042\"]],AUTHORITY[\"EPSG\",\"6243\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4243\"]],UNIT[\"Indian yar"); + add_srs_wkt (p, 7, + "d\",0.9143985307444408,AUTHORITY[\"EPSG\",\"9084\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",26],PARAMETER[\"central_meridian\",74]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",0.99878641],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",3000000],PARAMETER[\"false_northing\",100000"); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"24372\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24373, "epsg", 24373, + "Kalianpur 1880 / India zone III"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=19 +lat_0=19 +lon_0=80 +k_0=0.99878641 "); + add_proj4text (p, 1, + "+x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299"); + add_proj4text (p, 2, + ".36559538 +b=6356098.359005156 +to_meter=0.9143985307444"); + add_proj4text (p, 3, "408 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1880 / India zone III\",GEOGCS[\"Kali"); + add_srs_wkt (p, 1, + "anpur 1880\",DATUM[\"Kalianpur_1880\",SPHEROID[\"Everest"); + add_srs_wkt (p, 2, + " (1830 Definition)\",6377299.36559538,300.8017255433552,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7042\"]],AUTHORITY[\"EPSG\",\"6243\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4243\"]],UNIT[\"Indian yar"); + add_srs_wkt (p, 7, + "d\",0.9143985307444408,AUTHORITY[\"EPSG\",\"9084\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",19],PARAMETER[\"central_meridian\",80]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",0.99878641],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",3000000],PARAMETER[\"false_northing\",100000"); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"24373\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24374, "epsg", 24374, + "Kalianpur 1880 / India zone IV"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=12 +lat_0=12 +lon_0=80 +k_0=0.99878641 "); + add_proj4text (p, 1, + "+x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299"); + add_proj4text (p, 2, + ".36559538 +b=6356098.359005156 +to_meter=0.9143985307444"); + add_proj4text (p, 3, "408 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1880 / India zone IV\",GEOGCS[\"Kalia"); + add_srs_wkt (p, 1, + "npur 1880\",DATUM[\"Kalianpur_1880\",SPHEROID[\"Everest "); + add_srs_wkt (p, 2, + "(1830 Definition)\",6377299.36559538,300.8017255433552,A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"7042\"]],AUTHORITY[\"EPSG\",\"6243\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4243\"]],UNIT[\"Indian yar"); + add_srs_wkt (p, 7, + "d\",0.9143985307444408,AUTHORITY[\"EPSG\",\"9084\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",12],PARAMETER[\"central_meridian\",80]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",0.99878641],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",3000000],PARAMETER[\"false_northing\",100000"); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"24374\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24375, "epsg", 24375, + "Kalianpur 1937 / India zone IIb"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 "); + add_proj4text (p, 1, + "+x_0=2743185.69 +y_0=914395.23 +a=6377276.345 +b=6356075"); + add_proj4text (p, 2, ".41314024 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1937 / India zone IIb\",GEOGCS[\"Kali"); + add_srs_wkt (p, 1, + "anpur 1937\",DATUM[\"Kalianpur_1937\",SPHEROID[\"Everest"); + add_srs_wkt (p, 2, + " 1830 (1937 Adjustment)\",6377276.345,300.8017,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7015\"]],AUTHORITY[\"EPSG\",\"6144\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4144\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_1SP\"],PARAMETER[\"latitude_of_origin\",26],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",90],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "99878641],PARAMETER[\"false_easting\",2743185.69],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",914395.23],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 12, + "4375\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 24376, "epsg", 24376, + "Kalianpur 1962 / India zone I"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878"); + add_proj4text (p, 1, + "641 +x_0=2743196.4 +y_0=914398.8 +a=6377301.243 +b=63561"); + add_proj4text (p, 2, "00.230165384 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1962 / India zone I\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1962\",DATUM[\"Kalianpur_1962\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1962 Definition)\",6377301.243,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7044\"]],AUTHORITY[\"EPSG\",\"6145\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4145\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_1SP\"],PARAMETER[\"latitude_of_origin\",32.5],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"central_meridian\",68],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.99878641],PARAMETER[\"false_easting\",2743196.4],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",914398.8],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "24376\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 13, "]"); + p = add_epsg_def (first, last, 24377, "epsg", 24377, + "Kalianpur 1962 / India zone IIa"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 "); + add_proj4text (p, 1, + "+x_0=2743196.4 +y_0=914398.8 +a=6377301.243 +b=6356100.2"); + add_proj4text (p, 2, "30165384 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1962 / India zone IIa\",GEOGCS[\"Kali"); + add_srs_wkt (p, 1, + "anpur 1962\",DATUM[\"Kalianpur_1962\",SPHEROID[\"Everest"); + add_srs_wkt (p, 2, + " 1830 (1962 Definition)\",6377301.243,300.8017255,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7044\"]],AUTHORITY[\"EPSG\",\"6145\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4145\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_1SP\"],PARAMETER[\"latitude_of_origin\",26],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"central_meridian\",74],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.99878641],PARAMETER[\"false_easting\",2743196.4],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",914398.8],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, + "24377\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 13, "]"); + p = add_epsg_def (first, last, 24378, "epsg", 24378, + "Kalianpur 1975 / India zone I"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=68 +k_0=0.99878"); + add_proj4text (p, 1, + "641 +x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=63560"); + add_proj4text (p, 2, + "98.145120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / India zone I\",GEOGCS[\"Kalian"); + add_srs_wkt (p, 1, + "pur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1975 Definition)\",6377299.151,300.8017255,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"414"); + add_srs_wkt (p, 7, + "6\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",32.5],PARAMETER[\"central_meridian\",6"); + add_srs_wkt (p, 10, + "8],PARAMETER[\"scale_factor\",0.99878641],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_easting\",2743195.5],PARAMETER[\"false_northing\",91"); + add_srs_wkt (p, 12, + "4398.5],AUTHORITY[\"EPSG\",\"24378\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 13, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24379, "epsg", 24379, + "Kalianpur 1975 / India zone IIa"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=74 +k_0=0.99878641 "); + add_proj4text (p, 1, + "+x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.1"); + add_proj4text (p, 2, + "45120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / India zone IIa\",GEOGCS[\"Kali"); + add_srs_wkt (p, 1, + "anpur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest"); + add_srs_wkt (p, 2, + " 1830 (1975 Definition)\",6377299.151,300.8017255,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "146\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",26],PARAMETER[\"central_meridian\",7"); + add_srs_wkt (p, 10, + "4],PARAMETER[\"scale_factor\",0.99878641],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_easting\",2743195.5],PARAMETER[\"false_northing\",91"); + add_srs_wkt (p, 12, + "4398.5],AUTHORITY[\"EPSG\",\"24379\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 13, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24380, "epsg", 24380, + "Kalianpur 1975 / India zone IIb"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 "); + add_proj4text (p, 1, + "+x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.1"); + add_proj4text (p, 2, + "45120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / India zone IIb\",GEOGCS[\"Kali"); + add_srs_wkt (p, 1, + "anpur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest"); + add_srs_wkt (p, 2, + " 1830 (1975 Definition)\",6377299.151,300.8017255,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "146\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",26],PARAMETER[\"central_meridian\",9"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"scale_factor\",0.99878641],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_easting\",2743195.5],PARAMETER[\"false_northing\",91"); + add_srs_wkt (p, 12, + "4398.5],AUTHORITY[\"EPSG\",\"24380\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 13, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24381, "epsg", 24381, + "Kalianpur 1975 / India zone III"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=19 +lat_0=19 +lon_0=80 +k_0=0.99878641 "); + add_proj4text (p, 1, + "+x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.1"); + add_proj4text (p, 2, + "45120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / India zone III\",GEOGCS[\"Kali"); + add_srs_wkt (p, 1, + "anpur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest"); + add_srs_wkt (p, 2, + " 1830 (1975 Definition)\",6377299.151,300.8017255,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "146\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",19],PARAMETER[\"central_meridian\",8"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"scale_factor\",0.99878641],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_easting\",2743195.5],PARAMETER[\"false_northing\",91"); + add_srs_wkt (p, 12, + "4398.5],AUTHORITY[\"EPSG\",\"24381\"],AXIS[\"Easting\",E"); + add_srs_wkt (p, 13, "AST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24382, "epsg", 24382, + "Kalianpur 1880 / India zone IIb"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=26 +lat_0=26 +lon_0=90 +k_0=0.99878641 "); + add_proj4text (p, 1, + "+x_0=2743195.592233322 +y_0=914398.5307444407 +a=6377299"); + add_proj4text (p, 2, + ".36559538 +b=6356098.359005156 +to_meter=0.9143985307444"); + add_proj4text (p, 3, "408 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1880 / India zone IIb\",GEOGCS[\"Kali"); + add_srs_wkt (p, 1, + "anpur 1880\",DATUM[\"Kalianpur_1880\",SPHEROID[\"Everest"); + add_srs_wkt (p, 2, + " (1830 Definition)\",6377299.36559538,300.8017255433552,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7042\"]],AUTHORITY[\"EPSG\",\"6243\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4243\"]],UNIT[\"Indian yar"); + add_srs_wkt (p, 7, + "d\",0.9143985307444408,AUTHORITY[\"EPSG\",\"9084\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",26],PARAMETER[\"central_meridian\",90]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"scale_factor\",0.99878641],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",3000000],PARAMETER[\"false_northing\",100000"); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"24382\"],AXIS[\"Easting\",EAST],"); + add_srs_wkt (p, 13, "AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24383, "epsg", 24383, + "Kalianpur 1975 / India zone IV"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=12 +lat_0=12 +lon_0=80 +k_0=0.99878641 "); + add_proj4text (p, 1, + "+x_0=2743195.5 +y_0=914398.5 +a=6377299.151 +b=6356098.1"); + add_proj4text (p, 2, + "45120132 +towgs84=295,736,257,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kalianpur 1975 / India zone IV\",GEOGCS[\"Kalia"); + add_srs_wkt (p, 1, + "npur 1975\",DATUM[\"Kalianpur_1975\",SPHEROID[\"Everest "); + add_srs_wkt (p, 2, + "1830 (1975 Definition)\",6377299.151,300.8017255,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7045\"]],TOWGS84[295,736,257,0,0,0,0],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6146\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"41"); + add_srs_wkt (p, 7, + "46\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",12],PARAMETER[\"central_meridian\",80"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.99878641],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_easting\",2743195.5],PARAMETER[\"false_northing\",914"); + add_srs_wkt (p, 12, + "398.5],AUTHORITY[\"EPSG\",\"24383\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 13, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24500, "epsg", 24500, + "Kertau 1968 / Singapore Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=1.287646666666667 +lon_0=103.853002222"); + add_proj4text (p, 1, + "2222 +x_0=30000 +y_0=30000 +a=6377304.063 +b=6356103.038"); + add_proj4text (p, 2, "993155 +towgs84=-11,851,5,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kertau 1968 / Singapore Grid\",GEOGCS[\"Kertau "); + add_srs_wkt (p, 1, + "1968\",DATUM[\"Kertau_1968\",SPHEROID[\"Everest 1830 Mod"); + add_srs_wkt (p, 2, + "ified\",6377304.063,300.8017,AUTHORITY[\"EPSG\",\"7018\""); + add_srs_wkt (p, 3, + "]],TOWGS84[-11,851,5,0,0,0,0],AUTHORITY[\"EPSG\",\"6245\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4245\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Cassini_Soldn"); + add_srs_wkt (p, 8, + "er\"],PARAMETER[\"latitude_of_origin\",1.287646666666667"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",103.8530022222222],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",30000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",30000],AUTHORITY[\"EPSG\",\"24500\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24547, "epsg", 24547, + "Kertau 1968 / UTM zone 47N"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +a=6377304.063 +b=6356103.038993155 +"); + add_proj4text (p, 1, "towgs84=-11,851,5,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kertau 1968 / UTM zone 47N\",GEOGCS[\"Kertau 19"); + add_srs_wkt (p, 1, + "68\",DATUM[\"Kertau_1968\",SPHEROID[\"Everest 1830 Modif"); + add_srs_wkt (p, 2, + "ied\",6377304.063,300.8017,AUTHORITY[\"EPSG\",\"7018\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[-11,851,5,0,0,0,0],AUTHORITY[\"EPSG\",\"6245\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4245\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",99],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"24547\"],AXIS[\"Eas"); + add_srs_wkt (p, 12, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24548, "epsg", 24548, + "Kertau 1968 / UTM zone 48N"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +a=6377304.063 +b=6356103.038993155 +"); + add_proj4text (p, 1, "towgs84=-11,851,5,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kertau 1968 / UTM zone 48N\",GEOGCS[\"Kertau 19"); + add_srs_wkt (p, 1, + "68\",DATUM[\"Kertau_1968\",SPHEROID[\"Everest 1830 Modif"); + add_srs_wkt (p, 2, + "ied\",6377304.063,300.8017,AUTHORITY[\"EPSG\",\"7018\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[-11,851,5,0,0,0,0],AUTHORITY[\"EPSG\",\"6245\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4245\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",105],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"24548\"],AXIS[\"Ea"); + add_srs_wkt (p, 12, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24571, "epsg", 24571, + "Kertau / R.S.O. Malaya (ch) (deprecated)"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=4 +lonc=102.25 +alpha=323.0257905 +k="); + add_proj4text (p, 1, + "0.99984 +x_0=804671.2997750348 +y_0=0 +a=6377304.063 +b="); + add_proj4text (p, 2, + "6356103.038993155 +towgs84=-11,851,5,0,0,0,0 +to_meter=2"); + add_proj4text (p, 3, "0.11678249437587 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Kertau / R.S.O. Malaya (ch) (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Kertau 1968\",DATUM[\"Kertau_1968\",SPHEROID[\"Ever"); + add_srs_wkt (p, 2, + "est 1830 Modified\",6377304.063,300.8017,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7018\"]],TOWGS84[-11,851,5,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 4, + "SG\",\"6245\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4245\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"British chain (Benoit 1895 B)\",20.11678249437587,AUT"); + add_srs_wkt (p, 8, + "HORITY[\"EPSG\",\"9062\"]],PROJECTION[\"Hotine_Oblique_M"); + add_srs_wkt (p, 9, + "ercator\"],PARAMETER[\"latitude_of_center\",4],PARAMETER"); + add_srs_wkt (p, 10, + "[\"longitude_of_center\",102.25],PARAMETER[\"azimuth\",3"); + add_srs_wkt (p, 11, + "23.0257905],PARAMETER[\"rectified_grid_angle\",323.13010"); + add_srs_wkt (p, 12, + "23611111],PARAMETER[\"scale_factor\",0.99984],PARAMETER["); + add_srs_wkt (p, 13, + "\"false_easting\",40000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 14, + ",AUTHORITY[\"EPSG\",\"24571\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 15, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24600, "epsg", 24600, "KOC Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.5 +lat_0=32.5 +lon_0=45 +k_0=0.99878"); + add_proj4text (p, 1, + "64078000001 +x_0=1500000 +y_0=1166200 +ellps=clrk80 +tow"); + add_proj4text (p, 2, "gs84=-294.7,-200.1,525.5,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"KOC Lambert\",GEOGCS[\"KOC\",DATUM[\"Kuwait_Oil"); + add_srs_wkt (p, 1, + "_Company\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,29"); + add_srs_wkt (p, 2, + "3.465,AUTHORITY[\"EPSG\",\"7012\"]],TOWGS84[-294.7,-200."); + add_srs_wkt (p, 3, + "1,525.5,0,0,0,0],AUTHORITY[\"EPSG\",\"6246\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4246\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"latitude_of_origin\",32.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",45],PARAMETER[\"scale_factor\",0.9987"); + add_srs_wkt (p, 10, + "864078],PARAMETER[\"false_easting\",1500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",1166200],AUTHORITY[\"EPSG\",\"24600\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24718, "epsg", 24718, + "La Canoa / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=intl +towgs84=-273.5,110.6,-35"); + add_proj4text (p, 1, "7.9,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"La Canoa / UTM zone 18N\",GEOGCS[\"La Canoa\",D"); + add_srs_wkt (p, 1, + "ATUM[\"La_Canoa\",SPHEROID[\"International 1924\",637838"); + add_srs_wkt (p, 2, + "8,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-273.5,110.6"); + add_srs_wkt (p, 3, + ",-357.9,0,0,0,0],AUTHORITY[\"EPSG\",\"6247\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4247\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-75],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"24718\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24719, "epsg", 24719, + "La Canoa / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=intl +towgs84=-273.5,110.6,-35"); + add_proj4text (p, 1, "7.9,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"La Canoa / UTM zone 19N\",GEOGCS[\"La Canoa\",D"); + add_srs_wkt (p, 1, + "ATUM[\"La_Canoa\",SPHEROID[\"International 1924\",637838"); + add_srs_wkt (p, 2, + "8,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-273.5,110.6"); + add_srs_wkt (p, 3, + ",-357.9,0,0,0,0],AUTHORITY[\"EPSG\",\"6247\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4247\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-69],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"24719\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24720, "epsg", 24720, + "La Canoa / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=intl +towgs84=-273.5,110.6,-35"); + add_proj4text (p, 1, "7.9,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"La Canoa / UTM zone 20N\",GEOGCS[\"La Canoa\",D"); + add_srs_wkt (p, 1, + "ATUM[\"La_Canoa\",SPHEROID[\"International 1924\",637838"); + add_srs_wkt (p, 2, + "8,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-273.5,110.6"); + add_srs_wkt (p, 3, + ",-357.9,0,0,0,0],AUTHORITY[\"EPSG\",\"6247\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4247\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-63],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"24720\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24817, "epsg", 24817, + "PSAD56 / UTM zone 17N"); + add_proj4text (p, 0, "+proj=utm +zone=17 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 17N\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-8"); + add_srs_wkt (p, 9, + "1],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"24817\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 24818, "epsg", 24818, + "PSAD56 / UTM zone 18N"); + add_proj4text (p, 0, "+proj=utm +zone=18 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 18N\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-7"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"24818\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 24819, "epsg", 24819, + "PSAD56 / UTM zone 19N"); + add_proj4text (p, 0, "+proj=utm +zone=19 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 19N\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-6"); + add_srs_wkt (p, 9, + "9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"24819\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 24820, "epsg", 24820, + "PSAD56 / UTM zone 20N"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 20N\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-6"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"24820\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 24821, "epsg", 24821, + "PSAD56 / UTM zone 21N"); + add_proj4text (p, 0, "+proj=utm +zone=21 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 21N\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-5"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"24821\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 24877, "epsg", 24877, + "PSAD56 / UTM zone 17S"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 17S\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-8"); + add_srs_wkt (p, 9, + "1],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",10000000]"); + add_srs_wkt (p, 11, + ",AUTHORITY[\"EPSG\",\"24877\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24878, "epsg", 24878, + "PSAD56 / UTM zone 18S"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 18S\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-7"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",10000000]"); + add_srs_wkt (p, 11, + ",AUTHORITY[\"EPSG\",\"24878\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24879, "epsg", 24879, + "PSAD56 / UTM zone 19S"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 19S\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-6"); + add_srs_wkt (p, 9, + "9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",10000000]"); + add_srs_wkt (p, 11, + ",AUTHORITY[\"EPSG\",\"24879\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24880, "epsg", 24880, + "PSAD56 / UTM zone 20S"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 20S\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-6"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",10000000]"); + add_srs_wkt (p, 11, + ",AUTHORITY[\"EPSG\",\"24880\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24881, "epsg", 24881, + "PSAD56 / UTM zone 21S"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 21S\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-5"); + add_srs_wkt (p, 9, + "7],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",10000000]"); + add_srs_wkt (p, 11, + ",AUTHORITY[\"EPSG\",\"24881\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24882, "epsg", 24882, + "PSAD56 / UTM zone 22S"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / UTM zone 22S\",GEOGCS[\"PSAD56\",DATUM"); + add_srs_wkt (p, 1, + "[\"Provisional_South_American_Datum_1956\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",-5"); + add_srs_wkt (p, 9, + "1],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",500000],PARAMETER[\"false_northing\",10000000]"); + add_srs_wkt (p, 11, + ",AUTHORITY[\"EPSG\",\"24882\"],AXIS[\"Easting\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 24891, "epsg", 24891, + "PSAD56 / Peru west zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-6 +lon_0=-80.5 +k=0.99983008 +x_0=22"); + add_proj4text (p, 1, "2000 +y_0=1426834.743 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / Peru west zone\",GEOGCS[\"PSAD56\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Provisional_South_American_Datum_1956\",SPHEROID[\""); + add_srs_wkt (p, 2, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "22\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",-6],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-80.5],PARAMETER[\"scale_factor\",0.99983008],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",222000],PARAMETER[\"false_northing\",1"); + add_srs_wkt (p, 11, + "426834.743],AUTHORITY[\"EPSG\",\"24891\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 12, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 24892, "epsg", 24892, + "PSAD56 / Peru central zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-9.5 +lon_0=-76 +k=0.99932994 +x_0=72"); + add_proj4text (p, 1, "0000 +y_0=1039979.159 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / Peru central zone\",GEOGCS[\"PSAD56\","); + add_srs_wkt (p, 1, + "DATUM[\"Provisional_South_American_Datum_1956\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7022\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",-9.5],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-76],PARAMETER[\"scale_factor\",0.99932994],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",720000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",1039979.159],AUTHORITY[\"EPSG\",\"24892\"],AXIS[\"X\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 24893, "epsg", 24893, + "PSAD56 / Peru east zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-9.5 +lon_0=-70.5 +k=0.99952992 +x_0="); + add_proj4text (p, 1, + "1324000 +y_0=1040084.558 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"PSAD56 / Peru east zone\",GEOGCS[\"PSAD56\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Provisional_South_American_Datum_1956\",SPHEROID[\""); + add_srs_wkt (p, 2, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "22\"]],AUTHORITY[\"EPSG\",\"6248\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4248\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",-9.5],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",-70.5],PARAMETER[\"scale_factor\",0.99952992],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",1324000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",1040084.558],AUTHORITY[\"EPSG\",\"24893\"],AXIS[\"X\",E"); + add_srs_wkt (p, 12, "AST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 25000, "epsg", 25000, + "Leigon / Ghana Metre Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4.666666666666667 +lon_0=-1 +k=0.9997"); + add_proj4text (p, 1, + "5 +x_0=274319.51 +y_0=0 +ellps=clrk80 +towgs84=-130,29,3"); + add_proj4text (p, 2, "64,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Leigon / Ghana Metre Grid\",GEOGCS[\"Leigon\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Leigon\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.1"); + add_srs_wkt (p, 2, + "45,293.465,AUTHORITY[\"EPSG\",\"7012\"]],TOWGS84[-130,29"); + add_srs_wkt (p, 3, + ",364,0,0,0,0],AUTHORITY[\"EPSG\",\"6250\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4250\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",4.666666666666667],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-1],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "99975],PARAMETER[\"false_easting\",274319.51],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"25000\"],AXIS"); + add_srs_wkt (p, 12, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25231, "epsg", 25231, "Lome / UTM zone 31N"); + add_proj4text (p, 0, + "+proj=utm +zone=31 +a=6378249.2 +b=6356515 +units=m +no_"); + add_proj4text (p, 1, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Lome / UTM zone 31N\",GEOGCS[\"Lome\",DATUM[\"L"); + add_srs_wkt (p, 1, + "ome\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.46602"); + add_srs_wkt (p, 2, + "12936265,AUTHORITY[\"EPSG\",\"7011\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6252\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4252\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",3],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 9, + "r\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"25231\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25391, "epsg", 25391, + "Luzon 1911 / Philippines zone I"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=0.99995 +x_0=500000 +"); + add_proj4text (p, 1, "y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Luzon 1911 / Philippines zone I\",GEOGCS[\"Luzo"); + add_srs_wkt (p, 1, + "n 1911\",DATUM[\"Luzon_1911\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6253\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4253\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",117],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.99995],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"25391\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 25392, "epsg", 25392, + "Luzon 1911 / Philippines zone II"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=119 +k=0.99995 +x_0=500000 +"); + add_proj4text (p, 1, "y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Luzon 1911 / Philippines zone II\",GEOGCS[\"Luz"); + add_srs_wkt (p, 1, + "on 1911\",DATUM[\"Luzon_1911\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6253\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4253\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",119],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.99995],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"25392\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 25393, "epsg", 25393, + "Luzon 1911 / Philippines zone III"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=121 +k=0.99995 +x_0=500000 +"); + add_proj4text (p, 1, "y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Luzon 1911 / Philippines zone III\",GEOGCS[\"Lu"); + add_srs_wkt (p, 1, + "zon 1911\",DATUM[\"Luzon_1911\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6253\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4253\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 8, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",121]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"scale_factor\",0.99995],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"25393\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 12, "]]"); + p = add_epsg_def (first, last, 25394, "epsg", 25394, + "Luzon 1911 / Philippines zone IV"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=0.99995 +x_0=500000 +"); + add_proj4text (p, 1, "y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Luzon 1911 / Philippines zone IV\",GEOGCS[\"Luz"); + add_srs_wkt (p, 1, + "on 1911\",DATUM[\"Luzon_1911\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6253\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4253\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",123],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.99995],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"25394\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 25395, "epsg", 25395, + "Luzon 1911 / Philippines zone V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=125 +k=0.99995 +x_0=500000 +"); + add_proj4text (p, 1, "y_0=0 +ellps=clrk66 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Luzon 1911 / Philippines zone V\",GEOGCS[\"Luzo"); + add_srs_wkt (p, 1, + "n 1911\",DATUM[\"Luzon_1911\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6253\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4253\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",125],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.99995],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"25395\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 25700, "epsg", 25700, + "Makassar (Jakarta) / NEIEZ (deprecated)"); + add_proj4text (p, 0, + "+proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 "); + add_proj4text (p, 1, + "+ellps=bessel +towgs84=-587.8,519.75,145.76,0,0,0,0 +pm="); + add_proj4text (p, 2, "jakarta +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Makassar (Jakarta) / NEIEZ (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Makassar (Jakarta)\",DATUM[\"Makassar_Jakarta\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7004\"]],TOWGS84[-587.8,519.75,145.76,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6804\"]],PRIMEM[\"Jakarta\",106.807"); + add_srs_wkt (p, 5, + "7194444444,AUTHORITY[\"EPSG\",\"8908\"]],UNIT[\"degree\""); + add_srs_wkt (p, 6, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"4804\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 8, + "SG\",\"9001\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",110],PARAMETER[\"scale_factor\",0.997"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_easting\",3900000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",900000],AUTHORITY[\"EPSG\",\"25700\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 25828, "epsg", 25828, + "ETRS89 / UTM zone 28N"); + add_proj4text (p, 0, "+proj=utm +zone=28 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 28N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",-15],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_easting\",500000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"25828\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25829, "epsg", 25829, + "ETRS89 / UTM zone 29N"); + add_proj4text (p, 0, "+proj=utm +zone=29 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 29N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"25829\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25830, "epsg", 25830, + "ETRS89 / UTM zone 30N"); + add_proj4text (p, 0, "+proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 30N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",-3],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"25830\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25831, "epsg", 25831, + "ETRS89 / UTM zone 31N"); + add_proj4text (p, 0, "+proj=utm +zone=31 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 31N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",3],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"25831\"],AXIS[\"Easting\",EAST],AXIS[\"N"); + add_srs_wkt (p, 12, "orthing\",NORTH]]"); + p = add_epsg_def (first, last, 25832, "epsg", 25832, + "ETRS89 / UTM zone 32N"); + add_proj4text (p, 0, "+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 32N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"25832\"],AXIS[\"Easting\",EAST],AXIS[\"N"); + add_srs_wkt (p, 12, "orthing\",NORTH]]"); + p = add_epsg_def (first, last, 25833, "epsg", 25833, + "ETRS89 / UTM zone 33N"); + add_proj4text (p, 0, "+proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 33N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",15],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"25833\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25834, "epsg", 25834, + "ETRS89 / UTM zone 34N"); + add_proj4text (p, 0, "+proj=utm +zone=34 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 34N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",21],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"25834\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25835, "epsg", 25835, + "ETRS89 / UTM zone 35N"); + add_proj4text (p, 0, "+proj=utm +zone=35 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 35N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",27],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"25835\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25836, "epsg", 25836, + "ETRS89 / UTM zone 36N"); + add_proj4text (p, 0, "+proj=utm +zone=36 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 36N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",33],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"25836\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25837, "epsg", 25837, + "ETRS89 / UTM zone 37N"); + add_proj4text (p, 0, "+proj=utm +zone=37 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 37N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",39],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"25837\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25838, "epsg", 25838, + "ETRS89 / UTM zone 38N"); + add_proj4text (p, 0, "+proj=utm +zone=38 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / UTM zone 38N\",GEOGCS[\"ETRS89\",DATUM"); + add_srs_wkt (p, 1, + "[\"European_Terrestrial_Reference_System_1989\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",45],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"25838\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 25884, "epsg", 25884, + "ETRS89 / TM Baltic93"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"ETRS89 / TM Baltic93\",GEOGCS[\"ETRS89\",DATUM["); + add_srs_wkt (p, 1, + "\"European_Terrestrial_Reference_System_1989\",SPHEROID["); + add_srs_wkt (p, 2, + "\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6258\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4258\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 9, + ",24],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"25884\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 12, "AST]]"); + p = add_epsg_def (first, last, 25932, "epsg", 25932, + "Malongo 1987 / UTM zone 32S"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +south +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Malongo 1987 / UTM zone 32S\",GEOGCS[\"Malongo "); + add_srs_wkt (p, 1, + "1987\",DATUM[\"Malongo_1987\",SPHEROID[\"International 1"); + add_srs_wkt (p, 2, + "924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6259\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4259\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"s"); + add_srs_wkt (p, 9, + "cale_factor\",0.9996],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, + "G\",\"25932\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 26191, "epsg", 26191, + "Merchich / Nord Maroc"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=-5.4 +k_0=0.999"); + add_proj4text (p, 1, + "625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +"); + add_proj4text (p, 2, "towgs84=31,146,47,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Merchich / Nord Maroc\",GEOGCS[\"Merchich\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Merchich\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2"); + add_srs_wkt (p, 2, + ",293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[31,146,47,0,0,0,0],AUTHORITY[\"EPSG\",\"6261\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4261\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Con"); + add_srs_wkt (p, 8, + "ic_1SP\"],PARAMETER[\"latitude_of_origin\",33.3],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-5.4],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999625769],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",300000],AUTHORITY[\"EPSG\",\"2619"); + add_srs_wkt (p, 12, "1\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26192, "epsg", 26192, + "Merchich / Sud Maroc"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=29.7 +lat_0=29.7 +lon_0=-5.4 +k_0=0.999"); + add_proj4text (p, 1, + "6155960000001 +x_0=500000 +y_0=300000 +a=6378249.2 +b=63"); + add_proj4text (p, 2, "56515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Merchich / Sud Maroc\",GEOGCS[\"Merchich\",DATU"); + add_srs_wkt (p, 1, + "M[\"Merchich\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,"); + add_srs_wkt (p, 2, + "293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84["); + add_srs_wkt (p, 3, + "31,146,47,0,0,0,0],AUTHORITY[\"EPSG\",\"6261\"]],PRIMEM["); + add_srs_wkt (p, 4, + "\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"deg"); + add_srs_wkt (p, 5, + "ree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"4261\"]],UNIT[\"metre\",1,AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Coni"); + add_srs_wkt (p, 8, + "c_1SP\"],PARAMETER[\"latitude_of_origin\",29.7],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-5.4],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.999615596],PARAMETER[\"false_easting\",500000],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_northing\",300000],AUTHORITY[\"EPSG\",\"26192"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26193, "epsg", 26193, + "Merchich / Sahara (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=26.1 +lat_0=26.1 +lon_0=-5.4 +k_0=0.999"); + add_proj4text (p, 1, + "6 +x_0=1200000 +y_0=400000 +a=6378249.2 +b=6356515 +towg"); + add_proj4text (p, 2, "s84=31,146,47,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Merchich / Sahara (deprecated)\",GEOGCS[\"Merch"); + add_srs_wkt (p, 1, + "ich\",DATUM[\"Merchich\",SPHEROID[\"Clarke 1880 (IGN)\","); + add_srs_wkt (p, 2, + "6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[31,146,47,0,0,0,0],AUTHORITY[\"EPSG\",\"6261\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4261\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Confo"); + add_srs_wkt (p, 8, + "rmal_Conic_1SP\"],PARAMETER[\"latitude_of_origin\",26.1]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"central_meridian\",-5.4],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9996],PARAMETER[\"false_easting\",1200000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",400000],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "26193\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26194, "epsg", 26194, + "Merchich / Sahara Nord"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=26.1 +lat_0=26.1 +lon_0=-5.4 +k_0=0.999"); + add_proj4text (p, 1, + "616304 +x_0=1200000 +y_0=400000 +a=6378249.2 +b=6356515 "); + add_proj4text (p, 2, "+towgs84=31,146,47,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Merchich / Sahara Nord\",GEOGCS[\"Merchich\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Merchich\",SPHEROID[\"Clarke 1880 (IGN)\",6378249."); + add_srs_wkt (p, 2, + "2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS8"); + add_srs_wkt (p, 3, + "4[31,146,47,0,0,0,0],AUTHORITY[\"EPSG\",\"6261\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4261\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Co"); + add_srs_wkt (p, 8, + "nic_1SP\"],PARAMETER[\"latitude_of_origin\",26.1],PARAME"); + add_srs_wkt (p, 9, + "TER[\"central_meridian\",-5.4],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999616304],PARAMETER[\"false_easting\",1200000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",400000],AUTHORITY[\"EPSG\",\"261"); + add_srs_wkt (p, 12, "94\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26195, "epsg", 26195, + "Merchich / Sahara Sud"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=22.5 +lat_0=22.5 +lon_0=-5.4 +k_0=0.999"); + add_proj4text (p, 1, + "616437 +x_0=1500000 +y_0=400000 +a=6378249.2 +b=6356515 "); + add_proj4text (p, 2, "+towgs84=31,146,47,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Merchich / Sahara Sud\",GEOGCS[\"Merchich\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Merchich\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2"); + add_srs_wkt (p, 2, + ",293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[31,146,47,0,0,0,0],AUTHORITY[\"EPSG\",\"6261\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4261\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Con"); + add_srs_wkt (p, 8, + "ic_1SP\"],PARAMETER[\"latitude_of_origin\",22.5],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-5.4],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.999616437],PARAMETER[\"false_easting\",1500000],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_northing\",400000],AUTHORITY[\"EPSG\",\"261"); + add_srs_wkt (p, 12, "95\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26237, "epsg", 26237, + "Massawa / UTM zone 37N"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +ellps=bessel +towgs84=639,405,60,0,0"); + add_proj4text (p, 1, ",0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Massawa / UTM zone 37N\",GEOGCS[\"Massawa\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Massawa\",SPHEROID[\"Bessel 1841\",6377397.155,299."); + add_srs_wkt (p, 2, + "1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[639,405,60"); + add_srs_wkt (p, 3, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6262\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 4, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 5, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"4262\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",39],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",500000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 11, + "THORITY[\"EPSG\",\"26237\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26331, "epsg", 26331, + "Minna / UTM zone 31N"); + add_proj4text (p, 0, "+proj=utm +zone=31 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Minna / UTM zone 31N\",GEOGCS[\"Minna\",DATUM[\""); + add_srs_wkt (p, 1, + "Minna\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.4"); + add_srs_wkt (p, 2, + "65,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"62"); + add_srs_wkt (p, 3, + "63\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4263\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",3],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26331\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26332, "epsg", 26332, + "Minna / UTM zone 32N"); + add_proj4text (p, 0, "+proj=utm +zone=32 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Minna / UTM zone 32N\",GEOGCS[\"Minna\",DATUM[\""); + add_srs_wkt (p, 1, + "Minna\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,293.4"); + add_srs_wkt (p, 2, + "65,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"62"); + add_srs_wkt (p, 3, + "63\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4263\"]],UNIT[\"metre\""); + add_srs_wkt (p, 6, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 7, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26332\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26391, "epsg", 26391, + "Minna / Nigeria West Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4 +lon_0=4.5 +k=0.99975 +x_0=230738.2"); + add_proj4text (p, 1, "6 +y_0=0 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Minna / Nigeria West Belt\",GEOGCS[\"Minna\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Minna\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145"); + add_srs_wkt (p, 2, + ",293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6263\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4263\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",4],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",4.5],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 9, + "tor\",0.99975],PARAMETER[\"false_easting\",230738.26],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26391"); + add_srs_wkt (p, 11, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26392, "epsg", 26392, + "Minna / Nigeria Mid Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4 +lon_0=8.5 +k=0.99975 +x_0=670553.9"); + add_proj4text (p, 1, "8 +y_0=0 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Minna / Nigeria Mid Belt\",GEOGCS[\"Minna\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Minna\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145,"); + add_srs_wkt (p, 2, + "293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6263\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4263\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",4],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",8.5],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 9, + "tor\",0.99975],PARAMETER[\"false_easting\",670553.98],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26392"); + add_srs_wkt (p, 11, "\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26393, "epsg", 26393, + "Minna / Nigeria East Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=4 +lon_0=12.5 +k=0.99975 +x_0=1110369"); + add_proj4text (p, 1, ".7 +y_0=0 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Minna / Nigeria East Belt\",GEOGCS[\"Minna\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Minna\",SPHEROID[\"Clarke 1880 (RGS)\",6378249.145"); + add_srs_wkt (p, 2, + ",293.465,AUTHORITY[\"EPSG\",\"7012\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6263\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4263\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",4],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",12.5],PARAMETER[\"scale_fa"); + add_srs_wkt (p, 9, + "ctor\",0.99975],PARAMETER[\"false_easting\",1110369.7],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2639"); + add_srs_wkt (p, 11, + "3\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26432, "epsg", 26432, + "Mhast / UTM zone 32S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +south +ellps=intl +towgs84=-252.95,-"); + add_proj4text (p, 1, "4.11,-96.38,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Mhast / UTM zone 32S (deprecated)\",GEOGCS[\"Mh"); + add_srs_wkt (p, 1, + "ast\",DATUM[\"Mhast\",SPHEROID[\"International 1924\",63"); + add_srs_wkt (p, 2, + "78388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-252.95,"); + add_srs_wkt (p, 3, + "-4.11,-96.38,0,0,0,0],AUTHORITY[\"EPSG\",\"6264\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4264\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 11, + "ing\",10000000],AUTHORITY[\"EPSG\",\"26432\"],AXIS[\"Eas"); + add_srs_wkt (p, 12, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26591, "epsg", 26591, + "Monte Mario (Rome) / Italy zone 1 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-3.45233333333333 +k=0.9996 "); + add_proj4text (p, 1, + "+x_0=1500000 +y_0=0 +ellps=intl +pm=rome +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"Monte Mario (Rome) / Italy zone 1 (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"Monte Mario (Rome)\",DATUM[\"Monte_Mario_Rome\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6806\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Rome\",12.45233333333333,AUTHORITY[\"EPSG\",\"8906\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4806\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-3.45233333333333],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",0.9996],PARAMETER[\"false_easting\",1500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"265"); + add_srs_wkt (p, 12, "91\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26592, "epsg", 26592, + "Monte Mario (Rome) / Italy zone 2 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=2.54766666666666 +k=0.9996 +"); + add_proj4text (p, 1, + "x_0=2520000 +y_0=0 +ellps=intl +pm=rome +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Monte Mario (Rome) / Italy zone 2 (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"Monte Mario (Rome)\",DATUM[\"Monte_Mario_Rome\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"International 1924\",6378388,297,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\"6806\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Rome\",12.45233333333333,AUTHORITY[\"EPSG\",\"8906\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4806\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 8, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",2.54766666666666],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.9996],PARAMETER[\"false_easting\",2520000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2659"); + add_srs_wkt (p, 12, "2\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26632, "epsg", 26632, + "M'poraloko / UTM zone 32N"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +a=6378249.2 +b=6356515 +units=m +no_"); + add_proj4text (p, 1, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"M'poraloko / UTM zone 32N\",GEOGCS[\"M'poraloko"); + add_srs_wkt (p, 1, + "\",DATUM[\"M_poraloko\",SPHEROID[\"Clarke 1880 (IGN)\",6"); + add_srs_wkt (p, 2, + "378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6266\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4266\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",9],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26632\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26692, "epsg", 26692, + "M'poraloko / UTM zone 32S"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +south +a=6378249.2 +b=6356515 +units"); + add_proj4text (p, 1, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"M'poraloko / UTM zone 32S\",GEOGCS[\"M'poraloko"); + add_srs_wkt (p, 1, + "\",DATUM[\"M_poraloko\",SPHEROID[\"Clarke 1880 (IGN)\",6"); + add_srs_wkt (p, 2, + "378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6266\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4266\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",9],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",10000000],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"26692\"],AXIS[\"Easting\",EAST],AXIS[\"N"); + add_srs_wkt (p, 12, "orthing\",NORTH]]"); + p = add_epsg_def (first, last, 26701, "epsg", 26701, "NAD27 / UTM zone 1N"); + add_proj4text (p, 0, + "+proj=utm +zone=1 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 1N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-177],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26701\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26702, "epsg", 26702, "NAD27 / UTM zone 2N"); + add_proj4text (p, 0, + "+proj=utm +zone=2 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 2N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-171],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26702\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26703, "epsg", 26703, "NAD27 / UTM zone 3N"); + add_proj4text (p, 0, + "+proj=utm +zone=3 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 3N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-165],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26703\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26704, "epsg", 26704, "NAD27 / UTM zone 4N"); + add_proj4text (p, 0, + "+proj=utm +zone=4 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 4N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-159],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26704\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26705, "epsg", 26705, "NAD27 / UTM zone 5N"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 5N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-153],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26705\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26706, "epsg", 26706, "NAD27 / UTM zone 6N"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 6N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-147],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26706\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26707, "epsg", 26707, "NAD27 / UTM zone 7N"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 7N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-141],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26707\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26708, "epsg", 26708, "NAD27 / UTM zone 8N"); + add_proj4text (p, 0, + "+proj=utm +zone=8 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 8N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-135],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26708\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26709, "epsg", 26709, "NAD27 / UTM zone 9N"); + add_proj4text (p, 0, + "+proj=utm +zone=9 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 9N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-129],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26709\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26710, "epsg", 26710, + "NAD27 / UTM zone 10N"); + add_proj4text (p, 0, + "+proj=utm +zone=10 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 10N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-123],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26710\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26711, "epsg", 26711, + "NAD27 / UTM zone 11N"); + add_proj4text (p, 0, + "+proj=utm +zone=11 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 11N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-117],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26711\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26712, "epsg", 26712, + "NAD27 / UTM zone 12N"); + add_proj4text (p, 0, + "+proj=utm +zone=12 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 12N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-111],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26712\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26713, "epsg", 26713, + "NAD27 / UTM zone 13N"); + add_proj4text (p, 0, + "+proj=utm +zone=13 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 13N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-105],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9996],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26713\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 26714, "epsg", 26714, + "NAD27 / UTM zone 14N"); + add_proj4text (p, 0, + "+proj=utm +zone=14 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 14N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-99],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"26714\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26715, "epsg", 26715, + "NAD27 / UTM zone 15N"); + add_proj4text (p, 0, + "+proj=utm +zone=15 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 15N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-93],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"26715\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26716, "epsg", 26716, + "NAD27 / UTM zone 16N"); + add_proj4text (p, 0, + "+proj=utm +zone=16 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 16N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-87],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"26716\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26717, "epsg", 26717, + "NAD27 / UTM zone 17N"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 17N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-81],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"26717\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26718, "epsg", 26718, + "NAD27 / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 18N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-75],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"26718\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26719, "epsg", 26719, + "NAD27 / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 19N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-69],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"26719\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26720, "epsg", 26720, + "NAD27 / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 20N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-63],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"26720\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26721, "epsg", 26721, + "NAD27 / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 21N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-57],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"26721\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26722, "epsg", 26722, + "NAD27 / UTM zone 22N"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +ellps=clrk66 +datum=NAD27 +units=m +"); + add_proj4text (p, 1, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / UTM zone 22N\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-51],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9996],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"26722\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26729, "epsg", 26729, + "NAD27 / Alabama East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.9"); + add_proj4text (p, 1, + "9996 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum="); + add_proj4text (p, 2, "NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alabama East\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",30.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-85.83333333333333],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.99996],PARAMETER[\"false_easting\",500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2672"); + add_srs_wkt (p, 12, "9\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26730, "epsg", 26730, + "NAD27 / Alabama West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=1"); + add_proj4text (p, 1, + "52400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +unit"); + add_proj4text (p, 2, "s=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alabama West\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",30],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-87.5],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "9933333],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"26730\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26731, "epsg", 26731, + "NAD27 / Alaska zone 1"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=32"); + add_proj4text (p, 1, + "3.1301023611111 +k=0.9999 +x_0=5000000.001016002 +y_0=-5"); + add_proj4text (p, 2, + "000000.001016002 +ellps=clrk66 +datum=NAD27 +units=us-ft"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska zone 1\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Hotine_Oblique"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_center\",57],PARAME"); + add_srs_wkt (p, 9, + "TER[\"longitude_of_center\",-133.6666666666667],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"azimuth\",323.1301023611111],PARAMETER[\"rectified_g"); + add_srs_wkt (p, 11, + "rid_angle\",323.1301023611111],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 12, + ",0.9999],PARAMETER[\"false_easting\",16404166.67],PARAME"); + add_srs_wkt (p, 13, + "TER[\"false_northing\",-16404166.67],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 14, "\"26731\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26732, "epsg", 26732, + "NAD27 / Alaska zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-142 +k=0.9999 +x_0=152400."); + add_proj4text (p, 1, + "3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska zone 2\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",54],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-142],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9999],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26732\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26733, "epsg", 26733, + "NAD27 / Alaska zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-146 +k=0.9999 +x_0=152400."); + add_proj4text (p, 1, + "3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska zone 3\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",54],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-146],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9999],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26733\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26734, "epsg", 26734, + "NAD27 / Alaska zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=152400."); + add_proj4text (p, 1, + "3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska zone 4\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",54],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-150],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9999],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26734\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26735, "epsg", 26735, + "NAD27 / Alaska zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-154 +k=0.9999 +x_0=152400."); + add_proj4text (p, 1, + "3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska zone 5\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",54],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-154],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9999],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26735\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26736, "epsg", 26736, + "NAD27 / Alaska zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-158 +k=0.9999 +x_0=152400."); + add_proj4text (p, 1, + "3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska zone 6\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",54],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-158],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9999],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26736\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26737, "epsg", 26737, + "NAD27 / Alaska zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-162 +k=0.9999 +x_0=213360."); + add_proj4text (p, 1, + "4267208534 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska zone 7\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",54],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-162],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9999],PARAMETER[\"false_easting\",700000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26737\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26738, "epsg", 26738, + "NAD27 / Alaska zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-166 +k=0.9999 +x_0=152400."); + add_proj4text (p, 1, + "3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska zone 8\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",54],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-166],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9999],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26738\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26739, "epsg", 26739, + "NAD27 / Alaska zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-170 +k=0.9999 +x_0=182880."); + add_proj4text (p, 1, + "3657607315 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-f"); + add_proj4text (p, 2, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska zone 9\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",54],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-170],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9999],PARAMETER[\"false_easting\",600000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26739\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26740, "epsg", 26740, + "NAD27 / Alaska zone 10"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333"); + add_proj4text (p, 1, + "334 +lat_0=51 +lon_0=-176 +x_0=914401.8288036576 +y_0=0 "); + add_proj4text (p, 2, "+ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Alaska zone 10\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",53.83"); + add_srs_wkt (p, 9, + "333333333334],PARAMETER[\"standard_parallel_2\",51.83333"); + add_srs_wkt (p, 10, + "333333334],PARAMETER[\"latitude_of_origin\",51],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"central_meridian\",-176],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",3000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"26740\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26741, "epsg", 26741, + "NAD27 / California zone I"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.3"); + add_proj4text (p, 1, + "3333333333334 +lon_0=-122 +x_0=609601.2192024384 +y_0=0 "); + add_proj4text (p, 2, "+ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / California zone I\",GEOGCS[\"NAD27\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866"); + add_srs_wkt (p, 2, + "\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4267\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 7, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 8, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",4"); + add_srs_wkt (p, 9, + "1.66666666666666],PARAMETER[\"standard_parallel_2\",40],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",39.33333333333334],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-122],PARAMETER[\"false_easti"); + add_srs_wkt (p, 12, + "ng\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"26741\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26742, "epsg", 26742, + "NAD27 / California zone II"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=609601.219"); + add_proj4text (p, 2, + "2024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / California zone II\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "39.83333333333334],PARAMETER[\"standard_parallel_2\",38."); + add_srs_wkt (p, 10, + "33333333333334],PARAMETER[\"latitude_of_origin\",37.6666"); + add_srs_wkt (p, 11, + "6666666666],PARAMETER[\"central_meridian\",-122],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_easting\",2000000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 13, + "\",0],AUTHORITY[\"EPSG\",\"26742\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 14, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26743, "epsg", 26743, + "NAD27 / California zone III"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.5 +lon_0=-120.5 +x_0=609601.2192024384 +y_"); + add_proj4text (p, 2, + "0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / California zone III\",GEOGCS[\"NAD27\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "66\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "08\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "38.43333333333333],PARAMETER[\"standard_parallel_2\",37."); + add_srs_wkt (p, 10, + "06666666666667],PARAMETER[\"latitude_of_origin\",36.5],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"central_meridian\",-120.5],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "easting\",2000000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 13, + "RITY[\"EPSG\",\"26743\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 14, "TH]]"); + p = add_epsg_def (first, last, 26744, "epsg", 26744, + "NAD27 / California zone IV"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.3333333333333"); + add_proj4text (p, 1, + "4 +lon_0=-119 +x_0=609601.2192024384 +y_0=0 +ellps=clrk6"); + add_proj4text (p, 2, "6 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / California zone IV\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "37.25],PARAMETER[\"standard_parallel_2\",36],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",35.33333333333334],PARAMETER[\"cent"); + add_srs_wkt (p, 11, + "ral_meridian\",-119],PARAMETER[\"false_easting\",2000000"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 13, "6744\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26745, "epsg", 26745, + "NAD27 / California zone V"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.5 +lon_0=-118 +x_0=609601.2192024384 +y_0="); + add_proj4text (p, 2, "0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / California zone V\",GEOGCS[\"NAD27\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866"); + add_srs_wkt (p, 2, + "\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4267\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 7, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 8, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",3"); + add_srs_wkt (p, 9, + "5.46666666666667],PARAMETER[\"standard_parallel_2\",34.0"); + add_srs_wkt (p, 10, + "3333333333333],PARAMETER[\"latitude_of_origin\",33.5],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"central_meridian\",-118],PARAMETER[\"false_eas"); + add_srs_wkt (p, 12, + "ting\",2000000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 13, + "Y[\"EPSG\",\"26745\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 14, "]"); + p = add_epsg_def (first, last, 26746, "epsg", 26746, + "NAD27 / California zone VI"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=609601."); + add_proj4text (p, 2, + "2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-f"); + add_proj4text (p, 3, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / California zone VI\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "33.88333333333333],PARAMETER[\"standard_parallel_2\",32."); + add_srs_wkt (p, 10, + "78333333333333],PARAMETER[\"latitude_of_origin\",32.1666"); + add_srs_wkt (p, 11, + "6666666666],PARAMETER[\"central_meridian\",-116.25],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_easting\",2000000],PARAMETER[\"false_north"); + add_srs_wkt (p, 13, + "ing\",0],AUTHORITY[\"EPSG\",\"26746\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 14, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26747, "epsg", 26747, + "NAD27 / California zone VII (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.41666666666666 +lat_2=33.86666666666"); + add_proj4text (p, 1, + "667 +lat_0=34.13333333333333 +lon_0=-118.3333333333333 +"); + add_proj4text (p, 2, + "x_0=1276106.450596901 +y_0=127079.524511049 +ellps=clrk6"); + add_proj4text (p, 3, "6 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / California zone VII (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD27\",DATUM[\"North_American_Datum_1927\",SPHEROI"); + add_srs_wkt (p, 2, + "D[\"Clarke 1866\",6378206.4,294.9786982139006,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM"); + add_srs_wkt (p, 4, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 5, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"4267\"]],UNIT[\"US survey foot\",0"); + add_srs_wkt (p, 7, + ".3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTI"); + add_srs_wkt (p, 8, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 9, + "_parallel_1\",34.41666666666666],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 10, + "rallel_2\",33.86666666666667],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 11, + "igin\",34.13333333333333],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 12, + ",-118.3333333333333],PARAMETER[\"false_easting\",4186692"); + add_srs_wkt (p, 13, + ".58],PARAMETER[\"false_northing\",416926.74],AUTHORITY[\""); + add_srs_wkt (p, 14, + "EPSG\",\"26747\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26748, "epsg", 26748, + "NAD27 / Arizona East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD"); + add_proj4text (p, 2, "27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Arizona East\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",31],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-110.1666666666667],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9999],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26748\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26749, "epsg", 26749, + "NAD27 / Arizona Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD"); + add_proj4text (p, 2, "27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Arizona Central\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_M"); + add_srs_wkt (p, 8, + "ercator\"],PARAMETER[\"latitude_of_origin\",31],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-111.9166666666667],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.9999],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 12, "6749\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26750, "epsg", 26750, + "NAD27 / Arizona West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0"); + add_proj4text (p, 1, + "=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +un"); + add_proj4text (p, 2, "its=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Arizona West\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",31],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-113.75],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "999933333],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26750\"],AXI"); + add_srs_wkt (p, 12, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26751, "epsg", 26751, + "NAD27 / Arkansas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=609601.2192"); + add_proj4text (p, 2, + "024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Arkansas North\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",36.23"); + add_srs_wkt (p, 9, + "333333333333],PARAMETER[\"standard_parallel_2\",34.93333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"latitude_of_origin\",34.333333333"); + add_srs_wkt (p, 11, + "33334],PARAMETER[\"central_meridian\",-92],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_easting\",2000000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"26751\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 26752, "epsg", 26752, + "NAD27 / Arkansas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-92 +x_0=609601.2192024384 +y_0=0"); + add_proj4text (p, 2, " +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Arkansas South\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",34.76"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"standard_parallel_2\",33.3],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",32.66666666666666],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-92],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"26752\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26753, "epsg", 26753, + "NAD27 / Colorado North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.71666666666667 +lat_2=40.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=609601.2"); + add_proj4text (p, 2, + "192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Colorado North\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",39.71"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"standard_parallel_2\",40.78333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"latitude_of_origin\",39.333333333"); + add_srs_wkt (p, 11, + "33334],PARAMETER[\"central_meridian\",-105.5],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_easting\",2000000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 13, + "0],AUTHORITY[\"EPSG\",\"26753\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 26754, "epsg", 26754, + "NAD27 / Colorado Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.8333333333"); + add_proj4text (p, 1, + "3334 +lon_0=-105.5 +x_0=609601.2192024384 +y_0=0 +ellps="); + add_proj4text (p, 2, "clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Colorado Central\",GEOGCS[\"NAD27\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",39."); + add_srs_wkt (p, 9, + "75],PARAMETER[\"standard_parallel_2\",38.45],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",37.83333333333334],PARAMETER[\"cent"); + add_srs_wkt (p, 11, + "ral_meridian\",-105.5],PARAMETER[\"false_easting\",20000"); + add_srs_wkt (p, 12, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "26754\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26755, "epsg", 26755, + "NAD27 / Colorado South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=609601.2"); + add_proj4text (p, 2, + "192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Colorado South\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",38.43"); + add_srs_wkt (p, 9, + "333333333333],PARAMETER[\"standard_parallel_2\",37.23333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"latitude_of_origin\",36.666666666"); + add_srs_wkt (p, 11, + "66666],PARAMETER[\"central_meridian\",-105.5],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_easting\",2000000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 13, + "0],AUTHORITY[\"EPSG\",\"26755\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 26756, "epsg", 26756, "NAD27 / Connecticut"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40"); + add_proj4text (p, 1, + ".83333333333334 +lon_0=-72.75 +x_0=182880.3657607315 +y_"); + add_proj4text (p, 2, + "0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Connecticut\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41.86666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",41.2],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"latitude_of_origin\",40.83333333333334],PARAMETER"); + add_srs_wkt (p, 11, + "[\"central_meridian\",-72.75],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",600000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 13, "G\",\"26756\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26757, "epsg", 26757, "NAD27 / Delaware"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999"); + add_proj4text (p, 1, + "995 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=N"); + add_proj4text (p, 2, "AD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Delaware\",GEOGCS[\"NAD27\",DATUM[\"Nor"); + add_srs_wkt (p, 1, + "th_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637820"); + add_srs_wkt (p, 2, + "6.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "67\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",38],PARAMETER[\"cen"); + add_srs_wkt (p, 9, + "tral_meridian\",-75.41666666666667],PARAMETER[\"scale_fa"); + add_srs_wkt (p, 10, + "ctor\",0.999995],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26757\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26758, "epsg", 26758, + "NAD27 / Florida East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datu"); + add_proj4text (p, 2, "m=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Florida East\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",24.33333333333333"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-81],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.999941177],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 12, "6758\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_21 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 26759, "epsg", 26759, + "NAD27 / Florida West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datu"); + add_proj4text (p, 2, "m=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Florida West\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",24.33333333333333"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-82],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.999941177],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 12, "6759\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26760, "epsg", 26760, + "NAD27 / Florida North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=2"); + add_proj4text (p, 1, + "9 +lon_0=-84.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk"); + add_proj4text (p, 2, "66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Florida North\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",30.75"); + add_srs_wkt (p, 9, + "],PARAMETER[\"standard_parallel_2\",29.58333333333333],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"latitude_of_origin\",29],PARAMETER[\"central_"); + add_srs_wkt (p, 11, + "meridian\",-84.5],PARAMETER[\"false_easting\",2000000],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2676"); + add_srs_wkt (p, 13, "0\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26766, "epsg", 26766, + "NAD27 / Georgia East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD"); + add_proj4text (p, 2, "27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Georgia East\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",30],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-82.16666666666667],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9999],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26766\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26767, "epsg", 26767, + "NAD27 / Georgia West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD"); + add_proj4text (p, 2, "27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Georgia West\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",30],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-84.16666666666667],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9999],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26767\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26768, "epsg", 26768, "NAD27 / Idaho East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666"); + add_proj4text (p, 1, + "666667 +k=0.9999473679999999 +x_0=152400.3048006096 +y_0"); + add_proj4text (p, 2, "=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Idaho East\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",41.66666666666666"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-112.1666666666667],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",0.999947368],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"26768\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 26769, "epsg", 26769, + "NAD27 / Idaho Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.99"); + add_proj4text (p, 1, + "99473679999999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk"); + add_proj4text (p, 2, "66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Idaho Central\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",41.66666666666"); + add_srs_wkt (p, 9, + "666],PARAMETER[\"central_meridian\",-114],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",0.999947368],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"26769\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26770, "epsg", 26770, "NAD27 / Idaho West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0"); + add_proj4text (p, 1, + ".999933333 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +"); + add_proj4text (p, 2, "datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Idaho West\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",41.66666666666666"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-115.75],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",0.999933333],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"26770\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26771, "epsg", 26771, + "NAD27 / Illinois East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333"); + add_proj4text (p, 1, + "333333 +k=0.9999749999999999 +x_0=152400.3048006096 +y_0"); + add_proj4text (p, 2, "=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Illinois East\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",36.66666666666"); + add_srs_wkt (p, 9, + "666],PARAMETER[\"central_meridian\",-88.33333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"scale_factor\",0.999975],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"26771\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 26772, "epsg", 26772, + "NAD27 / Illinois West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ell"); + add_proj4text (p, 2, "ps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Illinois West\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",36.66666666666"); + add_srs_wkt (p, 9, + "666],PARAMETER[\"central_meridian\",-90.16666666666667],"); + add_srs_wkt (p, 10, + "PARAMETER[\"scale_factor\",0.999941177],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 12, + "ORITY[\"EPSG\",\"26772\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 13, "RTH]]"); + p = add_epsg_def (first, last, 26773, "epsg", 26773, + "NAD27 / Indiana East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +da"); + add_proj4text (p, 2, "tum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Indiana East\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",37.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-85.66666666666667],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.999966667],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "26773\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26774, "epsg", 26774, + "NAD27 / Indiana West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +da"); + add_proj4text (p, 2, "tum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Indiana West\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",37.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-87.08333333333333],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.999966667],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "26774\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26775, "epsg", 26775, "NAD27 / Iowa North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=41.5 +lon_0=-93.5 +x_0=609601.2192024384 +y_0"); + add_proj4text (p, 2, "=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Iowa North\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",43.26666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",42.06666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",41.5],PARAMETER"); + add_srs_wkt (p, 11, + "[\"central_meridian\",-93.5],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"26775\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26776, "epsg", 26776, "NAD27 / Iowa South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666"); + add_proj4text (p, 1, + "667 +lat_0=40 +lon_0=-93.5 +x_0=609601.2192024384 +y_0=0"); + add_proj4text (p, 2, " +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Iowa South\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41.78333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",40.61666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",40],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-93.5],PARAMETER[\"false_easting\",20"); + add_srs_wkt (p, 12, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"26776\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26777, "epsg", 26777, + "NAD27 / Kansas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=609601.2192"); + add_proj4text (p, 2, + "024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Kansas North\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",39.78333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",38.71666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",38.333333333333"); + add_srs_wkt (p, 11, + "34],PARAMETER[\"central_meridian\",-98],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_easting\",2000000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 13, + "HORITY[\"EPSG\",\"26777\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 14, "ORTH]]"); + p = add_epsg_def (first, last, 26778, "epsg", 26778, + "NAD27 / Kansas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=609601.21"); + add_proj4text (p, 2, + "92024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Kansas South\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",38.56666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",37.26666666"); + add_srs_wkt (p, 10, + "666667],PARAMETER[\"latitude_of_origin\",36.666666666666"); + add_srs_wkt (p, 11, + "66],PARAMETER[\"central_meridian\",-98.5],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_easting\",2000000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 13, + "UTHORITY[\"EPSG\",\"26778\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 26779, "epsg", 26779, + "NAD27 / Kentucky North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=37.5 +lon_0=-84.25 +x_0=609601.2192024384 +y_"); + add_proj4text (p, 2, + "0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Kentucky North\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",37.96"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"standard_parallel_2\",38.96666"); + add_srs_wkt (p, 10, + "666666667],PARAMETER[\"latitude_of_origin\",37.5],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-84.25],PARAMETER[\"false_easti"); + add_srs_wkt (p, 12, + "ng\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"26779\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26780, "epsg", 26780, + "NAD27 / Kentucky South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.73333333333333 +lat_2=37.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=609601.2"); + add_proj4text (p, 2, + "192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Kentucky South\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",36.73"); + add_srs_wkt (p, 9, + "333333333333],PARAMETER[\"standard_parallel_2\",37.93333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"latitude_of_origin\",36.333333333"); + add_srs_wkt (p, 11, + "33334],PARAMETER[\"central_meridian\",-85.75],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_easting\",2000000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 13, + "0],AUTHORITY[\"EPSG\",\"26780\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 14, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 26781, "epsg", 26781, + "NAD27 / Louisiana North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=31.16666666666667 +lat_2=32.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=30.66666666666667 +lon_0=-92.5 +x_0=609601.21"); + add_proj4text (p, 2, + "92024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Louisiana North\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",31."); + add_srs_wkt (p, 9, + "16666666666667],PARAMETER[\"standard_parallel_2\",32.666"); + add_srs_wkt (p, 10, + "66666666666],PARAMETER[\"latitude_of_origin\",30.6666666"); + add_srs_wkt (p, 11, + "6666667],PARAMETER[\"central_meridian\",-92.5],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_easting\",2000000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"26781\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 14, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26782, "epsg", 26782, + "NAD27 / Louisiana South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=29.3 +lat_2=30.7 +lat_0=28.666666666666"); + add_proj4text (p, 1, + "67 +lon_0=-91.33333333333333 +x_0=609601.2192024384 +y_0"); + add_proj4text (p, 2, "=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Louisiana South\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",29."); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",30.7],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",28.66666666666667],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-91.33333333333333],PARAMETER[\"false_east"); + add_srs_wkt (p, 12, + "ing\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"26782\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 14, ""); + p = add_epsg_def (first, last, 26783, "epsg", 26783, "NAD27 / Maine East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.83333333333334 +lon_0=-68.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=N"); + add_proj4text (p, 2, "AD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Maine East\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",43.83333333333334"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-68.5],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",0.9999],PARAMETER[\"false_easting\",500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2678"); + add_srs_wkt (p, 12, "3\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26784, "epsg", 26784, "NAD27 / Maine West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=152400.3048006096 +y_0=0 +ell"); + add_proj4text (p, 2, "ps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Maine West\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",42.83333333333334"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-70.16666666666667],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",0.999966667],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"26784\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 26785, "epsg", 26785, "NAD27 / Maryland"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.3 +lat_2=39.45 +lat_0=37.83333333333"); + add_proj4text (p, 1, + "334 +lon_0=-77 +x_0=243840.4876809754 +y_0=0 +ellps=clrk"); + add_proj4text (p, 2, "66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Maryland\",GEOGCS[\"NAD27\",DATUM[\"Nor"); + add_srs_wkt (p, 1, + "th_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637820"); + add_srs_wkt (p, 2, + "6.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "67\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 8, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",38.3],PARA"); + add_srs_wkt (p, 9, + "METER[\"standard_parallel_2\",39.45],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",37.83333333333334],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-77],PARAMETER[\"false_easting\",800000.00000000"); + add_srs_wkt (p, 12, + "02],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "26785\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26786, "epsg", 26786, + "NAD27 / Massachusetts Mainland"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.71666666666667 +lat_2=42.68333333333"); + add_proj4text (p, 1, + "333 +lat_0=41 +lon_0=-71.5 +x_0=182880.3657607315 +y_0=0"); + add_proj4text (p, 2, " +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Massachusetts Mainland\",GEOGCS[\"NAD27"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 2, + " 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096"); + add_srs_wkt (p, 7, + "012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamber"); + add_srs_wkt (p, 8, + "t_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 9, + "\",41.71666666666667],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 10, + "42.68333333333333],PARAMETER[\"latitude_of_origin\",41],"); + add_srs_wkt (p, 11, + "PARAMETER[\"central_meridian\",-71.5],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "easting\",600000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 13, + "ITY[\"EPSG\",\"26786\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 14, "H]]"); + p = add_epsg_def (first, last, 26787, "epsg", 26787, + "NAD27 / Massachusetts Island"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.28333333333333 +lat_2=41.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=41 +lon_0=-70.5 +x_0=60960.12192024384 +y_0=0"); + add_proj4text (p, 2, " +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Massachusetts Island\",GEOGCS[\"NAD27\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1"); + add_srs_wkt (p, 2, + "866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 7, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_"); + add_srs_wkt (p, 8, + "Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 9, + ",41.28333333333333],PARAMETER[\"standard_parallel_2\",41"); + add_srs_wkt (p, 10, + ".48333333333333],PARAMETER[\"latitude_of_origin\",41],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"central_meridian\",-70.5],PARAMETER[\"false_ea"); + add_srs_wkt (p, 12, + "sting\",200000],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 13, + "Y[\"EPSG\",\"26787\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 14, "]"); + p = add_epsg_def (first, last, 26791, "epsg", 26791, + "NAD27 / Minnesota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.03333333333333 +lat_2=48.63333333333"); + add_proj4text (p, 1, + "333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=609601.21"); + add_proj4text (p, 2, + "92024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Minnesota North\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",47."); + add_srs_wkt (p, 9, + "03333333333333],PARAMETER[\"standard_parallel_2\",48.633"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"latitude_of_origin\",46.5],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-93.1],PARAMETER[\"false_east"); + add_srs_wkt (p, 12, + "ing\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"26791\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 14, ""); + p = add_epsg_def (first, last, 26792, "epsg", 26792, + "NAD27 / Minnesota Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.61666666666667 +lat_2=47.05 +lat_0=4"); + add_proj4text (p, 1, + "5 +lon_0=-94.25 +x_0=609601.2192024384 +y_0=0 +ellps=clr"); + add_proj4text (p, 2, "k66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Minnesota Central\",GEOGCS[\"NAD27\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866"); + add_srs_wkt (p, 2, + "\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4267\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 7, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 8, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",4"); + add_srs_wkt (p, 9, + "5.61666666666667],PARAMETER[\"standard_parallel_2\",47.0"); + add_srs_wkt (p, 10, + "5],PARAMETER[\"latitude_of_origin\",45],PARAMETER[\"cent"); + add_srs_wkt (p, 11, + "ral_meridian\",-94.25],PARAMETER[\"false_easting\",20000"); + add_srs_wkt (p, 12, + "00],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "26792\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26793, "epsg", 26793, + "NAD27 / Minnesota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.78333333333333 +lat_2=45.21666666666"); + add_proj4text (p, 1, + "667 +lat_0=43 +lon_0=-94 +x_0=609601.2192024384 +y_0=0 +"); + add_proj4text (p, 2, "ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Minnesota South\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",43."); + add_srs_wkt (p, 9, + "78333333333333],PARAMETER[\"standard_parallel_2\",45.216"); + add_srs_wkt (p, 10, + "66666666667],PARAMETER[\"latitude_of_origin\",43],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-94],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"26793\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26794, "epsg", 26794, + "NAD27 / Mississippi East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.66666666666667 +lon_0=-88.83333333"); + add_proj4text (p, 1, + "333333 +k=0.99996 +x_0=152400.3048006096 +y_0=0 +ellps=c"); + add_proj4text (p, 2, "lrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Mississippi East\",GEOGCS[\"NAD27\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_M"); + add_srs_wkt (p, 8, + "ercator\"],PARAMETER[\"latitude_of_origin\",29.666666666"); + add_srs_wkt (p, 9, + "66667],PARAMETER[\"central_meridian\",-88.83333333333333"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.99996],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 12, + "ITY[\"EPSG\",\"26794\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 13, "H]]"); + p = add_epsg_def (first, last, 26795, "epsg", 26795, + "NAD27 / Mississippi West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30.5 +lon_0=-90.33333333333333 +k=0.9"); + add_proj4text (p, 1, + "99941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +da"); + add_proj4text (p, 2, "tum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Mississippi West\",GEOGCS[\"NAD27\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_M"); + add_srs_wkt (p, 8, + "ercator\"],PARAMETER[\"latitude_of_origin\",30.5],PARAME"); + add_srs_wkt (p, 9, + "TER[\"central_meridian\",-90.33333333333333],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.999941177],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"26795\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26796, "epsg", 26796, + "NAD27 / Missouri East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.9"); + add_proj4text (p, 1, + "99933333 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +da"); + add_proj4text (p, 2, "tum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Missouri East\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",35.83333333333"); + add_srs_wkt (p, 9, + "334],PARAMETER[\"central_meridian\",-90.5],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.999933333],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"26796\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26797, "epsg", 26797, + "NAD27 / Missouri Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.9"); + add_proj4text (p, 1, + "99933333 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +da"); + add_proj4text (p, 2, "tum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Missouri Central\",GEOGCS[\"NAD27\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_M"); + add_srs_wkt (p, 8, + "ercator\"],PARAMETER[\"latitude_of_origin\",35.833333333"); + add_srs_wkt (p, 9, + "33334],PARAMETER[\"central_meridian\",-92.5],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.999933333],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"26797\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26798, "epsg", 26798, + "NAD27 / Missouri West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.9"); + add_proj4text (p, 1, + "99941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +da"); + add_proj4text (p, 2, "tum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Missouri West\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",36.16666666666"); + add_srs_wkt (p, 9, + "666],PARAMETER[\"central_meridian\",-94.5],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.999941177],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"26798\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26799, "epsg", 26799, + "NAD27 / California zone VII"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.41666666666666 +lat_2=33.86666666666"); + add_proj4text (p, 1, + "667 +lat_0=34.13333333333333 +lon_0=-118.3333333333333 +"); + add_proj4text (p, 2, + "x_0=1276106.450596901 +y_0=1268253.006858014 +ellps=clrk"); + add_proj4text (p, 3, "66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / California zone VII\",GEOGCS[\"NAD27\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "66\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "08\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "34.41666666666666],PARAMETER[\"standard_parallel_2\",33."); + add_srs_wkt (p, 10, + "86666666666667],PARAMETER[\"latitude_of_origin\",34.1333"); + add_srs_wkt (p, 11, + "3333333333],PARAMETER[\"central_meridian\",-118.33333333"); + add_srs_wkt (p, 12, + "33333],PARAMETER[\"false_easting\",4186692.58],PARAMETER"); + add_srs_wkt (p, 13, + "[\"false_northing\",4160926.74],AUTHORITY[\"EPSG\",\"267"); + add_srs_wkt (p, 14, "99\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26801, "epsg", 26801, + "NAD Michigan / Michigan East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.5 +lon_0=-83.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99942857 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548"); + add_proj4text (p, 2, "896 +b=6356826.621488444 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD Michigan / Michigan East\",GEOGCS[\"NAD27 M"); + add_srs_wkt (p, 1, + "ichigan\",DATUM[\"NAD_Michigan\",SPHEROID[\"Clarke 1866 "); + add_srs_wkt (p, 2, + "Michigan\",6378450.047548896,294.9786971646739,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7009\"]],AUTHORITY[\"EPSG\",\"6268\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4268\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",41.5],PARAMETER[\"central_meridian\",-83.666666666"); + add_srs_wkt (p, 10, + "66667],PARAMETER[\"scale_factor\",0.999942857],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"26801\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 26802, "epsg", 26802, + "NAD Michigan / Michigan Old Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.5 +lon_0=-85.75 +k=0.999909091 +x_"); + add_proj4text (p, 1, + "0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=63568"); + add_proj4text (p, 2, "26.621488444 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD Michigan / Michigan Old Central\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD27 Michigan\",DATUM[\"NAD_Michigan\",SPHEROID[\"Clark"); + add_srs_wkt (p, 2, + "e 1866 Michigan\",6378450.047548896,294.9786971646739,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7009\"]],AUTHORITY[\"EPSG\",\"6268\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4268\"]],UNIT[\"US survey "); + add_srs_wkt (p, 7, + "foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",41.5],PARAMETER[\"central_meridian\",-85.75"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.999909091],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_easting\",500000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 12, + "THORITY[\"EPSG\",\"26802\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 26803, "epsg", 26803, + "NAD Michigan / Michigan West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.5 +lon_0=-88.75 +k=0.999909091 +x_"); + add_proj4text (p, 1, + "0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=63568"); + add_proj4text (p, 2, "26.621488444 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD Michigan / Michigan West\",GEOGCS[\"NAD27 M"); + add_srs_wkt (p, 1, + "ichigan\",DATUM[\"NAD_Michigan\",SPHEROID[\"Clarke 1866 "); + add_srs_wkt (p, 2, + "Michigan\",6378450.047548896,294.9786971646739,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7009\"]],AUTHORITY[\"EPSG\",\"6268\"]],PRIME"); + add_srs_wkt (p, 4, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 5, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 6, + "],AUTHORITY[\"EPSG\",\"4268\"]],UNIT[\"US survey foot\","); + add_srs_wkt (p, 7, + "0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",41.5],PARAMETER[\"central_meridian\",-88.75],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.999909091],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"26803\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 26811, "epsg", 26811, + "NAD Michigan / Michigan North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.48333333333333 +lat_2=47.08333333333"); + add_proj4text (p, 1, + "334 +lat_0=44.78333333333333 +lon_0=-87 +x_0=609601.2192"); + add_proj4text (p, 2, + "024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 "); + add_proj4text (p, 3, "+units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD Michigan / Michigan North\",GEOGCS[\"NAD27 "); + add_srs_wkt (p, 1, + "Michigan\",DATUM[\"NAD_Michigan\",SPHEROID[\"Clarke 1866"); + add_srs_wkt (p, 2, + " Michigan\",6378450.047548896,294.9786971646739,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7009\"]],AUTHORITY[\"EPSG\",\"6268\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4268\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",45.48333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",47.08333333333334],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",44.78333333333333],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",-87],PARAMETER[\"false_easting\",2000000],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_northing\",0],AUTHORITY[\"EPSG\",\"26811\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26812, "epsg", 26812, + "NAD Michigan / Michigan Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.18333333333333 +lat_2=45.7 +lat_0=43"); + add_proj4text (p, 1, + ".31666666666667 +lon_0=-84.33333333333333 +x_0=609601.21"); + add_proj4text (p, 2, + "92024384 +y_0=0 +a=6378450.047548896 +b=6356826.62148844"); + add_proj4text (p, 3, "4 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD Michigan / Michigan Central\",GEOGCS[\"NAD2"); + add_srs_wkt (p, 1, + "7 Michigan\",DATUM[\"NAD_Michigan\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "66 Michigan\",6378450.047548896,294.9786971646739,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7009\"]],AUTHORITY[\"EPSG\",\"6268\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4268\"]],UNIT[\"US survey foot"); + add_srs_wkt (p, 7, + "\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_1\",44.18333333333333],PARAMETER[\"standar"); + add_srs_wkt (p, 10, + "d_parallel_2\",45.7],PARAMETER[\"latitude_of_origin\",43"); + add_srs_wkt (p, 11, + ".31666666666667],PARAMETER[\"central_meridian\",-84.3333"); + add_srs_wkt (p, 12, + "3333333333],PARAMETER[\"false_easting\",2000000],PARAMET"); + add_srs_wkt (p, 13, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26812\"],A"); + add_srs_wkt (p, 14, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26813, "epsg", 26813, + "NAD Michigan / Michigan South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.1 +lat_2=43.66666666666666 +lat_0=41"); + add_proj4text (p, 1, + ".5 +lon_0=-84.33333333333333 +x_0=609601.2192024384 +y_0"); + add_proj4text (p, 2, + "=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-f"); + add_proj4text (p, 3, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD Michigan / Michigan South\",GEOGCS[\"NAD27 "); + add_srs_wkt (p, 1, + "Michigan\",DATUM[\"NAD_Michigan\",SPHEROID[\"Clarke 1866"); + add_srs_wkt (p, 2, + " Michigan\",6378450.047548896,294.9786971646739,AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"7009\"]],AUTHORITY[\"EPSG\",\"6268\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4268\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",42.1],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 10, + "43.66666666666666],PARAMETER[\"latitude_of_origin\",41.5"); + add_srs_wkt (p, 11, + "],PARAMETER[\"central_meridian\",-84.33333333333333],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"false_easting\",2000000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 13, + "hing\",0],AUTHORITY[\"EPSG\",\"26813\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 14, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26814, "epsg", 26814, + "NAD83 / Maine East (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maine East (ftUS) (deprecated)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID["); + add_srs_wkt (p, 2, + "\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",43.66666666666666],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-68.5],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "99],PARAMETER[\"false_easting\",300000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"26814\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26815, "epsg", 26815, + "NAD83 / Maine West (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +d"); + add_proj4text (p, 2, "atum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maine West (ftUS) (deprecated)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID["); + add_srs_wkt (p, 2, + "\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",42.83333333333334],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",-70.16666666666667],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.999966667],PARAMETER[\"false_easting\",900000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 12, "6815\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26819, "epsg", 26819, + "NAD83 / Minnesota North (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.00"); + add_proj4text (p, 2, + "00101601 +y_0=99999.99998984 +ellps=GRS80 +datum=NAD83 +"); + add_proj4text (p, 3, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Minnesota North (ftUS) (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"standard_parallel_1\",48.63333333333333]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"standard_parallel_2\",47.03333333333333],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",46.5],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-93.1],PARAMETER[\"false_easting\",800000.00"); + add_srs_wkt (p, 12, + "00101601],PARAMETER[\"false_northing\",99999.99998984],A"); + add_srs_wkt (p, 13, + "UTHORITY[\"EPSG\",\"26819\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 26820, "epsg", 26820, + "NAD83 / Minnesota Central (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=4"); + add_proj4text (p, 1, + "5 +lon_0=-94.25 +x_0=800000.0000101601 +y_0=99999.999989"); + add_proj4text (p, 2, "84 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Minnesota Central (ftUS) (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",47.05],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_2\",45.61666666666667],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",45],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 11, + "-94.25],PARAMETER[\"false_easting\",800000.0000101601],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",99999.99998984],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"26820\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26821, "epsg", 26821, + "NAD83 / Minnesota South (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101601 +y_0=999"); + add_proj4text (p, 2, + "99.99998984 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Minnesota South (ftUS) (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHE"); + add_srs_wkt (p, 2, + "ROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"standard_parallel_1\",45.21666666666667]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"standard_parallel_2\",43.78333333333333],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",43],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",-94],PARAMETER[\"false_easting\",800000.000010"); + add_srs_wkt (p, 12, + "1601],PARAMETER[\"false_northing\",99999.99998984],AUTHO"); + add_srs_wkt (p, 13, + "RITY[\"EPSG\",\"26821\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 14, "TH]]"); + p = add_epsg_def (first, last, 26822, "epsg", 26822, + "NAD83 / Nebraska (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +"); + add_proj4text (p, 1, + "lon_0=-100 +x_0=500000.0000101601 +y_0=0 +ellps=GRS80 +d"); + add_proj4text (p, 2, "atum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Nebraska (ftUS) (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"standard_parallel_1\",43],PARAMETER[\"standard_p"); + add_srs_wkt (p, 9, + "arallel_2\",40],PARAMETER[\"latitude_of_origin\",39.8333"); + add_srs_wkt (p, 10, + "3333333334],PARAMETER[\"central_meridian\",-100],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",500000.0000101601],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",0],AUTHORITY[\"EPSG\",\"26822\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26823, "epsg", 26823, + "NAD83 / West Virginia North (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79."); + add_proj4text (p, 1, + "5 +x_0=1968500 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / West Virginia North (ftUS) (deprecated)"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",40.25],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_2\",39],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 10, + "gin\",38.5],PARAMETER[\"central_meridian\",-79.5],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",1968500],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"26823\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26824, "epsg", 26824, + "NAD83 / West Virginia South (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=37 +lon_0=-81 +x_0=1968500 +y_0=0 +ellps=GRS8"); + add_proj4text (p, 2, "0 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / West Virginia South (ftUS) (deprecated)"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\","); + add_srs_wkt (p, 2, + "SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"standard_parallel_1\",38.8833333333333"); + add_srs_wkt (p, 9, + "3],PARAMETER[\"standard_parallel_2\",37.48333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",37],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-81],PARAMETER[\"false_easting\",1968500],PA"); + add_srs_wkt (p, 12, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26824"); + add_srs_wkt (p, 13, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26825, "epsg", 26825, + "NAD83(HARN) / Maine East (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maine East (ftUS) (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regio"); + add_srs_wkt (p, 2, + "nal_Network\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"615"); + add_srs_wkt (p, 4, + "2\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",43.6666666"); + add_srs_wkt (p, 9, + "6666666],PARAMETER[\"central_meridian\",-68.5],PARAMETER"); + add_srs_wkt (p, 10, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",30"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"26825\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26826, "epsg", 26826, + "NAD83(HARN) / Maine West (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maine West (ftUS) (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regio"); + add_srs_wkt (p, 2, + "nal_Network\",SPHEROID[\"GRS 1980\",6378137,298.25722210"); + add_srs_wkt (p, 3, + "1,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"615"); + add_srs_wkt (p, 4, + "2\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 5, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",42.8333333"); + add_srs_wkt (p, 9, + "3333334],PARAMETER[\"central_meridian\",-70.166666666666"); + add_srs_wkt (p, 10, + "67],PARAMETER[\"scale_factor\",0.999966667],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",900000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"26826\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 26830, "epsg", 26830, + "NAD83(HARN) / Minnesota North (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.00"); + add_proj4text (p, 2, + "00101601 +y_0=99999.99998984 +ellps=GRS80 +units=m +no_d"); + add_proj4text (p, 3, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Minnesota North (ftUS) (deprecate"); + add_srs_wkt (p, 1, + "d)\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_"); + add_srs_wkt (p, 2, + "Regional_Network\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lamb"); + add_srs_wkt (p, 8, + "ert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 9, + "_1\",48.63333333333333],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 10, + ",47.03333333333333],PARAMETER[\"latitude_of_origin\",46."); + add_srs_wkt (p, 11, + "5],PARAMETER[\"central_meridian\",-93.1],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_easting\",800000.0000101601],PARAMETER[\"false_northi"); + add_srs_wkt (p, 13, + "ng\",99999.99998984],AUTHORITY[\"EPSG\",\"26830\"],AXIS["); + add_srs_wkt (p, 14, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26831, "epsg", 26831, + "NAD83(HARN) / Minnesota Central (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=4"); + add_proj4text (p, 1, + "5 +lon_0=-94.25 +x_0=800000.0000101601 +y_0=99999.999989"); + add_proj4text (p, 2, "84 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Minnesota Central (ftUS) (depreca"); + add_srs_wkt (p, 1, + "ted)\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accurac"); + add_srs_wkt (p, 2, + "y_Regional_Network\",SPHEROID[\"GRS 1980\",6378137,298.2"); + add_srs_wkt (p, 3, + "57222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lamb"); + add_srs_wkt (p, 8, + "ert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 9, + "_1\",47.05],PARAMETER[\"standard_parallel_2\",45.6166666"); + add_srs_wkt (p, 10, + "6666667],PARAMETER[\"latitude_of_origin\",45],PARAMETER["); + add_srs_wkt (p, 11, + "\"central_meridian\",-94.25],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",800000.0000101601],PARAMETER[\"false_northing\",99999.9"); + add_srs_wkt (p, 13, + "9998984],AUTHORITY[\"EPSG\",\"26831\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 14, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26832, "epsg", 26832, + "NAD83(HARN) / Minnesota South (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101601 +y_0=999"); + add_proj4text (p, 2, "99.99998984 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Minnesota South (ftUS) (deprecate"); + add_srs_wkt (p, 1, + "d)\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_"); + add_srs_wkt (p, 2, + "Regional_Network\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lamb"); + add_srs_wkt (p, 8, + "ert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 9, + "_1\",45.21666666666667],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 10, + ",43.78333333333333],PARAMETER[\"latitude_of_origin\",43]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"central_meridian\",-94],PARAMETER[\"false_e"); + add_srs_wkt (p, 12, + "asting\",800000.0000101601],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",99999.99998984],AUTHORITY[\"EPSG\",\"26832\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26833, "epsg", 26833, + "NAD83(HARN) / Nebraska (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +"); + add_proj4text (p, 1, + "lon_0=-100 +x_0=500000.0000101601 +y_0=0 +ellps=GRS80 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Nebraska (ftUS) (deprecated)\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regiona"); + add_srs_wkt (p, 2, + "l_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 5, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Confo"); + add_srs_wkt (p, 8, + "rmal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",43],"); + add_srs_wkt (p, 9, + "PARAMETER[\"standard_parallel_2\",40],PARAMETER[\"latitu"); + add_srs_wkt (p, 10, + "de_of_origin\",39.83333333333334],PARAMETER[\"central_me"); + add_srs_wkt (p, 11, + "ridian\",-100],PARAMETER[\"false_easting\",500000.000010"); + add_srs_wkt (p, 12, + "1601],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"26833\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26834, "epsg", 26834, + "NAD83(HARN) / West Virginia North (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79."); + add_proj4text (p, 1, + "5 +x_0=1968500 +y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / West Virginia North (ftUS) (depre"); + add_srs_wkt (p, 1, + "cated)\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accur"); + add_srs_wkt (p, 2, + "acy_Regional_Network\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 3, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_1\",40.25],PARAMETER[\"standard_parallel_2\",39],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",38.5],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-79.5],PARAMETER[\"false_easting\",1968500],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"268"); + add_srs_wkt (p, 13, "34\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26835, "epsg", 26835, + "NAD83(HARN) / West Virginia South (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=37 +lon_0=-81 +x_0=1968500 +y_0=0 +ellps=GRS8"); + add_proj4text (p, 2, "0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / West Virginia South (ftUS) (depre"); + add_srs_wkt (p, 1, + "cated)\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accur"); + add_srs_wkt (p, 2, + "acy_Regional_Network\",SPHEROID[\"GRS 1980\",6378137,298"); + add_srs_wkt (p, 3, + ".257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_1\",38.88333333333333],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 10, + "l_2\",37.48333333333333],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 11, + ",37],PARAMETER[\"central_meridian\",-81],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_easting\",1968500],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 13, + "THORITY[\"EPSG\",\"26835\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 14, "NORTH]]"); + p = add_epsg_def (first, last, 26836, "epsg", 26836, + "NAD83(NSRS2007) / Maine East (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0"); + add_proj4text (p, 2, ",0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maine East (ftUS) (deprecated"); + add_srs_wkt (p, 1, + ")\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Sp"); + add_srs_wkt (p, 2, + "atial_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 3, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 4, + "0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 5, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 6, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 8, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 9, + "METER[\"latitude_of_origin\",43.66666666666666],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"central_meridian\",-68.5],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 11, + ",0.9999],PARAMETER[\"false_easting\",300000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"26836\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26837, "epsg", 26837, + "NAD83(NSRS2007) / Maine West (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +t"); + add_proj4text (p, 2, "owgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maine West (ftUS) (deprecated"); + add_srs_wkt (p, 1, + ")\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Sp"); + add_srs_wkt (p, 2, + "atial_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 3, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84["); + add_srs_wkt (p, 4, + "0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 5, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 6, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 8, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 9, + "METER[\"latitude_of_origin\",42.83333333333334],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"central_meridian\",-70.16666666666667],PARAMETER[\"s"); + add_srs_wkt (p, 11, + "cale_factor\",0.999966667],PARAMETER[\"false_easting\",9"); + add_srs_wkt (p, 12, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"26837\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26841, "epsg", 26841, + "NAD83(NSRS2007) / Minnesota North (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.00"); + add_proj4text (p, 2, + "00101601 +y_0=99999.99998984 +ellps=GRS80 +towgs84=0,0,0"); + add_proj4text (p, 3, ",0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Minnesota North (ftUS) (depre"); + add_srs_wkt (p, 1, + "cated)\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_Nation"); + add_srs_wkt (p, 2, + "al_Spatial_Reference_System_2007\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 3, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 4, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM"); + add_srs_wkt (p, 5, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 6, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 8, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Con"); + add_srs_wkt (p, 9, + "ic_2SP\"],PARAMETER[\"standard_parallel_1\",48.633333333"); + add_srs_wkt (p, 10, + "33333],PARAMETER[\"standard_parallel_2\",47.033333333333"); + add_srs_wkt (p, 11, + "33],PARAMETER[\"latitude_of_origin\",46.5],PARAMETER[\"c"); + add_srs_wkt (p, 12, + "entral_meridian\",-93.1],PARAMETER[\"false_easting\",800"); + add_srs_wkt (p, 13, + "000.0000101601],PARAMETER[\"false_northing\",99999.99998"); + add_srs_wkt (p, 14, + "984],AUTHORITY[\"EPSG\",\"26841\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 15, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26842, "epsg", 26842, + "NAD83(NSRS2007) / Minnesota Central (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=4"); + add_proj4text (p, 1, + "5 +lon_0=-94.25 +x_0=800000.0000101601 +y_0=99999.999989"); + add_proj4text (p, 2, + "84 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Minnesota Central (ftUS) (dep"); + add_srs_wkt (p, 1, + "recated)\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_Nati"); + add_srs_wkt (p, 2, + "onal_Spatial_Reference_System_2007\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 3, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 4, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIM"); + add_srs_wkt (p, 5, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 6, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 7, + "]],AUTHORITY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 8, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 9, + "onic_2SP\"],PARAMETER[\"standard_parallel_1\",47.05],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"standard_parallel_2\",45.61666666666667],PARAME"); + add_srs_wkt (p, 11, + "TER[\"latitude_of_origin\",45],PARAMETER[\"central_merid"); + add_srs_wkt (p, 12, + "ian\",-94.25],PARAMETER[\"false_easting\",800000.0000101"); + add_srs_wkt (p, 13, + "601],PARAMETER[\"false_northing\",99999.99998984],AUTHOR"); + add_srs_wkt (p, 14, + "ITY[\"EPSG\",\"26842\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 15, "H]]"); + p = add_epsg_def (first, last, 26843, "epsg", 26843, + "NAD83(NSRS2007) / Minnesota South (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101601 +y_0=999"); + add_proj4text (p, 2, + "99.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Minnesota South (ftUS) (depre"); + add_srs_wkt (p, 1, + "cated)\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_Nation"); + add_srs_wkt (p, 2, + "al_Spatial_Reference_System_2007\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 3, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOW"); + add_srs_wkt (p, 4, + "GS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM"); + add_srs_wkt (p, 5, + "[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"de"); + add_srs_wkt (p, 6, + "gree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]]"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 8, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Con"); + add_srs_wkt (p, 9, + "ic_2SP\"],PARAMETER[\"standard_parallel_1\",45.216666666"); + add_srs_wkt (p, 10, + "66667],PARAMETER[\"standard_parallel_2\",43.783333333333"); + add_srs_wkt (p, 11, + "33],PARAMETER[\"latitude_of_origin\",43],PARAMETER[\"cen"); + add_srs_wkt (p, 12, + "tral_meridian\",-94],PARAMETER[\"false_easting\",800000."); + add_srs_wkt (p, 13, + "0000101601],PARAMETER[\"false_northing\",99999.99998984]"); + add_srs_wkt (p, 14, + ",AUTHORITY[\"EPSG\",\"26843\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 15, "\",NORTH]]"); + p = add_epsg_def (first, last, 26844, "epsg", 26844, + "NAD83(NSRS2007) / Nebraska (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +"); + add_proj4text (p, 1, + "lon_0=-100 +x_0=500000.0000101601 +y_0=0 +ellps=GRS80 +t"); + add_proj4text (p, 2, "owgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Nebraska (ftUS) (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spati"); + add_srs_wkt (p, 2, + "al_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 3, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0"); + add_srs_wkt (p, 4, + ",0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 5, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 6, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"standard_parallel_1\",43],PARAMETER[\"stan"); + add_srs_wkt (p, 10, + "dard_parallel_2\",40],PARAMETER[\"latitude_of_origin\",3"); + add_srs_wkt (p, 11, + "9.83333333333334],PARAMETER[\"central_meridian\",-100],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_easting\",500000.0000101601],PARAMETER["); + add_srs_wkt (p, 13, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"26844\"],AXIS"); + add_srs_wkt (p, 14, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26845, "epsg", 26845, + "NAD83(NSRS2007) / West Virginia North (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79."); + add_proj4text (p, 1, + "5 +x_0=1968500 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,"); + add_proj4text (p, 2, "0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / West Virginia North (ftUS) (d"); + add_srs_wkt (p, 1, + "eprecated)\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_Na"); + add_srs_wkt (p, 2, + "tional_Spatial_Reference_System_2007\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 3, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 4, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PR"); + add_srs_wkt (p, 5, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 6, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 7, + "\"]],AUTHORITY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 8, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 9, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",40.25],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"standard_parallel_2\",39],PARAMETER[\"latitud"); + add_srs_wkt (p, 11, + "e_of_origin\",38.5],PARAMETER[\"central_meridian\",-79.5"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_easting\",1968500],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",0],AUTHORITY[\"EPSG\",\"26845\"],AXIS[\"X\","); + add_srs_wkt (p, 14, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26846, "epsg", 26846, + "NAD83(NSRS2007) / West Virginia South (ftUS) (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=37 +lon_0=-81 +x_0=1968500 +y_0=0 +ellps=GRS8"); + add_proj4text (p, 2, "0 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / West Virginia South (ftUS) (d"); + add_srs_wkt (p, 1, + "eprecated)\",GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_Na"); + add_srs_wkt (p, 2, + "tional_Spatial_Reference_System_2007\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 3, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 4, + ",TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PR"); + add_srs_wkt (p, 5, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 6, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 7, + "\"]],AUTHORITY[\"EPSG\",\"4759\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 8, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 9, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",38.88333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"standard_parallel_2\",37.48333333"); + add_srs_wkt (p, 11, + "333333],PARAMETER[\"latitude_of_origin\",37],PARAMETER[\""); + add_srs_wkt (p, 12, + "central_meridian\",-81],PARAMETER[\"false_easting\",1968"); + add_srs_wkt (p, 13, + "500],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 14, "\"26846\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26847, "epsg", 26847, + "NAD83 / Maine East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +datum=NA"); + add_proj4text (p, 2, "D83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maine East (ftUS)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",43.66666666666666],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",-68.5],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9999],PARAMETER[\"false_easting\",984250.0000"); + add_srs_wkt (p, 11, + "000002],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"26847\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26848, "epsg", 26848, + "NAD83 / Maine West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +d"); + add_proj4text (p, 2, "atum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maine West (ftUS)\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",42.83333333333334],"); + add_srs_wkt (p, 9, + "PARAMETER[\"central_meridian\",-70.16666666666667],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.999966667],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",2952750],PARAMETER[\"false_northing\",0],AUTHORIT"); + add_srs_wkt (p, 12, + "Y[\"EPSG\",\"26848\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 13, "]"); + p = add_epsg_def (first, last, 26849, "epsg", 26849, + "NAD83 / Minnesota North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.00"); + add_proj4text (p, 2, + "00101599 +y_0=99999.99998983997 +ellps=GRS80 +datum=NAD8"); + add_proj4text (p, 3, "3 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Minnesota North (ftUS)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",48.63"); + add_srs_wkt (p, 9, + "333333333333],PARAMETER[\"standard_parallel_2\",47.03333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"latitude_of_origin\",46.5],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-93.1],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",2624666.6667],PARAMETER[\"false_northing\",328083.33"); + add_srs_wkt (p, 13, + "33],AUTHORITY[\"EPSG\",\"26849\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 14, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26850, "epsg", 26850, + "NAD83 / Minnesota Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=4"); + add_proj4text (p, 1, + "5 +lon_0=-94.25 +x_0=800000.0000101599 +y_0=99999.999989"); + add_proj4text (p, 2, + "83997 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Minnesota Central (ftUS)\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",47."); + add_srs_wkt (p, 9, + "05],PARAMETER[\"standard_parallel_2\",45.61666666666667]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"latitude_of_origin\",45],PARAMETER[\"centra"); + add_srs_wkt (p, 11, + "l_meridian\",-94.25],PARAMETER[\"false_easting\",2624666"); + add_srs_wkt (p, 12, + ".6667],PARAMETER[\"false_northing\",328083.3333],AUTHORI"); + add_srs_wkt (p, 13, + "TY[\"EPSG\",\"26850\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 14, "]]"); + p = add_epsg_def (first, last, 26851, "epsg", 26851, + "NAD83 / Minnesota South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101599 +y_0=999"); + add_proj4text (p, 2, + "99.99998983997 +ellps=GRS80 +datum=NAD83 +units=us-ft +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Minnesota South (ftUS)\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",45.21"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"standard_parallel_2\",43.78333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"latitude_of_origin\",43],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"central_meridian\",-94],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "2624666.6667],PARAMETER[\"false_northing\",328083.3333],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"26851\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 26852, "epsg", 26852, + "NAD83 / Nebraska (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +"); + add_proj4text (p, 1, + "lon_0=-100 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +dat"); + add_proj4text (p, 2, "um=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Nebraska (ftUS)\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal_Con"); + add_srs_wkt (p, 8, + "ic_2SP\"],PARAMETER[\"standard_parallel_1\",43],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"standard_parallel_2\",40],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 10, + "igin\",39.83333333333334],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 11, + ",-100],PARAMETER[\"false_easting\",1640416.6667],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26852\"],A"); + add_srs_wkt (p, 13, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26853, "epsg", 26853, + "NAD83 / West Virginia North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79."); + add_proj4text (p, 1, + "5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us"); + add_proj4text (p, 2, "-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / West Virginia North (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4269\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 7, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 8, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",4"); + add_srs_wkt (p, 9, + "0.25],PARAMETER[\"standard_parallel_2\",39],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",38.5],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 11, + ",-79.5],PARAMETER[\"false_easting\",1968500],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"26853\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26854, "epsg", 26854, + "NAD83 / West Virginia South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +datum=NAD83 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / West Virginia South (ftUS)\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "AD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GR"); + add_srs_wkt (p, 2, + "S 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4269\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 7, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 8, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",3"); + add_srs_wkt (p, 9, + "8.88333333333333],PARAMETER[\"standard_parallel_2\",37.4"); + add_srs_wkt (p, 10, + "8333333333333],PARAMETER[\"latitude_of_origin\",37],PARA"); + add_srs_wkt (p, 11, + "METER[\"central_meridian\",-81],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",1968500],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"26854\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26855, "epsg", 26855, + "NAD83(HARN) / Maine East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +units=us"); + add_proj4text (p, 2, "-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maine East (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",43.66666666666666],PARAMETER[\"central_meridian\",-68.5"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",984250.0000000002],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"26855\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26856, "epsg", 26856, + "NAD83(HARN) / Maine West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +u"); + add_proj4text (p, 2, "nits=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Maine West (ftUS)\",GEOGCS[\"NAD8"); + add_srs_wkt (p, 1, + "3(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 9, + ",42.83333333333334],PARAMETER[\"central_meridian\",-70.1"); + add_srs_wkt (p, 10, + "6666666666667],PARAMETER[\"scale_factor\",0.999966667],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",2952750],PARAMETER[\"false_no"); + add_srs_wkt (p, 12, + "rthing\",0],AUTHORITY[\"EPSG\",\"26856\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 13, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26857, "epsg", 26857, + "NAD83(HARN) / Minnesota North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.00"); + add_proj4text (p, 2, + "00101599 +y_0=99999.99998983997 +ellps=GRS80 +units=us-f"); + add_proj4text (p, 3, "t +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Minnesota North (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",48.63333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",47.03333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",46.5],PARAMETER[\"central_meridian\",-93.1],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"false_easting\",2624666.6667],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",328083.3333],AUTHORITY[\"EPSG\",\"26857\"],A"); + add_srs_wkt (p, 14, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26858, "epsg", 26858, + "NAD83(HARN) / Minnesota Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=4"); + add_proj4text (p, 1, + "5 +lon_0=-94.25 +x_0=800000.0000101599 +y_0=99999.999989"); + add_proj4text (p, 2, "83997 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Minnesota Central (ftUS)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Ne"); + add_srs_wkt (p, 2, + "twork\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],"); + add_srs_wkt (p, 4, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 5, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 6, + "22\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey fo"); + add_srs_wkt (p, 7, + "ot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 9, + "andard_parallel_1\",47.05],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 10, + "_2\",45.61666666666667],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 11, + ",45],PARAMETER[\"central_meridian\",-94.25],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",2624666.6667],PARAMETER[\"false_northing"); + add_srs_wkt (p, 13, + "\",328083.3333],AUTHORITY[\"EPSG\",\"26858\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26859, "epsg", 26859, + "NAD83(HARN) / Minnesota South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101599 +y_0=999"); + add_proj4text (p, 2, "99.99998983997 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Minnesota South (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Netwo"); + add_srs_wkt (p, 2, + "rk\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRI"); + add_srs_wkt (p, 4, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\""); + add_srs_wkt (p, 7, + ",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJEC"); + add_srs_wkt (p, 8, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_1\",45.21666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 10, + "parallel_2\",43.78333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 11, + "origin\",43],PARAMETER[\"central_meridian\",-94],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_easting\",2624666.6667],PARAMETER[\"false_nor"); + add_srs_wkt (p, 13, + "thing\",328083.3333],AUTHORITY[\"EPSG\",\"26859\"],AXIS["); + add_srs_wkt (p, 14, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26860, "epsg", 26860, + "NAD83(HARN) / Nebraska (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +"); + add_proj4text (p, 1, + "lon_0=-100 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +uni"); + add_proj4text (p, 2, "ts=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / Nebraska (ftUS)\",GEOGCS[\"NAD83("); + add_srs_wkt (p, 1, + "HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey foot\",0.30"); + add_srs_wkt (p, 7, + "48006096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION["); + add_srs_wkt (p, 8, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_1\",43],PARAMETER[\"standard_parallel_2\",40],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"latitude_of_origin\",39.83333333333334],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"central_meridian\",-100],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",1640416.6667],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"26860\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 14, ""); + p = add_epsg_def (first, last, 26861, "epsg", 26861, + "NAD83(HARN) / West Virginia North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79."); + add_proj4text (p, 1, + "5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / West Virginia North (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_"); + add_srs_wkt (p, 2, + "Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey "); + add_srs_wkt (p, 7, + "foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",40.25],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 10, + "el_2\",39],PARAMETER[\"latitude_of_origin\",38.5],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-79.5],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",1968500],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"26861\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26862, "epsg", 26862, + "NAD83(HARN) / West Virginia South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(HARN) / West Virginia South (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_"); + add_srs_wkt (p, 2, + "Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]"); + add_srs_wkt (p, 4, + "],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],U"); + add_srs_wkt (p, 5, + "NIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],UNIT[\"US survey "); + add_srs_wkt (p, 7, + "foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_1\",38.88333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 10, + "ndard_parallel_2\",37.48333333333333],PARAMETER[\"latitu"); + add_srs_wkt (p, 11, + "de_of_origin\",37],PARAMETER[\"central_meridian\",-81],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_easting\",1968500],PARAMETER[\"false_no"); + add_srs_wkt (p, 13, + "rthing\",0],AUTHORITY[\"EPSG\",\"26862\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 14, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26863, "epsg", 26863, + "NAD83(NSRS2007) / Maine East (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84="); + add_proj4text (p, 2, "0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maine East (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 9, + "cator\"],PARAMETER[\"latitude_of_origin\",43.66666666666"); + add_srs_wkt (p, 10, + "666],PARAMETER[\"central_meridian\",-68.5],PARAMETER[\"s"); + add_srs_wkt (p, 11, + "cale_factor\",0.9999],PARAMETER[\"false_easting\",984250"); + add_srs_wkt (p, 12, + ".0000000002],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"26863\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26864, "epsg", 26864, + "NAD83(NSRS2007) / Maine West (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +t"); + add_proj4text (p, 2, "owgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Maine West (ftUS)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Referen"); + add_srs_wkt (p, 2, + "ce_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.25722"); + add_srs_wkt (p, 3, + "2101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 8, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 9, + "cator\"],PARAMETER[\"latitude_of_origin\",42.83333333333"); + add_srs_wkt (p, 10, + "334],PARAMETER[\"central_meridian\",-70.16666666666667],"); + add_srs_wkt (p, 11, + "PARAMETER[\"scale_factor\",0.999966667],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_easting\",2952750],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 13, + "HORITY[\"EPSG\",\"26864\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 14, "ORTH]]"); + p = add_epsg_def (first, last, 26865, "epsg", 26865, + "NAD83(NSRS2007) / Minnesota North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.00"); + add_proj4text (p, 2, + "00101599 +y_0=99999.99998983997 +ellps=GRS80 +towgs84=0,"); + add_proj4text (p, 3, "0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Minnesota North (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Re"); + add_srs_wkt (p, 2, + "ference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298."); + add_srs_wkt (p, 3, + "257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "48.63333333333333],PARAMETER[\"standard_parallel_2\",47."); + add_srs_wkt (p, 11, + "03333333333333],PARAMETER[\"latitude_of_origin\",46.5],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"central_meridian\",-93.1],PARAMETER[\"false_e"); + add_srs_wkt (p, 13, + "asting\",2624666.6667],PARAMETER[\"false_northing\",3280"); + add_srs_wkt (p, 14, + "83.3333],AUTHORITY[\"EPSG\",\"26865\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 15, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26866, "epsg", 26866, + "NAD83(NSRS2007) / Minnesota Central (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=4"); + add_proj4text (p, 1, + "5 +lon_0=-94.25 +x_0=800000.0000101599 +y_0=99999.999989"); + add_proj4text (p, 2, + "83997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Minnesota Central (ftUS)\",GE"); + add_srs_wkt (p, 1, + "OGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_"); + add_srs_wkt (p, 2, + "Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 3, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 5, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096"); + add_srs_wkt (p, 8, + "012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamber"); + add_srs_wkt (p, 9, + "t_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 10, + "\",47.05],PARAMETER[\"standard_parallel_2\",45.616666666"); + add_srs_wkt (p, 11, + "66667],PARAMETER[\"latitude_of_origin\",45],PARAMETER[\""); + add_srs_wkt (p, 12, + "central_meridian\",-94.25],PARAMETER[\"false_easting\",2"); + add_srs_wkt (p, 13, + "624666.6667],PARAMETER[\"false_northing\",328083.3333],A"); + add_srs_wkt (p, 14, + "UTHORITY[\"EPSG\",\"26866\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 15, ",NORTH]]"); + p = add_epsg_def (first, last, 26867, "epsg", 26867, + "NAD83(NSRS2007) / Minnesota South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101599 +y_0=999"); + add_proj4text (p, 2, + "99.99998983997 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +unit"); + add_proj4text (p, 3, "s=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Minnesota South (ftUS)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Re"); + add_srs_wkt (p, 2, + "ference_System_2007\",SPHEROID[\"GRS 1980\",6378137,298."); + add_srs_wkt (p, 3, + "257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 5, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 6, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 7, + "PSG\",\"4759\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 8, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 9, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 10, + "45.21666666666667],PARAMETER[\"standard_parallel_2\",43."); + add_srs_wkt (p, 11, + "78333333333333],PARAMETER[\"latitude_of_origin\",43],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"central_meridian\",-94],PARAMETER[\"false_easti"); + add_srs_wkt (p, 13, + "ng\",2624666.6667],PARAMETER[\"false_northing\",328083.3"); + add_srs_wkt (p, 14, + "333],AUTHORITY[\"EPSG\",\"26867\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 15, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26868, "epsg", 26868, + "NAD83(NSRS2007) / Nebraska (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +"); + add_proj4text (p, 1, + "lon_0=-100 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +tow"); + add_proj4text (p, 2, "gs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / Nebraska (ftUS)\",GEOGCS[\"NA"); + add_srs_wkt (p, 1, + "D83(NSRS2007)\",DATUM[\"NAD83_National_Spatial_Reference"); + add_srs_wkt (p, 2, + "_System_2007\",SPHEROID[\"GRS 1980\",6378137,298.2572221"); + add_srs_wkt (p, 3, + "01,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 7, + "\"4759\"]],UNIT[\"US survey foot\",0.3048006096012192,AU"); + add_srs_wkt (p, 8, + "THORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conform"); + add_srs_wkt (p, 9, + "al_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",43],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"standard_parallel_2\",40],PARAMETER[\"latitude"); + add_srs_wkt (p, 11, + "_of_origin\",39.83333333333334],PARAMETER[\"central_meri"); + add_srs_wkt (p, 12, + "dian\",-100],PARAMETER[\"false_easting\",1640416.6667],P"); + add_srs_wkt (p, 13, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2686"); + add_srs_wkt (p, 14, "8\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26869, "epsg", 26869, + "NAD83(NSRS2007) / West Virginia North (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79."); + add_proj4text (p, 1, + "5 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0"); + add_proj4text (p, 2, " +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / West Virginia North (ftUS)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatia"); + add_srs_wkt (p, 2, + "l_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,"); + add_srs_wkt (p, 3, + "298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 5, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 6, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060"); + add_srs_wkt (p, 8, + "96012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamb"); + add_srs_wkt (p, 9, + "ert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 10, + "_1\",40.25],PARAMETER[\"standard_parallel_2\",39],PARAME"); + add_srs_wkt (p, 11, + "TER[\"latitude_of_origin\",38.5],PARAMETER[\"central_mer"); + add_srs_wkt (p, 12, + "idian\",-79.5],PARAMETER[\"false_easting\",1968500],PARA"); + add_srs_wkt (p, 13, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26869\""); + add_srs_wkt (p, 14, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26870, "epsg", 26870, + "NAD83(NSRS2007) / West Virginia South (ftUS)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(NSRS2007) / West Virginia South (ftUS)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"NAD83(NSRS2007)\",DATUM[\"NAD83_National_Spatia"); + add_srs_wkt (p, 2, + "l_Reference_System_2007\",SPHEROID[\"GRS 1980\",6378137,"); + add_srs_wkt (p, 3, + "298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,"); + add_srs_wkt (p, 4, + "0,0,0,0,0],AUTHORITY[\"EPSG\",\"6759\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 5, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 6, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"4759\"]],UNIT[\"US survey foot\",0.30480060"); + add_srs_wkt (p, 8, + "96012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamb"); + add_srs_wkt (p, 9, + "ert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 10, + "_1\",38.88333333333333],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 11, + ",37.48333333333333],PARAMETER[\"latitude_of_origin\",37]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"central_meridian\",-81],PARAMETER[\"false_e"); + add_srs_wkt (p, 13, + "asting\",1968500],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 14, + "ITY[\"EPSG\",\"26870\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 15, "H]]"); + p = add_epsg_def (first, last, 26891, "epsg", 26891, + "NAD83(CSRS) / MTM zone 11"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-82.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 11\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-82.5],PARAMETER[\"scale_factor\",0.9999],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",304800],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",0],AUTHORITY[\"EPSG\",\"26891\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26892, "epsg", 26892, + "NAD83(CSRS) / MTM zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 12\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-81],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"26892\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26893, "epsg", 26893, + "NAD83(CSRS) / MTM zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 13\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-84],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"26893\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26894, "epsg", 26894, + "NAD83(CSRS) / MTM zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 14\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-87],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"26894\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26895, "epsg", 26895, + "NAD83(CSRS) / MTM zone 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 15\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-90],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"26895\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26896, "epsg", 26896, + "NAD83(CSRS) / MTM zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 16\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-93],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"26896\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26897, "epsg", 26897, + "NAD83(CSRS) / MTM zone 17"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-96 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 17\",GEOGCS[\"NAD83(CSRS"); + add_srs_wkt (p, 1, + ")\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SP"); + add_srs_wkt (p, 2, + "HEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",-96],PARAMETER[\"scale_factor\",0.9999],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",304800],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"26897\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 26898, "epsg", 26898, + "NAD83(CSRS) / MTM zone 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-53 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 1\",GEOGCS[\"NAD83(CSRS)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-53],PARAMETER[\"scale_factor\",0.9999],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",304800],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"26898\"],AXIS[\"E(X)\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 26899, "epsg", 26899, + "NAD83(CSRS) / MTM zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-56 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83(CSRS) / MTM zone 2\",GEOGCS[\"NAD83(CSRS)"); + add_srs_wkt (p, 1, + "\",DATUM[\"NAD83_Canadian_Spatial_Reference_System\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7019\"]],AUTHORITY[\"EPSG\",\"6140\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4617\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",0],PARAMETER[\"central_meri"); + add_srs_wkt (p, 9, + "dian\",-56],PARAMETER[\"scale_factor\",0.9999],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",304800],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"26899\"],AXIS[\"E(X)\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 26901, "epsg", 26901, "NAD83 / UTM zone 1N"); + add_proj4text (p, 0, + "+proj=utm +zone=1 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 1N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-177],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26901\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26902, "epsg", 26902, "NAD83 / UTM zone 2N"); + add_proj4text (p, 0, + "+proj=utm +zone=2 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 2N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-171],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26902\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26903, "epsg", 26903, "NAD83 / UTM zone 3N"); + add_proj4text (p, 0, + "+proj=utm +zone=3 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 3N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-165],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26903\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26904, "epsg", 26904, "NAD83 / UTM zone 4N"); + add_proj4text (p, 0, + "+proj=utm +zone=4 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 4N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-159],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26904\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26905, "epsg", 26905, "NAD83 / UTM zone 5N"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 5N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-153],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26905\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26906, "epsg", 26906, "NAD83 / UTM zone 6N"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 6N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-147],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26906\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26907, "epsg", 26907, "NAD83 / UTM zone 7N"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 7N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-141],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26907\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26908, "epsg", 26908, "NAD83 / UTM zone 8N"); + add_proj4text (p, 0, + "+proj=utm +zone=8 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 8N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-135],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26908\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26909, "epsg", 26909, "NAD83 / UTM zone 9N"); + add_proj4text (p, 0, + "+proj=utm +zone=9 +ellps=GRS80 +datum=NAD83 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 9N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-129],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26909\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26910, "epsg", 26910, + "NAD83 / UTM zone 10N"); + add_proj4text (p, 0, + "+proj=utm +zone=10 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 10N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-123],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26910\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26911, "epsg", 26911, + "NAD83 / UTM zone 11N"); + add_proj4text (p, 0, + "+proj=utm +zone=11 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 11N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-117],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26911\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26912, "epsg", 26912, + "NAD83 / UTM zone 12N"); + add_proj4text (p, 0, + "+proj=utm +zone=12 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 12N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-111],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26912\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26913, "epsg", 26913, + "NAD83 / UTM zone 13N"); + add_proj4text (p, 0, + "+proj=utm +zone=13 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 13N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-105],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26913\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26914, "epsg", 26914, + "NAD83 / UTM zone 14N"); + add_proj4text (p, 0, + "+proj=utm +zone=14 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 14N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-99],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26914\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26915, "epsg", 26915, + "NAD83 / UTM zone 15N"); + add_proj4text (p, 0, + "+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 15N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-93],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26915\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26916, "epsg", 26916, + "NAD83 / UTM zone 16N"); + add_proj4text (p, 0, + "+proj=utm +zone=16 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 16N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-87],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26916\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26917, "epsg", 26917, + "NAD83 / UTM zone 17N"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 17N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-81],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26917\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26918, "epsg", 26918, + "NAD83 / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 18N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-75],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26918\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26919, "epsg", 26919, + "NAD83 / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 19N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-69],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26919\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26920, "epsg", 26920, + "NAD83 / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 20N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-63],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26920\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26921, "epsg", 26921, + "NAD83 / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 21N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-57],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26921\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26922, "epsg", 26922, + "NAD83 / UTM zone 22N"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 22N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-51],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26922\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26923, "epsg", 26923, + "NAD83 / UTM zone 23N"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +ellps=GRS80 +datum=NAD83 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / UTM zone 23N\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-45],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "26923\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 26929, "epsg", 26929, + "NAD83 / Alabama East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.9"); + add_proj4text (p, 1, + "9996 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alabama East\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",30.5],PARAMETER[\"central_meridian\",-85.8333333333"); + add_srs_wkt (p, 9, + "3333],PARAMETER[\"scale_factor\",0.99996],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",200000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 11, + "THORITY[\"EPSG\",\"26929\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 26930, "epsg", 26930, + "NAD83 / Alabama West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=6"); + add_proj4text (p, 1, + "00000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_proj4text (p, 2, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alabama West\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",30],PARAMETER[\"central_meridian\",-87.5],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.999933333],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",600000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, "PSG\",\"26930\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26931, "epsg", 26931, + "NAD83 / Alaska zone 1"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=32"); + add_proj4text (p, 1, + "3.1301023611111 +k=0.9999 +x_0=5000000 +y_0=-5000000 +el"); + add_proj4text (p, 2, "lps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska zone 1\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Hotine_Oblique_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_center\",57],PARAMETER[\"longitude_of_center\",-133.666"); + add_srs_wkt (p, 9, + "6666666667],PARAMETER[\"azimuth\",323.1301023611111],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"rectified_grid_angle\",323.1301023611111],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",5000000],PARAMETER[\"false_northing\",-5000000],AUTHORI"); + add_srs_wkt (p, 13, + "TY[\"EPSG\",\"26931\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 14, "]]"); + p = add_epsg_def (first, last, 26932, "epsg", 26932, + "NAD83 / Alaska zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-142 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska zone 2\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",54],PARAMETER[\"central_meridian\",-142],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"26932\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26933, "epsg", 26933, + "NAD83 / Alaska zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-146 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska zone 3\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",54],PARAMETER[\"central_meridian\",-146],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"26933\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26934, "epsg", 26934, + "NAD83 / Alaska zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska zone 4\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",54],PARAMETER[\"central_meridian\",-150],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"26934\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26935, "epsg", 26935, + "NAD83 / Alaska zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-154 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska zone 5\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",54],PARAMETER[\"central_meridian\",-154],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"26935\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26936, "epsg", 26936, + "NAD83 / Alaska zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-158 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska zone 6\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",54],PARAMETER[\"central_meridian\",-158],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"26936\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26937, "epsg", 26937, + "NAD83 / Alaska zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-162 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska zone 7\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",54],PARAMETER[\"central_meridian\",-162],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"26937\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_22 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 26938, "epsg", 26938, + "NAD83 / Alaska zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-166 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska zone 8\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",54],PARAMETER[\"central_meridian\",-166],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"26938\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26939, "epsg", 26939, + "NAD83 / Alaska zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=54 +lon_0=-170 +k=0.9999 +x_0=500000 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska zone 9\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",54],PARAMETER[\"central_meridian\",-170],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 10, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"26939\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26940, "epsg", 26940, + "NAD83 / Alaska zone 10"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333"); + add_proj4text (p, 1, + "334 +lat_0=51 +lon_0=-176 +x_0=1000000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Alaska zone 10\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",53.83333333333334],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",51.83333333333334],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",51],PARAMETER[\"central_meridian\",-176],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",1000000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"26940\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26941, "epsg", 26941, + "NAD83 / California zone 1"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.3"); + add_proj4text (p, 1, + "3333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellp"); + add_proj4text (p, 2, "s=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 1\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 8, + "andard_parallel_1\",41.66666666666666],PARAMETER[\"stand"); + add_srs_wkt (p, 9, + "ard_parallel_2\",40],PARAMETER[\"latitude_of_origin\",39"); + add_srs_wkt (p, 10, + ".33333333333334],PARAMETER[\"central_meridian\",-122],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",2000000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",500000],AUTHORITY[\"EPSG\",\"26941\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26942, "epsg", 26942, + "NAD83 / California zone 2"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y"); + add_proj4text (p, 2, + "_0=500000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 2\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 8, + "andard_parallel_1\",39.83333333333334],PARAMETER[\"stand"); + add_srs_wkt (p, 9, + "ard_parallel_2\",38.33333333333334],PARAMETER[\"latitude"); + add_srs_wkt (p, 10, + "_of_origin\",37.66666666666666],PARAMETER[\"central_meri"); + add_srs_wkt (p, 11, + "dian\",-122],PARAMETER[\"false_easting\",2000000],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_northing\",500000],AUTHORITY[\"EPSG\",\"2694"); + add_srs_wkt (p, 13, "2\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26943, "epsg", 26943, + "NAD83 / California zone 3"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +"); + add_proj4text (p, 2, "ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 3\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 8, + "andard_parallel_1\",38.43333333333333],PARAMETER[\"stand"); + add_srs_wkt (p, 9, + "ard_parallel_2\",37.06666666666667],PARAMETER[\"latitude"); + add_srs_wkt (p, 10, + "_of_origin\",36.5],PARAMETER[\"central_meridian\",-120.5"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_easting\",2000000],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_northing\",500000],AUTHORITY[\"EPSG\",\"26943\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26944, "epsg", 26944, + "NAD83 / California zone 4"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.3333333333333"); + add_proj4text (p, 1, + "4 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +dat"); + add_proj4text (p, 2, "um=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 4\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 8, + "andard_parallel_1\",37.25],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 9, + "_2\",36],PARAMETER[\"latitude_of_origin\",35.33333333333"); + add_srs_wkt (p, 10, + "334],PARAMETER[\"central_meridian\",-119],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_easting\",2000000],PARAMETER[\"false_northing\",5000"); + add_srs_wkt (p, 12, + "00],AUTHORITY[\"EPSG\",\"26944\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26945, "epsg", 26945, + "NAD83 / California zone 5"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +el"); + add_proj4text (p, 2, "lps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 5\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 8, + "andard_parallel_1\",35.46666666666667],PARAMETER[\"stand"); + add_srs_wkt (p, 9, + "ard_parallel_2\",34.03333333333333],PARAMETER[\"latitude"); + add_srs_wkt (p, 10, + "_of_origin\",33.5],PARAMETER[\"central_meridian\",-118],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_easting\",2000000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",500000],AUTHORITY[\"EPSG\",\"26945\"],AXIS[\"X"); + add_srs_wkt (p, 13, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26946, "epsg", 26946, + "NAD83 / California zone 6"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000"); + add_proj4text (p, 2, + " +y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_proj4text (p, 3, ""); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / California zone 6\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 8, + "andard_parallel_1\",33.88333333333333],PARAMETER[\"stand"); + add_srs_wkt (p, 9, + "ard_parallel_2\",32.78333333333333],PARAMETER[\"latitude"); + add_srs_wkt (p, 10, + "_of_origin\",32.16666666666666],PARAMETER[\"central_meri"); + add_srs_wkt (p, 11, + "dian\",-116.25],PARAMETER[\"false_easting\",2000000],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"false_northing\",500000],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 13, "6946\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26948, "epsg", 26948, + "NAD83 / Arizona East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Arizona East\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",31],PARAMETER[\"central_meridian\",-110.16666666666"); + add_srs_wkt (p, 9, + "67],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",213360],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"26948\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 12, "TH]]"); + p = add_epsg_def (first, last, 26949, "epsg", 26949, + "NAD83 / Arizona Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Arizona Central\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",31],PARAMETER[\"central_meridian\",-111.9166666"); + add_srs_wkt (p, 9, + "666667],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",213360],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"26949\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26950, "epsg", 26950, + "NAD83 / Arizona West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0"); + add_proj4text (p, 1, + "=213360 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Arizona West\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",31],PARAMETER[\"central_meridian\",-113.75],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",0.999933333],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",213360],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"26950\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26951, "epsg", 26951, + "NAD83 / Arkansas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Arkansas North\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",36.23333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",34.93333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",34.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 11, + "\",-92],PARAMETER[\"false_easting\",400000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"26951\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26952, "epsg", 26952, + "NAD83 / Arkansas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellp"); + add_proj4text (p, 2, "s=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Arkansas South\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",34.76666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",33.3],PARAMETER[\"latitude_of_origin\",32.6"); + add_srs_wkt (p, 10, + "6666666666666],PARAMETER[\"central_meridian\",-92],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",400000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",400000],AUTHORITY[\"EPSG\",\"26952\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 13, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26953, "epsg", 26953, + "NAD83 / Colorado North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, + "289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +units=m "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Colorado North\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",40.78333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",39.71666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",39.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 11, + "\",-105.5],PARAMETER[\"false_easting\",914401.8289],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_northing\",304800.6096],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"26953\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26954, "epsg", 26954, + "NAD83 / Colorado Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.8333333333"); + add_proj4text (p, 1, + "3334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +el"); + add_proj4text (p, 2, "lps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Colorado Central\",GEOGCS[\"NAD83\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 8, + "ndard_parallel_1\",39.75],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 9, + "2\",38.45],PARAMETER[\"latitude_of_origin\",37.833333333"); + add_srs_wkt (p, 10, + "33334],PARAMETER[\"central_meridian\",-105.5],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",914401.8289],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",304800.6096],AUTHORITY[\"EPSG\",\"26954\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26955, "epsg", 26955, + "NAD83 / Colorado South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8"); + add_proj4text (p, 2, + "289 +y_0=304800.6096 +ellps=GRS80 +datum=NAD83 +units=m "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Colorado South\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",38.43333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",37.23333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",36.66666666666666],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 11, + "\",-105.5],PARAMETER[\"false_easting\",914401.8289],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_northing\",304800.6096],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"26955\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26956, "epsg", 26956, "NAD83 / Connecticut"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40"); + add_proj4text (p, 1, + ".83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=1524"); + add_proj4text (p, 2, "00.3048 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Connecticut\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",41.86666666666667],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_2\",41.2],PARAMETER[\"latitude_of_origin\",40.833"); + add_srs_wkt (p, 10, + "33333333334],PARAMETER[\"central_meridian\",-72.75],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_easting\",304800.6096],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",152400.3048],AUTHORITY[\"EPSG\",\"26956\"],AXI"); + add_srs_wkt (p, 13, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26957, "epsg", 26957, "NAD83 / Delaware"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999"); + add_proj4text (p, 1, + "995 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Delaware\",GEOGCS[\"NAD83\",DATUM[\"Nor"); + add_srs_wkt (p, 1, + "th_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,2"); + add_srs_wkt (p, 2, + "98.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",38],PARAMETER[\"central_meridian\",-75.41666666666667],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",0.999995],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",200000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"26957\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 12, "]]"); + p = add_epsg_def (first, last, 26958, "epsg", 26958, + "NAD83 / Florida East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Florida East\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",24.33333333333333],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "81],PARAMETER[\"scale_factor\",0.999941177],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",200000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"26958\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26959, "epsg", 26959, + "NAD83 / Florida West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999"); + add_proj4text (p, 1, + "941177 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Florida West\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",24.33333333333333],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "82],PARAMETER[\"scale_factor\",0.999941177],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",200000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"26959\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26960, "epsg", 26960, + "NAD83 / Florida North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=2"); + add_proj4text (p, 1, + "9 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NA"); + add_proj4text (p, 2, "D83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Florida North\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standar"); + add_srs_wkt (p, 8, + "d_parallel_1\",30.75],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 9, + "29.58333333333333],PARAMETER[\"latitude_of_origin\",29],"); + add_srs_wkt (p, 10, + "PARAMETER[\"central_meridian\",-84.5],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",600000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 12, + "ITY[\"EPSG\",\"26960\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 13, "H]]"); + p = add_epsg_def (first, last, 26961, "epsg", 26961, + "NAD83 / Hawaii zone 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0."); + add_proj4text (p, 1, + "999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +"); + add_proj4text (p, 2, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Hawaii zone 1\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",18.83333333333333],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-155.5],PARAMETER[\"scale_factor\",0.999966667],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"26961\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26962, "epsg", 26962, + "NAD83 / Hawaii zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +d"); + add_proj4text (p, 2, "atum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Hawaii zone 2\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",20.33333333333333],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-156.6666666666667],PARAMETER[\"scale_factor\",0.9999666"); + add_srs_wkt (p, 10, + "67],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"26962\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26963, "epsg", 26963, + "NAD83 / Hawaii zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99"); + add_proj4text (p, 1, + "999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Hawaii zone 3\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",21.16666666666667],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-158],PARAMETER[\"scale_factor\",0.99999],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",500000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 11, + "THORITY[\"EPSG\",\"26963\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 26964, "epsg", 26964, + "NAD83 / Hawaii zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0."); + add_proj4text (p, 1, + "99999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Hawaii zone 4\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",21.83333333333333],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-159.5],PARAMETER[\"scale_factor\",0.99999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"26964\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 26965, "epsg", 26965, + "NAD83 / Hawaii zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Hawaii zone 5\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",21.66666666666667],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-160.1666666666667],PARAMETER[\"scale_factor\",1],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 11, + "\",0],AUTHORITY[\"EPSG\",\"26965\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26966, "epsg", 26966, + "NAD83 / Georgia East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Georgia East\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",30],PARAMETER[\"central_meridian\",-82.166666666666"); + add_srs_wkt (p, 9, + "67],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",200000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"26966\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 12, "TH]]"); + p = add_epsg_def (first, last, 26967, "epsg", 26967, + "NAD83 / Georgia West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.999"); + add_proj4text (p, 1, + "9 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Georgia West\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",30],PARAMETER[\"central_meridian\",-84.166666666666"); + add_srs_wkt (p, 9, + "67],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",700000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"26967\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 12, "TH]]"); + p = add_epsg_def (first, last, 26968, "epsg", 26968, "NAD83 / Idaho East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666"); + add_proj4text (p, 1, + "666667 +k=0.9999473679999999 +x_0=200000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Idaho East\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",41.66666666666666],PARAMETER[\"central_meridian\",-11"); + add_srs_wkt (p, 9, + "2.1666666666667],PARAMETER[\"scale_factor\",0.999947368]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_easting\",200000],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",0],AUTHORITY[\"EPSG\",\"26968\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26969, "epsg", 26969, + "NAD83 / Idaho Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.99"); + add_proj4text (p, 1, + "99473679999999 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NA"); + add_proj4text (p, 2, "D83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Idaho Central\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",41.66666666666666],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-114],PARAMETER[\"scale_factor\",0.999947368],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"26969\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 26970, "epsg", 26970, "NAD83 / Idaho West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0"); + add_proj4text (p, 1, + ".999933333 +x_0=800000 +y_0=0 +ellps=GRS80 +datum=NAD83 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Idaho West\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",41.66666666666666],PARAMETER[\"central_meridian\",-11"); + add_srs_wkt (p, 9, + "5.75],PARAMETER[\"scale_factor\",0.999933333],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",800000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"26970\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 26971, "epsg", 26971, + "NAD83 / Illinois East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333"); + add_proj4text (p, 1, + "333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Illinois East\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",36.66666666666666],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-88.33333333333333],PARAMETER[\"scale_factor\",0.999975]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_easting\",300000],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",0],AUTHORITY[\"EPSG\",\"26971\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26972, "epsg", 26972, + "NAD83 / Illinois West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999941177 +x_0=700000 +y_0=0 +ellps=GRS80 +d"); + add_proj4text (p, 2, "atum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Illinois West\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",36.66666666666666],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-90.16666666666667],PARAMETER[\"scale_factor\",0.9999411"); + add_srs_wkt (p, 10, + "77],PARAMETER[\"false_easting\",700000],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_northing\",0],AUTHORITY[\"EPSG\",\"26972\"],AXIS[\"X\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26973, "epsg", 26973, + "NAD83 / Indiana East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=100000 +y_0=250000 +ellps=GRS80 +datum=NAD"); + add_proj4text (p, 2, "83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Indiana East\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",37.5],PARAMETER[\"central_meridian\",-85.6666666666"); + add_srs_wkt (p, 9, + "6667],PARAMETER[\"scale_factor\",0.999966667],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",100000],PARAMETER[\"false_northing\",2"); + add_srs_wkt (p, 11, + "50000],AUTHORITY[\"EPSG\",\"26973\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26974, "epsg", 26974, + "NAD83 / Indiana West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=900000 +y_0=250000 +ellps=GRS80 +datum=NAD"); + add_proj4text (p, 2, "83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Indiana West\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",37.5],PARAMETER[\"central_meridian\",-87.0833333333"); + add_srs_wkt (p, 9, + "3333],PARAMETER[\"scale_factor\",0.999966667],PARAMETER["); + add_srs_wkt (p, 10, + "\"false_easting\",900000],PARAMETER[\"false_northing\",2"); + add_srs_wkt (p, 11, + "50000],AUTHORITY[\"EPSG\",\"26974\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26975, "epsg", 26975, "NAD83 / Iowa North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +"); + add_proj4text (p, 2, "ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Iowa North\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_p"); + add_srs_wkt (p, 8, + "arallel_1\",43.26666666666667],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_2\",42.06666666666667],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",41.5],PARAMETER[\"central_meridian\",-93.5],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",1500000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 12, + "\",1000000],AUTHORITY[\"EPSG\",\"26975\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 13, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26976, "epsg", 26976, "NAD83 / Iowa South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666"); + add_proj4text (p, 1, + "667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Iowa South\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_p"); + add_srs_wkt (p, 8, + "arallel_1\",41.78333333333333],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_2\",40.61666666666667],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",40],PARAMETER[\"central_meridian\",-93.5],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"26976\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 26977, "epsg", 26977, + "NAD83 / Kansas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kansas North\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",39.78333333333333],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_2\",38.71666666666667],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 10, + "igin\",38.33333333333334],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 11, + ",-98],PARAMETER[\"false_easting\",400000],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"26977\"],AXIS[\"X"); + add_srs_wkt (p, 13, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26978, "epsg", 26978, + "NAD83 / Kansas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y"); + add_proj4text (p, 2, + "_0=400000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kansas South\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",38.56666666666667],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_2\",37.26666666666667],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 10, + "igin\",36.66666666666666],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 11, + ",-98.5],PARAMETER[\"false_easting\",400000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",400000],AUTHORITY[\"EPSG\",\"26978\"],A"); + add_srs_wkt (p, 13, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26979, "epsg", 26979, + "NAD83 / Kentucky North (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=37.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps="); + add_proj4text (p, 2, "GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kentucky North (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"G"); + add_srs_wkt (p, 2, + "RS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"701"); + add_srs_wkt (p, 3, + "9\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"standard_parallel_1\",37.96666666666667],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"standard_parallel_2\",37.96666666666667],PARAMETER["); + add_srs_wkt (p, 10, + "\"latitude_of_origin\",37.5],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 11, + "n\",-84.25],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26979\"],AX"); + add_srs_wkt (p, 13, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26980, "epsg", 26980, + "NAD83 / Kentucky South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +"); + add_proj4text (p, 2, + "y_0=500000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Kentucky South\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",37.93333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",36.73333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",36.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 11, + "\",-85.75],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_northing\",500000],AUTHORITY[\"EPSG\",\"26980\""); + add_srs_wkt (p, 13, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26981, "epsg", 26981, + "NAD83 / Louisiana North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps="); + add_proj4text (p, 2, "GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Louisiana North\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 8, + "dard_parallel_1\",32.66666666666666],PARAMETER[\"standar"); + add_srs_wkt (p, 9, + "d_parallel_2\",31.16666666666667],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 10, + "f_origin\",30.5],PARAMETER[\"central_meridian\",-92.5],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",1000000],PARAMETER[\"false_no"); + add_srs_wkt (p, 12, + "rthing\",0],AUTHORITY[\"EPSG\",\"26981\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 13, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26982, "epsg", 26982, + "NAD83 / Louisiana South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91"); + add_proj4text (p, 1, + ".33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum="); + add_proj4text (p, 2, "NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Louisiana South\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 8, + "dard_parallel_1\",30.7],PARAMETER[\"standard_parallel_2\""); + add_srs_wkt (p, 9, + ",29.3],PARAMETER[\"latitude_of_origin\",28.5],PARAMETER["); + add_srs_wkt (p, 10, + "\"central_meridian\",-91.33333333333333],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_easting\",1000000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 12, + "THORITY[\"EPSG\",\"26982\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 13, "NORTH]]"); + p = add_epsg_def (first, last, 26983, "epsg", 26983, "NAD83 / Maine East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maine East\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",43.66666666666666],PARAMETER[\"central_meridian\",-68"); + add_srs_wkt (p, 9, + ".5],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",300000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"26983\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 12, "TH]]"); + p = add_epsg_def (first, last, 26984, "epsg", 26984, "NAD83 / Maine West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666"); + add_proj4text (p, 1, + "666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +d"); + add_proj4text (p, 2, "atum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maine West\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",42.83333333333334],PARAMETER[\"central_meridian\",-70"); + add_srs_wkt (p, 9, + ".16666666666667],PARAMETER[\"scale_factor\",0.999966667]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_easting\",900000],PARAMETER[\"false_n"); + add_srs_wkt (p, 11, + "orthing\",0],AUTHORITY[\"EPSG\",\"26984\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26985, "epsg", 26985, "NAD83 / Maryland"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666"); + add_proj4text (p, 1, + "666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +datum=NA"); + add_proj4text (p, 2, "D83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Maryland\",GEOGCS[\"NAD83\",DATUM[\"Nor"); + add_srs_wkt (p, 1, + "th_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,2"); + add_srs_wkt (p, 2, + "98.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 8, + "rallel_1\",39.45],PARAMETER[\"standard_parallel_2\",38.3"); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",37.66666666666666],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"central_meridian\",-77],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",400000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 12, + "\"EPSG\",\"26985\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26986, "epsg", 26986, + "NAD83 / Massachusetts Mainland"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellp"); + add_proj4text (p, 2, "s=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Massachusetts Mainland\",GEOGCS[\"NAD83"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 19"); + add_srs_wkt (p, 2, + "80\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"standard_parallel_1\",42.68333333333333],PARAMETER[\""); + add_srs_wkt (p, 9, + "standard_parallel_2\",41.71666666666667],PARAMETER[\"lat"); + add_srs_wkt (p, 10, + "itude_of_origin\",41],PARAMETER[\"central_meridian\",-71"); + add_srs_wkt (p, 11, + ".5],PARAMETER[\"false_easting\",200000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",750000],AUTHORITY[\"EPSG\",\"26986\"],AXIS["); + add_srs_wkt (p, 13, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26987, "epsg", 26987, + "NAD83 / Massachusetts Island"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333"); + add_proj4text (p, 1, + "333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Massachusetts Island\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "standard_parallel_1\",41.48333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_2\",41.28333333333333],PARAMETER[\"latitu"); + add_srs_wkt (p, 10, + "de_of_origin\",41],PARAMETER[\"central_meridian\",-70.5]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",500000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",0],AUTHORITY[\"EPSG\",\"26987\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 13, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26988, "epsg", 26988, + "NAD83 / Michigan North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_"); + add_proj4text (p, 2, "0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Michigan North\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",47.08333333333334],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",45.48333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",44.78333333333333],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 11, + "\",-87],PARAMETER[\"false_easting\",8000000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"26988\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26989, "epsg", 26989, + "NAD83 / Michigan Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43"); + add_proj4text (p, 1, + ".31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +"); + add_proj4text (p, 2, "y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Michigan Central\",GEOGCS[\"NAD83\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 8, + "ndard_parallel_1\",45.7],PARAMETER[\"standard_parallel_2"); + add_srs_wkt (p, 9, + "\",44.18333333333333],PARAMETER[\"latitude_of_origin\",4"); + add_srs_wkt (p, 10, + "3.31666666666667],PARAMETER[\"central_meridian\",-84.366"); + add_srs_wkt (p, 11, + "66666666666],PARAMETER[\"false_easting\",6000000],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"26989\"],"); + add_srs_wkt (p, 13, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26990, "epsg", 26990, + "NAD83 / Michigan South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41"); + add_proj4text (p, 1, + ".5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps="); + add_proj4text (p, 2, "GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Michigan South\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",43.66666666666666],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",42.1],PARAMETER[\"latitude_of_origin\",41.5"); + add_srs_wkt (p, 10, + "],PARAMETER[\"central_meridian\",-84.36666666666666],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",4000000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",0],AUTHORITY[\"EPSG\",\"26990\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 13, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26991, "epsg", 26991, + "NAD83 / Minnesota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y"); + add_proj4text (p, 2, + "_0=100000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Minnesota North\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 8, + "dard_parallel_1\",48.63333333333333],PARAMETER[\"standar"); + add_srs_wkt (p, 9, + "d_parallel_2\",47.03333333333333],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 10, + "f_origin\",46.5],PARAMETER[\"central_meridian\",-93.1],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",800000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",100000],AUTHORITY[\"EPSG\",\"26991\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26992, "epsg", 26992, + "NAD83 / Minnesota Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=4"); + add_proj4text (p, 1, + "5 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +da"); + add_proj4text (p, 2, "tum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Minnesota Central\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 8, + "andard_parallel_1\",47.05],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 9, + "_2\",45.61666666666667],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 10, + ",45],PARAMETER[\"central_meridian\",-94.25],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",800000],PARAMETER[\"false_northing\",100"); + add_srs_wkt (p, 12, + "000],AUTHORITY[\"EPSG\",\"26992\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 13, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26993, "epsg", 26993, + "NAD83 / Minnesota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps="); + add_proj4text (p, 2, "GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Minnesota South\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 8, + "dard_parallel_1\",45.21666666666667],PARAMETER[\"standar"); + add_srs_wkt (p, 9, + "d_parallel_2\",43.78333333333333],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 10, + "f_origin\",43],PARAMETER[\"central_meridian\",-94],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",800000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",100000],AUTHORITY[\"EPSG\",\"26993\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 13, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26994, "epsg", 26994, + "NAD83 / Mississippi East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Mississippi East\",GEOGCS[\"NAD83\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",29.5],PARAMETER[\"central_meridian\",-88.83333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"scale_factor\",0.99995],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",300000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"26994\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 26995, "epsg", 26995, + "NAD83 / Mississippi West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.9"); + add_proj4text (p, 1, + "9995 +x_0=700000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Mississippi West\",GEOGCS[\"NAD83\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",29.5],PARAMETER[\"central_meridian\",-90.33333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"scale_factor\",0.99995],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",700000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"26995\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 26996, "epsg", 26996, + "NAD83 / Missouri East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.9"); + add_proj4text (p, 1, + "99933333 +x_0=250000 +y_0=0 +ellps=GRS80 +datum=NAD83 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Missouri East\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",35.83333333333334],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-90.5],PARAMETER[\"scale_factor\",0.999933333],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",250000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"26996\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 26997, "epsg", 26997, + "NAD83 / Missouri Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.9"); + add_proj4text (p, 1, + "99933333 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Missouri Central\",GEOGCS[\"NAD83\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",35.83333333333334],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 9, + "n\",-92.5],PARAMETER[\"scale_factor\",0.999933333],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",0],AUTHORITY[\"EPSG\",\"26997\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 12, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 26998, "epsg", 26998, + "NAD83 / Missouri West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.9"); + add_proj4text (p, 1, + "99941177 +x_0=850000 +y_0=0 +ellps=GRS80 +datum=NAD83 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Missouri West\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",36.16666666666666],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-94.5],PARAMETER[\"scale_factor\",0.999941177],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",850000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"26998\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 27037, "epsg", 27037, + "Nahrwan 1967 / UTM zone 37N"); + add_proj4text (p, 0, "+proj=utm +zone=37 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nahrwan 1967 / UTM zone 37N\",GEOGCS[\"Nahrwan "); + add_srs_wkt (p, 1, + "1967\",DATUM[\"Nahrwan_1967\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6270\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4270\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",39],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, + "G\",\"27037\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 27038, "epsg", 27038, + "Nahrwan 1967 / UTM zone 38N"); + add_proj4text (p, 0, "+proj=utm +zone=38 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nahrwan 1967 / UTM zone 38N\",GEOGCS[\"Nahrwan "); + add_srs_wkt (p, 1, + "1967\",DATUM[\"Nahrwan_1967\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6270\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4270\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",45],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, + "G\",\"27038\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 27039, "epsg", 27039, + "Nahrwan 1967 / UTM zone 39N"); + add_proj4text (p, 0, "+proj=utm +zone=39 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nahrwan 1967 / UTM zone 39N\",GEOGCS[\"Nahrwan "); + add_srs_wkt (p, 1, + "1967\",DATUM[\"Nahrwan_1967\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6270\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4270\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",51],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, + "G\",\"27039\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 27040, "epsg", 27040, + "Nahrwan 1967 / UTM zone 40N"); + add_proj4text (p, 0, "+proj=utm +zone=40 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nahrwan 1967 / UTM zone 40N\",GEOGCS[\"Nahrwan "); + add_srs_wkt (p, 1, + "1967\",DATUM[\"Nahrwan_1967\",SPHEROID[\"Clarke 1880 (RG"); + add_srs_wkt (p, 2, + "S)\",6378249.145,293.465,AUTHORITY[\"EPSG\",\"7012\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6270\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4270\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",57],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, + "G\",\"27040\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 27120, "epsg", 27120, + "Naparima 1972 / UTM zone 20N"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Naparima 1972 / UTM zone 20N\",GEOGCS[\"Naparim"); + add_srs_wkt (p, 1, + "a 1972\",DATUM[\"Naparima_1972\",SPHEROID[\"Internationa"); + add_srs_wkt (p, 2, + "l 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6271\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"427"); + add_srs_wkt (p, 6, + "1\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",-63],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, + "\",\"27120\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",N"); + add_srs_wkt (p, 12, "ORTH]]"); + p = add_epsg_def (first, last, 27200, "epsg", 27200, + "NZGD49 / New Zealand Map Grid"); + add_proj4text (p, 0, + "+proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=60231"); + add_proj4text (p, 1, "50 +ellps=intl +datum=nzgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / New Zealand Map Grid\",GEOGCS[\"NZGD49"); + add_srs_wkt (p, 1, + "\",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\""); + add_srs_wkt (p, 2, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "22\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.599"); + add_srs_wkt (p, 4, + "3],AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 6, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 8, + "\"]],PROJECTION[\"New_Zealand_Map_Grid\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",-41],PARAMETER[\"central_meridian\",1"); + add_srs_wkt (p, 10, + "73],PARAMETER[\"false_easting\",2510000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",6023150],AUTHORITY[\"EPSG\",\"27200\"],AXI"); + add_srs_wkt (p, 12, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 27205, "epsg", 27205, + "NZGD49 / Mount Eden Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-36.87986527777778 +lon_0=174.7643393"); + add_proj4text (p, 1, + "611111 +k=0.9999 +x_0=300000 +y_0=700000 +ellps=intl +da"); + add_proj4text (p, 2, "tum=nzgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Mount Eden Circuit\",GEOGCS[\"NZGD49\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",-36.87986527777778],PARAMETER[\"central_"); + add_srs_wkt (p, 10, + "meridian\",174.7643393611111],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 11, + ",0.9999],PARAMETER[\"false_easting\",300000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",700000],AUTHORITY[\"EPSG\",\"27205\"],A"); + add_srs_wkt (p, 13, "XIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27206, "epsg", 27206, + "NZGD49 / Bay of Plenty Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-37.76124980555556 +lon_0=176.4661972"); + add_proj4text (p, 1, + "5 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Bay of Plenty Circuit\",GEOGCS[\"NZGD4"); + add_srs_wkt (p, 1, + "9\",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\""); + add_srs_wkt (p, 2, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "22\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.599"); + add_srs_wkt (p, 4, + "3],AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 6, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 8, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",-37.76124980555556],PARAMETER[\"centra"); + add_srs_wkt (p, 10, + "l_meridian\",176.46619725],PARAMETER[\"scale_factor\",1]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",300000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",700000],AUTHORITY[\"EPSG\",\"27206\"],AXIS[\"N"); + add_srs_wkt (p, 13, "orthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27207, "epsg", 27207, + "NZGD49 / Poverty Bay Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-38.62470277777778 +lon_0=177.8856362"); + add_proj4text (p, 1, + "777778 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Poverty Bay Circuit\",GEOGCS[\"NZGD49\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",-38.62470277777778],PARAMETER[\"central_"); + add_srs_wkt (p, 10, + "meridian\",177.8856362777778],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 11, + ",1],PARAMETER[\"false_easting\",300000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",700000],AUTHORITY[\"EPSG\",\"27207\"],AXIS["); + add_srs_wkt (p, 13, "\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27208, "epsg", 27208, + "NZGD49 / Hawkes Bay Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-39.65092930555556 +lon_0=176.6736805"); + add_proj4text (p, 1, + "277778 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Hawkes Bay Circuit\",GEOGCS[\"NZGD49\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",-39.65092930555556],PARAMETER[\"central_"); + add_srs_wkt (p, 10, + "meridian\",176.6736805277778],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 11, + ",1],PARAMETER[\"false_easting\",300000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",700000],AUTHORITY[\"EPSG\",\"27208\"],AXIS["); + add_srs_wkt (p, 13, "\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27209, "epsg", 27209, + "NZGD49 / Taranaki Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-39.13575830555556 +lon_0=174.2280117"); + add_proj4text (p, 1, + "5 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Taranaki Circuit\",GEOGCS[\"NZGD49\",D"); + add_srs_wkt (p, 1, + "ATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Inte"); + add_srs_wkt (p, 2, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",-39.13575830555556],PARAMETER[\"central_mer"); + add_srs_wkt (p, 10, + "idian\",174.22801175],PARAMETER[\"scale_factor\",1],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_easting\",300000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 12, + "ng\",700000],AUTHORITY[\"EPSG\",\"27209\"],AXIS[\"Northi"); + add_srs_wkt (p, 13, "ng\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27210, "epsg", 27210, + "NZGD49 / Tuhirangi Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-39.51247038888889 +lon_0=175.6400368"); + add_proj4text (p, 1, + "055556 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Tuhirangi Circuit\",GEOGCS[\"NZGD49\","); + add_srs_wkt (p, 1, + "DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Int"); + add_srs_wkt (p, 2, + "ernational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",-39.51247038888889],PARAMETER[\"central_mer"); + add_srs_wkt (p, 10, + "idian\",175.6400368055556],PARAMETER[\"scale_factor\",1]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",300000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",700000],AUTHORITY[\"EPSG\",\"27210\"],AXIS[\"N"); + add_srs_wkt (p, 13, "orthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27211, "epsg", 27211, + "NZGD49 / Wanganui Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-40.24194713888889 +lon_0=175.4880996"); + add_proj4text (p, 1, + "111111 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Wanganui Circuit\",GEOGCS[\"NZGD49\",D"); + add_srs_wkt (p, 1, + "ATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Inte"); + add_srs_wkt (p, 2, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",-40.24194713888889],PARAMETER[\"central_mer"); + add_srs_wkt (p, 10, + "idian\",175.4880996111111],PARAMETER[\"scale_factor\",1]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",300000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",700000],AUTHORITY[\"EPSG\",\"27211\"],AXIS[\"N"); + add_srs_wkt (p, 13, "orthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27212, "epsg", 27212, + "NZGD49 / Wairarapa Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-40.92553263888889 +lon_0=175.6473496"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Wairarapa Circuit\",GEOGCS[\"NZGD49\","); + add_srs_wkt (p, 1, + "DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Int"); + add_srs_wkt (p, 2, + "ernational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",-40.92553263888889],PARAMETER[\"central_mer"); + add_srs_wkt (p, 10, + "idian\",175.6473496666667],PARAMETER[\"scale_factor\",1]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",300000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",700000],AUTHORITY[\"EPSG\",\"27212\"],AXIS[\"N"); + add_srs_wkt (p, 13, "orthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27213, "epsg", 27213, + "NZGD49 / Wellington Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-41.30131963888888 +lon_0=174.7766231"); + add_proj4text (p, 1, + "111111 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Wellington Circuit\",GEOGCS[\"NZGD49\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",-41.30131963888888],PARAMETER[\"central_"); + add_srs_wkt (p, 10, + "meridian\",174.7766231111111],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 11, + ",1],PARAMETER[\"false_easting\",300000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",700000],AUTHORITY[\"EPSG\",\"27213\"],AXIS["); + add_srs_wkt (p, 13, "\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27214, "epsg", 27214, + "NZGD49 / Collingwood Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-40.71475905555556 +lon_0=172.6720465"); + add_proj4text (p, 1, + " +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Collingwood Circuit\",GEOGCS[\"NZGD49\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",-40.71475905555556],PARAMETER[\"central_"); + add_srs_wkt (p, 10, + "meridian\",172.6720465],PARAMETER[\"scale_factor\",1],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",300000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",700000],AUTHORITY[\"EPSG\",\"27214\"],AXIS[\"Nort"); + add_srs_wkt (p, 13, "hing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27215, "epsg", 27215, + "NZGD49 / Nelson Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-41.27454472222222 +lon_0=173.2993168"); + add_proj4text (p, 1, + "055555 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Nelson Circuit\",GEOGCS[\"NZGD49\",DAT"); + add_srs_wkt (p, 1, + "UM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Intern"); + add_srs_wkt (p, 2, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",-41.27454472222222],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",173.2993168055555],PARAMETER[\"scale_factor\",1],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_easting\",300000],PARAMETER[\"false_no"); + add_srs_wkt (p, 12, + "rthing\",700000],AUTHORITY[\"EPSG\",\"27215\"],AXIS[\"No"); + add_srs_wkt (p, 13, "rthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27216, "epsg", 27216, + "NZGD49 / Karamea Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-41.28991152777778 +lon_0=172.1090281"); + add_proj4text (p, 1, + "944444 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Karamea Circuit\",GEOGCS[\"NZGD49\",DA"); + add_srs_wkt (p, 1, + "TUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Inter"); + add_srs_wkt (p, 2, + "national 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",-41.28991152777778],PARAMETER[\"central_mer"); + add_srs_wkt (p, 10, + "idian\",172.1090281944444],PARAMETER[\"scale_factor\",1]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",300000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",700000],AUTHORITY[\"EPSG\",\"27216\"],AXIS[\"N"); + add_srs_wkt (p, 13, "orthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27217, "epsg", 27217, + "NZGD49 / Buller Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-41.81080286111111 +lon_0=171.5812600"); + add_proj4text (p, 1, + "555556 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Buller Circuit\",GEOGCS[\"NZGD49\",DAT"); + add_srs_wkt (p, 1, + "UM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Intern"); + add_srs_wkt (p, 2, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",-41.81080286111111],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",171.5812600555556],PARAMETER[\"scale_factor\",1],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_easting\",300000],PARAMETER[\"false_no"); + add_srs_wkt (p, 12, + "rthing\",700000],AUTHORITY[\"EPSG\",\"27217\"],AXIS[\"No"); + add_srs_wkt (p, 13, "rthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27218, "epsg", 27218, + "NZGD49 / Grey Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-42.33369427777778 +lon_0=171.5497713"); + add_proj4text (p, 1, + "055556 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Grey Circuit\",GEOGCS[\"NZGD49\",DATUM"); + add_srs_wkt (p, 1, + "[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"427"); + add_srs_wkt (p, 7, + "2\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",-42.33369427777778],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",171.5497713055556],PARAMETER[\"scale_factor\",1],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",300000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",700000],AUTHORITY[\"EPSG\",\"27218\"],AXIS[\"Nort"); + add_srs_wkt (p, 13, "hing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27219, "epsg", 27219, + "NZGD49 / Amuri Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-42.68911658333333 +lon_0=173.0101333"); + add_proj4text (p, 1, + "888889 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Amuri Circuit\",GEOGCS[\"NZGD49\",DATU"); + add_srs_wkt (p, 1, + "M[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "72\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",-42.68911658333333],PARAMETER[\"central_merid"); + add_srs_wkt (p, 10, + "ian\",173.0101333888889],PARAMETER[\"scale_factor\",1],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",300000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",700000],AUTHORITY[\"EPSG\",\"27219\"],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27220, "epsg", 27220, + "NZGD49 / Marlborough Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-41.54448666666666 +lon_0=173.8020741"); + add_proj4text (p, 1, + "111111 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Marlborough Circuit\",GEOGCS[\"NZGD49\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",-41.54448666666666],PARAMETER[\"central_"); + add_srs_wkt (p, 10, + "meridian\",173.8020741111111],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 11, + ",1],PARAMETER[\"false_easting\",300000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",700000],AUTHORITY[\"EPSG\",\"27220\"],AXIS["); + add_srs_wkt (p, 13, "\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27221, "epsg", 27221, + "NZGD49 / Hokitika Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-42.88632236111111 +lon_0=170.9799935"); + add_proj4text (p, 1, + " +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Hokitika Circuit\",GEOGCS[\"NZGD49\",D"); + add_srs_wkt (p, 1, + "ATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Inte"); + add_srs_wkt (p, 2, + "rnational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",-42.88632236111111],PARAMETER[\"central_mer"); + add_srs_wkt (p, 10, + "idian\",170.9799935],PARAMETER[\"scale_factor\",1],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",300000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",700000],AUTHORITY[\"EPSG\",\"27221\"],AXIS[\"Northin"); + add_srs_wkt (p, 13, "g\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27222, "epsg", 27222, + "NZGD49 / Okarito Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-43.11012813888889 +lon_0=170.2609258"); + add_proj4text (p, 1, + "333333 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Okarito Circuit\",GEOGCS[\"NZGD49\",DA"); + add_srs_wkt (p, 1, + "TUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Inter"); + add_srs_wkt (p, 2, + "national 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]"); + add_srs_wkt (p, 3, + "],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",-43.11012813888889],PARAMETER[\"central_mer"); + add_srs_wkt (p, 10, + "idian\",170.2609258333333],PARAMETER[\"scale_factor\",1]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",300000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",700000],AUTHORITY[\"EPSG\",\"27222\"],AXIS[\"N"); + add_srs_wkt (p, 13, "orthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27223, "epsg", 27223, + "NZGD49 / Jacksons Bay Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-43.97780288888889 +lon_0=168.606267 "); + add_proj4text (p, 1, + "+k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=nzgd49 +"); + add_proj4text (p, 2, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Jacksons Bay Circuit\",GEOGCS[\"NZGD49"); + add_srs_wkt (p, 1, + "\",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\""); + add_srs_wkt (p, 2, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "22\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.599"); + add_srs_wkt (p, 4, + "3],AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 6, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 8, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",-43.97780288888889],PARAMETER[\"centra"); + add_srs_wkt (p, 10, + "l_meridian\",168.606267],PARAMETER[\"scale_factor\",1],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",300000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",700000],AUTHORITY[\"EPSG\",\"27223\"],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27224, "epsg", 27224, + "NZGD49 / Mount Pleasant Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-43.59063758333333 +lon_0=172.7271935"); + add_proj4text (p, 1, + "833333 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Mount Pleasant Circuit\",GEOGCS[\"NZGD"); + add_srs_wkt (p, 1, + "49\",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID["); + add_srs_wkt (p, 2, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7022\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5"); + add_srs_wkt (p, 4, + "993],AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",-43.59063758333333],PARAMETER[\"cent"); + add_srs_wkt (p, 10, + "ral_meridian\",172.7271935833333],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 11, + "or\",1],PARAMETER[\"false_easting\",300000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",700000],AUTHORITY[\"EPSG\",\"27224\"],A"); + add_srs_wkt (p, 13, "XIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27225, "epsg", 27225, + "NZGD49 / Gawler Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-43.74871155555556 +lon_0=171.3607484"); + add_proj4text (p, 1, + "722222 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Gawler Circuit\",GEOGCS[\"NZGD49\",DAT"); + add_srs_wkt (p, 1, + "UM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Intern"); + add_srs_wkt (p, 2, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",-43.74871155555556],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",171.3607484722222],PARAMETER[\"scale_factor\",1],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_easting\",300000],PARAMETER[\"false_no"); + add_srs_wkt (p, 12, + "rthing\",700000],AUTHORITY[\"EPSG\",\"27225\"],AXIS[\"No"); + add_srs_wkt (p, 13, "rthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27226, "epsg", 27226, + "NZGD49 / Timaru Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-44.40222036111111 +lon_0=171.0572508"); + add_proj4text (p, 1, + "333333 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Timaru Circuit\",GEOGCS[\"NZGD49\",DAT"); + add_srs_wkt (p, 1, + "UM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Intern"); + add_srs_wkt (p, 2, + "ational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",-44.40222036111111],PARAMETER[\"central_meri"); + add_srs_wkt (p, 10, + "dian\",171.0572508333333],PARAMETER[\"scale_factor\",1],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_easting\",300000],PARAMETER[\"false_no"); + add_srs_wkt (p, 12, + "rthing\",700000],AUTHORITY[\"EPSG\",\"27226\"],AXIS[\"No"); + add_srs_wkt (p, 13, "rthing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27227, "epsg", 27227, + "NZGD49 / Lindis Peak Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-44.73526797222222 +lon_0=169.4677550"); + add_proj4text (p, 1, + "833333 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Lindis Peak Circuit\",GEOGCS[\"NZGD49\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",-44.73526797222222],PARAMETER[\"central_"); + add_srs_wkt (p, 10, + "meridian\",169.4677550833333],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 11, + ",1],PARAMETER[\"false_easting\",300000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",700000],AUTHORITY[\"EPSG\",\"27227\"],AXIS["); + add_srs_wkt (p, 13, "\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27228, "epsg", 27228, + "NZGD49 / Mount Nicholas Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-45.13290258333333 +lon_0=168.3986411"); + add_proj4text (p, 1, + "944444 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Mount Nicholas Circuit\",GEOGCS[\"NZGD"); + add_srs_wkt (p, 1, + "49\",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID["); + add_srs_wkt (p, 2, + "\"International 1924\",6378388,297,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7022\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5"); + add_srs_wkt (p, 4, + "993],AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 5, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 6, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 9, + "atitude_of_origin\",-45.13290258333333],PARAMETER[\"cent"); + add_srs_wkt (p, 10, + "ral_meridian\",168.3986411944444],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 11, + "or\",1],PARAMETER[\"false_easting\",300000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",700000],AUTHORITY[\"EPSG\",\"27228\"],A"); + add_srs_wkt (p, 13, "XIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27229, "epsg", 27229, + "NZGD49 / Mount York Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-45.56372616666666 +lon_0=167.7388617"); + add_proj4text (p, 1, + "777778 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Mount York Circuit\",GEOGCS[\"NZGD49\""); + add_srs_wkt (p, 1, + ",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",-45.56372616666666],PARAMETER[\"central_"); + add_srs_wkt (p, 10, + "meridian\",167.7388617777778],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 11, + ",1],PARAMETER[\"false_easting\",300000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",700000],AUTHORITY[\"EPSG\",\"27229\"],AXIS["); + add_srs_wkt (p, 13, "\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27230, "epsg", 27230, + "NZGD49 / Observation Point Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-45.81619661111111 +lon_0=170.6285951"); + add_proj4text (p, 1, + "666667 +k=1 +x_0=300000 +y_0=700000 +ellps=intl +datum=n"); + add_proj4text (p, 2, "zgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Observation Point Circuit\",GEOGCS[\"N"); + add_srs_wkt (p, 1, + "ZGD49\",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7022\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-"); + add_srs_wkt (p, 4, + "4.5993],AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 5, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "latitude_of_origin\",-45.81619661111111],PARAMETER[\"cen"); + add_srs_wkt (p, 10, + "tral_meridian\",170.6285951666667],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 11, + "tor\",1],PARAMETER[\"false_easting\",300000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",700000],AUTHORITY[\"EPSG\",\"27230\"],A"); + add_srs_wkt (p, 13, "XIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27231, "epsg", 27231, + "NZGD49 / North Taieri Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-45.86151336111111 +lon_0=170.2825891"); + add_proj4text (p, 1, + "111111 +k=0.99996 +x_0=300000 +y_0=700000 +ellps=intl +d"); + add_proj4text (p, 2, "atum=nzgd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / North Taieri Circuit\",GEOGCS[\"NZGD49"); + add_srs_wkt (p, 1, + "\",DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\""); + add_srs_wkt (p, 2, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "22\"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.599"); + add_srs_wkt (p, 4, + "3],AUTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 6, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"4272\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 8, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",-45.86151336111111],PARAMETER[\"centra"); + add_srs_wkt (p, 10, + "l_meridian\",170.2825891111111],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 11, + "\",0.99996],PARAMETER[\"false_easting\",300000],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_northing\",700000],AUTHORITY[\"EPSG\",\"27231\""); + add_srs_wkt (p, 13, "],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27232, "epsg", 27232, + "NZGD49 / Bluff Circuit"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-46.60000961111111 +lon_0=168.342872 "); + add_proj4text (p, 1, + "+k=1 +x_0=300002.66 +y_0=699999.58 +ellps=intl +datum=nz"); + add_proj4text (p, 2, "gd49 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / Bluff Circuit\",GEOGCS[\"NZGD49\",DATU"); + add_srs_wkt (p, 1, + "M[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Interna"); + add_srs_wkt (p, 2, + "tional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],"); + add_srs_wkt (p, 3, + "TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "72\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",-46.60000961111111],PARAMETER[\"central_merid"); + add_srs_wkt (p, 10, + "ian\",168.342872],PARAMETER[\"scale_factor\",1],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_easting\",300002.66],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",699999.58],AUTHORITY[\"EPSG\",\"27232\"],AXIS[\"Nort"); + add_srs_wkt (p, 13, "hing\",NORTH],AXIS[\"Easting\",EAST]]"); + p = add_epsg_def (first, last, 27258, "epsg", 27258, + "NZGD49 / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=intl +datum=nzgd49 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / UTM zone 58S\",GEOGCS[\"NZGD49\",DATUM"); + add_srs_wkt (p, 1, + "[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"427"); + add_srs_wkt (p, 7, + "2\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",165],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",10000000],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"27258\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 13, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 27259, "epsg", 27259, + "NZGD49 / UTM zone 59S"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +south +ellps=intl +datum=nzgd49 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / UTM zone 59S\",GEOGCS[\"NZGD49\",DATUM"); + add_srs_wkt (p, 1, + "[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"427"); + add_srs_wkt (p, 7, + "2\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",171],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",10000000],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"27259\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 13, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 27260, "epsg", 27260, + "NZGD49 / UTM zone 60S"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +south +ellps=intl +datum=nzgd49 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / UTM zone 60S\",GEOGCS[\"NZGD49\",DATUM"); + add_srs_wkt (p, 1, + "[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Internat"); + add_srs_wkt (p, 2, + "ional 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 6, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"427"); + add_srs_wkt (p, 7, + "2\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 8, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 9, + "_origin\",0],PARAMETER[\"central_meridian\",177],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",10000000],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"27260\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 13, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 27291, "epsg", 27291, + "NZGD49 / North Island Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-39 +lon_0=175.5 +k=1 +x_0=274319.524"); + add_proj4text (p, 1, + "3848086 +y_0=365759.3658464114 +ellps=intl +datum=nzgd49"); + add_proj4text (p, 2, " +to_meter=0.9143984146160287 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / North Island Grid\",GEOGCS[\"NZGD49\","); + add_srs_wkt (p, 1, + "DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Int"); + add_srs_wkt (p, 2, + "ernational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4272\"]],UNIT[\"British yard (Sears 1922)\",0.9143984146"); + add_srs_wkt (p, 8, + "160287,AUTHORITY[\"EPSG\",\"9040\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 9, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",-39],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"central_meridian\",175.5],PARAMETER[\"scale_f"); + add_srs_wkt (p, 11, + "actor\",1],PARAMETER[\"false_easting\",300000],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_northing\",400000],AUTHORITY[\"EPSG\",\"27291\""); + add_srs_wkt (p, 13, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 27292, "epsg", 27292, + "NZGD49 / South Island Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=-44 +lon_0=171.5 +k=1 +x_0=457199.207"); + add_proj4text (p, 1, + "3080143 +y_0=457199.2073080143 +ellps=intl +datum=nzgd49"); + add_proj4text (p, 2, " +to_meter=0.9143984146160287 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NZGD49 / South Island Grid\",GEOGCS[\"NZGD49\","); + add_srs_wkt (p, 1, + "DATUM[\"New_Zealand_Geodetic_Datum_1949\",SPHEROID[\"Int"); + add_srs_wkt (p, 2, + "ernational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6272\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 5, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 6, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4272\"]],UNIT[\"British yard (Sears 1922)\",0.9143984146"); + add_srs_wkt (p, 8, + "160287,AUTHORITY[\"EPSG\",\"9040\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 9, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",-44],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"central_meridian\",171.5],PARAMETER[\"scale_f"); + add_srs_wkt (p, 11, + "actor\",1],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_northing\",500000],AUTHORITY[\"EPSG\",\"27292\""); + add_srs_wkt (p, 13, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 27391, "epsg", 27391, + "NGO 1948 (Oslo) / NGO zone I"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=58 +lon_0=-4.666666666666667 +k=1 +x_"); + add_proj4text (p, 1, + "0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84="); + add_proj4text (p, 2, + "278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NGO 1948 (Oslo) / NGO zone I\",GEOGCS[\"NGO 194"); + add_srs_wkt (p, 1, + "8 (Oslo)\",DATUM[\"NGO_1948_Oslo\",SPHEROID[\"Bessel Mod"); + add_srs_wkt (p, 2, + "ified\",6377492.018,299.1528128,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "5\"]],TOWGS84[278.3,93,474.5,7.889,0.05,-6.61,6.21],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6817\"]],PRIMEM[\"Oslo\",10.72291666666"); + add_srs_wkt (p, 5, + "667,AUTHORITY[\"EPSG\",\"8913\"]],UNIT[\"degree\",0.0174"); + add_srs_wkt (p, 6, + "5329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4817\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "latitude_of_origin\",58],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 10, + "-4.666666666666667],PARAMETER[\"scale_factor\",1],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",0],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"27391\"],AXIS[\"x\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "y\",EAST]]"); + p = add_epsg_def (first, last, 27392, "epsg", 27392, + "NGO 1948 (Oslo) / NGO zone II"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=58 +lon_0=-2.333333333333333 +k=1 +x_"); + add_proj4text (p, 1, + "0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84="); + add_proj4text (p, 2, + "278.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NGO 1948 (Oslo) / NGO zone II\",GEOGCS[\"NGO 19"); + add_srs_wkt (p, 1, + "48 (Oslo)\",DATUM[\"NGO_1948_Oslo\",SPHEROID[\"Bessel Mo"); + add_srs_wkt (p, 2, + "dified\",6377492.018,299.1528128,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "05\"]],TOWGS84[278.3,93,474.5,7.889,0.05,-6.61,6.21],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6817\"]],PRIMEM[\"Oslo\",10.7229166666"); + add_srs_wkt (p, 5, + "6667,AUTHORITY[\"EPSG\",\"8913\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4817\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "latitude_of_origin\",58],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 10, + "-2.333333333333333],PARAMETER[\"scale_factor\",1],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",0],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"27392\"],AXIS[\"x\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "y\",EAST]]"); + p = add_epsg_def (first, last, 27393, "epsg", 27393, + "NGO 1948 (Oslo) / NGO zone III"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=58 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=637"); + add_proj4text (p, 1, + "7492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,7."); + add_proj4text (p, 2, "889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NGO 1948 (Oslo) / NGO zone III\",GEOGCS[\"NGO 1"); + add_srs_wkt (p, 1, + "948 (Oslo)\",DATUM[\"NGO_1948_Oslo\",SPHEROID[\"Bessel M"); + add_srs_wkt (p, 2, + "odified\",6377492.018,299.1528128,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "005\"]],TOWGS84[278.3,93,474.5,7.889,0.05,-6.61,6.21],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6817\"]],PRIMEM[\"Oslo\",10.722916666"); + add_srs_wkt (p, 5, + "66667,AUTHORITY[\"EPSG\",\"8913\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4817\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 8, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"latitude_of_origin\",58],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 10, + "\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_ea"); + add_srs_wkt (p, 11, + "sting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, "PSG\",\"27393\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 27394, "epsg", 27394, + "NGO 1948 (Oslo) / NGO zone IV"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=58 +lon_0=2.5 +k=1 +x_0=0 +y_0=0 +a=6"); + add_proj4text (p, 1, + "377492.018 +b=6356173.508712696 +towgs84=278.3,93,474.5,"); + add_proj4text (p, 2, "7.889,0.05,-6.61,6.21 +pm=oslo +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NGO 1948 (Oslo) / NGO zone IV\",GEOGCS[\"NGO 19"); + add_srs_wkt (p, 1, + "48 (Oslo)\",DATUM[\"NGO_1948_Oslo\",SPHEROID[\"Bessel Mo"); + add_srs_wkt (p, 2, + "dified\",6377492.018,299.1528128,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "05\"]],TOWGS84[278.3,93,474.5,7.889,0.05,-6.61,6.21],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6817\"]],PRIMEM[\"Oslo\",10.7229166666"); + add_srs_wkt (p, 5, + "6667,AUTHORITY[\"EPSG\",\"8913\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4817\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "latitude_of_origin\",58],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 10, + "2.5],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 12, "SG\",\"27394\"],AXIS[\"x\",NORTH],AXIS[\"y\",EAST]]"); + p = add_epsg_def (first, last, 27395, "epsg", 27395, + "NGO 1948 (Oslo) / NGO zone V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=58 +lon_0=6.166666666666667 +k=1 +x_0"); + add_proj4text (p, 1, + "=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=2"); + add_proj4text (p, 2, + "78.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NGO 1948 (Oslo) / NGO zone V\",GEOGCS[\"NGO 194"); + add_srs_wkt (p, 1, + "8 (Oslo)\",DATUM[\"NGO_1948_Oslo\",SPHEROID[\"Bessel Mod"); + add_srs_wkt (p, 2, + "ified\",6377492.018,299.1528128,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "5\"]],TOWGS84[278.3,93,474.5,7.889,0.05,-6.61,6.21],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6817\"]],PRIMEM[\"Oslo\",10.72291666666"); + add_srs_wkt (p, 5, + "667,AUTHORITY[\"EPSG\",\"8913\"]],UNIT[\"degree\",0.0174"); + add_srs_wkt (p, 6, + "5329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4817\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "latitude_of_origin\",58],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 10, + "6.166666666666667],PARAMETER[\"scale_factor\",1],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",0],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"27395\"],AXIS[\"x\",NORTH],AXIS[\"y"); + add_srs_wkt (p, 13, "\",EAST]]"); + p = add_epsg_def (first, last, 27396, "epsg", 27396, + "NGO 1948 (Oslo) / NGO zone VI"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=58 +lon_0=10.16666666666667 +k=1 +x_0"); + add_proj4text (p, 1, + "=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=2"); + add_proj4text (p, 2, + "78.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NGO 1948 (Oslo) / NGO zone VI\",GEOGCS[\"NGO 19"); + add_srs_wkt (p, 1, + "48 (Oslo)\",DATUM[\"NGO_1948_Oslo\",SPHEROID[\"Bessel Mo"); + add_srs_wkt (p, 2, + "dified\",6377492.018,299.1528128,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "05\"]],TOWGS84[278.3,93,474.5,7.889,0.05,-6.61,6.21],AUT"); + add_srs_wkt (p, 4, + "HORITY[\"EPSG\",\"6817\"]],PRIMEM[\"Oslo\",10.7229166666"); + add_srs_wkt (p, 5, + "6667,AUTHORITY[\"EPSG\",\"8913\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 6, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"4817\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 8, + "9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "latitude_of_origin\",58],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 10, + "10.16666666666667],PARAMETER[\"scale_factor\",1],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",0],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"27396\"],AXIS[\"x\",NORTH],AXIS[\"y"); + add_srs_wkt (p, 13, "\",EAST]]"); + p = add_epsg_def (first, last, 27397, "epsg", 27397, + "NGO 1948 (Oslo) / NGO zone VII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=58 +lon_0=14.16666666666667 +k=1 +x_0"); + add_proj4text (p, 1, + "=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=2"); + add_proj4text (p, 2, + "78.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NGO 1948 (Oslo) / NGO zone VII\",GEOGCS[\"NGO 1"); + add_srs_wkt (p, 1, + "948 (Oslo)\",DATUM[\"NGO_1948_Oslo\",SPHEROID[\"Bessel M"); + add_srs_wkt (p, 2, + "odified\",6377492.018,299.1528128,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "005\"]],TOWGS84[278.3,93,474.5,7.889,0.05,-6.61,6.21],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6817\"]],PRIMEM[\"Oslo\",10.722916666"); + add_srs_wkt (p, 5, + "66667,AUTHORITY[\"EPSG\",\"8913\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 6, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4817\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 8, + "\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"latitude_of_origin\",58],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 10, + "\",14.16666666666667],PARAMETER[\"scale_factor\",1],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_easting\",0],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"27397\"],AXIS[\"x\",NORTH],AXIS["); + add_srs_wkt (p, 13, "\"y\",EAST]]"); + p = add_epsg_def (first, last, 27398, "epsg", 27398, + "NGO 1948 (Oslo) / NGO zone VIII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=58 +lon_0=18.33333333333333 +k=1 +x_0"); + add_proj4text (p, 1, + "=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 +towgs84=2"); + add_proj4text (p, 2, + "78.3,93,474.5,7.889,0.05,-6.61,6.21 +pm=oslo +units=m +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NGO 1948 (Oslo) / NGO zone VIII\",GEOGCS[\"NGO "); + add_srs_wkt (p, 1, + "1948 (Oslo)\",DATUM[\"NGO_1948_Oslo\",SPHEROID[\"Bessel "); + add_srs_wkt (p, 2, + "Modified\",6377492.018,299.1528128,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7005\"]],TOWGS84[278.3,93,474.5,7.889,0.05,-6.61,6.21],A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"6817\"]],PRIMEM[\"Oslo\",10.72291666"); + add_srs_wkt (p, 5, + "666667,AUTHORITY[\"EPSG\",\"8913\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 6, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"4817\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"latitude_of_origin\",58],PARAMETER[\"central_meridia"); + add_srs_wkt (p, 10, + "n\",18.33333333333333],PARAMETER[\"scale_factor\",1],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",0],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"27398\"],AXIS[\"x\",NORTH],AXIS"); + add_srs_wkt (p, 13, "[\"y\",EAST]]"); + p = add_epsg_def (first, last, 27429, "epsg", 27429, + "Datum 73 / UTM zone 29N"); + add_proj4text (p, 0, "+proj=utm +zone=29 +ellps=intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Datum 73 / UTM zone 29N\",GEOGCS[\"Datum 73\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Datum_73\",SPHEROID[\"International 1924\",637838"); + add_srs_wkt (p, 2, + "8,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "6274\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 4, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 5, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4274\"]],UNIT[\"met"); + add_srs_wkt (p, 6, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 7, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 8, + "AMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 9, + "\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_northing\",0],AUTHORITY[\"EPSG\",\"27429\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 27492, "epsg", 27492, + "Datum 73 / Modified Portuguese Grid (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111"); + add_proj4text (p, 1, + "111112 +k=1 +x_0=180.598 +y_0=-86.98999999999999 +ellps="); + add_proj4text (p, 2, "intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Datum 73 / Modified Portuguese Grid (deprecated"); + add_srs_wkt (p, 1, + ")\",GEOGCS[\"Datum 73\",DATUM[\"Datum_73\",SPHEROID[\"In"); + add_srs_wkt (p, 2, + "ternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6274\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4274\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",39.66666666666666],PARAMETER[\"centr"); + add_srs_wkt (p, 9, + "al_meridian\",-8.131906111111112],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",1],PARAMETER[\"false_easting\",180.598],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",-86.99],AUTHORITY[\"EPSG\",\"27492\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 27493, "epsg", 27493, + "Datum 73 / Modified Portuguese Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111"); + add_proj4text (p, 1, + "111112 +k=1 +x_0=180.598 +y_0=-86.98999999999999 +ellps="); + add_proj4text (p, 2, "intl +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Datum 73 / Modified Portuguese Grid\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Datum 73\",DATUM[\"Datum_73\",SPHEROID[\"International 1"); + add_srs_wkt (p, 2, + "924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6274\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4274\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",39.66666666666666],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-8.131906111111112],PARAMETER[\"scale_factor\",1],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_easting\",180.598],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",-86.99],AUTHORITY[\"EPSG\",\"27493\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 12, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27500, "epsg", 27500, "unnamed"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49.5 +lat_0=49.5 +lon_0=5.4 +k_0=0.9995"); + add_proj4text (p, 1, + "0908 +x_0=500000 +y_0=300000 +a=6376523 +b=6355862.93325"); + add_proj4text (p, 2, "5573 +pm=2.3372291666985 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"unnamed\",GEOGCS[\"unnamed ellipse\",DATUM[\"un"); + add_srs_wkt (p, 1, + "known\",SPHEROID[\"unnamed\",6376523,308.6399999999991]]"); + add_srs_wkt (p, 2, + ",PRIMEM[\"unnamed\",2.3372291666985],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 3, + "174532925199433]],PROJECTION[\"Lambert_Conformal_Conic_1"); + add_srs_wkt (p, 4, + "SP\"],PARAMETER[\"latitude_of_origin\",49.5],PARAMETER[\""); + add_srs_wkt (p, 5, + "central_meridian\",5.4],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 6, + "50908],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 7, + "alse_northing\",300000],UNIT[\"Meter\",1],AUTHORITY[\"EP"); + add_srs_wkt (p, 8, "SG\",\"27500\"]]"); + p = add_epsg_def (first, last, 27561, "epsg", 27561, + "NTF (Paris) / Lambert Nord France"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a"); + add_proj4text (p, 2, + "=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm="); + add_proj4text (p, 3, "paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Lambert Nord France\",GEOGCS[\"NT"); + add_srs_wkt (p, 1, + "F (Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise_Par"); + add_srs_wkt (p, 2, + "is\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.466021"); + add_srs_wkt (p, 3, + "2936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60,3"); + add_srs_wkt (p, 4, + "20,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Paris"); + add_srs_wkt (p, 5, + "\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\""); + add_srs_wkt (p, 6, + ",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 8, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP"); + add_srs_wkt (p, 9, + "\"],PARAMETER[\"latitude_of_origin\",55],PARAMETER[\"cen"); + add_srs_wkt (p, 10, + "tral_meridian\",0],PARAMETER[\"scale_factor\",0.99987734"); + add_srs_wkt (p, 11, + "1],PARAMETER[\"false_easting\",600000],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_northing\",200000],AUTHORITY[\"EPSG\",\"27561\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27562, "epsg", 27562, + "NTF (Paris) / Lambert Centre France"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.999877"); + add_proj4text (p, 1, + "42 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towg"); + add_proj4text (p, 2, + "s84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Lambert Centre France\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NTF (Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise_P"); + add_srs_wkt (p, 2, + "aris\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660"); + add_srs_wkt (p, 3, + "212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60"); + add_srs_wkt (p, 4, + ",320,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Par"); + add_srs_wkt (p, 5, + "is\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"gra"); + add_srs_wkt (p, 6, + "d\",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 8, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1"); + add_srs_wkt (p, 9, + "SP\"],PARAMETER[\"latitude_of_origin\",52],PARAMETER[\"c"); + add_srs_wkt (p, 10, + "entral_meridian\",0],PARAMETER[\"scale_factor\",0.999877"); + add_srs_wkt (p, 11, + "42],PARAMETER[\"false_easting\",600000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",200000],AUTHORITY[\"EPSG\",\"27562\"],AXIS["); + add_srs_wkt (p, 13, "\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27563, "epsg", 27563, + "NTF (Paris) / Lambert Sud France"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=200000 +a"); + add_proj4text (p, 2, + "=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm="); + add_proj4text (p, 3, "paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Lambert Sud France\",GEOGCS[\"NTF"); + add_srs_wkt (p, 1, + " (Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise_Pari"); + add_srs_wkt (p, 2, + "s\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660212"); + add_srs_wkt (p, 3, + "936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60,32"); + add_srs_wkt (p, 4, + "0,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Paris\""); + add_srs_wkt (p, 5, + ",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\","); + add_srs_wkt (p, 6, + "0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 8, + "G\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",49],PARAMETER[\"centr"); + add_srs_wkt (p, 10, + "al_meridian\",0],PARAMETER[\"scale_factor\",0.999877499]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",600000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",200000],AUTHORITY[\"EPSG\",\"27563\"],AXIS[\"X"); + add_srs_wkt (p, 13, "\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27564, "epsg", 27564, + "NTF (Paris) / Lambert Corse"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=185861.36"); + add_proj4text (p, 2, + "9 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 "); + add_proj4text (p, 3, "+pm=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Lambert Corse\",GEOGCS[\"NTF (Par"); + add_srs_wkt (p, 1, + "is)\",DATUM[\"Nouvelle_Triangulation_Francaise_Paris\",S"); + add_srs_wkt (p, 2, + "PHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.466021293626"); + add_srs_wkt (p, 3, + "5,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60,320,0,0"); + add_srs_wkt (p, 4, + ",0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Paris\",2.3"); + add_srs_wkt (p, 5, + "3722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\",0.01"); + add_srs_wkt (p, 6, + "570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 8, + "\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"latitude_of_origin\",46.85],PARAMETER[\"centr"); + add_srs_wkt (p, 10, + "al_meridian\",0],PARAMETER[\"scale_factor\",0.99994471],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_easting\",234.358],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",185861.369],AUTHORITY[\"EPSG\",\"27564\"],AXIS"); + add_srs_wkt (p, 13, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27571, "epsg", 27571, + "NTF (Paris) / Lambert zone I"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +"); + add_proj4text (p, 2, + "a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm"); + add_proj4text (p, 3, "=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Lambert zone I\",GEOGCS[\"NTF (Pa"); + add_srs_wkt (p, 1, + "ris)\",DATUM[\"Nouvelle_Triangulation_Francaise_Paris\","); + add_srs_wkt (p, 2, + "SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.46602129362"); + add_srs_wkt (p, 3, + "65,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60,320,0,"); + add_srs_wkt (p, 4, + "0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Paris\",2."); + add_srs_wkt (p, 5, + "33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\",0.0"); + add_srs_wkt (p, 6, + "1570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHORITY"); + add_srs_wkt (p, 7, + "[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],"); + add_srs_wkt (p, 9, + "PARAMETER[\"latitude_of_origin\",55],PARAMETER[\"central"); + add_srs_wkt (p, 10, + "_meridian\",0],PARAMETER[\"scale_factor\",0.999877341],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",600000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",1200000],AUTHORITY[\"EPSG\",\"27571\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27572, "epsg", 27572, + "NTF (Paris) / Lambert zone II"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.999877"); + add_proj4text (p, 1, + "42 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +tow"); + add_proj4text (p, 2, + "gs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Lambert zone II\",GEOGCS[\"NTF (P"); + add_srs_wkt (p, 1, + "aris)\",DATUM[\"Nouvelle_Triangulation_Francaise_Paris\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660212936"); + add_srs_wkt (p, 3, + "265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60,320,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Paris\",2"); + add_srs_wkt (p, 5, + ".33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\",0."); + add_srs_wkt (p, 6, + "01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],"); + add_srs_wkt (p, 9, + "PARAMETER[\"latitude_of_origin\",52],PARAMETER[\"central"); + add_srs_wkt (p, 10, + "_meridian\",0],PARAMETER[\"scale_factor\",0.99987742],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",600000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",2200000],AUTHORITY[\"EPSG\",\"27572\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27573, "epsg", 27573, + "NTF (Paris) / Lambert zone III"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +"); + add_proj4text (p, 2, + "a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm"); + add_proj4text (p, 3, "=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Lambert zone III\",GEOGCS[\"NTF ("); + add_srs_wkt (p, 1, + "Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise_Paris\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660212936"); + add_srs_wkt (p, 3, + "265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60,320,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Paris\",2"); + add_srs_wkt (p, 5, + ".33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\",0."); + add_srs_wkt (p, 6, + "01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],"); + add_srs_wkt (p, 9, + "PARAMETER[\"latitude_of_origin\",49],PARAMETER[\"central"); + add_srs_wkt (p, 10, + "_meridian\",0],PARAMETER[\"scale_factor\",0.999877499],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_easting\",600000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",3200000],AUTHORITY[\"EPSG\",\"27573\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27574, "epsg", 27574, + "NTF (Paris) / Lambert zone IV"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=4185861.3"); + add_proj4text (p, 2, + "69 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0"); + add_proj4text (p, 3, " +pm=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Lambert zone IV\",GEOGCS[\"NTF (P"); + add_srs_wkt (p, 1, + "aris)\",DATUM[\"Nouvelle_Triangulation_Francaise_Paris\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660212936"); + add_srs_wkt (p, 3, + "265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60,320,0"); + add_srs_wkt (p, 4, + ",0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Paris\",2"); + add_srs_wkt (p, 5, + ".33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\",0."); + add_srs_wkt (p, 6, + "01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHORIT"); + add_srs_wkt (p, 7, + "Y[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 8, + ",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],"); + add_srs_wkt (p, 9, + "PARAMETER[\"latitude_of_origin\",46.85],PARAMETER[\"cent"); + add_srs_wkt (p, 10, + "ral_meridian\",0],PARAMETER[\"scale_factor\",0.99994471]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",234.358],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "northing\",4185861.369],AUTHORITY[\"EPSG\",\"27574\"],AX"); + add_srs_wkt (p, 13, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27581, "epsg", 27581, + "NTF (Paris) / France I (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +"); + add_proj4text (p, 2, + "a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm"); + add_proj4text (p, 3, "=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / France I (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NTF (Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise_P"); + add_srs_wkt (p, 2, + "aris\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660"); + add_srs_wkt (p, 3, + "212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60"); + add_srs_wkt (p, 4, + ",320,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Par"); + add_srs_wkt (p, 5, + "is\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"gra"); + add_srs_wkt (p, 6, + "d\",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 8, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1"); + add_srs_wkt (p, 9, + "SP\"],PARAMETER[\"latitude_of_origin\",55],PARAMETER[\"c"); + add_srs_wkt (p, 10, + "entral_meridian\",0],PARAMETER[\"scale_factor\",0.999877"); + add_srs_wkt (p, 11, + "341],PARAMETER[\"false_easting\",600000],PARAMETER[\"fal"); + add_srs_wkt (p, 12, + "se_northing\",1200000],AUTHORITY[\"EPSG\",\"27581\"],AXI"); + add_srs_wkt (p, 13, "S[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27582, "epsg", 27582, + "NTF (Paris) / France II (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.999877"); + add_proj4text (p, 1, + "42 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +tow"); + add_proj4text (p, 2, + "gs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / France II (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NTF (Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise_P"); + add_srs_wkt (p, 2, + "aris\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660"); + add_srs_wkt (p, 3, + "212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60"); + add_srs_wkt (p, 4, + ",320,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Par"); + add_srs_wkt (p, 5, + "is\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"gra"); + add_srs_wkt (p, 6, + "d\",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 8, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1"); + add_srs_wkt (p, 9, + "SP\"],PARAMETER[\"latitude_of_origin\",52],PARAMETER[\"c"); + add_srs_wkt (p, 10, + "entral_meridian\",0],PARAMETER[\"scale_factor\",0.999877"); + add_srs_wkt (p, 11, + "42],PARAMETER[\"false_easting\",600000],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",2200000],AUTHORITY[\"EPSG\",\"27582\"],AXIS"); + add_srs_wkt (p, 13, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27583, "epsg", 27583, + "NTF (Paris) / France III (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +"); + add_proj4text (p, 2, + "a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm"); + add_proj4text (p, 3, "=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / France III (deprecated)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NTF (Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise"); + add_srs_wkt (p, 2, + "_Paris\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.46"); + add_srs_wkt (p, 3, + "60212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-"); + add_srs_wkt (p, 4, + "60,320,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"P"); + add_srs_wkt (p, 5, + "aris\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"g"); + add_srs_wkt (p, 6, + "rad\",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY"); + add_srs_wkt (p, 8, + "[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Coni"); + add_srs_wkt (p, 9, + "c_1SP\"],PARAMETER[\"latitude_of_origin\",49],PARAMETER["); + add_srs_wkt (p, 10, + "\"central_meridian\",0],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 11, + "877499],PARAMETER[\"false_easting\",600000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",3200000],AUTHORITY[\"EPSG\",\"27583\"],"); + add_srs_wkt (p, 13, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27584, "epsg", 27584, + "NTF (Paris) / France IV (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=4185861.3"); + add_proj4text (p, 2, + "69 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0"); + add_proj4text (p, 3, " +pm=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / France IV (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NTF (Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise_P"); + add_srs_wkt (p, 2, + "aris\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660"); + add_srs_wkt (p, 3, + "212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60"); + add_srs_wkt (p, 4, + ",320,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Par"); + add_srs_wkt (p, 5, + "is\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"gra"); + add_srs_wkt (p, 6, + "d\",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AU"); + add_srs_wkt (p, 7, + "THORITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 8, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1"); + add_srs_wkt (p, 9, + "SP\"],PARAMETER[\"latitude_of_origin\",46.85],PARAMETER["); + add_srs_wkt (p, 10, + "\"central_meridian\",0],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 11, + "94471],PARAMETER[\"false_easting\",234.358],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",4185861.369],AUTHORITY[\"EPSG\",\"27584"); + add_srs_wkt (p, 13, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27591, "epsg", 27591, + "NTF (Paris) / Nord France (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a"); + add_proj4text (p, 2, + "=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm="); + add_proj4text (p, 3, "paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Nord France (deprecated)\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"NTF (Paris)\",DATUM[\"Nouvelle_Triangulation_Francais"); + add_srs_wkt (p, 2, + "e_Paris\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4"); + add_srs_wkt (p, 3, + "660212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,"); + add_srs_wkt (p, 4, + "-60,320,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\""); + add_srs_wkt (p, 5, + "Paris\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\""); + add_srs_wkt (p, 6, + "grad\",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]]"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 8, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Con"); + add_srs_wkt (p, 9, + "ic_1SP\"],PARAMETER[\"latitude_of_origin\",55],PARAMETER"); + add_srs_wkt (p, 10, + "[\"central_meridian\",0],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 11, + "9877341],PARAMETER[\"false_easting\",600000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",200000],AUTHORITY[\"EPSG\",\"27591\"],A"); + add_srs_wkt (p, 13, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27592, "epsg", 27592, + "NTF (Paris) / Centre France (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.999877"); + add_proj4text (p, 1, + "42 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towg"); + add_proj4text (p, 2, + "s84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Centre France (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"NTF (Paris)\",DATUM[\"Nouvelle_Triangulation_Franca"); + add_srs_wkt (p, 2, + "ise_Paris\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293"); + add_srs_wkt (p, 3, + ".4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-16"); + add_srs_wkt (p, 4, + "8,-60,320,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM["); + add_srs_wkt (p, 5, + "\"Paris\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT["); + add_srs_wkt (p, 6, + "\"grad\",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\""); + add_srs_wkt (p, 7, + "]],AUTHORITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 8, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_C"); + add_srs_wkt (p, 9, + "onic_1SP\"],PARAMETER[\"latitude_of_origin\",52],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"central_meridian\",0],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 11, + "99987742],PARAMETER[\"false_easting\",600000],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_northing\",200000],AUTHORITY[\"EPSG\",\"27592\"]"); + add_srs_wkt (p, 13, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27593, "epsg", 27593, + "NTF (Paris) / Sud France (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=200000 +a"); + add_proj4text (p, 2, + "=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm="); + add_proj4text (p, 3, "paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Sud France (deprecated)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"NTF (Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise"); + add_srs_wkt (p, 2, + "_Paris\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.46"); + add_srs_wkt (p, 3, + "60212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-"); + add_srs_wkt (p, 4, + "60,320,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"P"); + add_srs_wkt (p, 5, + "aris\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"g"); + add_srs_wkt (p, 6, + "rad\",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],"); + add_srs_wkt (p, 7, + "AUTHORITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY"); + add_srs_wkt (p, 8, + "[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Coni"); + add_srs_wkt (p, 9, + "c_1SP\"],PARAMETER[\"latitude_of_origin\",49],PARAMETER["); + add_srs_wkt (p, 10, + "\"central_meridian\",0],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 11, + "877499],PARAMETER[\"false_easting\",600000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",200000],AUTHORITY[\"EPSG\",\"27593\"],A"); + add_srs_wkt (p, 13, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27594, "epsg", 27594, + "NTF (Paris) / Corse (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000"); + add_proj4text (p, 1, + "001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=185861.36"); + add_proj4text (p, 2, + "9 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 "); + add_proj4text (p, 3, "+pm=paris +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NTF (Paris) / Corse (deprecated)\",GEOGCS[\"NTF"); + add_srs_wkt (p, 1, + " (Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise_Pari"); + add_srs_wkt (p, 2, + "s\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.4660212"); + add_srs_wkt (p, 3, + "936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60,32"); + add_srs_wkt (p, 4, + "0,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Paris\""); + add_srs_wkt (p, 5, + ",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\","); + add_srs_wkt (p, 6, + "0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 8, + "G\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",46.85],PARAMETER[\"ce"); + add_srs_wkt (p, 10, + "ntral_meridian\",0],PARAMETER[\"scale_factor\",0.9999447"); + add_srs_wkt (p, 11, + "1],PARAMETER[\"false_easting\",234.358],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_northing\",185861.369],AUTHORITY[\"EPSG\",\"27594\"],A"); + add_srs_wkt (p, 13, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 27700, "epsg", 27700, + "OSGB 1936 / British National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400"); + add_proj4text (p, 1, + "000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"OSGB 1936 / British National Grid\",GEOGCS[\"OS"); + add_srs_wkt (p, 1, + "GB 1936\",DATUM[\"OSGB_1936\",SPHEROID[\"Airy 1830\",637"); + add_srs_wkt (p, 2, + "7563.396,299.3249646,AUTHORITY[\"EPSG\",\"7001\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6277\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"427"); + add_srs_wkt (p, 6, + "7\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",49],PARAMETER[\"central_meridian\",-2],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",0.9996012717],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",400000],PARAMETER[\"false_northing\",-100000],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"27700\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_23 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 28191, "epsg", 28191, + "Palestine 1923 / Palestine Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=31.73409694444445 +lon_0=35.2120805555"); + add_proj4text (p, 1, + "5556 +x_0=170251.555 +y_0=126867.909 +a=6378300.789 +b=6"); + add_proj4text (p, 2, + "356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.4"); + add_proj4text (p, 3, "2,-11.821,1 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Palestine 1923 / Palestine Grid\",GEOGCS[\"Pale"); + add_srs_wkt (p, 1, + "stine 1923\",DATUM[\"Palestine_1923\",SPHEROID[\"Clarke "); + add_srs_wkt (p, 2, + "1880 (Benoit)\",6378300.789,293.4663155389802,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7010\"]],TOWGS84[-275.722,94.7824,340.894,-8."); + add_srs_wkt (p, 4, + "001,-4.42,-11.821,1],AUTHORITY[\"EPSG\",\"6281\"]],PRIME"); + add_srs_wkt (p, 5, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 6, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 7, + "],AUTHORITY[\"EPSG\",\"4281\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 8, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Cassini_Soldner\"],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"latitude_of_origin\",31.73409694444445],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"central_meridian\",35.21208055555556],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",170251.555],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",126867.909],AUTHORITY[\"EPSG\",\"28191\"],AXIS[\"Eastin"); + add_srs_wkt (p, 13, "g\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28192, "epsg", 28192, + "Palestine 1923 / Palestine Belt"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31.73409694444445 +lon_0=35.212080555"); + add_proj4text (p, 1, + "55556 +k=1 +x_0=170251.555 +y_0=1126867.909 +a=6378300.7"); + add_proj4text (p, 2, + "89 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.0"); + add_proj4text (p, 3, "01,-4.42,-11.821,1 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Palestine 1923 / Palestine Belt\",GEOGCS[\"Pale"); + add_srs_wkt (p, 1, + "stine 1923\",DATUM[\"Palestine_1923\",SPHEROID[\"Clarke "); + add_srs_wkt (p, 2, + "1880 (Benoit)\",6378300.789,293.4663155389802,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7010\"]],TOWGS84[-275.722,94.7824,340.894,-8."); + add_srs_wkt (p, 4, + "001,-4.42,-11.821,1],AUTHORITY[\"EPSG\",\"6281\"]],PRIME"); + add_srs_wkt (p, 5, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 6, + "egree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]"); + add_srs_wkt (p, 7, + "],AUTHORITY[\"EPSG\",\"4281\"]],UNIT[\"metre\",1,AUTHORI"); + add_srs_wkt (p, 8, + "TY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",31.73409694444445],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"central_meridian\",35.21208055555556],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",170251"); + add_srs_wkt (p, 12, + ".555],PARAMETER[\"false_northing\",1126867.909],AUTHORIT"); + add_srs_wkt (p, 13, + "Y[\"EPSG\",\"28192\"],AXIS[\"Easting\",EAST],AXIS[\"Nort"); + add_srs_wkt (p, 14, "hing\",NORTH]]"); + p = add_epsg_def (first, last, 28193, "epsg", 28193, + "Palestine 1923 / Israeli CS Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=31.73409694444445 +lon_0=35.2120805555"); + add_proj4text (p, 1, + "5556 +x_0=170251.555 +y_0=1126867.909 +a=6378300.789 +b="); + add_proj4text (p, 2, + "6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4."); + add_proj4text (p, 3, "42,-11.821,1 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Palestine 1923 / Israeli CS Grid\",GEOGCS[\"Pal"); + add_srs_wkt (p, 1, + "estine 1923\",DATUM[\"Palestine_1923\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 2, + " 1880 (Benoit)\",6378300.789,293.4663155389802,AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"7010\"]],TOWGS84[-275.722,94.7824,340.894,-8"); + add_srs_wkt (p, 4, + ".001,-4.42,-11.821,1],AUTHORITY[\"EPSG\",\"6281\"]],PRIM"); + add_srs_wkt (p, 5, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 6, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 7, + "]],AUTHORITY[\"EPSG\",\"4281\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 8, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Cassini_Soldner\"],"); + add_srs_wkt (p, 9, + "PARAMETER[\"latitude_of_origin\",31.73409694444445],PARA"); + add_srs_wkt (p, 10, + "METER[\"central_meridian\",35.21208055555556],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",170251.555],PARAMETER[\"false_northing"); + add_srs_wkt (p, 12, + "\",1126867.909],AUTHORITY[\"EPSG\",\"28193\"],AXIS[\"Eas"); + add_srs_wkt (p, 13, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28232, "epsg", 28232, + "Pointe Noire / UTM zone 32S"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +south +a=6378249.2 +b=6356515 +units"); + add_proj4text (p, 1, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pointe Noire / UTM zone 32S\",GEOGCS[\"Pointe N"); + add_srs_wkt (p, 1, + "oire\",DATUM[\"Congo_1960_Pointe_Noire\",SPHEROID[\"Clar"); + add_srs_wkt (p, 2, + "ke 1880 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7011\"]],AUTHORITY[\"EPSG\",\"6282\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4282\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",500000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "10000000],AUTHORITY[\"EPSG\",\"28232\"],AXIS[\"Easting\""); + add_srs_wkt (p, 12, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28348, "epsg", 28348, "GDA94 / MGA zone 48"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 48\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",105],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28348\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28349, "epsg", 28349, "GDA94 / MGA zone 49"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 49\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",111],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28349\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28350, "epsg", 28350, "GDA94 / MGA zone 50"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 50\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",117],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28350\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28351, "epsg", 28351, "GDA94 / MGA zone 51"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 51\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",123],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28351\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28352, "epsg", 28352, "GDA94 / MGA zone 52"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 52\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",129],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28352\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28353, "epsg", 28353, "GDA94 / MGA zone 53"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 53\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",135],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28353\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28354, "epsg", 28354, "GDA94 / MGA zone 54"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 54\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",141],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28354\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28355, "epsg", 28355, "GDA94 / MGA zone 55"); + add_proj4text (p, 0, + "+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 55\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",147],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28355\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28356, "epsg", 28356, "GDA94 / MGA zone 56"); + add_proj4text (p, 0, + "+proj=utm +zone=56 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 56\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",153],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28356\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28357, "epsg", 28357, "GDA94 / MGA zone 57"); + add_proj4text (p, 0, + "+proj=utm +zone=57 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 57\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",159],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28357\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28358, "epsg", 28358, "GDA94 / MGA zone 58"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"GDA94 / MGA zone 58\",GEOGCS[\"GDA94\",DATUM[\""); + add_srs_wkt (p, 1, + "Geocentric_Datum_of_Australia_1994\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6283\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4283\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",165],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",10000000],AUTHORITY[\"EPSG\",\"28358\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28402, "epsg", 28402, + "Pulkovo 1942 / Gauss-Kruger zone 2 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=2500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 2 (deprecated)"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",9],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2"); + add_srs_wkt (p, 11, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 12, "\",\"28402\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28403, "epsg", 28403, + "Pulkovo 1942 / Gauss-Kruger zone 3 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=3500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 3 (deprecated)"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHERO"); + add_srs_wkt (p, 2, + "ID[\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12]"); + add_srs_wkt (p, 4, + ",AUTHORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 6, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",15],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 11, + "3500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"28403\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28404, "epsg", 28404, + "Pulkovo 1942 / Gauss-Kruger zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 4\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",21],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",4500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28404\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28405, "epsg", 28405, + "Pulkovo 1942 / Gauss-Kruger zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 5\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",27],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",5500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28405\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28406, "epsg", 28406, + "Pulkovo 1942 / Gauss-Kruger zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=6500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 6\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",33],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",6500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28406\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28407, "epsg", 28407, + "Pulkovo 1942 / Gauss-Kruger zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=7500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 7\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",39],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",7500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28407\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28408, "epsg", 28408, + "Pulkovo 1942 / Gauss-Kruger zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=8500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 8\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",45],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",8500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28408\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28409, "epsg", 28409, + "Pulkovo 1942 / Gauss-Kruger zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=9500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 9\",GEOGCS[\"P"); + add_srs_wkt (p, 1, + "ulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassows"); + add_srs_wkt (p, 2, + "ky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",51],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",9500000],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28409\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28410, "epsg", 28410, + "Pulkovo 1942 / Gauss-Kruger zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=10500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 10\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",57],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",10500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28410\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28411, "epsg", 28411, + "Pulkovo 1942 / Gauss-Kruger zone 11"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=11500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 11\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",63],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",11500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28411\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28412, "epsg", 28412, + "Pulkovo 1942 / Gauss-Kruger zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=12500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 12\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",69],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",12500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28412\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28413, "epsg", 28413, + "Pulkovo 1942 / Gauss-Kruger zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 13\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",75],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",13500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28413\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28414, "epsg", 28414, + "Pulkovo 1942 / Gauss-Kruger zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 14\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",81],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",14500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28414\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28415, "epsg", 28415, + "Pulkovo 1942 / Gauss-Kruger zone 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 15\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",87],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",15500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28415\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28416, "epsg", 28416, + "Pulkovo 1942 / Gauss-Kruger zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 16\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",93],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",16500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28416\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28417, "epsg", 28417, + "Pulkovo 1942 / Gauss-Kruger zone 17"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 17\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",99],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",1],PARAMETER[\"false_easting\",17500000],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28417\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28418, "epsg", 28418, + "Pulkovo 1942 / Gauss-Kruger zone 18"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 18\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",105],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",18500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28418"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28419, "epsg", 28419, + "Pulkovo 1942 / Gauss-Kruger zone 19"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 19\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",111],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",19500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28419"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28420, "epsg", 28420, + "Pulkovo 1942 / Gauss-Kruger zone 20"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 20\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",117],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",20500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28420"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28421, "epsg", 28421, + "Pulkovo 1942 / Gauss-Kruger zone 21"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 21\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",123],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",21500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28421"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28422, "epsg", 28422, + "Pulkovo 1942 / Gauss-Kruger zone 22"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 22\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",129],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",22500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28422"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28423, "epsg", 28423, + "Pulkovo 1942 / Gauss-Kruger zone 23"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 23\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",135],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",23500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28423"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28424, "epsg", 28424, + "Pulkovo 1942 / Gauss-Kruger zone 24"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=24500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 24\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",141],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",24500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28424"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28425, "epsg", 28425, + "Pulkovo 1942 / Gauss-Kruger zone 25"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=25500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 25\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",147],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",25500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28425"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28426, "epsg", 28426, + "Pulkovo 1942 / Gauss-Kruger zone 26"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=26500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 26\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",153],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",26500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28426"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28427, "epsg", 28427, + "Pulkovo 1942 / Gauss-Kruger zone 27"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=27500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 27\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",159],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",27500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28427"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28428, "epsg", 28428, + "Pulkovo 1942 / Gauss-Kruger zone 28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=28500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 28\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",165],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",28500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28428"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28429, "epsg", 28429, + "Pulkovo 1942 / Gauss-Kruger zone 29"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=29500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 29\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",171],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",29500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28429"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28430, "epsg", 28430, + "Pulkovo 1942 / Gauss-Kruger zone 30"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=30500000 +y_0="); + add_proj4text (p, 1, "0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 30\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",177],PARAMETER[\"sc"); + add_srs_wkt (p, 10, + "ale_factor\",1],PARAMETER[\"false_easting\",30500000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"28430"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28431, "epsg", 28431, + "Pulkovo 1942 / Gauss-Kruger zone 31"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=31500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 31\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",-177],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",31500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2843"); + add_srs_wkt (p, 12, "1\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28432, "epsg", 28432, + "Pulkovo 1942 / Gauss-Kruger zone 32"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=32500000 +y_0"); + add_proj4text (p, 1, "=0 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger zone 32\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\"Krassow"); + add_srs_wkt (p, 2, + "sky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7024\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4284\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 9, + "\",0],PARAMETER[\"central_meridian\",-171],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",1],PARAMETER[\"false_easting\",32500000],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2843"); + add_srs_wkt (p, 12, "2\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28462, "epsg", 28462, + "Pulkovo 1942 / Gauss-Kruger 2N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=500000 +y_0=0 +e"); + add_proj4text (p, 1, "llps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 2N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"scale_factor\",1],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"2"); + add_srs_wkt (p, 12, "8462\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28463, "epsg", 28463, + "Pulkovo 1942 / Gauss-Kruger 3N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 3N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",15],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "28463\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28464, "epsg", 28464, + "Pulkovo 1942 / Gauss-Kruger 4N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 4N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",21],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "28464\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28465, "epsg", 28465, + "Pulkovo 1942 / Gauss-Kruger 5N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 5N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",27],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "28465\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28466, "epsg", 28466, + "Pulkovo 1942 / Gauss-Kruger 6N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 6N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",33],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "28466\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28467, "epsg", 28467, + "Pulkovo 1942 / Gauss-Kruger 7N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 7N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",39],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "28467\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28468, "epsg", 28468, + "Pulkovo 1942 / Gauss-Kruger 8N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=45 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 8N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",45],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "28468\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28469, "epsg", 28469, + "Pulkovo 1942 / Gauss-Kruger 9N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=51 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 9N (deprecated)\",G"); + add_srs_wkt (p, 1, + "EOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "4\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 5, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 6, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 7, + "84\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 8, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",0],PARAMETER[\"central_meridian\",51],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"scale_factor\",1],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "28469\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28470, "epsg", 28470, + "Pulkovo 1942 / Gauss-Kruger 10N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=57 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 10N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",57],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"28470\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28471, "epsg", 28471, + "Pulkovo 1942 / Gauss-Kruger 11N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=63 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 11N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",63],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"28471\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28472, "epsg", 28472, + "Pulkovo 1942 / Gauss-Kruger 12N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=69 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 12N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",69],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"28472\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28473, "epsg", 28473, + "Pulkovo 1942 / Gauss-Kruger 13N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 13N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",75],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"28473\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28474, "epsg", 28474, + "Pulkovo 1942 / Gauss-Kruger 14N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 14N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",81],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"28474\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28475, "epsg", 28475, + "Pulkovo 1942 / Gauss-Kruger 15N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 15N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",87],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"28475\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28476, "epsg", 28476, + "Pulkovo 1942 / Gauss-Kruger 16N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 16N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",93],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"28476\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28477, "epsg", 28477, + "Pulkovo 1942 / Gauss-Kruger 17N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 17N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",99],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",1],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"28477\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28478, "epsg", 28478, + "Pulkovo 1942 / Gauss-Kruger 18N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 18N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",105],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28478\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28479, "epsg", 28479, + "Pulkovo 1942 / Gauss-Kruger 19N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 19N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",111],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28479\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28480, "epsg", 28480, + "Pulkovo 1942 / Gauss-Kruger 20N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 20N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",117],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28480\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28481, "epsg", 28481, + "Pulkovo 1942 / Gauss-Kruger 21N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 21N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",123],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28481\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28482, "epsg", 28482, + "Pulkovo 1942 / Gauss-Kruger 22N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 22N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",129],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28482\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28483, "epsg", 28483, + "Pulkovo 1942 / Gauss-Kruger 23N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 23N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",135],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28483\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28484, "epsg", 28484, + "Pulkovo 1942 / Gauss-Kruger 24N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=141 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 24N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",141],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28484\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28485, "epsg", 28485, + "Pulkovo 1942 / Gauss-Kruger 25N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=147 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 25N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",147],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28485\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28486, "epsg", 28486, + "Pulkovo 1942 / Gauss-Kruger 26N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=153 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 26N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",153],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28486\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28487, "epsg", 28487, + "Pulkovo 1942 / Gauss-Kruger 27N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=159 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 27N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",159],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28487\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28488, "epsg", 28488, + "Pulkovo 1942 / Gauss-Kruger 28N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=165 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 28N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",165],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28488\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28489, "epsg", 28489, + "Pulkovo 1942 / Gauss-Kruger 29N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=171 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 29N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",171],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28489\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28490, "epsg", 28490, + "Pulkovo 1942 / Gauss-Kruger 30N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=177 +k=1 +x_0=500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 30N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",177],PARA"); + add_srs_wkt (p, 10, + "METER[\"scale_factor\",1],PARAMETER[\"false_easting\",50"); + add_srs_wkt (p, 11, + "0000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28490\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28491, "epsg", 28491, + "Pulkovo 1942 / Gauss-Kruger 31N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-177 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 31N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-177],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28491\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28492, "epsg", 28492, + "Pulkovo 1942 / Gauss-Kruger 32N (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-171 +k=1 +x_0=500000 +y_0=0"); + add_proj4text (p, 1, " +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Pulkovo 1942 / Gauss-Kruger 32N (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Pulkovo 1942\",DATUM[\"Pulkovo_1942\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Krassowsky 1940\",6378245,298.3,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "024\"]],TOWGS84[23.9,-141.3,-80.9,-0,0.37,0.85,-0.12],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6284\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4284\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",-171],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"28492\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 28600, "epsg", 28600, + "Qatar 1974 / Qatar National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=24.45 +lon_0=51.21666666666667 +k=0.9"); + add_proj4text (p, 1, + "9999 +x_0=200000 +y_0=300000 +ellps=intl +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"Qatar 1974 / Qatar National Grid\",GEOGCS[\"Qat"); + add_srs_wkt (p, 1, + "ar 1974\",DATUM[\"Qatar_1974\",SPHEROID[\"International "); + add_srs_wkt (p, 2, + "1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6285\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4285\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",24.45],PARAMETER[\"central_meridian\",51.21666666"); + add_srs_wkt (p, 9, + "666667],PARAMETER[\"scale_factor\",0.99999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",200000],PARAMETER[\"false_northing\",300"); + add_srs_wkt (p, 11, + "000],AUTHORITY[\"EPSG\",\"28600\"],AXIS[\"Easting\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 28991, "epsg", 28991, "Amersfoort / RD Old"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.387638888"); + add_proj4text (p, 1, + "88889 +k=0.9999079 +x_0=0 +y_0=0 +ellps=bessel +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Amersfoort / RD Old\",GEOGCS[\"Amersfoort\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Amersfoort\",SPHEROID[\"Bessel 1841\",6377397.155,2"); + add_srs_wkt (p, 2, + "99.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6289\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4289\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Oblique_Stereographic\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",52.15616055555555],PARAMETER[\"central_meridian\",5.387"); + add_srs_wkt (p, 9, + "63888888889],PARAMETER[\"scale_factor\",0.9999079],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",0],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 11, + "],AUTHORITY[\"EPSG\",\"28991\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 28992, "epsg", 28992, "Amersfoort / RD New"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.387638888"); + add_proj4text (p, 1, + "88889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Amersfoort / RD New\",GEOGCS[\"Amersfoort\",DAT"); + add_srs_wkt (p, 1, + "UM[\"Amersfoort\",SPHEROID[\"Bessel 1841\",6377397.155,2"); + add_srs_wkt (p, 2, + "99.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"6289\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4289\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Oblique_Stereographic\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",52.15616055555555],PARAMETER[\"central_meridian\",5.387"); + add_srs_wkt (p, 9, + "63888888889],PARAMETER[\"scale_factor\",0.9999079],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",155000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 11, + "g\",463000],AUTHORITY[\"EPSG\",\"28992\"],AXIS[\"X\",EAS"); + add_srs_wkt (p, 12, "T],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 29100, "epsg", 29100, + "SAD69 / Brazil Polyconic (deprecated)"); + add_proj4text (p, 0, + "+proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=1000000"); + add_proj4text (p, 1, "0 +ellps=GRS67 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / Brazil Polyconic (deprecated)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"SAD69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\""); + add_srs_wkt (p, 2, + "GRS 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "36\"]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "32925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Polyconic\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",0],PARAMETER[\"central_meridian\",-54],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"false_easting\",5000000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 10, + "\",10000000],AUTHORITY[\"EPSG\",\"29100\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 11, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 29101, "epsg", 29101, + "SAD69 / Brazil Polyconic"); + add_proj4text (p, 0, + "+proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=1000000"); + add_proj4text (p, 1, "0 +ellps=aust_SA +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / Brazil Polyconic\",GEOGCS[\"SAD69\",DAT"); + add_srs_wkt (p, 1, + "UM[\"South_American_Datum_1969\",SPHEROID[\"GRS 1967 Mod"); + add_srs_wkt (p, 2, + "ified\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "618\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Polyconic\"],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 8, + ",0],PARAMETER[\"central_meridian\",-54],PARAMETER[\"fals"); + add_srs_wkt (p, 9, + "e_easting\",5000000],PARAMETER[\"false_northing\",100000"); + add_srs_wkt (p, 10, + "00],AUTHORITY[\"EPSG\",\"29101\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 11, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 29118, "epsg", 29118, + "SAD69 / UTM zone 18N (deprecated)"); + add_proj4text (p, 0, "+proj=utm +zone=18 +ellps=GRS67 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 18N (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-75],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"29118\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 29119, "epsg", 29119, + "SAD69 / UTM zone 19N (deprecated)"); + add_proj4text (p, 0, "+proj=utm +zone=19 +ellps=GRS67 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 19N (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-69],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"29119\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 29120, "epsg", 29120, + "SAD69 / UTM zone 20N (deprecated)"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=GRS67 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 20N (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-63],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"29120\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 29121, "epsg", 29121, + "SAD69 / UTM zone 21N (deprecated)"); + add_proj4text (p, 0, "+proj=utm +zone=21 +ellps=GRS67 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 21N (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-57],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"29121\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 29122, "epsg", 29122, + "SAD69 / UTM zone 22N (deprecated)"); + add_proj4text (p, 0, "+proj=utm +zone=22 +ellps=GRS67 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 22N (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-51],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"29122\"],AXIS[\"Easting\",EAST],AXIS[\"Northi"); + add_srs_wkt (p, 12, "ng\",NORTH]]"); + p = add_epsg_def (first, last, 29168, "epsg", 29168, + "SAD69 / UTM zone 18N"); + add_proj4text (p, 0, "+proj=utm +zone=18 +ellps=aust_SA +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 18N\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-75],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "29168\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 29169, "epsg", 29169, + "SAD69 / UTM zone 19N"); + add_proj4text (p, 0, "+proj=utm +zone=19 +ellps=aust_SA +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 19N\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-69],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "29169\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 29170, "epsg", 29170, + "SAD69 / UTM zone 20N"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=aust_SA +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 20N\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-63],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "29170\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 29171, "epsg", 29171, + "SAD69 / UTM zone 21N"); + add_proj4text (p, 0, "+proj=utm +zone=21 +ellps=aust_SA +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 21N\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-57],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "29171\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 29172, "epsg", 29172, + "SAD69 / UTM zone 22N"); + add_proj4text (p, 0, "+proj=utm +zone=22 +ellps=aust_SA +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 22N\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-51],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "29172\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 29177, "epsg", 29177, + "SAD69 / UTM zone 17S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +south +ellps=GRS67 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 17S (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-81],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"29177\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29178, "epsg", 29178, + "SAD69 / UTM zone 18S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +south +ellps=GRS67 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 18S (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-75],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"29178\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29179, "epsg", 29179, + "SAD69 / UTM zone 19S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +south +ellps=GRS67 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 19S (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-69],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"29179\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29180, "epsg", 29180, + "SAD69 / UTM zone 20S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +south +ellps=GRS67 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 20S (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-63],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"29180\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29181, "epsg", 29181, + "SAD69 / UTM zone 21S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +south +ellps=GRS67 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 21S (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-57],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"29181\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29182, "epsg", 29182, + "SAD69 / UTM zone 22S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +south +ellps=GRS67 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 22S (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-51],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"29182\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29183, "epsg", 29183, + "SAD69 / UTM zone 23S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +south +ellps=GRS67 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 23S (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-45],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"29183\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29184, "epsg", 29184, + "SAD69 / UTM zone 24S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +south +ellps=GRS67 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 24S (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-39],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"29184\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29185, "epsg", 29185, + "SAD69 / UTM zone 25S (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +south +ellps=GRS67 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 25S (deprecated)\",GEOGCS[\"SA"); + add_srs_wkt (p, 1, + "D69\",DATUM[\"South_American_Datum_1969\",SPHEROID[\"GRS"); + add_srs_wkt (p, 2, + " 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6291\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "25199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4291\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-33],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",500000],PARAMETER[\"false_northing\",10000000],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"29185\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29187, "epsg", 29187, + "SAD69 / UTM zone 17S"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 17S\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-81],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"29187\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 29188, "epsg", 29188, + "SAD69 / UTM zone 18S"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 18S\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-75],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"29188\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 29189, "epsg", 29189, + "SAD69 / UTM zone 19S"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 19S\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-69],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"29189\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 29190, "epsg", 29190, + "SAD69 / UTM zone 20S"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 20S\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-63],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"29190\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 29191, "epsg", 29191, + "SAD69 / UTM zone 21S"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 21S\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-57],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"29191\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 29192, "epsg", 29192, + "SAD69 / UTM zone 22S"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 22S\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-51],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"29192\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 29193, "epsg", 29193, + "SAD69 / UTM zone 23S"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 23S\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-45],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"29193\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 29194, "epsg", 29194, + "SAD69 / UTM zone 24S"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 24S\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-39],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"29194\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 29195, "epsg", 29195, + "SAD69 / UTM zone 25S"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +south +ellps=aust_SA +units=m +no_de"); + add_proj4text (p, 1, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"SAD69 / UTM zone 25S\",GEOGCS[\"SAD69\",DATUM[\""); + add_srs_wkt (p, 1, + "South_American_Datum_1969\",SPHEROID[\"GRS 1967 Modified"); + add_srs_wkt (p, 2, + "\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6618\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4618\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",-33],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9996],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",10000000],AUTHORITY[\"EP"); + add_srs_wkt (p, 11, + "SG\",\"29195\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 29220, "epsg", 29220, + "Sapper Hill 1943 / UTM zone 20S"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +south +ellps=intl +towgs84=-355,21,7"); + add_proj4text (p, 1, "2,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Sapper Hill 1943 / UTM zone 20S\",GEOGCS[\"Sapp"); + add_srs_wkt (p, 1, + "er Hill 1943\",DATUM[\"Sapper_Hill_1943\",SPHEROID[\"Int"); + add_srs_wkt (p, 2, + "ernational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[-355,21,72,0,0,0,0],AUTHORITY[\"EPSG\",\"6292"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4292\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-63],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"29220\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29221, "epsg", 29221, + "Sapper Hill 1943 / UTM zone 21S"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +south +ellps=intl +towgs84=-355,21,7"); + add_proj4text (p, 1, "2,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Sapper Hill 1943 / UTM zone 21S\",GEOGCS[\"Sapp"); + add_srs_wkt (p, 1, + "er Hill 1943\",DATUM[\"Sapper_Hill_1943\",SPHEROID[\"Int"); + add_srs_wkt (p, 2, + "ernational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"7022\""); + add_srs_wkt (p, 3, + "]],TOWGS84[-355,21,72,0,0,0,0],AUTHORITY[\"EPSG\",\"6292"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4292\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-57],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"29221\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29333, "epsg", 29333, + "Schwarzeck / UTM zone 33S"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +south +ellps=bess_nam +units=m +no_d"); + add_proj4text (p, 1, "efs"); + add_srs_wkt (p, 0, + "PROJCS[\"Schwarzeck / UTM zone 33S\",GEOGCS[\"Schwarzeck"); + add_srs_wkt (p, 1, + "\",DATUM[\"Schwarzeck\",SPHEROID[\"Bessel Namibia (GLM)\""); + add_srs_wkt (p, 2, + ",6377483.865280419,299.1528128,AUTHORITY[\"EPSG\",\"7046"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6293\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4293\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 7, + "01\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"l"); + add_srs_wkt (p, 8, + "atitude_of_origin\",0],PARAMETER[\"central_meridian\",15"); + add_srs_wkt (p, 9, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 10, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"29333\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29635, "epsg", 29635, + "Sudan / UTM zone 35N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +a=6378249.2 +b=6356515 +units=m +no_"); + add_proj4text (p, 1, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Sudan / UTM zone 35N (deprecated)\",GEOGCS[\"Su"); + add_srs_wkt (p, 1, + "dan\",DATUM[\"Sudan\",SPHEROID[\"Clarke 1880 (IGN)\",637"); + add_srs_wkt (p, 2, + "8249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6296\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "9433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4296\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",27],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, + "G\",\"29635\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 29636, "epsg", 29636, + "Sudan / UTM zone 36N (deprecated)"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +a=6378249.2 +b=6356515 +units=m +no_"); + add_proj4text (p, 1, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Sudan / UTM zone 36N (deprecated)\",GEOGCS[\"Su"); + add_srs_wkt (p, 1, + "dan\",DATUM[\"Sudan\",SPHEROID[\"Clarke 1880 (IGN)\",637"); + add_srs_wkt (p, 2, + "8249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6296\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "9433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4296\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",33],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 11, + "G\",\"29636\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 29700, "epsg", 29700, + "Tananarive (Paris) / Laborde Grid (deprecated)"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=-18.9 +lonc=44.10000000000001 +alpha="); + add_proj4text (p, 1, + "18.9 +k=0.9995000000000001 +x_0=400000 +y_0=800000 +ellp"); + add_proj4text (p, 2, + "s=intl +towgs84=-189,-242,-91,0,0,0,0 +pm=paris +units=m"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tananarive (Paris) / Laborde Grid (deprecated)\""); + add_srs_wkt (p, 1, + ",GEOGCS[\"Tananarive (Paris)\",DATUM[\"Tananarive_1925_P"); + add_srs_wkt (p, 2, + "aris\",SPHEROID[\"International 1924\",6378388,297,AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"7022\"]],TOWGS84[-189,-242,-91,0,0,0,0],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6810\"]],PRIMEM[\"Paris\",2.3372291"); + add_srs_wkt (p, 5, + "7,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\",0.01570796"); + add_srs_wkt (p, 6, + "326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"4810\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 8, + "\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 9, + "latitude_of_center\",-21],PARAMETER[\"longitude_of_cente"); + add_srs_wkt (p, 10, + "r\",49],PARAMETER[\"azimuth\",21],PARAMETER[\"rectified_"); + add_srs_wkt (p, 11, + "grid_angle\",21],PARAMETER[\"scale_factor\",0.9995],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_easting\",400000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 13, + "ng\",800000],AUTHORITY[\"EPSG\",\"29700\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 14, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 29702, "epsg", 29702, + "Tananarive (Paris) / Laborde Grid approximation"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=-18.9 +lonc=44.10000000000001 +alpha="); + add_proj4text (p, 1, + "18.9 +k=0.9995000000000001 +x_0=400000 +y_0=800000 +ellp"); + add_proj4text (p, 2, + "s=intl +towgs84=-189,-242,-91,0,0,0,0 +pm=paris +units=m"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tananarive (Paris) / Laborde Grid approximation"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"Tananarive (Paris)\",DATUM[\"Tananarive_1925"); + add_srs_wkt (p, 2, + "_Paris\",SPHEROID[\"International 1924\",6378388,297,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7022\"]],TOWGS84[-189,-242,-91,0,0,0,0"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6810\"]],PRIMEM[\"Paris\",2.33722"); + add_srs_wkt (p, 5, + "917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\",0.015707"); + add_srs_wkt (p, 6, + "96326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"4810\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"90"); + add_srs_wkt (p, 8, + "01\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"latitude_of_center\",-21],PARAMETER[\"longitude_of_ce"); + add_srs_wkt (p, 10, + "nter\",49],PARAMETER[\"azimuth\",21],PARAMETER[\"rectifi"); + add_srs_wkt (p, 11, + "ed_grid_angle\",21],PARAMETER[\"scale_factor\",0.9995],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_easting\",400000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 13, + "thing\",800000],AUTHORITY[\"EPSG\",\"29702\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 29738, "epsg", 29738, + "Tananarive / UTM zone 38S"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +south +ellps=intl +towgs84=-189,-242"); + add_proj4text (p, 1, ",-91,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tananarive / UTM zone 38S\",GEOGCS[\"Tananarive"); + add_srs_wkt (p, 1, + "\",DATUM[\"Tananarive_1925\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-"); + add_srs_wkt (p, 3, + "189,-242,-91,0,0,0,0],AUTHORITY[\"EPSG\",\"6297\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4297\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",45],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 11, + "hing\",10000000],AUTHORITY[\"EPSG\",\"29738\"],AXIS[\"Ea"); + add_srs_wkt (p, 12, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29739, "epsg", 29739, + "Tananarive / UTM zone 39S"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +south +ellps=intl +towgs84=-189,-242"); + add_proj4text (p, 1, ",-91,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tananarive / UTM zone 39S\",GEOGCS[\"Tananarive"); + add_srs_wkt (p, 1, + "\",DATUM[\"Tananarive_1925\",SPHEROID[\"International 19"); + add_srs_wkt (p, 2, + "24\",6378388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-"); + add_srs_wkt (p, 3, + "189,-242,-91,0,0,0,0],AUTHORITY[\"EPSG\",\"6297\"]],PRIM"); + add_srs_wkt (p, 4, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4297\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",51],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 11, + "hing\",10000000],AUTHORITY[\"EPSG\",\"29739\"],AXIS[\"Ea"); + add_srs_wkt (p, 12, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29849, "epsg", 29849, + "Timbalai 1948 / UTM zone 49N"); + add_proj4text (p, 0, "+proj=utm +zone=49 +ellps=evrstSS +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Timbalai 1948 / UTM zone 49N\",GEOGCS[\"Timbala"); + add_srs_wkt (p, 1, + "i 1948\",DATUM[\"Timbalai_1948\",SPHEROID[\"Everest 1830"); + add_srs_wkt (p, 2, + " (1967 Definition)\",6377298.556,300.8017,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7016\"]],AUTHORITY[\"EPSG\",\"6298\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4298\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",111],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"29849\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29850, "epsg", 29850, + "Timbalai 1948 / UTM zone 50N"); + add_proj4text (p, 0, "+proj=utm +zone=50 +ellps=evrstSS +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Timbalai 1948 / UTM zone 50N\",GEOGCS[\"Timbala"); + add_srs_wkt (p, 1, + "i 1948\",DATUM[\"Timbalai_1948\",SPHEROID[\"Everest 1830"); + add_srs_wkt (p, 2, + " (1967 Definition)\",6377298.556,300.8017,AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"7016\"]],AUTHORITY[\"EPSG\",\"6298\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4298\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",117],PARAMETER[\"scale_factor\",0.9996],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"29850\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29871, "epsg", 29871, + "Timbalai 1948 / RSO Borneo (ch)"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 "); + add_proj4text (p, 1, + "+k=0.99984 +x_0=590476.8714630401 +y_0=442857.653094361 "); + add_proj4text (p, 2, "+ellps=evrstSS +to_meter=20.11676512155263 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Timbalai 1948 / RSO Borneo (ch)\",GEOGCS[\"Timb"); + add_srs_wkt (p, 1, + "alai 1948\",DATUM[\"Timbalai_1948\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1967 Definition)\",6377298.556,300.8017,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7016\"]],AUTHORITY[\"EPSG\",\"6298\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4298\"]],UNIT[\"British chain (Sears "); + add_srs_wkt (p, 7, + "1922)\",20.11676512155263,AUTHORITY[\"EPSG\",\"9042\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMETER[\"lati"); + add_srs_wkt (p, 9, + "tude_of_center\",4],PARAMETER[\"longitude_of_center\",11"); + add_srs_wkt (p, 10, + "5],PARAMETER[\"azimuth\",53.31582047222222],PARAMETER[\""); + add_srs_wkt (p, 11, + "rectified_grid_angle\",53.13010236111111],PARAMETER[\"sc"); + add_srs_wkt (p, 12, + "ale_factor\",0.99984],PARAMETER[\"false_easting\",29352."); + add_srs_wkt (p, 13, + "4763],PARAMETER[\"false_northing\",22014.3572],AUTHORITY"); + add_srs_wkt (p, 14, + "[\"EPSG\",\"29871\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 15, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 29872, "epsg", 29872, + "Timbalai 1948 / RSO Borneo (ft)"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 "); + add_proj4text (p, 1, + "+k=0.99984 +x_0=590476.8727431979 +y_0=442857.6545573985"); + add_proj4text (p, 2, + " +ellps=evrstSS +to_meter=0.3047994715386762 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Timbalai 1948 / RSO Borneo (ft)\",GEOGCS[\"Timb"); + add_srs_wkt (p, 1, + "alai 1948\",DATUM[\"Timbalai_1948\",SPHEROID[\"Everest 1"); + add_srs_wkt (p, 2, + "830 (1967 Definition)\",6377298.556,300.8017,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7016\"]],AUTHORITY[\"EPSG\",\"6298\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4298\"]],UNIT[\"British foot (Sears 1"); + add_srs_wkt (p, 7, + "922)\",0.3047994715386762,AUTHORITY[\"EPSG\",\"9041\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMETER[\"lati"); + add_srs_wkt (p, 9, + "tude_of_center\",4],PARAMETER[\"longitude_of_center\",11"); + add_srs_wkt (p, 10, + "5],PARAMETER[\"azimuth\",53.31582047222222],PARAMETER[\""); + add_srs_wkt (p, 11, + "rectified_grid_angle\",53.13010236111111],PARAMETER[\"sc"); + add_srs_wkt (p, 12, + "ale_factor\",0.99984],PARAMETER[\"false_easting\",193726"); + add_srs_wkt (p, 13, + "3.44],PARAMETER[\"false_northing\",1452947.58],AUTHORITY"); + add_srs_wkt (p, 14, + "[\"EPSG\",\"29872\"],AXIS[\"Easting\",EAST],AXIS[\"North"); + add_srs_wkt (p, 15, "ing\",NORTH]]"); + p = add_epsg_def (first, last, 29873, "epsg", 29873, + "Timbalai 1948 / RSO Borneo (m)"); + add_proj4text (p, 0, + "+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31582047222222 "); + add_proj4text (p, 1, + "+k=0.99984 +x_0=590476.87 +y_0=442857.65 +ellps=evrstSS "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Timbalai 1948 / RSO Borneo (m)\",GEOGCS[\"Timba"); + add_srs_wkt (p, 1, + "lai 1948\",DATUM[\"Timbalai_1948\",SPHEROID[\"Everest 18"); + add_srs_wkt (p, 2, + "30 (1967 Definition)\",6377298.556,300.8017,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7016\"]],AUTHORITY[\"EPSG\",\"6298\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4298\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Hotine_Oblique_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_center\",4],PARAMETER[\"longit"); + add_srs_wkt (p, 9, + "ude_of_center\",115],PARAMETER[\"azimuth\",53.3158204722"); + add_srs_wkt (p, 10, + "2222],PARAMETER[\"rectified_grid_angle\",53.130102361111"); + add_srs_wkt (p, 11, + "11],PARAMETER[\"scale_factor\",0.99984],PARAMETER[\"fals"); + add_srs_wkt (p, 12, + "e_easting\",590476.87],PARAMETER[\"false_northing\",4428"); + add_srs_wkt (p, 13, + "57.65],AUTHORITY[\"EPSG\",\"29873\"],AXIS[\"Easting\",EA"); + add_srs_wkt (p, 14, "ST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29900, "epsg", 29900, + "TM65 / Irish National Grid (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=20000"); + add_proj4text (p, 1, + "0 +y_0=250000 +ellps=mod_airy +datum=ire65 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"TM65 / Irish National Grid (deprecated)\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"TM65\",DATUM[\"TM65\",SPHEROID[\"Airy Modified 1849\""); + add_srs_wkt (p, 2, + ",6377340.189,299.3249646,AUTHORITY[\"EPSG\",\"7002\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6299\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4299\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",53.5],PARAMETER[\"central_meridian\",-8],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",1.000035],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",200000],PARAMETER[\"false_northing\",250000],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"29900\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29901, "epsg", 29901, + "OSNI 1952 / Irish National Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1 +x_0=200000 +y_0="); + add_proj4text (p, 1, + "250000 +ellps=airy +towgs84=482.5,-130.6,564.6,-1.042,-0"); + add_proj4text (p, 2, ".214,-0.631,8.15 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"OSNI 1952 / Irish National Grid\",GEOGCS[\"OSNI"); + add_srs_wkt (p, 1, + " 1952\",DATUM[\"OSNI_1952\",SPHEROID[\"Airy 1830\",63775"); + add_srs_wkt (p, 2, + "63.396,299.3249646,AUTHORITY[\"EPSG\",\"7001\"]],TOWGS84"); + add_srs_wkt (p, 3, + "[482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15],AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"6188\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4188\"]"); + add_srs_wkt (p, 7, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 8, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 9, + "gin\",53.5],PARAMETER[\"central_meridian\",-8],PARAMETER"); + add_srs_wkt (p, 10, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",200000]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_northing\",250000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, + ",\"29901\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 29902, "epsg", 29902, "TM65 / Irish Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=20000"); + add_proj4text (p, 1, + "0 +y_0=250000 +ellps=mod_airy +datum=ire65 +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"TM65 / Irish Grid\",GEOGCS[\"TM65\",DATUM[\"TM6"); + add_srs_wkt (p, 1, + "5\",SPHEROID[\"Airy Modified 1849\",6377340.189,299.3249"); + add_srs_wkt (p, 2, + "646,AUTHORITY[\"EPSG\",\"7002\"]],AUTHORITY[\"EPSG\",\"6"); + add_srs_wkt (p, 3, + "299\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901"); + add_srs_wkt (p, 4, + "\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"9122\"]],AUTHORITY[\"EPSG\",\"4299\"]],UNIT[\"metr"); + add_srs_wkt (p, 6, + "e\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transve"); + add_srs_wkt (p, 7, + "rse_Mercator\"],PARAMETER[\"latitude_of_origin\",53.5],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",-8],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 9, + "or\",1.000035],PARAMETER[\"false_easting\",200000],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_northing\",250000],AUTHORITY[\"EPSG\",\"299"); + add_srs_wkt (p, 11, + "02\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 29903, "epsg", 29903, "TM75 / Irish Grid"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=20000"); + add_proj4text (p, 1, "0 +y_0=250000 +ellps=mod_airy +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"TM75 / Irish Grid\",GEOGCS[\"TM75\",DATUM[\"Geo"); + add_srs_wkt (p, 1, + "detic_Datum_of_1965\",SPHEROID[\"Airy Modified 1849\",63"); + add_srs_wkt (p, 2, + "77340.189,299.3249646,AUTHORITY[\"EPSG\",\"7002\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6300\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"43"); + add_srs_wkt (p, 6, + "00\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 8, + "f_origin\",53.5],PARAMETER[\"central_meridian\",-8],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",1.000035],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",200000],PARAMETER[\"false_northing\",250000],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"29903\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 12, "rthing\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_24 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 30161, "epsg", 30161, + "Tokyo / Japan Plane Rectangular CS I"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=33 +lon_0=129.5 +k=0.9999 +x_0=0 +y_0"); + add_proj4text (p, 1, "=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS I\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",6377397"); + add_srs_wkt (p, 2, + ".155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",33],PARAMETER[\"central_meridian\",129.5],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",0"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3"); + add_srs_wkt (p, 11, "0161\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30162, "epsg", 30162, + "Tokyo / Japan Plane Rectangular CS II"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=33 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS II\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",63773"); + add_srs_wkt (p, 2, + "97.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",33],PARAMETER[\"central_meridian\",131],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",0]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30"); + add_srs_wkt (p, 11, "162\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30163, "epsg", 30163, + "Tokyo / Japan Plane Rectangular CS III"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=132.1666666666667 +k=0.9999"); + add_proj4text (p, 1, " +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS III\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",6377"); + add_srs_wkt (p, 2, + "397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",36],PARAMETER[\"central_meridian\",132.16666666"); + add_srs_wkt (p, 9, + "66667],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",0],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"30163\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST"); + add_srs_wkt (p, 12, "]]"); + p = add_epsg_def (first, last, 30164, "epsg", 30164, + "Tokyo / Japan Plane Rectangular CS IV"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=33 +lon_0=133.5 +k=0.9999 +x_0=0 +y_0"); + add_proj4text (p, 1, "=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS IV\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",63773"); + add_srs_wkt (p, 2, + "97.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",33],PARAMETER[\"central_meridian\",133.5],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "30164\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30165, "epsg", 30165, + "Tokyo / Japan Plane Rectangular CS V"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=134.3333333333333 +k=0.9999"); + add_proj4text (p, 1, " +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS V\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",6377397"); + add_srs_wkt (p, 2, + ".155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",36],PARAMETER[\"central_meridian\",134.33333333333"); + add_srs_wkt (p, 9, + "33],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"30165\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30166, "epsg", 30166, + "Tokyo / Japan Plane Rectangular CS VI"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS VI\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",63773"); + add_srs_wkt (p, 2, + "97.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",36],PARAMETER[\"central_meridian\",136],PARAMETER"); + add_srs_wkt (p, 9, + "[\"scale_factor\",0.9999],PARAMETER[\"false_easting\",0]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30"); + add_srs_wkt (p, 11, "166\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30167, "epsg", 30167, + "Tokyo / Japan Plane Rectangular CS VII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=137.1666666666667 +k=0.9999"); + add_proj4text (p, 1, " +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS VII\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",6377"); + add_srs_wkt (p, 2, + "397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",36],PARAMETER[\"central_meridian\",137.16666666"); + add_srs_wkt (p, 9, + "66667],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",0],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 11, + "TY[\"EPSG\",\"30167\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST"); + add_srs_wkt (p, 12, "]]"); + p = add_epsg_def (first, last, 30168, "epsg", 30168, + "Tokyo / Japan Plane Rectangular CS VIII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.9999 +x_0=0 +y_0"); + add_proj4text (p, 1, "=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS VIII\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",637"); + add_srs_wkt (p, 2, + "7397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"430"); + add_srs_wkt (p, 6, + "1\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",36],PARAMETER[\"central_meridian\",138.5],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9999],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"30168\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30169, "epsg", 30169, + "Tokyo / Japan Plane Rectangular CS IX"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=36 +lon_0=139.8333333333333 +k=0.9999"); + add_proj4text (p, 1, " +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS IX\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",63773"); + add_srs_wkt (p, 2, + "97.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",36],PARAMETER[\"central_meridian\",139.8333333333"); + add_srs_wkt (p, 9, + "333],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"30169\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 30170, "epsg", 30170, + "Tokyo / Japan Plane Rectangular CS X"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=140.8333333333333 +k=0.9999"); + add_proj4text (p, 1, " +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS X\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",6377397"); + add_srs_wkt (p, 2, + ".155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",40],PARAMETER[\"central_meridian\",140.83333333333"); + add_srs_wkt (p, 9, + "33],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"30170\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30171, "epsg", 30171, + "Tokyo / Japan Plane Rectangular CS XI"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=44 +lon_0=140.25 +k=0.9999 +x_0=0 +y_"); + add_proj4text (p, 1, "0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS XI\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",63773"); + add_srs_wkt (p, 2, + "97.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",44],PARAMETER[\"central_meridian\",140.25],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "30171\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30172, "epsg", 30172, + "Tokyo / Japan Plane Rectangular CS XII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=44 +lon_0=142.25 +k=0.9999 +x_0=0 +y_"); + add_proj4text (p, 1, "0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS XII\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",6377"); + add_srs_wkt (p, 2, + "397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",44],PARAMETER[\"central_meridian\",142.25],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9999],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"30172\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30173, "epsg", 30173, + "Tokyo / Japan Plane Rectangular CS XIII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=44 +lon_0=144.25 +k=0.9999 +x_0=0 +y_"); + add_proj4text (p, 1, "0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS XIII\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",637"); + add_srs_wkt (p, 2, + "7397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"430"); + add_srs_wkt (p, 6, + "1\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",44],PARAMETER[\"central_meridian\",144.25],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"scale_factor\",0.9999],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 10, + "g\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 11, ",\"30173\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30174, "epsg", 30174, + "Tokyo / Japan Plane Rectangular CS XIV"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=26 +lon_0=142 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS XIV\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",6377"); + add_srs_wkt (p, 2, + "397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",26],PARAMETER[\"central_meridian\",142],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "30174\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30175, "epsg", 30175, + "Tokyo / Japan Plane Rectangular CS XV"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=26 +lon_0=127.5 +k=0.9999 +x_0=0 +y_0"); + add_proj4text (p, 1, "=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS XV\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",63773"); + add_srs_wkt (p, 2, + "97.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",26],PARAMETER[\"central_meridian\",127.5],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "30175\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30176, "epsg", 30176, + "Tokyo / Japan Plane Rectangular CS XVI"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=26 +lon_0=124 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS XVI\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",6377"); + add_srs_wkt (p, 2, + "397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",26],PARAMETER[\"central_meridian\",124],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "30176\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30177, "epsg", 30177, + "Tokyo / Japan Plane Rectangular CS XVII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=26 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS XVII\",GEOGC"); + add_srs_wkt (p, 1, + "S[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",637"); + add_srs_wkt (p, 2, + "7397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"430"); + add_srs_wkt (p, 6, + "1\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",26],PARAMETER[\"central_meridian\",131],PARAME"); + add_srs_wkt (p, 9, + "TER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "30177\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30178, "epsg", 30178, + "Tokyo / Japan Plane Rectangular CS XVIII"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=20 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS XVIII\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",63"); + add_srs_wkt (p, 2, + "77397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"43"); + add_srs_wkt (p, 6, + "01\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 8, + "f_origin\",20],PARAMETER[\"central_meridian\",136],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 10, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "30178\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30179, "epsg", 30179, + "Tokyo / Japan Plane Rectangular CS XIX"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=26 +lon_0=154 +k=0.9999 +x_0=0 +y_0=0"); + add_proj4text (p, 1, " +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Tokyo / Japan Plane Rectangular CS XIX\",GEOGCS"); + add_srs_wkt (p, 1, + "[\"Tokyo\",DATUM[\"Tokyo\",SPHEROID[\"Bessel 1841\",6377"); + add_srs_wkt (p, 2, + "397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6301\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4301"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",26],PARAMETER[\"central_meridian\",154],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"scale_factor\",0.9999],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "30179\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 30200, "epsg", 30200, + "Trinidad 1903 / Trinidad Grid"); + add_proj4text (p, 0, + "+proj=cass +lat_0=10.44166666666667 +lon_0=-61.333333333"); + add_proj4text (p, 1, + "33334 +x_0=86501.46392051999 +y_0=65379.0134283 +a=63782"); + add_proj4text (p, 2, + "93.645208759 +b=6356617.987679838 +to_meter=0.2011661951"); + add_proj4text (p, 3, "64 +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Trinidad 1903 / Trinidad Grid\",GEOGCS[\"Trinid"); + add_srs_wkt (p, 1, + "ad 1903\",DATUM[\"Trinidad_1903\",SPHEROID[\"Clarke 1858"); + add_srs_wkt (p, 2, + "\",6378293.645208759,294.2606763692569,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7007\"]],AUTHORITY[\"EPSG\",\"6302\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4302\"]],UNIT[\"Clarke's link\",0.20116619"); + add_srs_wkt (p, 7, + "5164,AUTHORITY[\"EPSG\",\"9039\"]],PROJECTION[\"Cassini_"); + add_srs_wkt (p, 8, + "Soldner\"],PARAMETER[\"latitude_of_origin\",10.441666666"); + add_srs_wkt (p, 9, + "66667],PARAMETER[\"central_meridian\",-61.33333333333334"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_easting\",430000],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "northing\",325000],AUTHORITY[\"EPSG\",\"30200\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 30339, "epsg", 30339, + "TC(1948) / UTM zone 39N"); + add_proj4text (p, 0, "+proj=utm +zone=39 +ellps=helmert +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"TC(1948) / UTM zone 39N\",GEOGCS[\"TC(1948)\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Trucial_Coast_1948\",SPHEROID[\"Helmert 1906\",63"); + add_srs_wkt (p, 2, + "78200,298.3,AUTHORITY[\"EPSG\",\"7020\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6303\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4303\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",51],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",0.9996],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30339\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 30340, "epsg", 30340, + "TC(1948) / UTM zone 40N"); + add_proj4text (p, 0, "+proj=utm +zone=40 +ellps=helmert +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"TC(1948) / UTM zone 40N\",GEOGCS[\"TC(1948)\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Trucial_Coast_1948\",SPHEROID[\"Helmert 1906\",63"); + add_srs_wkt (p, 2, + "78200,298.3,AUTHORITY[\"EPSG\",\"7020\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6303\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4303\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",57],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",0.9996],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"30340\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 30491, "epsg", 30491, + "Voirol 1875 / Nord Algerie (ancienne)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.99962554"); + add_proj4text (p, 1, + "4 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs"); + add_proj4text (p, 2, "84=-73,-247,227,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Voirol 1875 / Nord Algerie (ancienne)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Voirol 1875\",DATUM[\"Voirol_1875\",SPHEROID[\"Clarke "); + add_srs_wkt (p, 2, + "1880 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7011\"]],TOWGS84[-73,-247,227,0,0,0,0],AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"6304\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 5, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4304\"]],U"); + add_srs_wkt (p, 7, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 8, + "[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 9, + "f_origin\",36],PARAMETER[\"central_meridian\",2.7],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.999625544],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",500000],PARAMETER[\"false_northing\",300000],AUTH"); + add_srs_wkt (p, 12, + "ORITY[\"EPSG\",\"30491\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 13, "RTH]]"); + p = add_epsg_def (first, last, 30492, "epsg", 30492, + "Voirol 1875 / Sud Algerie (ancienne)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.9996"); + add_proj4text (p, 1, + "25769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +t"); + add_proj4text (p, 2, "owgs84=-73,-247,227,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Voirol 1875 / Sud Algerie (ancienne)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Voirol 1875\",DATUM[\"Voirol_1875\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "80 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7011\"]],TOWGS84[-73,-247,227,0,0,0,0],AUTHORITY[\"EP"); + add_srs_wkt (p, 4, + "SG\",\"6304\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4304\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Lambert_Conformal_Conic_1SP\"],PARAMETER[\"latitude_of_o"); + add_srs_wkt (p, 9, + "rigin\",33.3],PARAMETER[\"central_meridian\",2.7],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",0.999625769],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",500000],PARAMETER[\"false_northing\",300000],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"30492\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 13, "TH]]"); + p = add_epsg_def (first, last, 30493, "epsg", 30493, + "Voirol 1879 / Nord Algerie (ancienne)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.99962554"); + add_proj4text (p, 1, + "4 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Voirol 1879 / Nord Algerie (ancienne)\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Voirol 1879\",DATUM[\"Voirol_1879\",SPHEROID[\"Clarke "); + add_srs_wkt (p, 2, + "1880 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7011\"]],AUTHORITY[\"EPSG\",\"6671\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4671\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",36],PARAMETER[\"cen"); + add_srs_wkt (p, 9, + "tral_meridian\",2.7],PARAMETER[\"scale_factor\",0.999625"); + add_srs_wkt (p, 10, + "544],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",300000],AUTHORITY[\"EPSG\",\"30493\"],AXIS"); + add_srs_wkt (p, 12, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 30494, "epsg", 30494, + "Voirol 1879 / Sud Algerie (ancienne)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.9996"); + add_proj4text (p, 1, + "25769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Voirol 1879 / Sud Algerie (ancienne)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Voirol 1879\",DATUM[\"Voirol_1879\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "80 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7011\"]],AUTHORITY[\"EPSG\",\"6671\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4671\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",33.3],PARAMETER[\"cen"); + add_srs_wkt (p, 9, + "tral_meridian\",2.7],PARAMETER[\"scale_factor\",0.999625"); + add_srs_wkt (p, 10, + "769],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",300000],AUTHORITY[\"EPSG\",\"30494\"],AXIS"); + add_srs_wkt (p, 12, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 30729, "epsg", 30729, + "Nord Sahara 1959 / UTM zone 29N"); + add_proj4text (p, 0, "+proj=utm +zone=29 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nord Sahara 1959 / UTM zone 29N\",GEOGCS[\"Nord"); + add_srs_wkt (p, 1, + " Sahara 1959\",DATUM[\"Nord_Sahara_1959\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7012\"]],AUTHORITY[\"EPSG\",\"6307\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4307\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",-9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",500000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 11, + "THORITY[\"EPSG\",\"30729\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 30730, "epsg", 30730, + "Nord Sahara 1959 / UTM zone 30N"); + add_proj4text (p, 0, "+proj=utm +zone=30 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nord Sahara 1959 / UTM zone 30N\",GEOGCS[\"Nord"); + add_srs_wkt (p, 1, + " Sahara 1959\",DATUM[\"Nord_Sahara_1959\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7012\"]],AUTHORITY[\"EPSG\",\"6307\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4307\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",-3],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",500000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 11, + "THORITY[\"EPSG\",\"30730\"],AXIS[\"Easting\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 30731, "epsg", 30731, + "Nord Sahara 1959 / UTM zone 31N"); + add_proj4text (p, 0, "+proj=utm +zone=31 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nord Sahara 1959 / UTM zone 31N\",GEOGCS[\"Nord"); + add_srs_wkt (p, 1, + " Sahara 1959\",DATUM[\"Nord_Sahara_1959\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7012\"]],AUTHORITY[\"EPSG\",\"6307\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4307\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",3],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_easting\",500000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"30731\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 30732, "epsg", 30732, + "Nord Sahara 1959 / UTM zone 32N"); + add_proj4text (p, 0, "+proj=utm +zone=32 +ellps=clrk80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nord Sahara 1959 / UTM zone 32N\",GEOGCS[\"Nord"); + add_srs_wkt (p, 1, + " Sahara 1959\",DATUM[\"Nord_Sahara_1959\",SPHEROID[\"Cla"); + add_srs_wkt (p, 2, + "rke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 3, + "\"7012\"]],AUTHORITY[\"EPSG\",\"6307\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4307\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_easting\",500000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"30732\"],AXIS[\"Easting\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Northing\",NORTH]]"); + p = add_epsg_def (first, last, 30791, "epsg", 30791, + "Nord Sahara 1959 / Voirol Unifie Nord"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36 +lat_0=36 +lon_0=2.7 +k_0=0.99962554"); + add_proj4text (p, 1, + "4 +x_0=500135 +y_0=300090 +ellps=clrk80 +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"Nord Sahara 1959 / Voirol Unifie Nord\",GEOGCS["); + add_srs_wkt (p, 1, + "\"Nord Sahara 1959\",DATUM[\"Nord_Sahara_1959\",SPHEROID"); + add_srs_wkt (p, 2, + "[\"Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"7012\"]],AUTHORITY[\"EPSG\",\"6307\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4307\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1"); + add_srs_wkt (p, 8, + "SP\"],PARAMETER[\"latitude_of_origin\",36],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",2.7],PARAMETER[\"scale_factor\",0.9996"); + add_srs_wkt (p, 10, + "25544],PARAMETER[\"false_easting\",500135],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",300090],AUTHORITY[\"EPSG\",\"30791\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 30792, "epsg", 30792, + "Nord Sahara 1959 / Voirol Unifie Sud"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=2.7 +k_0=0.9996"); + add_proj4text (p, 1, + "25769 +x_0=500135 +y_0=300090 +ellps=clrk80 +units=m +no"); + add_proj4text (p, 2, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Nord Sahara 1959 / Voirol Unifie Sud\",GEOGCS[\""); + add_srs_wkt (p, 1, + "Nord Sahara 1959\",DATUM[\"Nord_Sahara_1959\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Clarke 1880 (RGS)\",6378249.145,293.465,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7012\"]],AUTHORITY[\"EPSG\",\"6307\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 4, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4307\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 7, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",33.3],PARAMETER[\"c"); + add_srs_wkt (p, 9, + "entral_meridian\",2.7],PARAMETER[\"scale_factor\",0.9996"); + add_srs_wkt (p, 10, + "25769],PARAMETER[\"false_easting\",500135],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",300090],AUTHORITY[\"EPSG\",\"30792\"],AX"); + add_srs_wkt (p, 12, "IS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 30800, "epsg", 30800, + "RT38 2.5 gon W (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0="); + add_proj4text (p, 1, "1500000 +y_0=0 +ellps=bessel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"RT38 2.5 gon W (deprecated)\",GEOGCS[\"RT38\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Stockholm_1938\",SPHEROID[\"Bessel 1841\",6377397"); + add_srs_wkt (p, 2, + ".155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY"); + add_srs_wkt (p, 3, + "[\"EPSG\",\"6308\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4308\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",0],PARAMETER[\"central_meridian\",15.8082777777777"); + add_srs_wkt (p, 9, + "8],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",1500000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 11, + "\"EPSG\",\"30800\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31028, "epsg", 31028, "Yoff / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +a=6378249.2 +b=6356515 +units=m +no_"); + add_proj4text (p, 1, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Yoff / UTM zone 28N\",GEOGCS[\"Yoff\",DATUM[\"Y"); + add_srs_wkt (p, 1, + "off\",SPHEROID[\"Clarke 1880 (IGN)\",6378249.2,293.46602"); + add_srs_wkt (p, 2, + "12936265,AUTHORITY[\"EPSG\",\"7011\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"6310\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 5, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4310\"]],UNIT[\"m"); + add_srs_wkt (p, 6, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 7, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 8, + "ARAMETER[\"central_meridian\",-15],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 9, + "tor\",0.9996],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 10, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"31028\"],"); + add_srs_wkt (p, 11, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31121, "epsg", 31121, + "Zanderij / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=intl +towgs84=-265,120,-358,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Zanderij / UTM zone 21N\",GEOGCS[\"Zanderij\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Zanderij\",SPHEROID[\"International 1924\",637838"); + add_srs_wkt (p, 2, + "8,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-265,120,-35"); + add_srs_wkt (p, 3, + "8,0,0,0,0],AUTHORITY[\"EPSG\",\"6311\"]],PRIMEM[\"Greenw"); + add_srs_wkt (p, 4, + "ich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0."); + add_srs_wkt (p, 5, + "01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"4311\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",-57],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",500000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"31121\"],AXIS[\"Easting\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31154, "epsg", 31154, "Zanderij / TM 54 NW"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-54 +k=0.9996 +x_0=500000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +units=m"); + add_proj4text (p, 2, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Zanderij / TM 54 NW\",GEOGCS[\"Zanderij\",DATUM"); + add_srs_wkt (p, 1, + "[\"Zanderij\",SPHEROID[\"International 1924\",6378388,29"); + add_srs_wkt (p, 2, + "7,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-265,120,-358,0,"); + add_srs_wkt (p, 3, + "0,0,0],AUTHORITY[\"EPSG\",\"6311\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4311\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 7, + "001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "latitude_of_origin\",0],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "54],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"31154\"],AXIS[\"Easting\",EAST],AXIS[\"N"); + add_srs_wkt (p, 12, "orthing\",NORTH]]"); + p = add_epsg_def (first, last, 31170, "epsg", 31170, + "Zanderij / Suriname Old TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-55.68333333333333 +k=0.9996"); + add_proj4text (p, 1, + " +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0"); + add_proj4text (p, 2, ",0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Zanderij / Suriname Old TM\",GEOGCS[\"Zanderij\""); + add_srs_wkt (p, 1, + ",DATUM[\"Zanderij\",SPHEROID[\"International 1924\",6378"); + add_srs_wkt (p, 2, + "388,297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-265,120,-"); + add_srs_wkt (p, 3, + "358,0,0,0,0],AUTHORITY[\"EPSG\",\"6311\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 4, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 5, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"4311\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAM"); + add_srs_wkt (p, 8, + "ETER[\"latitude_of_origin\",0],PARAMETER[\"central_merid"); + add_srs_wkt (p, 9, + "ian\",-55.68333333333333],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 10, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 11, + "se_northing\",0],AUTHORITY[\"EPSG\",\"31170\"],AXIS[\"Ea"); + add_srs_wkt (p, 12, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31171, "epsg", 31171, + "Zanderij / Suriname TM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-55.68333333333333 +k=0.9999"); + add_proj4text (p, 1, + " +x_0=500000 +y_0=0 +ellps=intl +towgs84=-265,120,-358,0"); + add_proj4text (p, 2, ",0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Zanderij / Suriname TM\",GEOGCS[\"Zanderij\",DA"); + add_srs_wkt (p, 1, + "TUM[\"Zanderij\",SPHEROID[\"International 1924\",6378388"); + add_srs_wkt (p, 2, + ",297,AUTHORITY[\"EPSG\",\"7022\"]],TOWGS84[-265,120,-358"); + add_srs_wkt (p, 3, + ",0,0,0,0],AUTHORITY[\"EPSG\",\"6311\"]],PRIMEM[\"Greenwi"); + add_srs_wkt (p, 4, + "ch\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0"); + add_srs_wkt (p, 5, + "1745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"4311\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETE"); + add_srs_wkt (p, 8, + "R[\"latitude_of_origin\",0],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 9, + "\",-55.68333333333333],PARAMETER[\"scale_factor\",0.9999"); + add_srs_wkt (p, 10, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "northing\",0],AUTHORITY[\"EPSG\",\"31171\"],AXIS[\"Easti"); + add_srs_wkt (p, 12, "ng\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31251, "epsg", 31251, + "MGI (Ferro) / Austria GK West Zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=0 +y_0=-5000000"); + add_proj4text (p, 1, " +ellps=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / Austria GK West Zone\",GEOGCS[\"M"); + add_srs_wkt (p, 1, + "GI (Ferro)\",DATUM[\"Militar_Geographische_Institut_Ferr"); + add_srs_wkt (p, 2, + "o\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6805\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Ferro\",-17.66666666666667,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8909\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4805\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",28],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",-5000000],AUTHORITY[\"EPSG\",\"31251\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31252, "epsg", 31252, + "MGI (Ferro) / Austria GK Central Zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=-5000000"); + add_proj4text (p, 1, " +ellps=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / Austria GK Central Zone\",GEOGCS["); + add_srs_wkt (p, 1, + "\"MGI (Ferro)\",DATUM[\"Militar_Geographische_Institut_F"); + add_srs_wkt (p, 2, + "erro\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,"); + add_srs_wkt (p, 3, + "AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6805\""); + add_srs_wkt (p, 4, + "]],PRIMEM[\"Ferro\",-17.66666666666667,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"8909\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 6, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4805\"]],UNIT"); + add_srs_wkt (p, 7, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 8, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 9, + "0],PARAMETER[\"central_meridian\",31],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",-5000000],AUTHORITY[\"EPSG\",\"31252\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31253, "epsg", 31253, + "MGI (Ferro) / Austria GK East Zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=0 +y_0=-5000000"); + add_proj4text (p, 1, " +ellps=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / Austria GK East Zone\",GEOGCS[\"M"); + add_srs_wkt (p, 1, + "GI (Ferro)\",DATUM[\"Militar_Geographische_Institut_Ferr"); + add_srs_wkt (p, 2, + "o\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6805\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Ferro\",-17.66666666666667,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8909\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4805\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",34],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",-5000000],AUTHORITY[\"EPSG\",\"31253\"],A"); + add_srs_wkt (p, 12, "XIS[\"X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31254, "epsg", 31254, + "MGI / Austria GK West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "0 +y_0=-5000000 +ellps=bessel +datum=hermannskogel +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria GK West\",GEOGCS[\"MGI\",DATUM[\""); + add_srs_wkt (p, 1, + "Militar_Geographische_Institute\",SPHEROID[\"Bessel 1841"); + add_srs_wkt (p, 2, + "\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "5199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",10.333"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",0],PARAMETER[\"false_northing\",-5000000]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"31254\"],AXIS[\"X\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Y\",EAST]]"); + p = add_epsg_def (first, last, 31255, "epsg", 31255, + "MGI / Austria GK Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "0 +y_0=-5000000 +ellps=bessel +datum=hermannskogel +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria GK Central\",GEOGCS[\"MGI\",DATUM"); + add_srs_wkt (p, 1, + "[\"Militar_Geographische_Institute\",SPHEROID[\"Bessel 1"); + add_srs_wkt (p, 2, + "841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\""); + add_srs_wkt (p, 3, + "]],TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.42"); + add_srs_wkt (p, 4, + "32],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 8, + "\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"lat"); + add_srs_wkt (p, 9, + "itude_of_origin\",0],PARAMETER[\"central_meridian\",13.3"); + add_srs_wkt (p, 10, + "3333333333333],PARAMETER[\"scale_factor\",1],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",0],PARAMETER[\"false_northing\",-5000000"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"31255\"],AXIS[\"X\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Y\",EAST]]"); + p = add_epsg_def (first, last, 31256, "epsg", 31256, + "MGI / Austria GK East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "0 +y_0=-5000000 +ellps=bessel +datum=hermannskogel +unit"); + add_proj4text (p, 2, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria GK East\",GEOGCS[\"MGI\",DATUM[\""); + add_srs_wkt (p, 1, + "Militar_Geographische_Institute\",SPHEROID[\"Bessel 1841"); + add_srs_wkt (p, 2, + "\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "5199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",16.333"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",0],PARAMETER[\"false_northing\",-5000000]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"31256\"],AXIS[\"X\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Y\",EAST]]"); + p = add_epsg_def (first, last, 31257, "epsg", 31257, + "MGI / Austria GK M28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "150000 +y_0=-5000000 +ellps=bessel +datum=hermannskogel "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria GK M28\",GEOGCS[\"MGI\",DATUM[\"M"); + add_srs_wkt (p, 1, + "ilitar_Geographische_Institute\",SPHEROID[\"Bessel 1841\""); + add_srs_wkt (p, 2, + ",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "99433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",10.333333"); + add_srs_wkt (p, 10, + "33333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",150000],PARAMETER[\"false_northing\",-500000"); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"31257\"],AXIS[\"X\",NORTH],AXIS["); + add_srs_wkt (p, 13, "\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31258, "epsg", 31258, + "MGI / Austria GK M31"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "450000 +y_0=-5000000 +ellps=bessel +datum=hermannskogel "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria GK M31\",GEOGCS[\"MGI\",DATUM[\"M"); + add_srs_wkt (p, 1, + "ilitar_Geographische_Institute\",SPHEROID[\"Bessel 1841\""); + add_srs_wkt (p, 2, + ",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "99433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",13.333333"); + add_srs_wkt (p, 10, + "33333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",450000],PARAMETER[\"false_northing\",-500000"); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"31258\"],AXIS[\"X\",NORTH],AXIS["); + add_srs_wkt (p, 13, "\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31259, "epsg", 31259, + "MGI / Austria GK M34"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "750000 +y_0=-5000000 +ellps=bessel +datum=hermannskogel "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria GK M34\",GEOGCS[\"MGI\",DATUM[\"M"); + add_srs_wkt (p, 1, + "ilitar_Geographische_Institute\",SPHEROID[\"Bessel 1841\""); + add_srs_wkt (p, 2, + ",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],T"); + add_srs_wkt (p, 3, + "OWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232],"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251"); + add_srs_wkt (p, 6, + "99433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 7, + "4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 8, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 9, + "_of_origin\",0],PARAMETER[\"central_meridian\",16.333333"); + add_srs_wkt (p, 10, + "33333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"fals"); + add_srs_wkt (p, 11, + "e_easting\",750000],PARAMETER[\"false_northing\",-500000"); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"31259\"],AXIS[\"X\",NORTH],AXIS["); + add_srs_wkt (p, 13, "\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31265, "epsg", 31265, + "MGI / 3-degree Gauss zone 5 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=bessel +datum=hermannskogel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / 3-degree Gauss zone 5 (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"MGI\",DATUM[\"Militar_Geographische_Institute\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137"); + add_srs_wkt (p, 4, + ",1.474,5.297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIME"); + add_srs_wkt (p, 5, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 6, + "egree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]]"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 8, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 10, + "l_meridian\",15],PARAMETER[\"scale_factor\",1],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",5500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"31265\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 31266, "epsg", 31266, + "MGI / 3-degree Gauss zone 6 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=6500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=bessel +datum=hermannskogel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / 3-degree Gauss zone 6 (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"MGI\",DATUM[\"Militar_Geographische_Institute\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137"); + add_srs_wkt (p, 4, + ",1.474,5.297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIME"); + add_srs_wkt (p, 5, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 6, + "egree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]]"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 8, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 10, + "l_meridian\",18],PARAMETER[\"scale_factor\",1],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",6500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"31266\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 31267, "epsg", 31267, + "MGI / 3-degree Gauss zone 7 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=bessel +datum=hermannskogel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / 3-degree Gauss zone 7 (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"MGI\",DATUM[\"Militar_Geographische_Institute\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137"); + add_srs_wkt (p, 4, + ",1.474,5.297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIME"); + add_srs_wkt (p, 5, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 6, + "egree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]]"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 8, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 10, + "l_meridian\",21],PARAMETER[\"scale_factor\",1],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",7500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"31267\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 31268, "epsg", 31268, + "MGI / 3-degree Gauss zone 8 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 "); + add_proj4text (p, 1, + "+ellps=bessel +datum=hermannskogel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / 3-degree Gauss zone 8 (deprecated)\",GEOG"); + add_srs_wkt (p, 1, + "CS[\"MGI\",DATUM[\"Militar_Geographische_Institute\",SPH"); + add_srs_wkt (p, 2, + "EROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137"); + add_srs_wkt (p, 4, + ",1.474,5.297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIME"); + add_srs_wkt (p, 5, + "M[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"d"); + add_srs_wkt (p, 6, + "egree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]]"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORIT"); + add_srs_wkt (p, 8, + "Y[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"centra"); + add_srs_wkt (p, 10, + "l_meridian\",24],PARAMETER[\"scale_factor\",1],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",8500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"31268\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 31275, "epsg", 31275, + "MGI / Balkans zone 5 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=5500000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=bessel +datum=hermannskogel +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Balkans zone 5 (deprecated)\",GEOGCS[\"MG"); + add_srs_wkt (p, 1, + "I\",DATUM[\"Militar_Geographische_Institute\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137,1.474,5"); + add_srs_wkt (p, 4, + ".297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 5, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 6, + "0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",15],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",5500000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"31275\"],AXIS[\"X\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Y\",EAST]]"); + p = add_epsg_def (first, last, 31276, "epsg", 31276, + "MGI / Balkans zone 6 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=18 +k=0.9999 +x_0=6500000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=bessel +datum=hermannskogel +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Balkans zone 6 (deprecated)\",GEOGCS[\"MG"); + add_srs_wkt (p, 1, + "I\",DATUM[\"Militar_Geographische_Institute\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137,1.474,5"); + add_srs_wkt (p, 4, + ".297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 5, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 6, + "0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",18],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",6500000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"31276\"],AXIS[\"X\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Y\",EAST]]"); + p = add_epsg_def (first, last, 31277, "epsg", 31277, + "MGI / Balkans zone 7 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=7500000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=bessel +datum=hermannskogel +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Balkans zone 7 (deprecated)\",GEOGCS[\"MG"); + add_srs_wkt (p, 1, + "I\",DATUM[\"Militar_Geographische_Institute\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137,1.474,5"); + add_srs_wkt (p, 4, + ".297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 5, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 6, + "0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",21],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",7500000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"31277\"],AXIS[\"X\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Y\",EAST]]"); + p = add_epsg_def (first, last, 31278, "epsg", 31278, + "MGI / Balkans zone 8 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=7500000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=bessel +datum=hermannskogel +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Balkans zone 8 (deprecated)\",GEOGCS[\"MG"); + add_srs_wkt (p, 1, + "I\",DATUM[\"Militar_Geographische_Institute\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137,1.474,5"); + add_srs_wkt (p, 4, + ".297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 5, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 6, + "0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",21],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",7500000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"31278\"],AXIS[\"X\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Y\",EAST]]"); + p = add_epsg_def (first, last, 31279, "epsg", 31279, + "MGI / Balkans zone 8 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=24 +k=0.9999 +x_0=8500000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=bessel +datum=hermannskogel +units=m +no_def"); + add_proj4text (p, 2, "s"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Balkans zone 8 (deprecated)\",GEOGCS[\"MG"); + add_srs_wkt (p, 1, + "I\",DATUM[\"Militar_Geographische_Institute\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137,1.474,5"); + add_srs_wkt (p, 4, + ".297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 5, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 6, + "0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 8, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 9, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 10, + "an\",24],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_easting\",8500000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 12, + ",AUTHORITY[\"EPSG\",\"31279\"],AXIS[\"X\",NORTH],AXIS[\""); + add_srs_wkt (p, 13, "Y\",EAST]]"); + p = add_epsg_def (first, last, 31281, "epsg", 31281, + "MGI (Ferro) / Austria West Zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=0 +y_0=0 +ellps"); + add_proj4text (p, 1, "=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / Austria West Zone\",GEOGCS[\"MGI "); + add_srs_wkt (p, 1, + "(Ferro)\",DATUM[\"Militar_Geographische_Institut_Ferro\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6805\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Ferro\",-17.66666666666667,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "909\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4805\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",28],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",0],AUTHORITY[\"EPSG\",\"31281\"],AXIS[\"X\","); + add_srs_wkt (p, 12, "NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31282, "epsg", 31282, + "MGI (Ferro) / Austria Central Zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=0 +ellps"); + add_proj4text (p, 1, "=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / Austria Central Zone\",GEOGCS[\"M"); + add_srs_wkt (p, 1, + "GI (Ferro)\",DATUM[\"Militar_Geographische_Institut_Ferr"); + add_srs_wkt (p, 2, + "o\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6805\"]]"); + add_srs_wkt (p, 4, + ",PRIMEM[\"Ferro\",-17.66666666666667,AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 5, + "\"8909\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY"); + add_srs_wkt (p, 6, + "[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4805\"]],UNIT["); + add_srs_wkt (p, 7, + "\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",31],PARAMETER[\"scale_f"); + add_srs_wkt (p, 10, + "actor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"31282\"],AXIS[\"X"); + add_srs_wkt (p, 12, "\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31283, "epsg", 31283, + "MGI (Ferro) / Austria East Zone"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=0 +y_0=0 +ellps"); + add_proj4text (p, 1, "=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / Austria East Zone\",GEOGCS[\"MGI "); + add_srs_wkt (p, 1, + "(Ferro)\",DATUM[\"Militar_Geographische_Institut_Ferro\""); + add_srs_wkt (p, 2, + ",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6805\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Ferro\",-17.66666666666667,AUTHORITY[\"EPSG\",\"8"); + add_srs_wkt (p, 5, + "909\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4805\"]],UNIT[\"m"); + add_srs_wkt (p, 7, + "etre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Tran"); + add_srs_wkt (p, 8, + "sverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"central_meridian\",34],PARAMETER[\"scale_fact"); + add_srs_wkt (p, 10, + "or\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",0],AUTHORITY[\"EPSG\",\"31283\"],AXIS[\"X\","); + add_srs_wkt (p, 12, "NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31284, "epsg", 31284, "MGI / Austria M28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "150000 +y_0=0 +ellps=bessel +datum=hermannskogel +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria M28\",GEOGCS[\"MGI\",DATUM[\"Mili"); + add_srs_wkt (p, 1, + "tar_Geographische_Institute\",SPHEROID[\"Bessel 1841\",6"); + add_srs_wkt (p, 2, + "377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",10.3333333"); + add_srs_wkt (p, 10, + "3333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_easting\",150000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"31284\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EA"); + add_srs_wkt (p, 13, "ST]]"); + p = add_epsg_def (first, last, 31285, "epsg", 31285, "MGI / Austria M31"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "450000 +y_0=0 +ellps=bessel +datum=hermannskogel +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria M31\",GEOGCS[\"MGI\",DATUM[\"Mili"); + add_srs_wkt (p, 1, + "tar_Geographische_Institute\",SPHEROID[\"Bessel 1841\",6"); + add_srs_wkt (p, 2, + "377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",13.3333333"); + add_srs_wkt (p, 10, + "3333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_easting\",450000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"31285\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EA"); + add_srs_wkt (p, 13, "ST]]"); + p = add_epsg_def (first, last, 31286, "epsg", 31286, "MGI / Austria M34"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "750000 +y_0=0 +ellps=bessel +datum=hermannskogel +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria M34\",GEOGCS[\"MGI\",DATUM[\"Mili"); + add_srs_wkt (p, 1, + "tar_Geographische_Institute\",SPHEROID[\"Bessel 1841\",6"); + add_srs_wkt (p, 2, + "377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOW"); + add_srs_wkt (p, 3, + "GS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232],AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 6, + "433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",16.3333333"); + add_srs_wkt (p, 10, + "3333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_easting\",750000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 12, + "RITY[\"EPSG\",\"31286\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EA"); + add_srs_wkt (p, 13, "ST]]"); + p = add_epsg_def (first, last, 31287, "epsg", 31287, + "MGI / Austria Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.3333"); + add_proj4text (p, 1, + "3333333333 +x_0=400000 +y_0=400000 +ellps=bessel +datum="); + add_proj4text (p, 2, "hermannskogel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria Lambert\",GEOGCS[\"MGI\",DATUM[\""); + add_srs_wkt (p, 1, + "Militar_Geographische_Institute\",SPHEROID[\"Bessel 1841"); + add_srs_wkt (p, 2, + "\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "5199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 9, + "[\"standard_parallel_1\",49],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 10, + "el_2\",46],PARAMETER[\"latitude_of_origin\",47.5],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",13.33333333333333],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",400000],PARAMETER[\"false_northing\",400"); + add_srs_wkt (p, 13, + "000],AUTHORITY[\"EPSG\",\"31287\"],AXIS[\"X\",NORTH],AXI"); + add_srs_wkt (p, 14, "S[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31288, "epsg", 31288, "MGI (Ferro) / M28"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=150000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / M28\",GEOGCS[\"MGI (Ferro)\",DATU"); + add_srs_wkt (p, 1, + "M[\"Militar_Geographische_Institut_Ferro\",SPHEROID[\"Be"); + add_srs_wkt (p, 2, + "ssel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7004\"]],AUTHORITY[\"EPSG\",\"6805\"]],PRIMEM[\"Ferro\","); + add_srs_wkt (p, 4, + "-17.66666666666667,AUTHORITY[\"EPSG\",\"8909\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4805\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",28],PARAMETER[\"scale_factor\",1],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",150000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"31288\"],AXIS[\"X\",NORTH],AXIS"); + add_srs_wkt (p, 12, "[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31289, "epsg", 31289, "MGI (Ferro) / M31"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=450000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / M31\",GEOGCS[\"MGI (Ferro)\",DATU"); + add_srs_wkt (p, 1, + "M[\"Militar_Geographische_Institut_Ferro\",SPHEROID[\"Be"); + add_srs_wkt (p, 2, + "ssel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7004\"]],AUTHORITY[\"EPSG\",\"6805\"]],PRIMEM[\"Ferro\","); + add_srs_wkt (p, 4, + "-17.66666666666667,AUTHORITY[\"EPSG\",\"8909\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4805\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",31],PARAMETER[\"scale_factor\",1],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",450000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"31289\"],AXIS[\"X\",NORTH],AXIS"); + add_srs_wkt (p, 12, "[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31290, "epsg", 31290, "MGI (Ferro) / M34"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=750000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / M34\",GEOGCS[\"MGI (Ferro)\",DATU"); + add_srs_wkt (p, 1, + "M[\"Militar_Geographische_Institut_Ferro\",SPHEROID[\"Be"); + add_srs_wkt (p, 2, + "ssel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7004\"]],AUTHORITY[\"EPSG\",\"6805\"]],PRIMEM[\"Ferro\","); + add_srs_wkt (p, 4, + "-17.66666666666667,AUTHORITY[\"EPSG\",\"8909\"]],UNIT[\""); + add_srs_wkt (p, 5, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 6, + "]],AUTHORITY[\"EPSG\",\"4805\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 8, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 9, + "ral_meridian\",34],PARAMETER[\"scale_factor\",1],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"false_easting\",750000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"31290\"],AXIS[\"X\",NORTH],AXIS"); + add_srs_wkt (p, 12, "[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31291, "epsg", 31291, + "MGI (Ferro) / Austria West Zone (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=28 +k=1 +x_0=0 +y_0=0 +ellps"); + add_proj4text (p, 1, "=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / Austria West Zone (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"MGI (Ferro)\",DATUM[\"Militar_Geographische_Ins"); + add_srs_wkt (p, 2, + "titut_Ferro\",SPHEROID[\"Bessel 1841\",6377397.155,299.1"); + add_srs_wkt (p, 3, + "528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6805\"]],PRIMEM[\"Ferro\",-17.66666666666667,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8909\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4805"); + add_srs_wkt (p, 7, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 9, + "origin\",0],PARAMETER[\"central_meridian\",28],PARAMETER"); + add_srs_wkt (p, 10, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"31291\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 31292, "epsg", 31292, + "MGI (Ferro) / Austria Central Zone (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=31 +k=1 +x_0=0 +y_0=0 +ellps"); + add_proj4text (p, 1, "=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / Austria Central Zone (deprecated)"); + add_srs_wkt (p, 1, + "\",GEOGCS[\"MGI (Ferro)\",DATUM[\"Militar_Geographische_"); + add_srs_wkt (p, 2, + "Institut_Ferro\",SPHEROID[\"Bessel 1841\",6377397.155,29"); + add_srs_wkt (p, 3, + "9.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"6805\"]],PRIMEM[\"Ferro\",-17.66666666666667,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"8909\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 6, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 7, + "805\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 8, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 9, + "of_origin\",0],PARAMETER[\"central_meridian\",31],PARAME"); + add_srs_wkt (p, 10, + "TER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3129"); + add_srs_wkt (p, 12, "2\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 31293, "epsg", 31293, + "MGI (Ferro) / Austria East Zone (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=34 +k=1 +x_0=0 +y_0=0 +ellps"); + add_proj4text (p, 1, "=bessel +pm=ferro +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI (Ferro) / Austria East Zone (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"MGI (Ferro)\",DATUM[\"Militar_Geographische_Ins"); + add_srs_wkt (p, 2, + "titut_Ferro\",SPHEROID[\"Bessel 1841\",6377397.155,299.1"); + add_srs_wkt (p, 3, + "528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 4, + "\"6805\"]],PRIMEM[\"Ferro\",-17.66666666666667,AUTHORITY"); + add_srs_wkt (p, 5, + "[\"EPSG\",\"8909\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 6, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4805"); + add_srs_wkt (p, 7, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 8, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 9, + "origin\",0],PARAMETER[\"central_meridian\",34],PARAMETER"); + add_srs_wkt (p, 10, + "[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"31293\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 31294, "epsg", 31294, + "MGI / M28 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "150000 +y_0=0 +ellps=bessel +datum=hermannskogel +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / M28 (deprecated)\",GEOGCS[\"MGI\",DATUM[\""); + add_srs_wkt (p, 1, + "Militar_Geographische_Institute\",SPHEROID[\"Bessel 1841"); + add_srs_wkt (p, 2, + "\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "5199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",10.333"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",150000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"31294\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 31295, "epsg", 31295, + "MGI / M31 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "450000 +y_0=0 +ellps=bessel +datum=hermannskogel +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / M31 (deprecated)\",GEOGCS[\"MGI\",DATUM[\""); + add_srs_wkt (p, 1, + "Militar_Geographische_Institute\",SPHEROID[\"Bessel 1841"); + add_srs_wkt (p, 2, + "\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "5199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",13.333"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",450000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"31295\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 31296, "epsg", 31296, + "MGI / M34 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0="); + add_proj4text (p, 1, + "750000 +y_0=0 +ellps=bessel +datum=hermannskogel +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / M34 (deprecated)\",GEOGCS[\"MGI\",DATUM[\""); + add_srs_wkt (p, 1, + "Militar_Geographische_Institute\",SPHEROID[\"Bessel 1841"); + add_srs_wkt (p, 2, + "\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]]"); + add_srs_wkt (p, 3, + ",TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232"); + add_srs_wkt (p, 4, + "],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 5, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 6, + "5199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 7, + ",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 8, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 9, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",16.333"); + add_srs_wkt (p, 10, + "33333333333],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",750000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"31296\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 31297, "epsg", 31297, + "MGI / Austria Lambert (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.3333"); + add_proj4text (p, 1, + "3333333333 +x_0=400000 +y_0=400000 +ellps=bessel +datum="); + add_proj4text (p, 2, "hermannskogel +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"MGI / Austria Lambert (deprecated)\",GEOGCS[\"M"); + add_srs_wkt (p, 1, + "GI\",DATUM[\"Militar_Geographische_Institute\",SPHEROID["); + add_srs_wkt (p, 2, + "\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 3, + "\",\"7004\"]],TOWGS84[577.326,90.129,463.919,5.137,1.474"); + add_srs_wkt (p, 4, + ",5.297,2.4232],AUTHORITY[\"EPSG\",\"6312\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 5, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 6, + ",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"4312\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 8, + "G\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\""); + add_srs_wkt (p, 9, + "],PARAMETER[\"standard_parallel_1\",49],PARAMETER[\"stan"); + add_srs_wkt (p, 10, + "dard_parallel_2\",46],PARAMETER[\"latitude_of_origin\",4"); + add_srs_wkt (p, 11, + "7.5],PARAMETER[\"central_meridian\",13.33333333333333],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_easting\",400000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 13, + "thing\",400000],AUTHORITY[\"EPSG\",\"31297\"],AXIS[\"X\""); + add_srs_wkt (p, 14, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 31300, "epsg", 31300, + "Belge 1972 / Belge Lambert 72"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49.83333333333334 +lat_2=51.16666666666"); + add_proj4text (p, 1, + "666 +lat_0=90 +lon_0=4.356939722222222 +x_0=150000.01256"); + add_proj4text (p, 2, + " +y_0=5400088.4378 +ellps=intl +towgs84=106.869,-52.2978"); + add_proj4text (p, 3, + ",103.724,-0.33657,0.456955,-1.84218,1 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Belge 1972 / Belge Lambert 72\",GEOGCS[\"Belge "); + add_srs_wkt (p, 1, + "1972\",DATUM[\"Reseau_National_Belge_1972\",SPHEROID[\"I"); + add_srs_wkt (p, 2, + "nternational 1924\",6378388,297,AUTHORITY[\"EPSG\",\"702"); + add_srs_wkt (p, 3, + "2\"]],TOWGS84[106.869,-52.2978,103.724,-0.33657,0.456955"); + add_srs_wkt (p, 4, + ",-1.84218,1],AUTHORITY[\"EPSG\",\"6313\"]],PRIMEM[\"Gree"); + add_srs_wkt (p, 5, + "nwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\","); + add_srs_wkt (p, 6, + "0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHOR"); + add_srs_wkt (p, 7, + "ITY[\"EPSG\",\"4313\"]],UNIT[\"metre\",1,AUTHORITY[\"EPS"); + add_srs_wkt (p, 8, + "G\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP_"); + add_srs_wkt (p, 9, + "Belgium\"],PARAMETER[\"standard_parallel_1\",49.83333333"); + add_srs_wkt (p, 10, + "333334],PARAMETER[\"standard_parallel_2\",51.16666666666"); + add_srs_wkt (p, 11, + "666],PARAMETER[\"latitude_of_origin\",90],PARAMETER[\"ce"); + add_srs_wkt (p, 12, + "ntral_meridian\",4.356939722222222],PARAMETER[\"false_ea"); + add_srs_wkt (p, 13, + "sting\",150000.01256],PARAMETER[\"false_northing\",54000"); + add_srs_wkt (p, 14, + "88.4378],AUTHORITY[\"EPSG\",\"31300\"],AXIS[\"X\",EAST],"); + add_srs_wkt (p, 15, "AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 31370, "epsg", 31370, + "Belge 1972 / Belgian Lambert 72"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +la"); + add_proj4text (p, 1, + "t_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=540"); + add_proj4text (p, 2, + "0088.438 +ellps=intl +towgs84=106.869,-52.2978,103.724,-"); + add_proj4text (p, 3, "0.33657,0.456955,-1.84218,1 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Belge 1972 / Belgian Lambert 72\",GEOGCS[\"Belg"); + add_srs_wkt (p, 1, + "e 1972\",DATUM[\"Reseau_National_Belge_1972\",SPHEROID[\""); + add_srs_wkt (p, 2, + "International 1924\",6378388,297,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "22\"]],TOWGS84[106.869,-52.2978,103.724,-0.33657,0.45695"); + add_srs_wkt (p, 4, + "5,-1.84218,1],AUTHORITY[\"EPSG\",\"6313\"]],PRIMEM[\"Gre"); + add_srs_wkt (p, 5, + "enwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 6, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 7, + "RITY[\"EPSG\",\"4313\"]],UNIT[\"metre\",1,AUTHORITY[\"EP"); + add_srs_wkt (p, 8, + "SG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP"); + add_srs_wkt (p, 9, + "\"],PARAMETER[\"standard_parallel_1\",51.16666723333333]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"standard_parallel_2\",49.8333339],PARAMETER"); + add_srs_wkt (p, 11, + "[\"latitude_of_origin\",90],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 12, + "\",4.367486666666666],PARAMETER[\"false_easting\",150000"); + add_srs_wkt (p, 13, + ".013],PARAMETER[\"false_northing\",5400088.438],AUTHORIT"); + add_srs_wkt (p, 14, + "Y[\"EPSG\",\"31370\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]"); + add_srs_wkt (p, 15, "]"); + p = add_epsg_def (first, last, 31461, "epsg", 31461, + "DHDN / 3-degree Gauss zone 1 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=3 +k=1 +x_0=1500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=bessel +datum=potsdam +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DHDN / 3-degree Gauss zone 1 (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"DHDN\",DATUM[\"Deutsches_Hauptdreiecksnetz\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6314\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4314\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",3],PARAMETER[\"scale_factor\",1],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",1500000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"31461\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 31462, "epsg", 31462, + "DHDN / 3-degree Gauss zone 2 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=bessel +datum=potsdam +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DHDN / 3-degree Gauss zone 2 (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"DHDN\",DATUM[\"Deutsches_Hauptdreiecksnetz\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6314\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4314\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",6],PARAMETER[\"scale_factor\",1],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",2500000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"31462\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 31463, "epsg", 31463, + "DHDN / 3-degree Gauss zone 3 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=bessel +datum=potsdam +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DHDN / 3-degree Gauss zone 3 (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"DHDN\",DATUM[\"Deutsches_Hauptdreiecksnetz\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6314\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4314\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",9],PARAMETER[\"scale_factor\",1],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",3500000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"31463\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 31464, "epsg", 31464, + "DHDN / 3-degree Gauss zone 4 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=bessel +datum=potsdam +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DHDN / 3-degree Gauss zone 4 (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"DHDN\",DATUM[\"Deutsches_Hauptdreiecksnetz\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6314\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4314\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",12],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",4500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"31464\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 31465, "epsg", 31465, + "DHDN / 3-degree Gauss zone 5 (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=bessel +datum=potsdam +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DHDN / 3-degree Gauss zone 5 (deprecated)\",GEO"); + add_srs_wkt (p, 1, + "GCS[\"DHDN\",DATUM[\"Deutsches_Hauptdreiecksnetz\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6314\"]],PRIMEM[\""); + add_srs_wkt (p, 4, + "Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degre"); + add_srs_wkt (p, 5, + "e\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"4314\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",15],PARAMETER[\"scale_factor\",1],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",5500000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"31465\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 31466, "epsg", 31466, + "DHDN / 3-degree Gauss-Kruger zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=bessel +datum=potsdam +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DHDN / 3-degree Gauss-Kruger zone 2\",GEOGCS[\""); + add_srs_wkt (p, 1, + "DHDN\",DATUM[\"Deutsches_Hauptdreiecksnetz\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7004\"]],AUTHORITY[\"EPSG\",\"6314\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4314\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",6],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",2500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"31466\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EA"); + add_srs_wkt (p, 12, "ST]]"); + p = add_epsg_def (first, last, 31467, "epsg", 31467, + "DHDN / 3-degree Gauss-Kruger zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=bessel +datum=potsdam +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DHDN / 3-degree Gauss-Kruger zone 3\",GEOGCS[\""); + add_srs_wkt (p, 1, + "DHDN\",DATUM[\"Deutsches_Hauptdreiecksnetz\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7004\"]],AUTHORITY[\"EPSG\",\"6314\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4314\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",9],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "easting\",3500000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"31467\"],AXIS[\"X\",NORTH],AXIS[\"Y\",EA"); + add_srs_wkt (p, 12, "ST]]"); + p = add_epsg_def (first, last, 31468, "epsg", 31468, + "DHDN / 3-degree Gauss-Kruger zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=bessel +datum=potsdam +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DHDN / 3-degree Gauss-Kruger zone 4\",GEOGCS[\""); + add_srs_wkt (p, 1, + "DHDN\",DATUM[\"Deutsches_Hauptdreiecksnetz\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7004\"]],AUTHORITY[\"EPSG\",\"6314\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4314\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",12],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",4500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"31468\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 12, "AST]]"); + p = add_epsg_def (first, last, 31469, "epsg", 31469, + "DHDN / 3-degree Gauss-Kruger zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 "); + add_proj4text (p, 1, "+ellps=bessel +datum=potsdam +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"DHDN / 3-degree Gauss-Kruger zone 5\",GEOGCS[\""); + add_srs_wkt (p, 1, + "DHDN\",DATUM[\"Deutsches_Hauptdreiecksnetz\",SPHEROID[\""); + add_srs_wkt (p, 2, + "Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7004\"]],AUTHORITY[\"EPSG\",\"6314\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4314\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PARAME"); + add_srs_wkt (p, 8, + "TER[\"latitude_of_origin\",0],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",15],PARAMETER[\"scale_factor\",1],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",5500000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 11, + "ORITY[\"EPSG\",\"31469\"],AXIS[\"X\",NORTH],AXIS[\"Y\",E"); + add_srs_wkt (p, 12, "AST]]"); + p = add_epsg_def (first, last, 31528, "epsg", 31528, + "Conakry 1905 / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +a=6378249.2 +b=6356515 +towgs84=-23,"); + add_proj4text (p, 1, "259,-9,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Conakry 1905 / UTM zone 28N\",GEOGCS[\"Conakry "); + add_srs_wkt (p, 1, + "1905\",DATUM[\"Conakry_1905\",SPHEROID[\"Clarke 1880 (IG"); + add_srs_wkt (p, 2, + "N)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "11\"]],TOWGS84[-23,259,-9,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6315\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4315\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",-15],PARAMETER[\"scale_facto"); + add_srs_wkt (p, 10, + "r\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_northing\",0],AUTHORITY[\"EPSG\",\"31528\"],AX"); + add_srs_wkt (p, 12, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31529, "epsg", 31529, + "Conakry 1905 / UTM zone 29N"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +a=6378249.2 +b=6356515 +towgs84=-23,"); + add_proj4text (p, 1, "259,-9,0,0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Conakry 1905 / UTM zone 29N\",GEOGCS[\"Conakry "); + add_srs_wkt (p, 1, + "1905\",DATUM[\"Conakry_1905\",SPHEROID[\"Clarke 1880 (IG"); + add_srs_wkt (p, 2, + "N)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "11\"]],TOWGS84[-23,259,-9,0,0,0,0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 4, + "6315\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"890"); + add_srs_wkt (p, 5, + "1\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4315\"]],UNIT[\"met"); + add_srs_wkt (p, 7, + "re\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transv"); + add_srs_wkt (p, 8, + "erse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"central_meridian\",-9],PARAMETER[\"scale_factor"); + add_srs_wkt (p, 10, + "\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",0],AUTHORITY[\"EPSG\",\"31529\"],AXI"); + add_srs_wkt (p, 12, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31600, "epsg", 31600, + "Dealul Piscului 1930 / Stereo 33"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=45.9 +lon_0=25.39246588888889 +k=0.9"); + add_proj4text (p, 1, + "996667 +x_0=500000 +y_0=500000 +ellps=intl +units=m +no_"); + add_proj4text (p, 2, "defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Dealul Piscului 1930 / Stereo 33\",GEOGCS[\"Dea"); + add_srs_wkt (p, 1, + "lul Piscului 1930\",DATUM[\"Dealul_Piscului_1930\",SPHER"); + add_srs_wkt (p, 2, + "OID[\"International 1924\",6378388,297,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 3, + ",\"7022\"]],AUTHORITY[\"EPSG\",\"6316\"]],PRIMEM[\"Green"); + add_srs_wkt (p, 4, + "wich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0"); + add_srs_wkt (p, 5, + ".01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORI"); + add_srs_wkt (p, 6, + "TY[\"EPSG\",\"4316\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 7, + "\",\"9001\"]],PROJECTION[\"Oblique_Stereographic\"],PARA"); + add_srs_wkt (p, 8, + "METER[\"latitude_of_origin\",45.9],PARAMETER[\"central_m"); + add_srs_wkt (p, 9, + "eridian\",25.39246588888889],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996667],PARAMETER[\"false_easting\",500000],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_northing\",500000],AUTHORITY[\"EPSG\",\"31600\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 31700, "epsg", 31700, + "Dealul Piscului 1970/ Stereo 70 (deprecated)"); + add_proj4text (p, 0, + "+proj=sterea +lat_0=46 +lon_0=25 +k=0.99975 +x_0=500000 "); + add_proj4text (p, 1, "+y_0=500000 +ellps=krass +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"Dealul Piscului 1970/ Stereo 70 (deprecated)\","); + add_srs_wkt (p, 1, + "GEOGCS[\"Dealul Piscului 1970\",DATUM[\"Dealul_Piscului_"); + add_srs_wkt (p, 2, + "1970\",SPHEROID[\"Krassowsky 1940\",6378245,298.3,AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"7024\"]],AUTHORITY[\"EPSG\",\"6317\"]],PR"); + add_srs_wkt (p, 4, + "IMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT["); + add_srs_wkt (p, 5, + "\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122"); + add_srs_wkt (p, 6, + "\"]],AUTHORITY[\"EPSG\",\"4317\"]],UNIT[\"metre\",1,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Oblique_Stereogra"); + add_srs_wkt (p, 8, + "phic\"],PARAMETER[\"latitude_of_origin\",46],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",25],PARAMETER[\"scale_factor\",0.9997"); + add_srs_wkt (p, 10, + "5],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 11, + "_northing\",500000],AUTHORITY[\"EPSG\",\"31700\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",NORTH],AXIS[\"Y\",EAST]]"); + p = add_epsg_def (first, last, 31838, "epsg", 31838, "NGN / UTM zone 38N"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +ellps=WGS84 +towgs84=-3.2,-5.7,2.8,0"); + add_proj4text (p, 1, ",0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NGN / UTM zone 38N\",GEOGCS[\"NGN\",DATUM[\"Nat"); + add_srs_wkt (p, 1, + "ional_Geodetic_Network\",SPHEROID[\"WGS 84\",6378137,298"); + add_srs_wkt (p, 2, + ".257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[-3.2,-5"); + add_srs_wkt (p, 3, + ".7,2.8,0,0,0,0],AUTHORITY[\"EPSG\",\"6318\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4318\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",45],PARAMETER[\"scale_factor\",0.9996],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"31838\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31839, "epsg", 31839, "NGN / UTM zone 39N"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +ellps=WGS84 +towgs84=-3.2,-5.7,2.8,0"); + add_proj4text (p, 1, ",0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NGN / UTM zone 39N\",GEOGCS[\"NGN\",DATUM[\"Nat"); + add_srs_wkt (p, 1, + "ional_Geodetic_Network\",SPHEROID[\"WGS 84\",6378137,298"); + add_srs_wkt (p, 2, + ".257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[-3.2,-5"); + add_srs_wkt (p, 3, + ".7,2.8,0,0,0,0],AUTHORITY[\"EPSG\",\"6318\"]],PRIMEM[\"G"); + add_srs_wkt (p, 4, + "reenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree"); + add_srs_wkt (p, 5, + "\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUT"); + add_srs_wkt (p, 6, + "HORITY[\"EPSG\",\"4318\"]],UNIT[\"metre\",1,AUTHORITY[\""); + add_srs_wkt (p, 7, + "EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator\"],PA"); + add_srs_wkt (p, 8, + "RAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_me"); + add_srs_wkt (p, 9, + "ridian\",51],PARAMETER[\"scale_factor\",0.9996],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",500000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"31839\"],AXIS[\"Easting\",EAST]"); + add_srs_wkt (p, 12, ",AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31900, "epsg", 31900, + "KUDAMS / KTM (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=48 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, "0=0 +ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"KUDAMS / KTM (deprecated)\",GEOGCS[\"KUDAMS\",D"); + add_srs_wkt (p, 1, + "ATUM[\"Kuwait_Utility\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 2, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6319\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4319\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "0],PARAMETER[\"central_meridian\",48],PARAMETER[\"scale_"); + add_srs_wkt (p, 9, + "factor\",0.9996],PARAMETER[\"false_easting\",500000],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"31900\""); + add_srs_wkt (p, 11, "],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31901, "epsg", 31901, "KUDAMS / KTM"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=48 +k=1 +x_0=500000 +y_0=0 +"); + add_proj4text (p, 1, "ellps=GRS80 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"KUDAMS / KTM\",GEOGCS[\"KUDAMS\",DATUM[\"Kuwait"); + add_srs_wkt (p, 1, + "_Utility\",SPHEROID[\"GRS 1980\",6378137,298.257222101,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6319\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4319\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",48],PARAMETER[\"scale_factor\",1],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"31901\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31965, "epsg", 31965, + "SIRGAS 2000 / UTM zone 11N"); + add_proj4text (p, 0, + "+proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 11N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-11"); + add_srs_wkt (p, 10, + "7],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 12, + "ITY[\"EPSG\",\"31965\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 13, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 31966, "epsg", 31966, + "SIRGAS 2000 / UTM zone 12N"); + add_proj4text (p, 0, + "+proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 12N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-11"); + add_srs_wkt (p, 10, + "1],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 12, + "ITY[\"EPSG\",\"31966\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 13, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 31967, "epsg", 31967, + "SIRGAS 2000 / UTM zone 13N"); + add_proj4text (p, 0, + "+proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 13N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-10"); + add_srs_wkt (p, 10, + "5],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",500000],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 12, + "ITY[\"EPSG\",\"31967\"],AXIS[\"Easting\",EAST],AXIS[\"No"); + add_srs_wkt (p, 13, "rthing\",NORTH]]"); + p = add_epsg_def (first, last, 31968, "epsg", 31968, + "SIRGAS 2000 / UTM zone 14N"); + add_proj4text (p, 0, + "+proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 14N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-99"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31968\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31969, "epsg", 31969, + "SIRGAS 2000 / UTM zone 15N"); + add_proj4text (p, 0, + "+proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 15N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-93"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31969\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31970, "epsg", 31970, + "SIRGAS 2000 / UTM zone 16N"); + add_proj4text (p, 0, + "+proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 16N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-87"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31970\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31971, "epsg", 31971, + "SIRGAS 2000 / UTM zone 17N"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 17N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-81"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31971\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31972, "epsg", 31972, + "SIRGAS 2000 / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 18N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-75"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31972\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31973, "epsg", 31973, + "SIRGAS 2000 / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 19N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-69"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31973\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31974, "epsg", 31974, + "SIRGAS 2000 / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 20N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-63"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31974\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31975, "epsg", 31975, + "SIRGAS 2000 / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 21N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-57"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31975\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31976, "epsg", 31976, + "SIRGAS 2000 / UTM zone 22N"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 22N\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-51"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31976\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31977, "epsg", 31977, + "SIRGAS 2000 / UTM zone 17S"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 17S\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-81"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31977\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31978, "epsg", 31978, + "SIRGAS 2000 / UTM zone 18S"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 18S\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-75"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31978\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31979, "epsg", 31979, + "SIRGAS 2000 / UTM zone 19S"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 19S\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-69"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31979\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31980, "epsg", 31980, + "SIRGAS 2000 / UTM zone 20S"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 20S\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-63"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31980\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31981, "epsg", 31981, + "SIRGAS 2000 / UTM zone 21S"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 21S\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-57"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31981\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31982, "epsg", 31982, + "SIRGAS 2000 / UTM zone 22S"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 22S\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-51"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31982\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31983, "epsg", 31983, + "SIRGAS 2000 / UTM zone 23S"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 23S\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-45"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31983\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31984, "epsg", 31984, + "SIRGAS 2000 / UTM zone 24S"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 24S\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-39"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31984\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31985, "epsg", 31985, + "SIRGAS 2000 / UTM zone 25S"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 2000 / UTM zone 25S\",GEOGCS[\"SIRGAS 20"); + add_srs_wkt (p, 1, + "00\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_2000\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6674\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4674\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-33"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31985\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31986, "epsg", 31986, + "SIRGAS 1995 / UTM zone 17N"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 17N\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-81"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31986\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31987, "epsg", 31987, + "SIRGAS 1995 / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 18N\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-75"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31987\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31988, "epsg", 31988, + "SIRGAS 1995 / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 19N\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-69"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31988\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31989, "epsg", 31989, + "SIRGAS 1995 / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 20N\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-63"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31989\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31990, "epsg", 31990, + "SIRGAS 1995 / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 21N\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-57"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31990\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31991, "epsg", 31991, + "SIRGAS 1995 / UTM zone 22N"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +"); + add_proj4text (p, 1, "units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 22N\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-51"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"31991\"],AXIS[\"Easting\",EAST],AXIS[\"Nor"); + add_srs_wkt (p, 13, "thing\",NORTH]]"); + p = add_epsg_def (first, last, 31992, "epsg", 31992, + "SIRGAS 1995 / UTM zone 17S"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 17S\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-81"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31992\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31993, "epsg", 31993, + "SIRGAS 1995 / UTM zone 18S"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 18S\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-75"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31993\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31994, "epsg", 31994, + "SIRGAS 1995 / UTM zone 19S"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 19S\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-69"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31994\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31995, "epsg", 31995, + "SIRGAS 1995 / UTM zone 20S"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 20S\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-63"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31995\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31996, "epsg", 31996, + "SIRGAS 1995 / UTM zone 21S"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 21S\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-57"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31996\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31997, "epsg", 31997, + "SIRGAS 1995 / UTM zone 22S"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 22S\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-51"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31997\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31998, "epsg", 31998, + "SIRGAS 1995 / UTM zone 23S"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 23S\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-45"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31998\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 31999, "epsg", 31999, + "SIRGAS 1995 / UTM zone 24S"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 24S\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-39"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"31999\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32000, "epsg", 32000, + "SIRGAS 1995 / UTM zone 25S"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +south +ellps=GRS80 +towgs84=0,0,0,0,"); + add_proj4text (p, 1, "0,0,0 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"SIRGAS 1995 / UTM zone 25S\",GEOGCS[\"SIRGAS 19"); + add_srs_wkt (p, 1, + "95\",DATUM[\"Sistema_de_Referencia_Geocentrico_para_Amer"); + add_srs_wkt (p, 2, + "ica_del_Sur_1995\",SPHEROID[\"GRS 1980\",6378137,298.257"); + add_srs_wkt (p, 3, + "222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0"); + add_srs_wkt (p, 4, + ",0],AUTHORITY[\"EPSG\",\"6170\"]],PRIMEM[\"Greenwich\",0"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532"); + add_srs_wkt (p, 6, + "9251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPS"); + add_srs_wkt (p, 7, + "G\",\"4170\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"900"); + add_srs_wkt (p, 8, + "1\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"la"); + add_srs_wkt (p, 9, + "titude_of_origin\",0],PARAMETER[\"central_meridian\",-33"); + add_srs_wkt (p, 10, + "],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",10000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"32000\"],AXIS[\"Easting\",EAST],AXI"); + add_srs_wkt (p, 13, "S[\"Northing\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_25 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 32001, "epsg", 32001, + "NAD27 / Montana North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.71666666666667 +lat_2=47.85 +lat_0=4"); + add_proj4text (p, 1, + "7 +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +ellps=clr"); + add_proj4text (p, 2, "k66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Montana North\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",48.71"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"standard_parallel_2\",47.85],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"latitude_of_origin\",47],PARAMETER[\"central_"); + add_srs_wkt (p, 11, + "meridian\",-109.5],PARAMETER[\"false_easting\",2000000],"); + add_srs_wkt (p, 12, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"320"); + add_srs_wkt (p, 13, "01\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32002, "epsg", 32002, + "NAD27 / Montana Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.88333333333333 +lat_2=46.45 +lat_0=4"); + add_proj4text (p, 1, + "5.83333333333334 +lon_0=-109.5 +x_0=609601.2192024384 +y"); + add_proj4text (p, 2, + "_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Montana Central\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",47."); + add_srs_wkt (p, 9, + "88333333333333],PARAMETER[\"standard_parallel_2\",46.45]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"latitude_of_origin\",45.83333333333334],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"central_meridian\",-109.5],PARAMETER[\"false_ea"); + add_srs_wkt (p, 12, + "sting\",2000000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 13, + "TY[\"EPSG\",\"32002\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 14, "]]"); + p = add_epsg_def (first, last, 32003, "epsg", 32003, + "NAD27 / Montana South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.4 +lat_2=44.86666666666667 +lat_0=44"); + add_proj4text (p, 1, + " +lon_0=-109.5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk"); + add_proj4text (p, 2, "66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Montana South\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",46.4]"); + add_srs_wkt (p, 9, + ",PARAMETER[\"standard_parallel_2\",44.86666666666667],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",44],PARAMETER[\"central_m"); + add_srs_wkt (p, 11, + "eridian\",-109.5],PARAMETER[\"false_easting\",2000000],P"); + add_srs_wkt (p, 12, + "ARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3200"); + add_srs_wkt (p, 13, "3\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32005, "epsg", 32005, + "NAD27 / Nebraska North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.85 +lat_2=42.81666666666667 +lat_0=4"); + add_proj4text (p, 1, + "1.33333333333334 +lon_0=-100 +x_0=609601.2192024384 +y_0"); + add_proj4text (p, 2, "=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Nebraska North\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",41.85"); + add_srs_wkt (p, 9, + "],PARAMETER[\"standard_parallel_2\",42.81666666666667],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"latitude_of_origin\",41.33333333333334],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"central_meridian\",-100],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"32005\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32006, "epsg", 32006, + "NAD27 / Nebraska South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.28333333333333 +lat_2=41.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=39.66666666666666 +lon_0=-99.5 +x_0=609601.21"); + add_proj4text (p, 2, + "92024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Nebraska South\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",40.28"); + add_srs_wkt (p, 9, + "333333333333],PARAMETER[\"standard_parallel_2\",41.71666"); + add_srs_wkt (p, 10, + "666666667],PARAMETER[\"latitude_of_origin\",39.666666666"); + add_srs_wkt (p, 11, + "66666],PARAMETER[\"central_meridian\",-99.5],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",2000000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 13, + ",AUTHORITY[\"EPSG\",\"32006\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 14, "\",NORTH]]"); + p = add_epsg_def (first, last, 32007, "epsg", 32007, "NAD27 / Nevada East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum="); + add_proj4text (p, 2, "NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Nevada East\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",34.75],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-115.5833333333333],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",0.9999],PARAMETER[\"false_easting\",500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"320"); + add_srs_wkt (p, 12, "07\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32008, "epsg", 32008, + "NAD27 / Nevada Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum="); + add_proj4text (p, 2, "NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Nevada Central\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",34.75],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-116.6666666666667],PARAMETER[\""); + add_srs_wkt (p, 10, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "32008\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32009, "epsg", 32009, "NAD27 / Nevada West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum="); + add_proj4text (p, 2, "NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Nevada West\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",34.75],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-118.5833333333333],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",0.9999],PARAMETER[\"false_easting\",500000],"); + add_srs_wkt (p, 11, + "PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"320"); + add_srs_wkt (p, 12, "09\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32010, "epsg", 32010, + "NAD27 / New Hampshire"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +da"); + add_proj4text (p, 2, "tum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / New Hampshire\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",42.5],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-71.66666666666667],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.999966667],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"32010\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32011, "epsg", 32011, "NAD27 / New Jersey"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.66666666"); + add_proj4text (p, 1, + "666667 +k=0.9999749999999999 +x_0=609601.2192024384 +y_0"); + add_proj4text (p, 2, "=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / New Jersey\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",38.83333333333334"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-74.66666666666667],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",0.999975],PARAMETER[\"false_east"); + add_srs_wkt (p, 11, + "ing\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"32011\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 32012, "epsg", 32012, + "NAD27 / New Mexico East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999"); + add_proj4text (p, 1, + "909091 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datu"); + add_proj4text (p, 2, "m=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / New Mexico East\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_M"); + add_srs_wkt (p, 8, + "ercator\"],PARAMETER[\"latitude_of_origin\",31],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-104.3333333333333],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.999909091],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"32012\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32013, "epsg", 32013, + "NAD27 / New Mexico Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=1524"); + add_proj4text (p, 1, + "00.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=u"); + add_proj4text (p, 2, "s-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / New Mexico Central\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transvers"); + add_srs_wkt (p, 8, + "e_Mercator\"],PARAMETER[\"latitude_of_origin\",31],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"central_meridian\",-106.25],PARAMETER[\"scale_fac"); + add_srs_wkt (p, 10, + "tor\",0.9999],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32013\"],"); + add_srs_wkt (p, 12, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32014, "epsg", 32014, + "NAD27 / New Mexico West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999"); + add_proj4text (p, 1, + "916667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datu"); + add_proj4text (p, 2, "m=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / New Mexico West\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_M"); + add_srs_wkt (p, 8, + "ercator\"],PARAMETER[\"latitude_of_origin\",31],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-107.8333333333333],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.999916667],PARAMETER[\"false_easting\",5"); + add_srs_wkt (p, 11, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 12, ",\"32014\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32015, "epsg", 32015, + "NAD27 / New York East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-74.33333333333333 +k=0.999"); + add_proj4text (p, 1, + "966667 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datu"); + add_proj4text (p, 2, "m=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / New York East\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",40],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-74.33333333333333],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",0.999966667],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"32015\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32016, "epsg", 32016, + "NAD27 / New York Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum="); + add_proj4text (p, 2, "NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / New York Central\",GEOGCS[\"NAD27\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_M"); + add_srs_wkt (p, 8, + "ercator\"],PARAMETER[\"latitude_of_origin\",40],PARAMETE"); + add_srs_wkt (p, 9, + "R[\"central_meridian\",-76.58333333333333],PARAMETER[\"s"); + add_srs_wkt (p, 10, + "cale_factor\",0.9999375],PARAMETER[\"false_easting\",500"); + add_srs_wkt (p, 11, + "000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 12, "\"32016\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32017, "epsg", 32017, + "NAD27 / New York West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum="); + add_proj4text (p, 2, "NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / New York West\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",40],PARAMETER["); + add_srs_wkt (p, 9, + "\"central_meridian\",-78.58333333333333],PARAMETER[\"sca"); + add_srs_wkt (p, 10, + "le_factor\",0.9999375],PARAMETER[\"false_easting\",50000"); + add_srs_wkt (p, 11, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "32017\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32018, "epsg", 32018, + "NAD27 / New York Long Island"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=40.5 +lon_0=-74 +x_0=304800.6096012192 +y_0=0"); + add_proj4text (p, 2, " +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / New York Long Island\",GEOGCS[\"NAD27\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1"); + add_srs_wkt (p, 2, + "866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 7, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_"); + add_srs_wkt (p, 8, + "Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 9, + ",41.03333333333333],PARAMETER[\"standard_parallel_2\",40"); + add_srs_wkt (p, 10, + ".66666666666666],PARAMETER[\"latitude_of_origin\",40.5],"); + add_srs_wkt (p, 11, + "PARAMETER[\"central_meridian\",-74],PARAMETER[\"false_ea"); + add_srs_wkt (p, 12, + "sting\",1000000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 13, + "TY[\"EPSG\",\"32018\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 14, "]]"); + p = add_epsg_def (first, last, 32019, "epsg", 32019, + "NAD27 / North Carolina"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.33333333333334 +lat_2=36.16666666666"); + add_proj4text (p, 1, + "666 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0="); + add_proj4text (p, 2, "0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / North Carolina\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",34.33"); + add_srs_wkt (p, 9, + "333333333334],PARAMETER[\"standard_parallel_2\",36.16666"); + add_srs_wkt (p, 10, + "666666666],PARAMETER[\"latitude_of_origin\",33.75],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"central_meridian\",-79],PARAMETER[\"false_easting"); + add_srs_wkt (p, 12, + "\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"32019\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32020, "epsg", 32020, + "NAD27 / North Dakota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.43333333333333 +lat_2=48.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=47 +lon_0=-100.5 +x_0=609601.2192024384 +y_0="); + add_proj4text (p, 2, "0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / North Dakota North\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "47.43333333333333],PARAMETER[\"standard_parallel_2\",48."); + add_srs_wkt (p, 10, + "73333333333333],PARAMETER[\"latitude_of_origin\",47],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"central_meridian\",-100.5],PARAMETER[\"false_ea"); + add_srs_wkt (p, 12, + "sting\",2000000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 13, + "TY[\"EPSG\",\"32020\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 14, "]]"); + p = add_epsg_def (first, last, 32021, "epsg", 32021, + "NAD27 / North Dakota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.18333333333333 +lat_2=47.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=609601.2"); + add_proj4text (p, 2, + "192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / North Dakota South\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "46.18333333333333],PARAMETER[\"standard_parallel_2\",47."); + add_srs_wkt (p, 10, + "48333333333333],PARAMETER[\"latitude_of_origin\",45.6666"); + add_srs_wkt (p, 11, + "6666666666],PARAMETER[\"central_meridian\",-100.5],PARAM"); + add_srs_wkt (p, 12, + "ETER[\"false_easting\",2000000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 13, + "ng\",0],AUTHORITY[\"EPSG\",\"32021\"],AXIS[\"X\",EAST],A"); + add_srs_wkt (p, 14, "XIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32022, "epsg", 32022, "NAD27 / Ohio North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.43333333333333 +lat_2=41.7 +lat_0=39"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-82.5 +x_0=609601.2192024384 +y_0"); + add_proj4text (p, 2, "=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Ohio North\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",40.43333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",41.7],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"latitude_of_origin\",39.66666666666666],PARAMETER"); + add_srs_wkt (p, 11, + "[\"central_meridian\",-82.5],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"32022\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32023, "epsg", 32023, "NAD27 / Ohio South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.73333333333333 +lat_2=40.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=38 +lon_0=-82.5 +x_0=609601.2192024384 +y_0=0"); + add_proj4text (p, 2, " +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Ohio South\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",38.73333"); + add_srs_wkt (p, 9, + "333333333],PARAMETER[\"standard_parallel_2\",40.03333333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"latitude_of_origin\",38],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-82.5],PARAMETER[\"false_easting\",20"); + add_srs_wkt (p, 12, + "00000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"32023\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32024, "epsg", 32024, + "NAD27 / Oklahoma North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.56666666666667 +lat_2=36.76666666666"); + add_proj4text (p, 1, + "667 +lat_0=35 +lon_0=-98 +x_0=609601.2192024384 +y_0=0 +"); + add_proj4text (p, 2, "ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Oklahoma North\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",35.56"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"standard_parallel_2\",36.76666"); + add_srs_wkt (p, 10, + "666666667],PARAMETER[\"latitude_of_origin\",35],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"central_meridian\",-98],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 12, + "2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 13, "G\",\"32024\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32025, "epsg", 32025, + "NAD27 / Oklahoma South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.93333333333333 +lat_2=35.23333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=609601.2192"); + add_proj4text (p, 2, + "024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Oklahoma South\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",33.93"); + add_srs_wkt (p, 9, + "333333333333],PARAMETER[\"standard_parallel_2\",35.23333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"latitude_of_origin\",33.333333333"); + add_srs_wkt (p, 11, + "33334],PARAMETER[\"central_meridian\",-98],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_easting\",2000000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"32025\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 32026, "epsg", 32026, + "NAD27 / Oregon North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.33333333333334 +lat_2=46 +lat_0=43.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=609601.2192024384 +y_0="); + add_proj4text (p, 2, "0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Oregon North\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",44.33333"); + add_srs_wkt (p, 9, + "333333334],PARAMETER[\"standard_parallel_2\",46],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"latitude_of_origin\",43.66666666666666],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-120.5],PARAMETER[\"false_easting\",2"); + add_srs_wkt (p, 12, + "000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 13, "\",\"32026\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32027, "epsg", 32027, + "NAD27 / Oregon South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.33333333333334 +lat_2=44 +lat_0=41.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=609601.2192024384 +y_0="); + add_proj4text (p, 2, "0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Oregon South\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",42.33333"); + add_srs_wkt (p, 9, + "333333334],PARAMETER[\"standard_parallel_2\",44],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"latitude_of_origin\",41.66666666666666],PARAMETER[\""); + add_srs_wkt (p, 11, + "central_meridian\",-120.5],PARAMETER[\"false_easting\",2"); + add_srs_wkt (p, 12, + "000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 13, "\",\"32027\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32028, "epsg", 32028, + "NAD27 / Pennsylvania North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.88333333333333 +lat_2=41.95 +lat_0=4"); + add_proj4text (p, 1, + "0.16666666666666 +lon_0=-77.75 +x_0=609601.2192024384 +y"); + add_proj4text (p, 2, + "_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Pennsylvania North\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "40.88333333333333],PARAMETER[\"standard_parallel_2\",41."); + add_srs_wkt (p, 10, + "95],PARAMETER[\"latitude_of_origin\",40.16666666666666],"); + add_srs_wkt (p, 11, + "PARAMETER[\"central_meridian\",-77.75],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_easting\",2000000],PARAMETER[\"false_northing\",0],AUTH"); + add_srs_wkt (p, 13, + "ORITY[\"EPSG\",\"32028\"],AXIS[\"X\",EAST],AXIS[\"Y\",NO"); + add_srs_wkt (p, 14, "RTH]]"); + p = add_epsg_def (first, last, 32029, "epsg", 32029, + "NAD27 / Pennsylvania South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.93333333333333 +lat_2=40.8 +lat_0=39"); + add_proj4text (p, 1, + ".33333333333334 +lon_0=-77.75 +x_0=609601.2192024384 +y_"); + add_proj4text (p, 2, + "0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Pennsylvania South\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "39.93333333333333],PARAMETER[\"standard_parallel_2\",40."); + add_srs_wkt (p, 10, + "8],PARAMETER[\"latitude_of_origin\",39.33333333333334],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"central_meridian\",-77.75],PARAMETER[\"false_"); + add_srs_wkt (p, 12, + "easting\",2000000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 13, + "RITY[\"EPSG\",\"32029\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 14, "TH]]"); + p = add_epsg_def (first, last, 32030, "epsg", 32030, + "NAD27 / Rhode Island"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.9"); + add_proj4text (p, 1, + "999938 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datu"); + add_proj4text (p, 2, "m=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Rhode Island\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",41.08333333333334"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-71.5],PARAMETER[\"scal"); + add_srs_wkt (p, 10, + "e_factor\",0.9999938],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3"); + add_srs_wkt (p, 12, "2030\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32031, "epsg", 32031, + "NAD27 / South Carolina North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.76666666666667 +lat_2=34.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=33 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +"); + add_proj4text (p, 2, "ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / South Carolina North\",GEOGCS[\"NAD27\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1"); + add_srs_wkt (p, 2, + "866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 7, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_"); + add_srs_wkt (p, 8, + "Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 9, + ",33.76666666666667],PARAMETER[\"standard_parallel_2\",34"); + add_srs_wkt (p, 10, + ".96666666666667],PARAMETER[\"latitude_of_origin\",33],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"central_meridian\",-81],PARAMETER[\"false_east"); + add_srs_wkt (p, 12, + "ing\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 13, + "[\"EPSG\",\"32031\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 14, ""); + p = add_epsg_def (first, last, 32033, "epsg", 32033, + "NAD27 / South Carolina South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.33333333333334 +lat_2=33.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609601.2192"); + add_proj4text (p, 2, + "024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / South Carolina South\",GEOGCS[\"NAD27\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1"); + add_srs_wkt (p, 2, + "866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 7, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_"); + add_srs_wkt (p, 8, + "Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\""); + add_srs_wkt (p, 9, + ",32.33333333333334],PARAMETER[\"standard_parallel_2\",33"); + add_srs_wkt (p, 10, + ".66666666666666],PARAMETER[\"latitude_of_origin\",31.833"); + add_srs_wkt (p, 11, + "33333333333],PARAMETER[\"central_meridian\",-81],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_easting\",2000000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 13, + "\",0],AUTHORITY[\"EPSG\",\"32033\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 14, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32034, "epsg", 32034, + "NAD27 / South Dakota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.41666666666666 +lat_2=45.68333333333"); + add_proj4text (p, 1, + "333 +lat_0=43.83333333333334 +lon_0=-100 +x_0=609601.219"); + add_proj4text (p, 2, + "2024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +"); + add_proj4text (p, 3, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / South Dakota North\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "44.41666666666666],PARAMETER[\"standard_parallel_2\",45."); + add_srs_wkt (p, 10, + "68333333333333],PARAMETER[\"latitude_of_origin\",43.8333"); + add_srs_wkt (p, 11, + "3333333334],PARAMETER[\"central_meridian\",-100],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_easting\",2000000],PARAMETER[\"false_northing"); + add_srs_wkt (p, 13, + "\",0],AUTHORITY[\"EPSG\",\"32034\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 14, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32035, "epsg", 32035, + "NAD27 / South Dakota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.83333333333334 +lat_2=44.4 +lat_0=42"); + add_proj4text (p, 1, + ".33333333333334 +lon_0=-100.3333333333333 +x_0=609601.21"); + add_proj4text (p, 2, + "92024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / South Dakota South\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "42.83333333333334],PARAMETER[\"standard_parallel_2\",44."); + add_srs_wkt (p, 10, + "4],PARAMETER[\"latitude_of_origin\",42.33333333333334],P"); + add_srs_wkt (p, 11, + "ARAMETER[\"central_meridian\",-100.3333333333333],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_easting\",2000000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 13, + "g\",0],AUTHORITY[\"EPSG\",\"32035\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 14, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32036, "epsg", 32036, + "NAD27 / Tennessee (deprecated)"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.25 +lat_2=36.41666666666666 +lat_0=3"); + add_proj4text (p, 1, + "4.66666666666666 +lon_0=-86 +x_0=30480.06096012192 +y_0="); + add_proj4text (p, 2, "0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Tennessee (deprecated)\",GEOGCS[\"NAD27"); + add_srs_wkt (p, 1, + "\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke"); + add_srs_wkt (p, 2, + " 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 3, + "7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwic"); + add_srs_wkt (p, 4, + "h\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01"); + add_srs_wkt (p, 5, + "745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY["); + add_srs_wkt (p, 6, + "\"EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096"); + add_srs_wkt (p, 7, + "012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lamber"); + add_srs_wkt (p, 8, + "t_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1"); + add_srs_wkt (p, 9, + "\",35.25],PARAMETER[\"standard_parallel_2\",36.416666666"); + add_srs_wkt (p, 10, + "66666],PARAMETER[\"latitude_of_origin\",34.6666666666666"); + add_srs_wkt (p, 11, + "6],PARAMETER[\"central_meridian\",-86],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_easting\",100000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 13, + "RITY[\"EPSG\",\"32036\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 14, "TH]]"); + p = add_epsg_def (first, last, 32037, "epsg", 32037, "NAD27 / Texas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.65 +lat_2=36.18333333333333 +lat_0=3"); + add_proj4text (p, 1, + "4 +lon_0=-101.5 +x_0=609601.2192024384 +y_0=0 +ellps=clr"); + add_proj4text (p, 2, "k66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Texas North\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",34.65],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"standard_parallel_2\",36.18333333333333],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",34],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-101.5],PARAMETER[\"false_easting\",2000000],PAR"); + add_srs_wkt (p, 12, + "AMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32037\""); + add_srs_wkt (p, 13, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32038, "epsg", 32038, + "NAD27 / Texas North Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=32.13333333333333 +lat_2=33.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=31.66666666666667 +lon_0=-97.5 +x_0=609601.21"); + add_proj4text (p, 2, + "92024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Texas North Central\",GEOGCS[\"NAD27\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "66\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "08\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "32.13333333333333],PARAMETER[\"standard_parallel_2\",33."); + add_srs_wkt (p, 10, + "96666666666667],PARAMETER[\"latitude_of_origin\",31.6666"); + add_srs_wkt (p, 11, + "6666666667],PARAMETER[\"central_meridian\",-97.5],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_easting\",2000000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 13, + "g\",0],AUTHORITY[\"EPSG\",\"32038\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 14, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32039, "epsg", 32039, + "NAD27 / Texas Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.11666666666667 +lat_2=31.88333333333"); + add_proj4text (p, 1, + "333 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +"); + add_proj4text (p, 2, + "x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 "); + add_proj4text (p, 3, "+units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Texas Central\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",30.11"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"standard_parallel_2\",31.88333"); + add_srs_wkt (p, 10, + "333333333],PARAMETER[\"latitude_of_origin\",29.666666666"); + add_srs_wkt (p, 11, + "66667],PARAMETER[\"central_meridian\",-100.3333333333333"); + add_srs_wkt (p, 12, + "],PARAMETER[\"false_easting\",2000000],PARAMETER[\"false"); + add_srs_wkt (p, 13, + "_northing\",0],AUTHORITY[\"EPSG\",\"32039\"],AXIS[\"X\","); + add_srs_wkt (p, 14, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32040, "epsg", 32040, + "NAD27 / Texas South Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=28.38333333333333 +lat_2=30.28333333333"); + add_proj4text (p, 1, + "333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=609601.2192"); + add_proj4text (p, 2, + "024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Texas South Central\",GEOGCS[\"NAD27\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "66\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "08\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "28.38333333333333],PARAMETER[\"standard_parallel_2\",30."); + add_srs_wkt (p, 10, + "28333333333333],PARAMETER[\"latitude_of_origin\",27.8333"); + add_srs_wkt (p, 11, + "3333333333],PARAMETER[\"central_meridian\",-99],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_easting\",2000000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"32040\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 14, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32041, "epsg", 32041, "NAD27 / Texas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=26.16666666666667 +lat_2=27.83333333333"); + add_proj4text (p, 1, + "333 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=609601.21"); + add_proj4text (p, 2, + "92024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Texas South\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",26.16666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",27.83333333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"latitude_of_origin\",25.666666666666"); + add_srs_wkt (p, 11, + "67],PARAMETER[\"central_meridian\",-98.5],PARAMETER[\"fa"); + add_srs_wkt (p, 12, + "lse_easting\",2000000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 13, + "UTHORITY[\"EPSG\",\"32041\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 32042, "epsg", 32042, "NAD27 / Utah North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.71666666666667 +lat_2=41.78333333333"); + add_proj4text (p, 1, + "333 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=609601.2"); + add_proj4text (p, 2, + "192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Utah North\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",40.71666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",41.78333333"); + add_srs_wkt (p, 10, + "333333],PARAMETER[\"latitude_of_origin\",40.333333333333"); + add_srs_wkt (p, 11, + "34],PARAMETER[\"central_meridian\",-111.5],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_easting\",2000000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 13, + "AUTHORITY[\"EPSG\",\"32042\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 14, ",NORTH]]"); + p = add_epsg_def (first, last, 32043, "epsg", 32043, + "NAD27 / Utah Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.01666666666667 +lat_2=40.65 +lat_0=3"); + add_proj4text (p, 1, + "8.33333333333334 +lon_0=-111.5 +x_0=609601.2192024384 +y"); + add_proj4text (p, 2, + "_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Utah Central\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",39.01666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",40.65],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",38.33333333333334],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"central_meridian\",-111.5],PARAMETER[\"false_easting"); + add_srs_wkt (p, 12, + "\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"32043\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32044, "epsg", 32044, "NAD27 / Utah South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.21666666666667 +lat_2=38.35 +lat_0=3"); + add_proj4text (p, 1, + "6.66666666666666 +lon_0=-111.5 +x_0=609601.2192024384 +y"); + add_proj4text (p, 2, + "_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Utah South\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conformal"); + add_srs_wkt (p, 8, + "_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",37.21666"); + add_srs_wkt (p, 9, + "666666667],PARAMETER[\"standard_parallel_2\",38.35],PARA"); + add_srs_wkt (p, 10, + "METER[\"latitude_of_origin\",36.66666666666666],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"central_meridian\",-111.5],PARAMETER[\"false_easting"); + add_srs_wkt (p, 12, + "\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"32044\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32045, "epsg", 32045, "NAD27 / Vermont"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0"); + add_proj4text (p, 1, + "=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +un"); + add_proj4text (p, 2, "its=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Vermont\",GEOGCS[\"NAD27\",DATUM[\"Nort"); + add_srs_wkt (p, 1, + "h_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378206"); + add_srs_wkt (p, 2, + ".4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "7\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHORI"); + add_srs_wkt (p, 7, + "TY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator\""); + add_srs_wkt (p, 8, + "],PARAMETER[\"latitude_of_origin\",42.5],PARAMETER[\"cen"); + add_srs_wkt (p, 9, + "tral_meridian\",-72.5],PARAMETER[\"scale_factor\",0.9999"); + add_srs_wkt (p, 10, + "64286],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32045\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32046, "epsg", 32046, + "NAD27 / Virginia North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.03333333333333 +lat_2=39.2 +lat_0=37"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-78.5 +x_0=609601.2192024384 +y_0"); + add_proj4text (p, 2, "=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Virginia North\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",38.03"); + add_srs_wkt (p, 9, + "333333333333],PARAMETER[\"standard_parallel_2\",39.2],PA"); + add_srs_wkt (p, 10, + "RAMETER[\"latitude_of_origin\",37.66666666666666],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-78.5],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"32046\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32047, "epsg", 32047, + "NAD27 / Virginia South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.76666666666667 +lat_2=37.96666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=609601.21"); + add_proj4text (p, 2, + "92024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft "); + add_proj4text (p, 3, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Virginia South\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Confor"); + add_srs_wkt (p, 8, + "mal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",36.76"); + add_srs_wkt (p, 9, + "666666666667],PARAMETER[\"standard_parallel_2\",37.96666"); + add_srs_wkt (p, 10, + "666666667],PARAMETER[\"latitude_of_origin\",36.333333333"); + add_srs_wkt (p, 11, + "33334],PARAMETER[\"central_meridian\",-78.5],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",2000000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 13, + ",AUTHORITY[\"EPSG\",\"32047\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 14, "\",NORTH]]"); + p = add_epsg_def (first, last, 32048, "epsg", 32048, + "NAD27 / Washington North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.5 +lat_2=48.73333333333333 +lat_0=47"); + add_proj4text (p, 1, + " +lon_0=-120.8333333333333 +x_0=609601.2192024384 +y_0=0"); + add_proj4text (p, 2, " +ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Washington North\",GEOGCS[\"NAD27\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",47."); + add_srs_wkt (p, 9, + "5],PARAMETER[\"standard_parallel_2\",48.73333333333333],"); + add_srs_wkt (p, 10, + "PARAMETER[\"latitude_of_origin\",47],PARAMETER[\"central"); + add_srs_wkt (p, 11, + "_meridian\",-120.8333333333333],PARAMETER[\"false_eastin"); + add_srs_wkt (p, 12, + "g\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 13, + "EPSG\",\"32048\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32049, "epsg", 32049, + "NAD27 / Washington South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.83333333333334 +lat_2=47.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=609601.2"); + add_proj4text (p, 2, + "192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft"); + add_proj4text (p, 3, " +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Washington South\",GEOGCS[\"NAD27\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",45."); + add_srs_wkt (p, 9, + "83333333333334],PARAMETER[\"standard_parallel_2\",47.333"); + add_srs_wkt (p, 10, + "33333333334],PARAMETER[\"latitude_of_origin\",45.3333333"); + add_srs_wkt (p, 11, + "3333334],PARAMETER[\"central_meridian\",-120.5],PARAMETE"); + add_srs_wkt (p, 12, + "R[\"false_easting\",2000000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 13, + ",0],AUTHORITY[\"EPSG\",\"32049\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 14, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32050, "epsg", 32050, + "NAD27 / West Virginia North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39 +lat_2=40.25 +lat_0=38.5 +lon_0=-79."); + add_proj4text (p, 1, + "5 +x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD"); + add_proj4text (p, 2, "27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / West Virginia North\",GEOGCS[\"NAD27\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "66\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "08\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "39],PARAMETER[\"standard_parallel_2\",40.25],PARAMETER[\""); + add_srs_wkt (p, 10, + "latitude_of_origin\",38.5],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 11, + ",-79.5],PARAMETER[\"false_easting\",2000000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32050\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32051, "epsg", 32051, + "NAD27 / West Virginia South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.48333333333333 +lat_2=38.88333333333"); + add_proj4text (p, 1, + "333 +lat_0=37 +lon_0=-81 +x_0=609601.2192024384 +y_0=0 +"); + add_proj4text (p, 2, "ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / West Virginia South\",GEOGCS[\"NAD27\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 18"); + add_srs_wkt (p, 2, + "66\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"70"); + add_srs_wkt (p, 3, + "08\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "37.48333333333333],PARAMETER[\"standard_parallel_2\",38."); + add_srs_wkt (p, 10, + "88333333333333],PARAMETER[\"latitude_of_origin\",37],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"central_meridian\",-81],PARAMETER[\"false_easti"); + add_srs_wkt (p, 12, + "ng\",2000000],PARAMETER[\"false_northing\",0],AUTHORITY["); + add_srs_wkt (p, 13, + "\"EPSG\",\"32051\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32052, "epsg", 32052, + "NAD27 / Wisconsin North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.56666666666667 +lat_2=46.76666666666"); + add_proj4text (p, 1, + "667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=609601.2192"); + add_proj4text (p, 2, + "024384 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Wisconsin North\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",45."); + add_srs_wkt (p, 9, + "56666666666667],PARAMETER[\"standard_parallel_2\",46.766"); + add_srs_wkt (p, 10, + "66666666667],PARAMETER[\"latitude_of_origin\",45.1666666"); + add_srs_wkt (p, 11, + "6666666],PARAMETER[\"central_meridian\",-90],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_easting\",2000000],PARAMETER[\"false_northing\",0]"); + add_srs_wkt (p, 13, + ",AUTHORITY[\"EPSG\",\"32052\"],AXIS[\"X\",EAST],AXIS[\"Y"); + add_srs_wkt (p, 14, "\",NORTH]]"); + p = add_epsg_def (first, last, 32053, "epsg", 32053, + "NAD27 / Wisconsin Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.25 +lat_2=45.5 +lat_0=43.83333333333"); + add_proj4text (p, 1, + "334 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +ellps=clrk"); + add_proj4text (p, 2, "66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Wisconsin Central\",GEOGCS[\"NAD27\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866"); + add_srs_wkt (p, 2, + "\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008"); + add_srs_wkt (p, 3, + "\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\","); + add_srs_wkt (p, 4, + "0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453"); + add_srs_wkt (p, 5, + "29251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 6, + "SG\",\"4267\"]],UNIT[\"US survey foot\",0.30480060960121"); + add_srs_wkt (p, 7, + "92,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Co"); + add_srs_wkt (p, 8, + "nformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",4"); + add_srs_wkt (p, 9, + "4.25],PARAMETER[\"standard_parallel_2\",45.5],PARAMETER["); + add_srs_wkt (p, 10, + "\"latitude_of_origin\",43.83333333333334],PARAMETER[\"ce"); + add_srs_wkt (p, 11, + "ntral_meridian\",-90],PARAMETER[\"false_easting\",200000"); + add_srs_wkt (p, 12, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 13, "32053\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32054, "epsg", 32054, + "NAD27 / Wisconsin South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=42.73333333333333 +lat_2=44.06666666666"); + add_proj4text (p, 1, + "667 +lat_0=42 +lon_0=-90 +x_0=609601.2192024384 +y_0=0 +"); + add_proj4text (p, 2, "ellps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Wisconsin South\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192"); + add_srs_wkt (p, 7, + ",AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_Conf"); + add_srs_wkt (p, 8, + "ormal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",42."); + add_srs_wkt (p, 9, + "73333333333333],PARAMETER[\"standard_parallel_2\",44.066"); + add_srs_wkt (p, 10, + "66666666667],PARAMETER[\"latitude_of_origin\",42],PARAME"); + add_srs_wkt (p, 11, + "TER[\"central_meridian\",-90],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 12, + ",2000000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 13, "SG\",\"32054\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32055, "epsg", 32055, + "NAD27 / Wyoming East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.66666666666666 +lon_0=-105.1666666"); + add_proj4text (p, 1, + "666667 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ell"); + add_proj4text (p, 2, "ps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Wyoming East\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",40.66666666666666"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-105.1666666666667],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",0.999941177],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"32055\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 32056, "epsg", 32056, + "NAD27 / Wyoming East Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.66666666666666 +lon_0=-107.3333333"); + add_proj4text (p, 1, + "333333 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ell"); + add_proj4text (p, 2, "ps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Wyoming East Central\",GEOGCS[\"NAD27\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1"); + add_srs_wkt (p, 2, + "866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 7, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transver"); + add_srs_wkt (p, 8, + "se_Mercator\"],PARAMETER[\"latitude_of_origin\",40.66666"); + add_srs_wkt (p, 9, + "666666666],PARAMETER[\"central_meridian\",-107.333333333"); + add_srs_wkt (p, 10, + "3333],PARAMETER[\"scale_factor\",0.999941177],PARAMETER["); + add_srs_wkt (p, 11, + "\"false_easting\",500000],PARAMETER[\"false_northing\",0"); + add_srs_wkt (p, 12, + "],AUTHORITY[\"EPSG\",\"32056\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 32057, "epsg", 32057, + "NAD27 / Wyoming West Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.66666666666666 +lon_0=-108.75 +k=0"); + add_proj4text (p, 1, + ".999941177 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +"); + add_proj4text (p, 2, "datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Wyoming West Central\",GEOGCS[\"NAD27\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1"); + add_srs_wkt (p, 2, + "866\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7"); + add_srs_wkt (p, 3, + "008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich"); + add_srs_wkt (p, 4, + "\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017"); + add_srs_wkt (p, 5, + "45329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\""); + add_srs_wkt (p, 6, + "EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.304800609601"); + add_srs_wkt (p, 7, + "2192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transver"); + add_srs_wkt (p, 8, + "se_Mercator\"],PARAMETER[\"latitude_of_origin\",40.66666"); + add_srs_wkt (p, 9, + "666666666],PARAMETER[\"central_meridian\",-108.75],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"scale_factor\",0.999941177],PARAMETER[\"false_eas"); + add_srs_wkt (p, 11, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 12, + "[\"EPSG\",\"32057\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 13, ""); + p = add_epsg_def (first, last, 32058, "epsg", 32058, + "NAD27 / Wyoming West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.66666666666666 +lon_0=-110.0833333"); + add_proj4text (p, 1, + "333333 +k=0.999941177 +x_0=152400.3048006096 +y_0=0 +ell"); + add_proj4text (p, 2, "ps=clrk66 +datum=NAD27 +units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Wyoming West\",GEOGCS[\"NAD27\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",637"); + add_srs_wkt (p, 2, + "8206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTH"); + add_srs_wkt (p, 7, + "ORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercat"); + add_srs_wkt (p, 8, + "or\"],PARAMETER[\"latitude_of_origin\",40.66666666666666"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-110.0833333333333],PAR"); + add_srs_wkt (p, 10, + "AMETER[\"scale_factor\",0.999941177],PARAMETER[\"false_e"); + add_srs_wkt (p, 11, + "asting\",500000],PARAMETER[\"false_northing\",0],AUTHORI"); + add_srs_wkt (p, 12, + "TY[\"EPSG\",\"32058\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH"); + add_srs_wkt (p, 13, "]]"); + p = add_epsg_def (first, last, 32061, "epsg", 32061, + "NAD27 / Guatemala Norte"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=16.81666666666667 +lat_0=16.81666666666"); + add_proj4text (p, 1, + "667 +lon_0=-90.33333333333333 +k_0=0.99992226 +x_0=50000"); + add_proj4text (p, 2, + "0 +y_0=292209.579 +ellps=clrk66 +datum=NAD27 +units=m +n"); + add_proj4text (p, 3, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Guatemala Norte\",GEOGCS[\"NAD27\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\""); + add_srs_wkt (p, 2, + ",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"latitude_of_origin\",16.81666666666667],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-90.33333333333333],PARAMETER[\"scale"); + add_srs_wkt (p, 10, + "_factor\",0.99992226],PARAMETER[\"false_easting\",500000"); + add_srs_wkt (p, 11, + "],PARAMETER[\"false_northing\",292209.579],AUTHORITY[\"E"); + add_srs_wkt (p, 12, "PSG\",\"32061\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32062, "epsg", 32062, + "NAD27 / Guatemala Sur"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=14.9 +lat_0=14.9 +lon_0=-90.33333333333"); + add_proj4text (p, 1, + "333 +k_0=0.99989906 +x_0=500000 +y_0=325992.681 +ellps=c"); + add_proj4text (p, 2, "lrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Guatemala Sur\",GEOGCS[\"NAD27\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6"); + add_srs_wkt (p, 2, + "378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]]"); + add_srs_wkt (p, 3, + ",AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AU"); + add_srs_wkt (p, 4, + "THORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925"); + add_srs_wkt (p, 5, + "1994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"latitude_of_origin\",14.9],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 9, + "an\",-90.33333333333333],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 10, + "989906],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",325992.681],AUTHORITY[\"EPSG\",\"32062\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32064, "epsg", 32064, + "NAD27 / BLM 14N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / BLM 14N (ftUS)\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-99],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",1640416.67],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32064\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32065, "epsg", 32065, + "NAD27 / BLM 15N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / BLM 15N (ftUS)\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-93],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",1640416.67],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32065\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32066, "epsg", 32066, + "NAD27 / BLM 16N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / BLM 16N (ftUS)\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-87],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",1640416.67],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32066\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32067, "epsg", 32067, + "NAD27 / BLM 17N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / BLM 17N (ftUS)\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012192,A"); + add_srs_wkt (p, 7, + "UTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mer"); + add_srs_wkt (p, 8, + "cator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 9, + "central_meridian\",-81],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 10, + "6],PARAMETER[\"false_easting\",1640416.67],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32067\"],AXIS[\""); + add_srs_wkt (p, 12, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32074, "epsg", 32074, + "NAD27 / BLM 14N (feet) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / BLM 14N (feet) (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD27\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"C"); + add_srs_wkt (p, 2, + "larke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.30480"); + add_srs_wkt (p, 7, + "06096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-99],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9996],PARAMETER[\"false_easting\",1640416.67]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32"); + add_srs_wkt (p, 12, "074\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32075, "epsg", 32075, + "NAD27 / BLM 15N (feet) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / BLM 15N (feet) (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD27\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"C"); + add_srs_wkt (p, 2, + "larke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.30480"); + add_srs_wkt (p, 7, + "06096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-93],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9996],PARAMETER[\"false_easting\",1640416.67]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32"); + add_srs_wkt (p, 12, "075\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32076, "epsg", 32076, + "NAD27 / BLM 16N (feet) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / BLM 16N (feet) (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD27\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"C"); + add_srs_wkt (p, 2, + "larke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.30480"); + add_srs_wkt (p, 7, + "06096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-87],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9996],PARAMETER[\"false_easting\",1640416.67]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32"); + add_srs_wkt (p, 12, "076\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32077, "epsg", 32077, + "NAD27 / BLM 17N (feet) (deprecated)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=us-ft +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / BLM 17N (feet) (deprecated)\",GEOGCS[\""); + add_srs_wkt (p, 1, + "NAD27\",DATUM[\"North_American_Datum_1927\",SPHEROID[\"C"); + add_srs_wkt (p, 2, + "larke 1866\",6378206.4,294.9786982139006,AUTHORITY[\"EPS"); + add_srs_wkt (p, 3, + "G\",\"7008\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Gr"); + add_srs_wkt (p, 4, + "eenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\""); + add_srs_wkt (p, 5, + ",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHO"); + add_srs_wkt (p, 6, + "RITY[\"EPSG\",\"4267\"]],UNIT[\"US survey foot\",0.30480"); + add_srs_wkt (p, 7, + "06096012192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"T"); + add_srs_wkt (p, 8, + "ransverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0"); + add_srs_wkt (p, 9, + "],PARAMETER[\"central_meridian\",-81],PARAMETER[\"scale_"); + add_srs_wkt (p, 10, + "factor\",0.9996],PARAMETER[\"false_easting\",1640416.67]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32"); + add_srs_wkt (p, 12, "077\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32081, "epsg", 32081, "NAD27 / MTM zone 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-53 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / MTM zone 1\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-53],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9999],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"32081\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 32082, "epsg", 32082, "NAD27 / MTM zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-56 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / MTM zone 2\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-56],PARA"); + add_srs_wkt (p, 9, + "METER[\"scale_factor\",0.9999],PARAMETER[\"false_easting"); + add_srs_wkt (p, 10, + "\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 11, + "PSG\",\"32082\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 32083, "epsg", 32083, "NAD27 / MTM zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / MTM zone 3\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-58.5],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"32083\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 32084, "epsg", 32084, "NAD27 / MTM zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / MTM zone 4\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-61.5],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"32084\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 32085, "epsg", 32085, "NAD27 / MTM zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / MTM zone 5\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-64.5],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"32085\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 32086, "epsg", 32086, "NAD27 / MTM zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / MTM zone 6\",GEOGCS[\"NAD27\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1927\",SPHEROID[\"Clarke 1866\",6378"); + add_srs_wkt (p, 2, + "206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]],AU"); + add_srs_wkt (p, 3, + "THORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,AUTHO"); + add_srs_wkt (p, 4, + "RITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199"); + add_srs_wkt (p, 5, + "4328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",0],PARAMETER[\"central_meridian\",-67.5],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_easti"); + add_srs_wkt (p, 10, + "ng\",304800],PARAMETER[\"false_northing\",0],AUTHORITY[\""); + add_srs_wkt (p, 11, + "EPSG\",\"32086\"],AXIS[\"Easting\",EAST],AXIS[\"Northing"); + add_srs_wkt (p, 12, "\",NORTH]]"); + p = add_epsg_def (first, last, 32098, "epsg", 32098, + "NAD27 / Quebec Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_"); + add_proj4text (p, 1, + "0=0 +y_0=0 +ellps=clrk66 +datum=NAD27 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Quebec Lambert\",GEOGCS[\"NAD27\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1927\",SPHEROID[\"Clarke 1866\","); + add_srs_wkt (p, 2, + "6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"7008\"]"); + add_srs_wkt (p, 3, + "],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\",0,A"); + add_srs_wkt (p, 4, + "UTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292"); + add_srs_wkt (p, 5, + "51994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"4267\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER"); + add_srs_wkt (p, 8, + "[\"standard_parallel_1\",60],PARAMETER[\"standard_parall"); + add_srs_wkt (p, 9, + "el_2\",46],PARAMETER[\"latitude_of_origin\",44],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"central_meridian\",-68.5],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 12, "32098\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32099, "epsg", 32099, + "NAD27 / Louisiana Offshore"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=25.66666666666667 +lon_0=-91.33333333333333 +"); + add_proj4text (p, 2, + "x_0=609601.2192024384 +y_0=0 +ellps=clrk66 +datum=NAD27 "); + add_proj4text (p, 3, "+units=us-ft +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD27 / Louisiana Offshore\",GEOGCS[\"NAD27\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1927\",SPHEROID[\"Clarke 186"); + add_srs_wkt (p, 2, + "6\",6378206.4,294.9786982139006,AUTHORITY[\"EPSG\",\"700"); + add_srs_wkt (p, 3, + "8\"]],AUTHORITY[\"EPSG\",\"6267\"]],PRIMEM[\"Greenwich\""); + add_srs_wkt (p, 4, + ",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745"); + add_srs_wkt (p, 5, + "329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 6, + "PSG\",\"4267\"]],UNIT[\"US survey foot\",0.3048006096012"); + add_srs_wkt (p, 7, + "192,AUTHORITY[\"EPSG\",\"9003\"]],PROJECTION[\"Lambert_C"); + add_srs_wkt (p, 8, + "onformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\","); + add_srs_wkt (p, 9, + "27.83333333333333],PARAMETER[\"standard_parallel_2\",26."); + add_srs_wkt (p, 10, + "16666666666667],PARAMETER[\"latitude_of_origin\",25.6666"); + add_srs_wkt (p, 11, + "6666666667],PARAMETER[\"central_meridian\",-91.333333333"); + add_srs_wkt (p, 12, + "33333],PARAMETER[\"false_easting\",2000000],PARAMETER[\""); + add_srs_wkt (p, 13, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32099\"],AXIS[\""); + add_srs_wkt (p, 14, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32100, "epsg", 32100, "NAD83 / Montana"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5"); + add_proj4text (p, 1, + " +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +"); + add_proj4text (p, 2, "no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Montana\",GEOGCS[\"NAD83\",DATUM[\"Nort"); + add_srs_wkt (p, 1, + "h_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 2, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_para"); + add_srs_wkt (p, 8, + "llel_1\",49],PARAMETER[\"standard_parallel_2\",45],PARAM"); + add_srs_wkt (p, 9, + "ETER[\"latitude_of_origin\",44.25],PARAMETER[\"central_m"); + add_srs_wkt (p, 10, + "eridian\",-109.5],PARAMETER[\"false_easting\",600000],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32100"); + add_srs_wkt (p, 12, "\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32104, "epsg", 32104, "NAD83 / Nebraska"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +"); + add_proj4text (p, 1, + "lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Nebraska\",GEOGCS[\"NAD83\",DATUM[\"Nor"); + add_srs_wkt (p, 1, + "th_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,2"); + add_srs_wkt (p, 2, + "98.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 8, + "rallel_1\",43],PARAMETER[\"standard_parallel_2\",40],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"latitude_of_origin\",39.83333333333334],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"central_meridian\",-100],PARAMETER[\"false_easting\""); + add_srs_wkt (p, 11, + ",500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPS"); + add_srs_wkt (p, 12, "G\",\"32104\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32107, "epsg", 32107, "NAD83 / Nevada East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=200000 +y_0=8000000 +ellps=GRS80 +datum=NAD83 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Nevada East\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",34.75],PARAMETER[\"central_meridian\",-115.58333333"); + add_srs_wkt (p, 9, + "33333],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",200000],PARAMETER[\"false_northing\",80000"); + add_srs_wkt (p, 11, + "00],AUTHORITY[\"EPSG\",\"32107\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32108, "epsg", 32108, + "NAD83 / Nevada Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=500000 +y_0=6000000 +ellps=GRS80 +datum=NAD83 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Nevada Central\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 8, + "igin\",34.75],PARAMETER[\"central_meridian\",-116.666666"); + add_srs_wkt (p, 9, + "6666667],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",500000],PARAMETER[\"false_northing\",600"); + add_srs_wkt (p, 11, + "0000],AUTHORITY[\"EPSG\",\"32108\"],AXIS[\"X\",EAST],AXI"); + add_srs_wkt (p, 12, "S[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32109, "epsg", 32109, "NAD83 / Nevada West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0."); + add_proj4text (p, 1, + "9999 +x_0=800000 +y_0=4000000 +ellps=GRS80 +datum=NAD83 "); + add_proj4text (p, 2, "+units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Nevada West\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",34.75],PARAMETER[\"central_meridian\",-118.58333333"); + add_srs_wkt (p, 9, + "33333],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",800000],PARAMETER[\"false_northing\",40000"); + add_srs_wkt (p, 11, + "00],AUTHORITY[\"EPSG\",\"32109\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32110, "epsg", 32110, + "NAD83 / New Hampshire"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.9"); + add_proj4text (p, 1, + "99966667 +x_0=300000 +y_0=0 +ellps=GRS80 +datum=NAD83 +u"); + add_proj4text (p, 2, "nits=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New Hampshire\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",42.5],PARAMETER[\"central_meridian\",-71.666666666"); + add_srs_wkt (p, 9, + "66667],PARAMETER[\"scale_factor\",0.999966667],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",300000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"32110\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 32111, "epsg", 32111, "NAD83 / New Jersey"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New Jersey\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",38.83333333333334],PARAMETER[\"central_meridian\",-74"); + add_srs_wkt (p, 9, + ".5],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_easting\",150000],PARAMETER[\"false_northing\",0],AUTHO"); + add_srs_wkt (p, 11, + "RITY[\"EPSG\",\"32111\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 12, "TH]]"); + p = add_epsg_def (first, last, 32112, "epsg", 32112, + "NAD83 / New Mexico East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999"); + add_proj4text (p, 1, + "909091 +x_0=165000 +y_0=0 +ellps=GRS80 +datum=NAD83 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New Mexico East\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",31],PARAMETER[\"central_meridian\",-104.3333333"); + add_srs_wkt (p, 9, + "333333],PARAMETER[\"scale_factor\",0.999909091],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",165000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"32112\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32113, "epsg", 32113, + "NAD83 / New Mexico Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=5000"); + add_proj4text (p, 1, + "00 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New Mexico Central\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_"); + add_srs_wkt (p, 8, + "of_origin\",31],PARAMETER[\"central_meridian\",-106.25],"); + add_srs_wkt (p, 9, + "PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"false_eas"); + add_srs_wkt (p, 10, + "ting\",500000],PARAMETER[\"false_northing\",0],AUTHORITY"); + add_srs_wkt (p, 11, + "[\"EPSG\",\"32113\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + add_srs_wkt (p, 12, ""); + p = add_epsg_def (first, last, 32114, "epsg", 32114, + "NAD83 / New Mexico West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999"); + add_proj4text (p, 1, + "916667 +x_0=830000 +y_0=0 +ellps=GRS80 +datum=NAD83 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New Mexico West\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 8, + "origin\",31],PARAMETER[\"central_meridian\",-107.8333333"); + add_srs_wkt (p, 9, + "333333],PARAMETER[\"scale_factor\",0.999916667],PARAMETE"); + add_srs_wkt (p, 10, + "R[\"false_easting\",830000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 11, + ",0],AUTHORITY[\"EPSG\",\"32114\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 12, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32115, "epsg", 32115, + "NAD83 / New York East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9"); + add_proj4text (p, 1, + "999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New York East\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",38.83333333333334],PARAMETER[\"central_meridian\","); + add_srs_wkt (p, 9, + "-74.5],PARAMETER[\"scale_factor\",0.9999],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_easting\",150000],PARAMETER[\"false_northing\",0],AU"); + add_srs_wkt (p, 11, + "THORITY[\"EPSG\",\"32115\"],AXIS[\"X\",EAST],AXIS[\"Y\","); + add_srs_wkt (p, 12, "NORTH]]"); + p = add_epsg_def (first, last, 32116, "epsg", 32116, + "NAD83 / New York Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=250000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New York Central\",GEOGCS[\"NAD83\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of"); + add_srs_wkt (p, 8, + "_origin\",40],PARAMETER[\"central_meridian\",-76.5833333"); + add_srs_wkt (p, 9, + "3333333],PARAMETER[\"scale_factor\",0.9999375],PARAMETER"); + add_srs_wkt (p, 10, + "[\"false_easting\",250000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 11, + "0],AUTHORITY[\"EPSG\",\"32116\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 12, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 32117, "epsg", 32117, + "NAD83 / New York West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.999"); + add_proj4text (p, 1, + "9375 +x_0=350000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units"); + add_proj4text (p, 2, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New York West\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_ori"); + add_srs_wkt (p, 8, + "gin\",40],PARAMETER[\"central_meridian\",-78.58333333333"); + add_srs_wkt (p, 9, + "333],PARAMETER[\"scale_factor\",0.9999375],PARAMETER[\"f"); + add_srs_wkt (p, 10, + "alse_easting\",350000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 11, + "UTHORITY[\"EPSG\",\"32117\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 32118, "epsg", 32118, + "NAD83 / New York Long Island"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666"); + add_proj4text (p, 1, + "666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / New York Long Island\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\""); + add_srs_wkt (p, 8, + "standard_parallel_1\",41.03333333333333],PARAMETER[\"sta"); + add_srs_wkt (p, 9, + "ndard_parallel_2\",40.66666666666666],PARAMETER[\"latitu"); + add_srs_wkt (p, 10, + "de_of_origin\",40.16666666666666],PARAMETER[\"central_me"); + add_srs_wkt (p, 11, + "ridian\",-74],PARAMETER[\"false_easting\",300000],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32118\"],"); + add_srs_wkt (p, 13, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32119, "epsg", 32119, + "NAD83 / North Carolina"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333"); + add_proj4text (p, 1, + "334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps"); + add_proj4text (p, 2, "=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / North Carolina\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",36.16666666666666],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",34.33333333333334],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",33.75],PARAMETER[\"central_meridian\",-79],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_easting\",609601.22],PARAMETER[\"false_nor"); + add_srs_wkt (p, 12, + "thing\",0],AUTHORITY[\"EPSG\",\"32119\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 13, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32120, "epsg", 32120, + "NAD83 / North Dakota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333"); + add_proj4text (p, 1, + "333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GR"); + add_proj4text (p, 2, "S80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / North Dakota North\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",48.73333333333333],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",47.43333333333333],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",47],PARAMETER[\"central_meridian\",-100.5]"); + add_srs_wkt (p, 11, + ",PARAMETER[\"false_easting\",600000],PARAMETER[\"false_n"); + add_srs_wkt (p, 12, + "orthing\",0],AUTHORITY[\"EPSG\",\"32120\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 13, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32121, "epsg", 32121, + "NAD83 / North Dakota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333"); + add_proj4text (p, 1, + "333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +"); + add_proj4text (p, 2, "y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / North Dakota South\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",47.48333333333333],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",46.18333333333333],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",45.66666666666666],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-100.5],PARAMETER[\"false_easting\",600000],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32121\""); + add_srs_wkt (p, 13, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32122, "epsg", 32122, "NAD83 / Ohio North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Ohio North\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_p"); + add_srs_wkt (p, 8, + "arallel_1\",41.7],PARAMETER[\"standard_parallel_2\",40.4"); + add_srs_wkt (p, 9, + "3333333333333],PARAMETER[\"latitude_of_origin\",39.66666"); + add_srs_wkt (p, 10, + "666666666],PARAMETER[\"central_meridian\",-82.5],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",600000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"32122\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32123, "epsg", 32123, "NAD83 / Ohio South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Ohio South\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_p"); + add_srs_wkt (p, 8, + "arallel_1\",40.03333333333333],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_2\",38.73333333333333],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",38],PARAMETER[\"central_meridian\",-82.5],PARAMETER"); + add_srs_wkt (p, 11, + "[\"false_easting\",600000],PARAMETER[\"false_northing\","); + add_srs_wkt (p, 12, + "0],AUTHORITY[\"EPSG\",\"32123\"],AXIS[\"X\",EAST],AXIS[\""); + add_srs_wkt (p, 13, "Y\",NORTH]]"); + p = add_epsg_def (first, last, 32124, "epsg", 32124, + "NAD83 / Oklahoma North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Oklahoma North\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",36.76666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",35.56666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",35],PARAMETER[\"central_meridian\",-98],PARAMET"); + add_srs_wkt (p, 11, + "ER[\"false_easting\",600000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"32124\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32125, "epsg", 32125, + "NAD83 / Oklahoma South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Oklahoma South\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",35.23333333333333],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",33.93333333333333],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",33.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 11, + "\",-98],PARAMETER[\"false_easting\",600000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32125\"],AXIS[\""); + add_srs_wkt (p, 13, "X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32126, "epsg", 32126, + "NAD83 / Oregon North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Oregon North\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",46],PARAMETER[\"standard_parallel_2\",44.3"); + add_srs_wkt (p, 9, + "3333333333334],PARAMETER[\"latitude_of_origin\",43.66666"); + add_srs_wkt (p, 10, + "666666666],PARAMETER[\"central_meridian\",-120.5],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",2500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"32126\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32127, "epsg", 32127, + "NAD83 / Oregon South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.6"); + add_proj4text (p, 1, + "6666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=G"); + add_proj4text (p, 2, "RS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Oregon South\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",44],PARAMETER[\"standard_parallel_2\",42.3"); + add_srs_wkt (p, 9, + "3333333333334],PARAMETER[\"latitude_of_origin\",41.66666"); + add_srs_wkt (p, 10, + "666666666],PARAMETER[\"central_meridian\",-120.5],PARAME"); + add_srs_wkt (p, 11, + "TER[\"false_easting\",1500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"32127\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32128, "epsg", 32128, + "NAD83 / Pennsylvania North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=4"); + add_proj4text (p, 1, + "0.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps"); + add_proj4text (p, 2, "=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Pennsylvania North\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",41.95],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 9, + "l_2\",40.88333333333333],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 10, + ",40.16666666666666],PARAMETER[\"central_meridian\",-77.7"); + add_srs_wkt (p, 11, + "5],PARAMETER[\"false_easting\",600000],PARAMETER[\"false"); + add_srs_wkt (p, 12, + "_northing\",0],AUTHORITY[\"EPSG\",\"32128\"],AXIS[\"X\","); + add_srs_wkt (p, 13, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32129, "epsg", 32129, + "NAD83 / Pennsylvania South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333"); + add_proj4text (p, 1, + "333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +"); + add_proj4text (p, 2, "y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Pennsylvania South\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",40.96666666666667],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",39.93333333333333],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",39.33333333333334],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-77.75],PARAMETER[\"false_easting\",600000],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32129\""); + add_srs_wkt (p, 13, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32130, "epsg", 32130, + "NAD83 / Rhode Island"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.9"); + add_proj4text (p, 1, + "9999375 +x_0=100000 +y_0=0 +ellps=GRS80 +datum=NAD83 +un"); + add_proj4text (p, 2, "its=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Rhode Island\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",41.08333333333334],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 9, + "71.5],PARAMETER[\"scale_factor\",0.99999375],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",100000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"32130\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 32133, "epsg", 32133, + "NAD83 / South Carolina"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31"); + add_proj4text (p, 1, + ".83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / South Carolina\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",34.83333333333334],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",32.5],PARAMETER[\"latitude_of_origin\",31.8"); + add_srs_wkt (p, 10, + "3333333333333],PARAMETER[\"central_meridian\",-81],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",609600],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"32133\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32134, "epsg", 32134, + "NAD83 / South Dakota North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666"); + add_proj4text (p, 1, + "666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_"); + add_proj4text (p, 2, "0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / South Dakota North\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",45.68333333333333],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",44.41666666666666],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",43.83333333333334],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-100],PARAMETER[\"false_easting\",600000],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32134\"],"); + add_srs_wkt (p, 13, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32135, "epsg", 32135, + "NAD83 / South Dakota South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42"); + add_proj4text (p, 1, + ".33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y"); + add_proj4text (p, 2, "_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / South Dakota South\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",44.4],PARAMETER[\"standard_parallel"); + add_srs_wkt (p, 9, + "_2\",42.83333333333334],PARAMETER[\"latitude_of_origin\""); + add_srs_wkt (p, 10, + ",42.33333333333334],PARAMETER[\"central_meridian\",-100."); + add_srs_wkt (p, 11, + "3333333333333],PARAMETER[\"false_easting\",600000],PARAM"); + add_srs_wkt (p, 12, + "ETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32135\"]"); + add_srs_wkt (p, 13, ",AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32136, "epsg", 32136, "NAD83 / Tennessee"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=3"); + add_proj4text (p, 1, + "4.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GR"); + add_proj4text (p, 2, "S80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Tennessee\",GEOGCS[\"NAD83\",DATUM[\"No"); + add_srs_wkt (p, 1, + "rth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,"); + add_srs_wkt (p, 2, + "298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_p"); + add_srs_wkt (p, 8, + "arallel_1\",36.41666666666666],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_2\",35.25],PARAMETER[\"latitude_of_origin\",34.3333"); + add_srs_wkt (p, 10, + "3333333334],PARAMETER[\"central_meridian\",-86],PARAMETE"); + add_srs_wkt (p, 11, + "R[\"false_easting\",600000],PARAMETER[\"false_northing\""); + add_srs_wkt (p, 12, + ",0],AUTHORITY[\"EPSG\",\"32136\"],AXIS[\"X\",EAST],AXIS["); + add_srs_wkt (p, 13, "\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32137, "epsg", 32137, "NAD83 / Texas North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=3"); + add_proj4text (p, 1, + "4 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +d"); + add_proj4text (p, 2, "atum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas North\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",36.18333333333333],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_2\",34.65],PARAMETER[\"latitude_of_origin\",34],P"); + add_srs_wkt (p, 10, + "ARAMETER[\"central_meridian\",-101.5],PARAMETER[\"false_"); + add_srs_wkt (p, 11, + "easting\",200000],PARAMETER[\"false_northing\",1000000],"); + add_srs_wkt (p, 12, + "AUTHORITY[\"EPSG\",\"32137\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 32138, "epsg", 32138, + "NAD83 / Texas North Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333"); + add_proj4text (p, 1, + "333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y"); + add_proj4text (p, 2, + "_0=2000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas North Central\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",33.96666666666667],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",32.13333333333333],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",31.66666666666667],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-98.5],PARAMETER[\"false_easting\",600000],PARAM"); + add_srs_wkt (p, 12, + "ETER[\"false_northing\",2000000],AUTHORITY[\"EPSG\",\"32"); + add_srs_wkt (p, 13, "138\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32139, "epsg", 32139, + "NAD83 / Texas Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666"); + add_proj4text (p, 1, + "667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +"); + add_proj4text (p, 2, + "x_0=700000 +y_0=3000000 +ellps=GRS80 +datum=NAD83 +units"); + add_proj4text (p, 3, "=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas Central\",GEOGCS[\"NAD83\",DATUM["); + add_srs_wkt (p, 1, + "\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378"); + add_srs_wkt (p, 2, + "137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORIT"); + add_srs_wkt (p, 3, + "Y[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\""); + add_srs_wkt (p, 4, + "EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AU"); + add_srs_wkt (p, 5, + "THORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]"); + add_srs_wkt (p, 6, + "],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECT"); + add_srs_wkt (p, 7, + "ION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standar"); + add_srs_wkt (p, 8, + "d_parallel_1\",31.88333333333333],PARAMETER[\"standard_p"); + add_srs_wkt (p, 9, + "arallel_2\",30.11666666666667],PARAMETER[\"latitude_of_o"); + add_srs_wkt (p, 10, + "rigin\",29.66666666666667],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 11, + ",-100.3333333333333],PARAMETER[\"false_easting\",700000]"); + add_srs_wkt (p, 12, + ",PARAMETER[\"false_northing\",3000000],AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 13, ",\"32139\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32140, "epsg", 32140, + "NAD83 / Texas South Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333"); + add_proj4text (p, 1, + "333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0"); + add_proj4text (p, 2, + "=4000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas South Central\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",30.28333333333333],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",28.38333333333333],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",27.83333333333333],PARAMETER[\"central_mer"); + add_srs_wkt (p, 11, + "idian\",-99],PARAMETER[\"false_easting\",600000],PARAMET"); + add_srs_wkt (p, 12, + "ER[\"false_northing\",4000000],AUTHORITY[\"EPSG\",\"3214"); + add_srs_wkt (p, 13, "0\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32141, "epsg", 32141, "NAD83 / Texas South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y"); + add_proj4text (p, 2, + "_0=5000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Texas South\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",27.83333333333333],PARAMETER[\"standard_pa"); + add_srs_wkt (p, 9, + "rallel_2\",26.16666666666667],PARAMETER[\"latitude_of_or"); + add_srs_wkt (p, 10, + "igin\",25.66666666666667],PARAMETER[\"central_meridian\""); + add_srs_wkt (p, 11, + ",-98.5],PARAMETER[\"false_easting\",300000],PARAMETER[\""); + add_srs_wkt (p, 12, + "false_northing\",5000000],AUTHORITY[\"EPSG\",\"32141\"],"); + add_srs_wkt (p, 13, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32142, "epsg", 32142, "NAD83 / Utah North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666"); + add_proj4text (p, 1, + "667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +"); + add_proj4text (p, 2, + "y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Utah North\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_p"); + add_srs_wkt (p, 8, + "arallel_1\",41.78333333333333],PARAMETER[\"standard_para"); + add_srs_wkt (p, 9, + "llel_2\",40.71666666666667],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 10, + "in\",40.33333333333334],PARAMETER[\"central_meridian\",-"); + add_srs_wkt (p, 11, + "111.5],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 12, + "alse_northing\",1000000],AUTHORITY[\"EPSG\",\"32142\"],A"); + add_srs_wkt (p, 13, "XIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32143, "epsg", 32143, + "NAD83 / Utah Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=3"); + add_proj4text (p, 1, + "8.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 "); + add_proj4text (p, 2, "+ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Utah Central\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard"); + add_srs_wkt (p, 8, + "_parallel_1\",40.65],PARAMETER[\"standard_parallel_2\",3"); + add_srs_wkt (p, 9, + "9.01666666666667],PARAMETER[\"latitude_of_origin\",38.33"); + add_srs_wkt (p, 10, + "333333333334],PARAMETER[\"central_meridian\",-111.5],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 12, + "ing\",2000000],AUTHORITY[\"EPSG\",\"32143\"],AXIS[\"X\","); + add_srs_wkt (p, 13, "EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32144, "epsg", 32144, "NAD83 / Utah South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=3"); + add_proj4text (p, 1, + "6.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 "); + add_proj4text (p, 2, "+ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Utah South\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_p"); + add_srs_wkt (p, 8, + "arallel_1\",38.35],PARAMETER[\"standard_parallel_2\",37."); + add_srs_wkt (p, 9, + "21666666666667],PARAMETER[\"latitude_of_origin\",36.6666"); + add_srs_wkt (p, 10, + "6666666666],PARAMETER[\"central_meridian\",-111.5],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",500000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",3000000],AUTHORITY[\"EPSG\",\"32144\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 13, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32145, "epsg", 32145, "NAD83 / Vermont"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0"); + add_proj4text (p, 1, + "=500000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Vermont\",GEOGCS[\"NAD83\",DATUM[\"Nort"); + add_srs_wkt (p, 1, + "h_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,29"); + add_srs_wkt (p, 2, + "8.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EP"); + add_srs_wkt (p, 3, + "SG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 4, + ",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORIT"); + add_srs_wkt (p, 5, + "Y[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],UNIT"); + add_srs_wkt (p, 6, + "[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\""); + add_srs_wkt (p, 7, + "Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\","); + add_srs_wkt (p, 8, + "42.5],PARAMETER[\"central_meridian\",-72.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.999964286],PARAMETER[\"false_easting\","); + add_srs_wkt (p, 10, + "500000],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 11, "\",\"32145\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32146, "epsg", 32146, + "NAD83 / Virginia North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37"); + add_proj4text (p, 1, + ".66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +"); + add_proj4text (p, 2, "ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Virginia North\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",39.2],PARAMETER[\"standard_parallel_2\","); + add_srs_wkt (p, 9, + "38.03333333333333],PARAMETER[\"latitude_of_origin\",37.6"); + add_srs_wkt (p, 10, + "6666666666666],PARAMETER[\"central_meridian\",-78.5],PAR"); + add_srs_wkt (p, 11, + "AMETER[\"false_easting\",3500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",2000000],AUTHORITY[\"EPSG\",\"32146\"],AXIS[\"X\""); + add_srs_wkt (p, 13, ",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32147, "epsg", 32147, + "NAD83 / Virginia South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666"); + add_proj4text (p, 1, + "667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +"); + add_proj4text (p, 2, + "y_0=1000000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Virginia South\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",37.96666666666667],PARAMETER[\"standard_"); + add_srs_wkt (p, 9, + "parallel_2\",36.76666666666667],PARAMETER[\"latitude_of_"); + add_srs_wkt (p, 10, + "origin\",36.33333333333334],PARAMETER[\"central_meridian"); + add_srs_wkt (p, 11, + "\",-78.5],PARAMETER[\"false_easting\",3500000],PARAMETER"); + add_srs_wkt (p, 12, + "[\"false_northing\",1000000],AUTHORITY[\"EPSG\",\"32147\""); + add_srs_wkt (p, 13, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32148, "epsg", 32148, + "NAD83 / Washington North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47"); + add_proj4text (p, 1, + " +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS"); + add_proj4text (p, 2, "80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Washington North\",GEOGCS[\"NAD83\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 8, + "ndard_parallel_1\",48.73333333333333],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_2\",47.5],PARAMETER[\"latitude_of_origin\",4"); + add_srs_wkt (p, 10, + "7],PARAMETER[\"central_meridian\",-120.8333333333333],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",0],AUTHORITY[\"EPSG\",\"32148\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 13, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32149, "epsg", 32149, + "NAD83 / Washington South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333"); + add_proj4text (p, 1, + "334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +"); + add_proj4text (p, 2, "y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Washington South\",GEOGCS[\"NAD83\",DAT"); + add_srs_wkt (p, 1, + "UM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6"); + add_srs_wkt (p, 2, + "378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHO"); + add_srs_wkt (p, 3, + "RITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORIT"); + add_srs_wkt (p, 4, + "Y[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199432"); + add_srs_wkt (p, 5, + "8,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"426"); + add_srs_wkt (p, 6, + "9\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PRO"); + add_srs_wkt (p, 7, + "JECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"sta"); + add_srs_wkt (p, 8, + "ndard_parallel_1\",47.33333333333334],PARAMETER[\"standa"); + add_srs_wkt (p, 9, + "rd_parallel_2\",45.83333333333334],PARAMETER[\"latitude_"); + add_srs_wkt (p, 10, + "of_origin\",45.33333333333334],PARAMETER[\"central_merid"); + add_srs_wkt (p, 11, + "ian\",-120.5],PARAMETER[\"false_easting\",500000],PARAME"); + add_srs_wkt (p, 12, + "TER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32149\"],"); + add_srs_wkt (p, 13, "AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32150, "epsg", 32150, + "NAD83 / West Virginia North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79."); + add_proj4text (p, 1, + "5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / West Virginia North\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",40.25],PARAMETER[\"standard_paralle"); + add_srs_wkt (p, 9, + "l_2\",39],PARAMETER[\"latitude_of_origin\",38.5],PARAMET"); + add_srs_wkt (p, 10, + "ER[\"central_meridian\",-79.5],PARAMETER[\"false_easting"); + add_srs_wkt (p, 11, + "\",600000],PARAMETER[\"false_northing\",0],AUTHORITY[\"E"); + add_srs_wkt (p, 12, "PSG\",\"32150\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32151, "epsg", 32151, + "NAD83 / West Virginia South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333"); + add_proj4text (p, 1, + "333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / West Virginia South\",GEOGCS[\"NAD83\","); + add_srs_wkt (p, 1, + "DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",38.88333333333333],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",37.48333333333333],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",37],PARAMETER[\"central_meridian\",-81],PA"); + add_srs_wkt (p, 11, + "RAMETER[\"false_easting\",600000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 12, + "hing\",0],AUTHORITY[\"EPSG\",\"32151\"],AXIS[\"X\",EAST]"); + add_srs_wkt (p, 13, ",AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32152, "epsg", 32152, + "NAD83 / Wisconsin North"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666"); + add_proj4text (p, 1, + "667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0"); + add_proj4text (p, 2, "=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wisconsin North\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 8, + "dard_parallel_1\",46.76666666666667],PARAMETER[\"standar"); + add_srs_wkt (p, 9, + "d_parallel_2\",45.56666666666667],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 10, + "f_origin\",45.16666666666666],PARAMETER[\"central_meridi"); + add_srs_wkt (p, 11, + "an\",-90],PARAMETER[\"false_easting\",600000],PARAMETER["); + add_srs_wkt (p, 12, + "\"false_northing\",0],AUTHORITY[\"EPSG\",\"32152\"],AXIS"); + add_srs_wkt (p, 13, "[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32153, "epsg", 32153, + "NAD83 / Wisconsin Central"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333"); + add_proj4text (p, 1, + "334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NA"); + add_proj4text (p, 2, "D83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wisconsin Central\",GEOGCS[\"NAD83\",DA"); + add_srs_wkt (p, 1, + "TUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\","); + add_srs_wkt (p, 2, + "6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTH"); + add_srs_wkt (p, 3, + "ORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORI"); + add_srs_wkt (p, 4, + "TY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519943"); + add_srs_wkt (p, 5, + "28,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"42"); + add_srs_wkt (p, 6, + "69\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PR"); + add_srs_wkt (p, 7, + "OJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"st"); + add_srs_wkt (p, 8, + "andard_parallel_1\",45.5],PARAMETER[\"standard_parallel_"); + add_srs_wkt (p, 9, + "2\",44.25],PARAMETER[\"latitude_of_origin\",43.833333333"); + add_srs_wkt (p, 10, + "33334],PARAMETER[\"central_meridian\",-90],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_easting\",600000],PARAMETER[\"false_northing\",0],A"); + add_srs_wkt (p, 12, + "UTHORITY[\"EPSG\",\"32153\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 13, ",NORTH]]"); + p = add_epsg_def (first, last, 32154, "epsg", 32154, + "NAD83 / Wisconsin South"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333"); + add_proj4text (p, 1, + "333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80"); + add_proj4text (p, 2, " +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wisconsin South\",GEOGCS[\"NAD83\",DATU"); + add_srs_wkt (p, 1, + "M[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",63"); + add_srs_wkt (p, 2, + "78137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHOR"); + add_srs_wkt (p, 3, + "ITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"); + add_srs_wkt (p, 4, + "[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328"); + add_srs_wkt (p, 5, + ",AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269"); + add_srs_wkt (p, 6, + "\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJ"); + add_srs_wkt (p, 7, + "ECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"stan"); + add_srs_wkt (p, 8, + "dard_parallel_1\",44.06666666666667],PARAMETER[\"standar"); + add_srs_wkt (p, 9, + "d_parallel_2\",42.73333333333333],PARAMETER[\"latitude_o"); + add_srs_wkt (p, 10, + "f_origin\",42],PARAMETER[\"central_meridian\",-90],PARAM"); + add_srs_wkt (p, 11, + "ETER[\"false_easting\",600000],PARAMETER[\"false_northin"); + add_srs_wkt (p, 12, + "g\",0],AUTHORITY[\"EPSG\",\"32154\"],AXIS[\"X\",EAST],AX"); + add_srs_wkt (p, 13, "IS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32155, "epsg", 32155, + "NAD83 / Wyoming East"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=200000 +y_0=0 +ellps=GRS80 +datum=NAD83 +uni"); + add_proj4text (p, 2, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wyoming East\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",40.5],PARAMETER[\"central_meridian\",-105.166666666"); + add_srs_wkt (p, 9, + "6667],PARAMETER[\"scale_factor\",0.9999375],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",200000],PARAMETER[\"false_northing\",0],"); + add_srs_wkt (p, 11, + "AUTHORITY[\"EPSG\",\"32155\"],AXIS[\"X\",EAST],AXIS[\"Y\""); + add_srs_wkt (p, 12, ",NORTH]]"); + p = add_epsg_def (first, last, 32156, "epsg", 32156, + "NAD83 / Wyoming East Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=400000 +y_0=100000 +ellps=GRS80 +datum=NAD83"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wyoming East Central\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",40.5],PARAMETER[\"central_meridian\",-107.3"); + add_srs_wkt (p, 9, + "333333333333],PARAMETER[\"scale_factor\",0.9999375],PARA"); + add_srs_wkt (p, 10, + "METER[\"false_easting\",400000],PARAMETER[\"false_northi"); + add_srs_wkt (p, 11, + "ng\",100000],AUTHORITY[\"EPSG\",\"32156\"],AXIS[\"X\",EA"); + add_srs_wkt (p, 12, "ST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32157, "epsg", 32157, + "NAD83 / Wyoming West Central"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0"); + add_proj4text (p, 1, + "=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_de"); + add_proj4text (p, 2, "fs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wyoming West Central\",GEOGCS[\"NAD83\""); + add_srs_wkt (p, 1, + ",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980"); + add_srs_wkt (p, 2, + "\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],A"); + add_srs_wkt (p, 3, + "UTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTH"); + add_srs_wkt (p, 4, + "ORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.017453292519"); + add_srs_wkt (p, 5, + "94328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 6, + "4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"); + add_srs_wkt (p, 7, + "PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude"); + add_srs_wkt (p, 8, + "_of_origin\",40.5],PARAMETER[\"central_meridian\",-108.7"); + add_srs_wkt (p, 9, + "5],PARAMETER[\"scale_factor\",0.9999375],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_easting\",600000],PARAMETER[\"false_northing\",0],AUT"); + add_srs_wkt (p, 11, + "HORITY[\"EPSG\",\"32157\"],AXIS[\"X\",EAST],AXIS[\"Y\",N"); + add_srs_wkt (p, 12, "ORTH]]"); + p = add_epsg_def (first, last, 32158, "epsg", 32158, + "NAD83 / Wyoming West"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9"); + add_proj4text (p, 1, + "999375 +x_0=800000 +y_0=100000 +ellps=GRS80 +datum=NAD83"); + add_proj4text (p, 2, " +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Wyoming West\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",40.5],PARAMETER[\"central_meridian\",-110.083333333"); + add_srs_wkt (p, 9, + "3333],PARAMETER[\"scale_factor\",0.9999375],PARAMETER[\""); + add_srs_wkt (p, 10, + "false_easting\",800000],PARAMETER[\"false_northing\",100"); + add_srs_wkt (p, 11, + "000],AUTHORITY[\"EPSG\",\"32158\"],AXIS[\"X\",EAST],AXIS"); + add_srs_wkt (p, 12, "[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32161, "epsg", 32161, + "NAD83 / Puerto Rico & Virgin Is."); + add_proj4text (p, 0, + "+proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333"); + add_proj4text (p, 1, + "333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +"); + add_proj4text (p, 2, + "x_0=200000 +y_0=200000 +ellps=GRS80 +datum=NAD83 +units="); + add_proj4text (p, 3, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Puerto Rico & Virgin Is.\",GEOGCS[\"NAD"); + add_srs_wkt (p, 1, + "83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS "); + add_srs_wkt (p, 2, + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\""); + add_srs_wkt (p, 3, + "]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,"); + add_srs_wkt (p, 4, + "AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329"); + add_srs_wkt (p, 5, + "251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG"); + add_srs_wkt (p, 6, + "\",\"4269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001"); + add_srs_wkt (p, 7, + "\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMET"); + add_srs_wkt (p, 8, + "ER[\"standard_parallel_1\",18.43333333333333],PARAMETER["); + add_srs_wkt (p, 9, + "\"standard_parallel_2\",18.03333333333333],PARAMETER[\"l"); + add_srs_wkt (p, 10, + "atitude_of_origin\",17.83333333333333],PARAMETER[\"centr"); + add_srs_wkt (p, 11, + "al_meridian\",-66.43333333333334],PARAMETER[\"false_east"); + add_srs_wkt (p, 12, + "ing\",200000],PARAMETER[\"false_northing\",200000],AUTHO"); + add_srs_wkt (p, 13, + "RITY[\"EPSG\",\"32161\"],AXIS[\"X\",EAST],AXIS[\"Y\",NOR"); + add_srs_wkt (p, 14, "TH]]"); + p = add_epsg_def (first, last, 32164, "epsg", 32164, + "NAD83 / BLM 14N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / BLM 14N (ftUS)\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"US survey foot\",0.3048006096012192,AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator\"],"); + add_srs_wkt (p, 8, + "PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_"); + add_srs_wkt (p, 9, + "meridian\",-99],PARAMETER[\"scale_factor\",0.9996],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",1640416.67],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"32164\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Y\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_26 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 32165, "epsg", 32165, + "NAD83 / BLM 15N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / BLM 15N (ftUS)\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"US survey foot\",0.3048006096012192,AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator\"],"); + add_srs_wkt (p, 8, + "PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_"); + add_srs_wkt (p, 9, + "meridian\",-93],PARAMETER[\"scale_factor\",0.9996],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",1640416.67],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"32165\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32166, "epsg", 32166, + "NAD83 / BLM 16N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / BLM 16N (ftUS)\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"US survey foot\",0.3048006096012192,AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator\"],"); + add_srs_wkt (p, 8, + "PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_"); + add_srs_wkt (p, 9, + "meridian\",-87],PARAMETER[\"scale_factor\",0.9996],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",1640416.67],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"32166\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32167, "epsg", 32167, + "NAD83 / BLM 17N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / BLM 17N (ftUS)\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"US survey foot\",0.3048006096012192,AUTHORITY["); + add_srs_wkt (p, 7, + "\"EPSG\",\"9003\"]],PROJECTION[\"Transverse_Mercator\"],"); + add_srs_wkt (p, 8, + "PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_"); + add_srs_wkt (p, 9, + "meridian\",-81],PARAMETER[\"scale_factor\",0.9996],PARAM"); + add_srs_wkt (p, 10, + "ETER[\"false_easting\",1640416.67],PARAMETER[\"false_nor"); + add_srs_wkt (p, 11, + "thing\",0],AUTHORITY[\"EPSG\",\"32167\"],AXIS[\"X\",EAST"); + add_srs_wkt (p, 12, "],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32180, "epsg", 32180, + "NAD83 / SCoPQ zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-55.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / SCoPQ zone 2\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-55.5],PARAMETER["); + add_srs_wkt (p, 9, + "\"scale_factor\",0.9999],PARAMETER[\"false_easting\",304"); + add_srs_wkt (p, 10, + "800],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"32180\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32181, "epsg", 32181, "NAD83 / MTM zone 1"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-53 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 1\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-53],PARAMETER[\"sc"); + add_srs_wkt (p, 9, + "ale_factor\",0.9999],PARAMETER[\"false_easting\",304800]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32"); + add_srs_wkt (p, 11, "181\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 32182, "epsg", 32182, "NAD83 / MTM zone 2"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-56 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 2\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-56],PARAMETER[\"sc"); + add_srs_wkt (p, 9, + "ale_factor\",0.9999],PARAMETER[\"false_easting\",304800]"); + add_srs_wkt (p, 10, + ",PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32"); + add_srs_wkt (p, 11, "182\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 32183, "epsg", 32183, "NAD83 / MTM zone 3"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-58.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 3\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-58.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "32183\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 32184, "epsg", 32184, "NAD83 / MTM zone 4"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-61.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 4\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-61.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "32184\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 32185, "epsg", 32185, "NAD83 / MTM zone 5"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-64.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 5\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-64.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "32185\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 32186, "epsg", 32186, "NAD83 / MTM zone 6"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-67.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 6\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-67.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "32186\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 32187, "epsg", 32187, "NAD83 / MTM zone 7"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-70.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 7\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-70.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "32187\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 32188, "epsg", 32188, "NAD83 / MTM zone 8"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-73.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 8\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-73.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "32188\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 32189, "epsg", 32189, "NAD83 / MTM zone 9"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-76.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 9\",GEOGCS[\"NAD83\",DATUM[\"N"); + add_srs_wkt (p, 1, + "orth_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137"); + add_srs_wkt (p, 2, + ",298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\""); + add_srs_wkt (p, 3, + "EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPS"); + add_srs_wkt (p, 4, + "G\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHO"); + add_srs_wkt (p, 5, + "RITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],U"); + add_srs_wkt (p, 6, + "NIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION"); + add_srs_wkt (p, 7, + "[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin"); + add_srs_wkt (p, 8, + "\",0],PARAMETER[\"central_meridian\",-76.5],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, "32189\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 32190, "epsg", 32190, "NAD83 / MTM zone 10"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-79.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 10\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-79.5],PARAMETER["); + add_srs_wkt (p, 9, + "\"scale_factor\",0.9999],PARAMETER[\"false_easting\",304"); + add_srs_wkt (p, 10, + "800],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, "\"32190\"],AXIS[\"E(X)\",EAST],AXIS[\"N(Y)\",NORTH]]"); + p = add_epsg_def (first, last, 32191, "epsg", 32191, "NAD83 / MTM zone 11"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-82.5 +k=0.9999 +x_0=304800 "); + add_proj4text (p, 1, "+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 11\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-82.5],PARAMETER["); + add_srs_wkt (p, 9, + "\"scale_factor\",0.9999],PARAMETER[\"false_easting\",304"); + add_srs_wkt (p, 10, + "800],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\","); + add_srs_wkt (p, 11, + "\"32191\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORT"); + add_srs_wkt (p, 12, "H]]"); + p = add_epsg_def (first, last, 32192, "epsg", 32192, "NAD83 / MTM zone 12"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 12\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-81],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "32192\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 32193, "epsg", 32193, "NAD83 / MTM zone 13"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 13\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-84],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "32193\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 32194, "epsg", 32194, "NAD83 / MTM zone 14"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 14\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-87],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "32194\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 32195, "epsg", 32195, "NAD83 / MTM zone 15"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 15\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-90],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "32195\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 32196, "epsg", 32196, "NAD83 / MTM zone 16"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 16\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-93],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "32196\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 32197, "epsg", 32197, "NAD83 / MTM zone 17"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-96 +k=0.9999 +x_0=304800 +y"); + add_proj4text (p, 1, "_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / MTM zone 17\",GEOGCS[\"NAD83\",DATUM[\""); + add_srs_wkt (p, 1, + "North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637813"); + add_srs_wkt (p, 2, + "7,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY["); + add_srs_wkt (p, 3, + "\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"E"); + add_srs_wkt (p, 4, + "PSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUT"); + add_srs_wkt (p, 5, + "HORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]]"); + add_srs_wkt (p, 6, + ",UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTI"); + add_srs_wkt (p, 7, + "ON[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_orig"); + add_srs_wkt (p, 8, + "in\",0],PARAMETER[\"central_meridian\",-96],PARAMETER[\""); + add_srs_wkt (p, 9, + "scale_factor\",0.9999],PARAMETER[\"false_easting\",30480"); + add_srs_wkt (p, 10, + "0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 11, + "32197\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]"); + add_srs_wkt (p, 12, "]"); + p = add_epsg_def (first, last, 32198, "epsg", 32198, + "NAD83 / Quebec Lambert"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_"); + add_proj4text (p, 1, + "0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Quebec Lambert\",GEOGCS[\"NAD83\",DATUM"); + add_srs_wkt (p, 1, + "[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",637"); + add_srs_wkt (p, 2, + "8137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORI"); + add_srs_wkt (p, 3, + "TY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY["); + add_srs_wkt (p, 4, + "\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,"); + add_srs_wkt (p, 5, + "AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\""); + add_srs_wkt (p, 6, + "]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJEC"); + add_srs_wkt (p, 7, + "TION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standa"); + add_srs_wkt (p, 8, + "rd_parallel_1\",60],PARAMETER[\"standard_parallel_2\",46"); + add_srs_wkt (p, 9, + "],PARAMETER[\"latitude_of_origin\",44],PARAMETER[\"centr"); + add_srs_wkt (p, 10, + "al_meridian\",-68.5],PARAMETER[\"false_easting\",0],PARA"); + add_srs_wkt (p, 11, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32198\""); + add_srs_wkt (p, 12, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32199, "epsg", 32199, + "NAD83 / Louisiana Offshore"); + add_proj4text (p, 0, + "+proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666"); + add_proj4text (p, 1, + "667 +lat_0=25.5 +lon_0=-91.33333333333333 +x_0=1000000 +"); + add_proj4text (p, 2, "y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"NAD83 / Louisiana Offshore\",GEOGCS[\"NAD83\",D"); + add_srs_wkt (p, 1, + "ATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\""); + add_srs_wkt (p, 2, + ",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUT"); + add_srs_wkt (p, 3, + "HORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHOR"); + add_srs_wkt (p, 4, + "ITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994"); + add_srs_wkt (p, 5, + "328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4"); + add_srs_wkt (p, 6, + "269\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],P"); + add_srs_wkt (p, 7, + "ROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"s"); + add_srs_wkt (p, 8, + "tandard_parallel_1\",27.83333333333333],PARAMETER[\"stan"); + add_srs_wkt (p, 9, + "dard_parallel_2\",26.16666666666667],PARAMETER[\"latitud"); + add_srs_wkt (p, 10, + "e_of_origin\",25.5],PARAMETER[\"central_meridian\",-91.3"); + add_srs_wkt (p, 11, + "3333333333333],PARAMETER[\"false_easting\",1000000],PARA"); + add_srs_wkt (p, 12, + "METER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"32199\""); + add_srs_wkt (p, 13, "],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32201, "epsg", 32201, + "WGS 72 / UTM zone 1N"); + add_proj4text (p, 0, "+proj=utm +zone=1 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 1N\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-177],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32201\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32202, "epsg", 32202, + "WGS 72 / UTM zone 2N"); + add_proj4text (p, 0, "+proj=utm +zone=2 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 2N\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-171],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32202\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32203, "epsg", 32203, + "WGS 72 / UTM zone 3N"); + add_proj4text (p, 0, "+proj=utm +zone=3 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 3N\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-165],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32203\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32204, "epsg", 32204, + "WGS 72 / UTM zone 4N"); + add_proj4text (p, 0, "+proj=utm +zone=4 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 4N\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-159],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32204\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32205, "epsg", 32205, + "WGS 72 / UTM zone 5N"); + add_proj4text (p, 0, "+proj=utm +zone=5 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 5N\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-153],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32205\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32206, "epsg", 32206, + "WGS 72 / UTM zone 6N"); + add_proj4text (p, 0, "+proj=utm +zone=6 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 6N\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-147],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32206\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32207, "epsg", 32207, + "WGS 72 / UTM zone 7N"); + add_proj4text (p, 0, "+proj=utm +zone=7 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 7N\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-141],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32207\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32208, "epsg", 32208, + "WGS 72 / UTM zone 8N"); + add_proj4text (p, 0, "+proj=utm +zone=8 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 8N\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-135],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32208\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32209, "epsg", 32209, + "WGS 72 / UTM zone 9N"); + add_proj4text (p, 0, "+proj=utm +zone=9 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 9N\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-129],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32209\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32210, "epsg", 32210, + "WGS 72 / UTM zone 10N"); + add_proj4text (p, 0, "+proj=utm +zone=10 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 10N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-123],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32210\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32211, "epsg", 32211, + "WGS 72 / UTM zone 11N"); + add_proj4text (p, 0, "+proj=utm +zone=11 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 11N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-117],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32211\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32212, "epsg", 32212, + "WGS 72 / UTM zone 12N"); + add_proj4text (p, 0, "+proj=utm +zone=12 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 12N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-111],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32212\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32213, "epsg", 32213, + "WGS 72 / UTM zone 13N"); + add_proj4text (p, 0, "+proj=utm +zone=13 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 13N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-105],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",0],AUTHORITY[\"EPSG\",\"32213\"],AXIS[\"Easting"); + add_srs_wkt (p, 11, "\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32214, "epsg", 32214, + "WGS 72 / UTM zone 14N"); + add_proj4text (p, 0, "+proj=utm +zone=14 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 14N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-99],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32214\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32215, "epsg", 32215, + "WGS 72 / UTM zone 15N"); + add_proj4text (p, 0, "+proj=utm +zone=15 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 15N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-93],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32215\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32216, "epsg", 32216, + "WGS 72 / UTM zone 16N"); + add_proj4text (p, 0, "+proj=utm +zone=16 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 16N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-87],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32216\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32217, "epsg", 32217, + "WGS 72 / UTM zone 17N"); + add_proj4text (p, 0, "+proj=utm +zone=17 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 17N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-81],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32217\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32218, "epsg", 32218, + "WGS 72 / UTM zone 18N"); + add_proj4text (p, 0, "+proj=utm +zone=18 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 18N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-75],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32218\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32219, "epsg", 32219, + "WGS 72 / UTM zone 19N"); + add_proj4text (p, 0, "+proj=utm +zone=19 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 19N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-69],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32219\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32220, "epsg", 32220, + "WGS 72 / UTM zone 20N"); + add_proj4text (p, 0, "+proj=utm +zone=20 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 20N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-63],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32220\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32221, "epsg", 32221, + "WGS 72 / UTM zone 21N"); + add_proj4text (p, 0, "+proj=utm +zone=21 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 21N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-57],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32221\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32222, "epsg", 32222, + "WGS 72 / UTM zone 22N"); + add_proj4text (p, 0, "+proj=utm +zone=22 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 22N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-51],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32222\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32223, "epsg", 32223, + "WGS 72 / UTM zone 23N"); + add_proj4text (p, 0, "+proj=utm +zone=23 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 23N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-45],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32223\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32224, "epsg", 32224, + "WGS 72 / UTM zone 24N"); + add_proj4text (p, 0, "+proj=utm +zone=24 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 24N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-39],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32224\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32225, "epsg", 32225, + "WGS 72 / UTM zone 25N"); + add_proj4text (p, 0, "+proj=utm +zone=25 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 25N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-33],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32225\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32226, "epsg", 32226, + "WGS 72 / UTM zone 26N"); + add_proj4text (p, 0, "+proj=utm +zone=26 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 26N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-27],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32226\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32227, "epsg", 32227, + "WGS 72 / UTM zone 27N"); + add_proj4text (p, 0, "+proj=utm +zone=27 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 27N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-21],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32227\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32228, "epsg", 32228, + "WGS 72 / UTM zone 28N"); + add_proj4text (p, 0, "+proj=utm +zone=28 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 28N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-15],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32228\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32229, "epsg", 32229, + "WGS 72 / UTM zone 29N"); + add_proj4text (p, 0, "+proj=utm +zone=29 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 29N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32229\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32230, "epsg", 32230, + "WGS 72 / UTM zone 30N"); + add_proj4text (p, 0, "+proj=utm +zone=30 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 30N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-3],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32230\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32231, "epsg", 32231, + "WGS 72 / UTM zone 31N"); + add_proj4text (p, 0, "+proj=utm +zone=31 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 31N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",3],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 10, + "ing\",0],AUTHORITY[\"EPSG\",\"32231\"],AXIS[\"Easting\","); + add_srs_wkt (p, 11, "EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32232, "epsg", 32232, + "WGS 72 / UTM zone 32N"); + add_proj4text (p, 0, "+proj=utm +zone=32 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 32N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 10, + "ing\",0],AUTHORITY[\"EPSG\",\"32232\"],AXIS[\"Easting\","); + add_srs_wkt (p, 11, "EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32233, "epsg", 32233, + "WGS 72 / UTM zone 33N"); + add_proj4text (p, 0, "+proj=utm +zone=33 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 33N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",15],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32233\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32234, "epsg", 32234, + "WGS 72 / UTM zone 34N"); + add_proj4text (p, 0, "+proj=utm +zone=34 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 34N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",21],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32234\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32235, "epsg", 32235, + "WGS 72 / UTM zone 35N"); + add_proj4text (p, 0, "+proj=utm +zone=35 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 35N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",27],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32235\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32236, "epsg", 32236, + "WGS 72 / UTM zone 36N"); + add_proj4text (p, 0, "+proj=utm +zone=36 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 36N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",33],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32236\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32237, "epsg", 32237, + "WGS 72 / UTM zone 37N"); + add_proj4text (p, 0, "+proj=utm +zone=37 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 37N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",39],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32237\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32238, "epsg", 32238, + "WGS 72 / UTM zone 38N"); + add_proj4text (p, 0, "+proj=utm +zone=38 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 38N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",45],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32238\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32239, "epsg", 32239, + "WGS 72 / UTM zone 39N"); + add_proj4text (p, 0, "+proj=utm +zone=39 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 39N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",51],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32239\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32240, "epsg", 32240, + "WGS 72 / UTM zone 40N"); + add_proj4text (p, 0, "+proj=utm +zone=40 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 40N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",57],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32240\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32241, "epsg", 32241, + "WGS 72 / UTM zone 41N"); + add_proj4text (p, 0, "+proj=utm +zone=41 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 41N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",63],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32241\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32242, "epsg", 32242, + "WGS 72 / UTM zone 42N"); + add_proj4text (p, 0, "+proj=utm +zone=42 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 42N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",69],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32242\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32243, "epsg", 32243, + "WGS 72 / UTM zone 43N"); + add_proj4text (p, 0, "+proj=utm +zone=43 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 43N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",75],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32243\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32244, "epsg", 32244, + "WGS 72 / UTM zone 44N"); + add_proj4text (p, 0, "+proj=utm +zone=44 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 44N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",81],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32244\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32245, "epsg", 32245, + "WGS 72 / UTM zone 45N"); + add_proj4text (p, 0, "+proj=utm +zone=45 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 45N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",87],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32245\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32246, "epsg", 32246, + "WGS 72 / UTM zone 46N"); + add_proj4text (p, 0, "+proj=utm +zone=46 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 46N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",93],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32246\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32247, "epsg", 32247, + "WGS 72 / UTM zone 47N"); + add_proj4text (p, 0, "+proj=utm +zone=47 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 47N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",99],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",0],AUTHORITY[\"EPSG\",\"32247\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32248, "epsg", 32248, + "WGS 72 / UTM zone 48N"); + add_proj4text (p, 0, "+proj=utm +zone=48 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 48N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",105],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32248\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32249, "epsg", 32249, + "WGS 72 / UTM zone 49N"); + add_proj4text (p, 0, "+proj=utm +zone=49 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 49N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",111],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32249\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32250, "epsg", 32250, + "WGS 72 / UTM zone 50N"); + add_proj4text (p, 0, "+proj=utm +zone=50 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 50N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",117],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32250\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32251, "epsg", 32251, + "WGS 72 / UTM zone 51N"); + add_proj4text (p, 0, "+proj=utm +zone=51 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 51N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",123],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32251\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32252, "epsg", 32252, + "WGS 72 / UTM zone 52N"); + add_proj4text (p, 0, "+proj=utm +zone=52 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 52N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",129],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32252\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32253, "epsg", 32253, + "WGS 72 / UTM zone 53N"); + add_proj4text (p, 0, "+proj=utm +zone=53 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 53N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",135],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32253\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32254, "epsg", 32254, + "WGS 72 / UTM zone 54N"); + add_proj4text (p, 0, "+proj=utm +zone=54 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 54N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",141],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32254\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32255, "epsg", 32255, + "WGS 72 / UTM zone 55N"); + add_proj4text (p, 0, "+proj=utm +zone=55 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 55N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",147],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32255\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32256, "epsg", 32256, + "WGS 72 / UTM zone 56N"); + add_proj4text (p, 0, "+proj=utm +zone=56 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 56N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",153],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32256\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32257, "epsg", 32257, + "WGS 72 / UTM zone 57N"); + add_proj4text (p, 0, "+proj=utm +zone=57 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 57N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",159],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32257\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32258, "epsg", 32258, + "WGS 72 / UTM zone 58N"); + add_proj4text (p, 0, "+proj=utm +zone=58 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 58N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",165],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32258\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32259, "epsg", 32259, + "WGS 72 / UTM zone 59N"); + add_proj4text (p, 0, "+proj=utm +zone=59 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 59N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",171],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32259\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32260, "epsg", 32260, + "WGS 72 / UTM zone 60N"); + add_proj4text (p, 0, "+proj=utm +zone=60 +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 60N\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",177],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",0],AUTHORITY[\"EPSG\",\"32260\"],AXIS[\"Easting\""); + add_srs_wkt (p, 11, ",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32301, "epsg", 32301, + "WGS 72 / UTM zone 1S"); + add_proj4text (p, 0, + "+proj=utm +zone=1 +south +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 1S\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-177],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32301\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32302, "epsg", 32302, + "WGS 72 / UTM zone 2S"); + add_proj4text (p, 0, + "+proj=utm +zone=2 +south +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 2S\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-171],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32302\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32303, "epsg", 32303, + "WGS 72 / UTM zone 3S"); + add_proj4text (p, 0, + "+proj=utm +zone=3 +south +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 3S\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-165],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32303\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32304, "epsg", 32304, + "WGS 72 / UTM zone 4S"); + add_proj4text (p, 0, + "+proj=utm +zone=4 +south +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 4S\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-159],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32304\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32305, "epsg", 32305, + "WGS 72 / UTM zone 5S"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +south +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 5S\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-153],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32305\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32306, "epsg", 32306, + "WGS 72 / UTM zone 6S"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +south +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 6S\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-147],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32306\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32307, "epsg", 32307, + "WGS 72 / UTM zone 7S"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +south +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 7S\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-141],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32307\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32308, "epsg", 32308, + "WGS 72 / UTM zone 8S"); + add_proj4text (p, 0, + "+proj=utm +zone=8 +south +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 8S\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-135],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32308\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32309, "epsg", 32309, + "WGS 72 / UTM zone 9S"); + add_proj4text (p, 0, + "+proj=utm +zone=9 +south +ellps=WGS72 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 9S\",GEOGCS[\"WGS 72\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORIT"); + add_srs_wkt (p, 2, + "Y[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRIM"); + add_srs_wkt (p, 3, + "EM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-129],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32309\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32310, "epsg", 32310, + "WGS 72 / UTM zone 10S"); + add_proj4text (p, 0, + "+proj=utm +zone=10 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 10S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-123],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32310\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32311, "epsg", 32311, + "WGS 72 / UTM zone 11S"); + add_proj4text (p, 0, + "+proj=utm +zone=11 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 11S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-117],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32311\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32312, "epsg", 32312, + "WGS 72 / UTM zone 12S"); + add_proj4text (p, 0, + "+proj=utm +zone=12 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 12S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-111],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32312\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32313, "epsg", 32313, + "WGS 72 / UTM zone 13S"); + add_proj4text (p, 0, + "+proj=utm +zone=13 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 13S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-105],PARAMETER[\"scale_factor\",0.9996],"); + add_srs_wkt (p, 9, + "PARAMETER[\"false_easting\",500000],PARAMETER[\"false_no"); + add_srs_wkt (p, 10, + "rthing\",10000000],AUTHORITY[\"EPSG\",\"32313\"],AXIS[\""); + add_srs_wkt (p, 11, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32314, "epsg", 32314, + "WGS 72 / UTM zone 14S"); + add_proj4text (p, 0, + "+proj=utm +zone=14 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 14S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-99],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32314\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32315, "epsg", 32315, + "WGS 72 / UTM zone 15S"); + add_proj4text (p, 0, + "+proj=utm +zone=15 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 15S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-93],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32315\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32316, "epsg", 32316, + "WGS 72 / UTM zone 16S"); + add_proj4text (p, 0, + "+proj=utm +zone=16 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 16S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-87],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32316\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32317, "epsg", 32317, + "WGS 72 / UTM zone 17S"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 17S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-81],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32317\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32318, "epsg", 32318, + "WGS 72 / UTM zone 18S"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 18S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-75],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32318\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32319, "epsg", 32319, + "WGS 72 / UTM zone 19S"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 19S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-69],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32319\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32320, "epsg", 32320, + "WGS 72 / UTM zone 20S"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 20S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-63],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32320\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32321, "epsg", 32321, + "WGS 72 / UTM zone 21S"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 21S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-57],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32321\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32322, "epsg", 32322, + "WGS 72 / UTM zone 22S"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 22S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-51],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32322\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32323, "epsg", 32323, + "WGS 72 / UTM zone 23S"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 23S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-45],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32323\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32324, "epsg", 32324, + "WGS 72 / UTM zone 24S"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 24S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-39],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32324\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32325, "epsg", 32325, + "WGS 72 / UTM zone 25S"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 25S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-33],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32325\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32326, "epsg", 32326, + "WGS 72 / UTM zone 26S"); + add_proj4text (p, 0, + "+proj=utm +zone=26 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 26S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-27],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32326\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32327, "epsg", 32327, + "WGS 72 / UTM zone 27S"); + add_proj4text (p, 0, + "+proj=utm +zone=27 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 27S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-21],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32327\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32328, "epsg", 32328, + "WGS 72 / UTM zone 28S"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 28S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-15],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32328\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32329, "epsg", 32329, + "WGS 72 / UTM zone 29S"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 29S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-9],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32329\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32330, "epsg", 32330, + "WGS 72 / UTM zone 30S"); + add_proj4text (p, 0, + "+proj=utm +zone=30 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 30S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",-3],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32330\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32331, "epsg", 32331, + "WGS 72 / UTM zone 31S"); + add_proj4text (p, 0, + "+proj=utm +zone=31 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 31S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",3],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 10, + "ing\",10000000],AUTHORITY[\"EPSG\",\"32331\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32332, "epsg", 32332, + "WGS 72 / UTM zone 32S"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 32S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PAR"); + add_srs_wkt (p, 9, + "AMETER[\"false_easting\",500000],PARAMETER[\"false_north"); + add_srs_wkt (p, 10, + "ing\",10000000],AUTHORITY[\"EPSG\",\"32332\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32333, "epsg", 32333, + "WGS 72 / UTM zone 33S"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 33S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",15],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32333\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32334, "epsg", 32334, + "WGS 72 / UTM zone 34S"); + add_proj4text (p, 0, + "+proj=utm +zone=34 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 34S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",21],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32334\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32335, "epsg", 32335, + "WGS 72 / UTM zone 35S"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 35S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",27],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32335\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32336, "epsg", 32336, + "WGS 72 / UTM zone 36S"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 36S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",33],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32336\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32337, "epsg", 32337, + "WGS 72 / UTM zone 37S"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 37S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",39],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32337\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32338, "epsg", 32338, + "WGS 72 / UTM zone 38S"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 38S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",45],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32338\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32339, "epsg", 32339, + "WGS 72 / UTM zone 39S"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 39S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",51],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32339\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32340, "epsg", 32340, + "WGS 72 / UTM zone 40S"); + add_proj4text (p, 0, + "+proj=utm +zone=40 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 40S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",57],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32340\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32341, "epsg", 32341, + "WGS 72 / UTM zone 41S"); + add_proj4text (p, 0, + "+proj=utm +zone=41 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 41S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",63],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32341\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32342, "epsg", 32342, + "WGS 72 / UTM zone 42S"); + add_proj4text (p, 0, + "+proj=utm +zone=42 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 42S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",69],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32342\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32343, "epsg", 32343, + "WGS 72 / UTM zone 43S"); + add_proj4text (p, 0, + "+proj=utm +zone=43 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 43S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",75],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32343\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32344, "epsg", 32344, + "WGS 72 / UTM zone 44S"); + add_proj4text (p, 0, + "+proj=utm +zone=44 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 44S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",81],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32344\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32345, "epsg", 32345, + "WGS 72 / UTM zone 45S"); + add_proj4text (p, 0, + "+proj=utm +zone=45 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 45S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",87],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32345\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_27 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 32346, "epsg", 32346, + "WGS 72 / UTM zone 46S"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 46S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",93],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32346\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32347, "epsg", 32347, + "WGS 72 / UTM zone 47S"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 47S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",99],PARAMETER[\"scale_factor\",0.9996],PA"); + add_srs_wkt (p, 9, + "RAMETER[\"false_easting\",500000],PARAMETER[\"false_nort"); + add_srs_wkt (p, 10, + "hing\",10000000],AUTHORITY[\"EPSG\",\"32347\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32348, "epsg", 32348, + "WGS 72 / UTM zone 48S"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 48S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",105],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32348\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32349, "epsg", 32349, + "WGS 72 / UTM zone 49S"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 49S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",111],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32349\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32350, "epsg", 32350, + "WGS 72 / UTM zone 50S"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 50S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",117],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32350\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32351, "epsg", 32351, + "WGS 72 / UTM zone 51S"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 51S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",123],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32351\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32352, "epsg", 32352, + "WGS 72 / UTM zone 52S"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 52S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",129],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32352\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32353, "epsg", 32353, + "WGS 72 / UTM zone 53S"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 53S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",135],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32353\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32354, "epsg", 32354, + "WGS 72 / UTM zone 54S"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 54S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",141],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32354\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32355, "epsg", 32355, + "WGS 72 / UTM zone 55S"); + add_proj4text (p, 0, + "+proj=utm +zone=55 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 55S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",147],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32355\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32356, "epsg", 32356, + "WGS 72 / UTM zone 56S"); + add_proj4text (p, 0, + "+proj=utm +zone=56 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 56S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",153],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32356\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32357, "epsg", 32357, + "WGS 72 / UTM zone 57S"); + add_proj4text (p, 0, + "+proj=utm +zone=57 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 57S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",159],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32357\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32358, "epsg", 32358, + "WGS 72 / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 58S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",165],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32358\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32359, "epsg", 32359, + "WGS 72 / UTM zone 59S"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 59S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",171],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32359\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32360, "epsg", 32360, + "WGS 72 / UTM zone 60S"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +south +ellps=WGS72 +units=m +no_defs"); + add_proj4text (p, 1, ""); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72 / UTM zone 60S\",GEOGCS[\"WGS 72\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1972\",SPHEROID[\"WGS 72\",6378135,298.26,AUTHORI"); + add_srs_wkt (p, 2, + "TY[\"EPSG\",\"7043\"]],AUTHORITY[\"EPSG\",\"6322\"]],PRI"); + add_srs_wkt (p, 3, + "MEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\""); + add_srs_wkt (p, 4, + "degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\""); + add_srs_wkt (p, 5, + "]],AUTHORITY[\"EPSG\",\"4322\"]],UNIT[\"metre\",1,AUTHOR"); + add_srs_wkt (p, 6, + "ITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Mercator"); + add_srs_wkt (p, 7, + "\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"cent"); + add_srs_wkt (p, 8, + "ral_meridian\",177],PARAMETER[\"scale_factor\",0.9996],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"false_easting\",500000],PARAMETER[\"false_nor"); + add_srs_wkt (p, 10, + "thing\",10000000],AUTHORITY[\"EPSG\",\"32360\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32401, "epsg", 32401, + "WGS 72BE / UTM zone 1N"); + add_proj4text (p, 0, + "+proj=utm +zone=1 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.81"); + add_proj4text (p, 1, "4,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 1N\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-177],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32401\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32402, "epsg", 32402, + "WGS 72BE / UTM zone 2N"); + add_proj4text (p, 0, + "+proj=utm +zone=2 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.81"); + add_proj4text (p, 1, "4,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 2N\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-171],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32402\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32403, "epsg", 32403, + "WGS 72BE / UTM zone 3N"); + add_proj4text (p, 0, + "+proj=utm +zone=3 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.81"); + add_proj4text (p, 1, "4,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 3N\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-165],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32403\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32404, "epsg", 32404, + "WGS 72BE / UTM zone 4N"); + add_proj4text (p, 0, + "+proj=utm +zone=4 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.81"); + add_proj4text (p, 1, "4,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 4N\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-159],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32404\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32405, "epsg", 32405, + "WGS 72BE / UTM zone 5N"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.81"); + add_proj4text (p, 1, "4,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 5N\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-153],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32405\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32406, "epsg", 32406, + "WGS 72BE / UTM zone 6N"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.81"); + add_proj4text (p, 1, "4,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 6N\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-147],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32406\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32407, "epsg", 32407, + "WGS 72BE / UTM zone 7N"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.81"); + add_proj4text (p, 1, "4,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 7N\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-141],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32407\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32408, "epsg", 32408, + "WGS 72BE / UTM zone 8N"); + add_proj4text (p, 0, + "+proj=utm +zone=8 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.81"); + add_proj4text (p, 1, "4,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 8N\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-135],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32408\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32409, "epsg", 32409, + "WGS 72BE / UTM zone 9N"); + add_proj4text (p, 0, + "+proj=utm +zone=9 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.81"); + add_proj4text (p, 1, "4,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 9N\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-129],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32409\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32410, "epsg", 32410, + "WGS 72BE / UTM zone 10N"); + add_proj4text (p, 0, + "+proj=utm +zone=10 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 10N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-123],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32410\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32411, "epsg", 32411, + "WGS 72BE / UTM zone 11N"); + add_proj4text (p, 0, + "+proj=utm +zone=11 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 11N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-117],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32411\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32412, "epsg", 32412, + "WGS 72BE / UTM zone 12N"); + add_proj4text (p, 0, + "+proj=utm +zone=12 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 12N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-111],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32412\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32413, "epsg", 32413, + "WGS 72BE / UTM zone 13N"); + add_proj4text (p, 0, + "+proj=utm +zone=13 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 13N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-105],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32413\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32414, "epsg", 32414, + "WGS 72BE / UTM zone 14N"); + add_proj4text (p, 0, + "+proj=utm +zone=14 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 14N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-99],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32414\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32415, "epsg", 32415, + "WGS 72BE / UTM zone 15N"); + add_proj4text (p, 0, + "+proj=utm +zone=15 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 15N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-93],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32415\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32416, "epsg", 32416, + "WGS 72BE / UTM zone 16N"); + add_proj4text (p, 0, + "+proj=utm +zone=16 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 16N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-87],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32416\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32417, "epsg", 32417, + "WGS 72BE / UTM zone 17N"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 17N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-81],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32417\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32418, "epsg", 32418, + "WGS 72BE / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 18N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-75],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32418\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32419, "epsg", 32419, + "WGS 72BE / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 19N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-69],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32419\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32420, "epsg", 32420, + "WGS 72BE / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 20N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-63],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32420\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32421, "epsg", 32421, + "WGS 72BE / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 21N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-57],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32421\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32422, "epsg", 32422, + "WGS 72BE / UTM zone 22N"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 22N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-51],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32422\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32423, "epsg", 32423, + "WGS 72BE / UTM zone 23N"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 23N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-45],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32423\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32424, "epsg", 32424, + "WGS 72BE / UTM zone 24N"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 24N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-39],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32424\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32425, "epsg", 32425, + "WGS 72BE / UTM zone 25N"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 25N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-33],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32425\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32426, "epsg", 32426, + "WGS 72BE / UTM zone 26N"); + add_proj4text (p, 0, + "+proj=utm +zone=26 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 26N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-27],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32426\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32427, "epsg", 32427, + "WGS 72BE / UTM zone 27N"); + add_proj4text (p, 0, + "+proj=utm +zone=27 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 27N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-21],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32427\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32428, "epsg", 32428, + "WGS 72BE / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 28N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-15],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32428\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32429, "epsg", 32429, + "WGS 72BE / UTM zone 29N"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 29N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32429\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32430, "epsg", 32430, + "WGS 72BE / UTM zone 30N"); + add_proj4text (p, 0, + "+proj=utm +zone=30 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 30N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-3],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32430\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32431, "epsg", 32431, + "WGS 72BE / UTM zone 31N"); + add_proj4text (p, 0, + "+proj=utm +zone=31 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 31N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",3],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32431\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32432, "epsg", 32432, + "WGS 72BE / UTM zone 32N"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 32N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32432\"],AXIS[\"E"); + add_srs_wkt (p, 12, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32433, "epsg", 32433, + "WGS 72BE / UTM zone 33N"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 33N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",15],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32433\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32434, "epsg", 32434, + "WGS 72BE / UTM zone 34N"); + add_proj4text (p, 0, + "+proj=utm +zone=34 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 34N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",21],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32434\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32435, "epsg", 32435, + "WGS 72BE / UTM zone 35N"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 35N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",27],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32435\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32436, "epsg", 32436, + "WGS 72BE / UTM zone 36N"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 36N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",33],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32436\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32437, "epsg", 32437, + "WGS 72BE / UTM zone 37N"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 37N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",39],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32437\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32438, "epsg", 32438, + "WGS 72BE / UTM zone 38N"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 38N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",45],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32438\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32439, "epsg", 32439, + "WGS 72BE / UTM zone 39N"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 39N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",51],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32439\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32440, "epsg", 32440, + "WGS 72BE / UTM zone 40N"); + add_proj4text (p, 0, + "+proj=utm +zone=40 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 40N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",57],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32440\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32441, "epsg", 32441, + "WGS 72BE / UTM zone 41N"); + add_proj4text (p, 0, + "+proj=utm +zone=41 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 41N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",63],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32441\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32442, "epsg", 32442, + "WGS 72BE / UTM zone 42N"); + add_proj4text (p, 0, + "+proj=utm +zone=42 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 42N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",69],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32442\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32443, "epsg", 32443, + "WGS 72BE / UTM zone 43N"); + add_proj4text (p, 0, + "+proj=utm +zone=43 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 43N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",75],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32443\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32444, "epsg", 32444, + "WGS 72BE / UTM zone 44N"); + add_proj4text (p, 0, + "+proj=utm +zone=44 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 44N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",81],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32444\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32445, "epsg", 32445, + "WGS 72BE / UTM zone 45N"); + add_proj4text (p, 0, + "+proj=utm +zone=45 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 45N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",87],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32445\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32446, "epsg", 32446, + "WGS 72BE / UTM zone 46N"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 46N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",93],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32446\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32447, "epsg", 32447, + "WGS 72BE / UTM zone 47N"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 47N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",99],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",0],AUTHORITY[\"EPSG\",\"32447\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32448, "epsg", 32448, + "WGS 72BE / UTM zone 48N"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 48N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",105],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32448\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32449, "epsg", 32449, + "WGS 72BE / UTM zone 49N"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 49N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",111],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32449\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32450, "epsg", 32450, + "WGS 72BE / UTM zone 50N"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 50N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",117],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32450\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32451, "epsg", 32451, + "WGS 72BE / UTM zone 51N"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 51N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",123],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32451\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32452, "epsg", 32452, + "WGS 72BE / UTM zone 52N"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 52N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",129],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32452\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32453, "epsg", 32453, + "WGS 72BE / UTM zone 53N"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 53N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",135],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32453\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32454, "epsg", 32454, + "WGS 72BE / UTM zone 54N"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 54N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",141],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32454\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32455, "epsg", 32455, + "WGS 72BE / UTM zone 55N"); + add_proj4text (p, 0, + "+proj=utm +zone=55 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 55N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",147],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32455\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32456, "epsg", 32456, + "WGS 72BE / UTM zone 56N"); + add_proj4text (p, 0, + "+proj=utm +zone=56 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 56N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",153],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32456\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32457, "epsg", 32457, + "WGS 72BE / UTM zone 57N"); + add_proj4text (p, 0, + "+proj=utm +zone=57 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 57N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",159],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32457\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32458, "epsg", 32458, + "WGS 72BE / UTM zone 58N"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 58N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",165],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32458\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32459, "epsg", 32459, + "WGS 72BE / UTM zone 59N"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 59N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",171],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32459\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32460, "epsg", 32460, + "WGS 72BE / UTM zone 60N"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.8"); + add_proj4text (p, 1, "14,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 60N\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",177],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",0],AUTHORITY[\"EPSG\",\"32460\"],AXIS[\""); + add_srs_wkt (p, 12, "Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32501, "epsg", 32501, + "WGS 72BE / UTM zone 1S"); + add_proj4text (p, 0, + "+proj=utm +zone=1 +south +ellps=WGS72 +towgs84=0,0,1.9,0"); + add_proj4text (p, 1, ",0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 1S\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-177],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32501\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32502, "epsg", 32502, + "WGS 72BE / UTM zone 2S"); + add_proj4text (p, 0, + "+proj=utm +zone=2 +south +ellps=WGS72 +towgs84=0,0,1.9,0"); + add_proj4text (p, 1, ",0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 2S\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-171],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32502\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32503, "epsg", 32503, + "WGS 72BE / UTM zone 3S"); + add_proj4text (p, 0, + "+proj=utm +zone=3 +south +ellps=WGS72 +towgs84=0,0,1.9,0"); + add_proj4text (p, 1, ",0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 3S\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-165],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32503\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32504, "epsg", 32504, + "WGS 72BE / UTM zone 4S"); + add_proj4text (p, 0, + "+proj=utm +zone=4 +south +ellps=WGS72 +towgs84=0,0,1.9,0"); + add_proj4text (p, 1, ",0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 4S\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-159],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32504\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32505, "epsg", 32505, + "WGS 72BE / UTM zone 5S"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +south +ellps=WGS72 +towgs84=0,0,1.9,0"); + add_proj4text (p, 1, ",0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 5S\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-153],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32505\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32506, "epsg", 32506, + "WGS 72BE / UTM zone 6S"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +south +ellps=WGS72 +towgs84=0,0,1.9,0"); + add_proj4text (p, 1, ",0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 6S\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-147],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32506\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32507, "epsg", 32507, + "WGS 72BE / UTM zone 7S"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +south +ellps=WGS72 +towgs84=0,0,1.9,0"); + add_proj4text (p, 1, ",0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 7S\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-141],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32507\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32508, "epsg", 32508, + "WGS 72BE / UTM zone 8S"); + add_proj4text (p, 0, + "+proj=utm +zone=8 +south +ellps=WGS72 +towgs84=0,0,1.9,0"); + add_proj4text (p, 1, ",0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 8S\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-135],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32508\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32509, "epsg", 32509, + "WGS 72BE / UTM zone 9S"); + add_proj4text (p, 0, + "+proj=utm +zone=9 +south +ellps=WGS72 +towgs84=0,0,1.9,0"); + add_proj4text (p, 1, ",0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 9S\",GEOGCS[\"WGS 72BE\",DA"); + add_srs_wkt (p, 1, + "TUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-129],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32509\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32510, "epsg", 32510, + "WGS 72BE / UTM zone 10S"); + add_proj4text (p, 0, + "+proj=utm +zone=10 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 10S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-123],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32510\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32511, "epsg", 32511, + "WGS 72BE / UTM zone 11S"); + add_proj4text (p, 0, + "+proj=utm +zone=11 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 11S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-117],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32511\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32512, "epsg", 32512, + "WGS 72BE / UTM zone 12S"); + add_proj4text (p, 0, + "+proj=utm +zone=12 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 12S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-111],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32512\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32513, "epsg", 32513, + "WGS 72BE / UTM zone 13S"); + add_proj4text (p, 0, + "+proj=utm +zone=13 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 13S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-105],PARAMETER[\"scale_factor\""); + add_srs_wkt (p, 10, + ",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32513\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32514, "epsg", 32514, + "WGS 72BE / UTM zone 14S"); + add_proj4text (p, 0, + "+proj=utm +zone=14 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 14S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-99],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32514\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32515, "epsg", 32515, + "WGS 72BE / UTM zone 15S"); + add_proj4text (p, 0, + "+proj=utm +zone=15 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 15S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-93],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32515\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32516, "epsg", 32516, + "WGS 72BE / UTM zone 16S"); + add_proj4text (p, 0, + "+proj=utm +zone=16 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 16S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-87],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32516\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32517, "epsg", 32517, + "WGS 72BE / UTM zone 17S"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 17S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-81],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32517\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32518, "epsg", 32518, + "WGS 72BE / UTM zone 18S"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 18S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-75],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32518\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32519, "epsg", 32519, + "WGS 72BE / UTM zone 19S"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 19S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-69],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32519\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32520, "epsg", 32520, + "WGS 72BE / UTM zone 20S"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 20S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-63],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32520\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32521, "epsg", 32521, + "WGS 72BE / UTM zone 21S"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 21S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-57],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32521\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32522, "epsg", 32522, + "WGS 72BE / UTM zone 22S"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 22S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-51],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32522\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32523, "epsg", 32523, + "WGS 72BE / UTM zone 23S"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 23S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-45],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32523\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32524, "epsg", 32524, + "WGS 72BE / UTM zone 24S"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 24S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-39],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32524\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32525, "epsg", 32525, + "WGS 72BE / UTM zone 25S"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 25S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-33],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32525\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32526, "epsg", 32526, + "WGS 72BE / UTM zone 26S"); + add_proj4text (p, 0, + "+proj=utm +zone=26 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 26S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-27],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32526\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32527, "epsg", 32527, + "WGS 72BE / UTM zone 27S"); + add_proj4text (p, 0, + "+proj=utm +zone=27 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 27S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-21],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32527\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32528, "epsg", 32528, + "WGS 72BE / UTM zone 28S"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 28S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-15],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32528\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32529, "epsg", 32529, + "WGS 72BE / UTM zone 29S"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 29S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-9],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32529\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32530, "epsg", 32530, + "WGS 72BE / UTM zone 30S"); + add_proj4text (p, 0, + "+proj=utm +zone=30 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 30S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",-3],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32530\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32531, "epsg", 32531, + "WGS 72BE / UTM zone 31S"); + add_proj4text (p, 0, + "+proj=utm +zone=31 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 31S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",3],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32531\"],A"); + add_srs_wkt (p, 12, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32532, "epsg", 32532, + "WGS 72BE / UTM zone 32S"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 32S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 10, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 11, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32532\"],A"); + add_srs_wkt (p, 12, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32533, "epsg", 32533, + "WGS 72BE / UTM zone 33S"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 33S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",15],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32533\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32534, "epsg", 32534, + "WGS 72BE / UTM zone 34S"); + add_proj4text (p, 0, + "+proj=utm +zone=34 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 34S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",21],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32534\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32535, "epsg", 32535, + "WGS 72BE / UTM zone 35S"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 35S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",27],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32535\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32536, "epsg", 32536, + "WGS 72BE / UTM zone 36S"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 36S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",33],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32536\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32537, "epsg", 32537, + "WGS 72BE / UTM zone 37S"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 37S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",39],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32537\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32538, "epsg", 32538, + "WGS 72BE / UTM zone 38S"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 38S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",45],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32538\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32539, "epsg", 32539, + "WGS 72BE / UTM zone 39S"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 39S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",51],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32539\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32540, "epsg", 32540, + "WGS 72BE / UTM zone 40S"); + add_proj4text (p, 0, + "+proj=utm +zone=40 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 40S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",57],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32540\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32541, "epsg", 32541, + "WGS 72BE / UTM zone 41S"); + add_proj4text (p, 0, + "+proj=utm +zone=41 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 41S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",63],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32541\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32542, "epsg", 32542, + "WGS 72BE / UTM zone 42S"); + add_proj4text (p, 0, + "+proj=utm +zone=42 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 42S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",69],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32542\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32543, "epsg", 32543, + "WGS 72BE / UTM zone 43S"); + add_proj4text (p, 0, + "+proj=utm +zone=43 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 43S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",75],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32543\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32544, "epsg", 32544, + "WGS 72BE / UTM zone 44S"); + add_proj4text (p, 0, + "+proj=utm +zone=44 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 44S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",81],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32544\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32545, "epsg", 32545, + "WGS 72BE / UTM zone 45S"); + add_proj4text (p, 0, + "+proj=utm +zone=45 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 45S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",87],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32545\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32546, "epsg", 32546, + "WGS 72BE / UTM zone 46S"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 46S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",93],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32546\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32547, "epsg", 32547, + "WGS 72BE / UTM zone 47S"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 47S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",99],PARAMETER[\"scale_factor\",0"); + add_srs_wkt (p, 10, + ".9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"f"); + add_srs_wkt (p, 11, + "alse_northing\",10000000],AUTHORITY[\"EPSG\",\"32547\"],"); + add_srs_wkt (p, 12, "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32548, "epsg", 32548, + "WGS 72BE / UTM zone 48S"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 48S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",105],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32548\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32549, "epsg", 32549, + "WGS 72BE / UTM zone 49S"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 49S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",111],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32549\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32550, "epsg", 32550, + "WGS 72BE / UTM zone 50S"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 50S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",117],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32550\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32551, "epsg", 32551, + "WGS 72BE / UTM zone 51S"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 51S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",123],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32551\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32552, "epsg", 32552, + "WGS 72BE / UTM zone 52S"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 52S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",129],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32552\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32553, "epsg", 32553, + "WGS 72BE / UTM zone 53S"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 53S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",135],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32553\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); +#endif /* full EPSG initialization enabled/disabled */ + if (first == last) + last = first; /* suppressing stupid compiler warnings */ +} + +static void +initialize_epsg_28 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ + struct epsg_defs *p; +#if OMIT_EPSG == 0 /* full EPSG initialization enabled */ + p = add_epsg_def (first, last, 32554, "epsg", 32554, + "WGS 72BE / UTM zone 54S"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 54S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",141],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32554\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32555, "epsg", 32555, + "WGS 72BE / UTM zone 55S"); + add_proj4text (p, 0, + "+proj=utm +zone=55 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 55S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",147],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32555\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32556, "epsg", 32556, + "WGS 72BE / UTM zone 56S"); + add_proj4text (p, 0, + "+proj=utm +zone=56 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 56S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",153],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32556\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32557, "epsg", 32557, + "WGS 72BE / UTM zone 57S"); + add_proj4text (p, 0, + "+proj=utm +zone=57 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 57S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",159],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32557\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32558, "epsg", 32558, + "WGS 72BE / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 58S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",165],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32558\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32559, "epsg", 32559, + "WGS 72BE / UTM zone 59S"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 59S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",171],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32559\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32560, "epsg", 32560, + "WGS 72BE / UTM zone 60S"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +south +ellps=WGS72 +towgs84=0,0,1.9,"); + add_proj4text (p, 1, "0,0,0.814,-0.38 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 72BE / UTM zone 60S\",GEOGCS[\"WGS 72BE\",D"); + add_srs_wkt (p, 1, + "ATUM[\"WGS_1972_Transit_Broadcast_Ephemeris\",SPHEROID[\""); + add_srs_wkt (p, 2, + "WGS 72\",6378135,298.26,AUTHORITY[\"EPSG\",\"7043\"]],TO"); + add_srs_wkt (p, 3, + "WGS84[0,0,1.9,0,0,0.814,-0.38],AUTHORITY[\"EPSG\",\"6324"); + add_srs_wkt (p, 4, + "\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]"); + add_srs_wkt (p, 5, + "],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 6, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4324\"]],UNIT[\"metre\""); + add_srs_wkt (p, 7, + ",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse"); + add_srs_wkt (p, 8, + "_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMET"); + add_srs_wkt (p, 9, + "ER[\"central_meridian\",177],PARAMETER[\"scale_factor\","); + add_srs_wkt (p, 10, + "0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\""); + add_srs_wkt (p, 11, + "false_northing\",10000000],AUTHORITY[\"EPSG\",\"32560\"]"); + add_srs_wkt (p, 12, ",AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + +#endif /* unconditionally loading the WGS82/UTM zones */ + p = add_epsg_def (first, last, 32601, "epsg", 32601, + "WGS 84 / UTM zone 1N"); + add_proj4text (p, 0, + "+proj=utm +zone=1 +ellps=WGS84 +datum=WGS84 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 1N\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-177],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32601\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32602, "epsg", 32602, + "WGS 84 / UTM zone 2N"); + add_proj4text (p, 0, + "+proj=utm +zone=2 +ellps=WGS84 +datum=WGS84 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 2N\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-171],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32602\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32603, "epsg", 32603, + "WGS 84 / UTM zone 3N"); + add_proj4text (p, 0, + "+proj=utm +zone=3 +ellps=WGS84 +datum=WGS84 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 3N\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-165],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32603\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32604, "epsg", 32604, + "WGS 84 / UTM zone 4N"); + add_proj4text (p, 0, + "+proj=utm +zone=4 +ellps=WGS84 +datum=WGS84 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 4N\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-159],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32604\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32605, "epsg", 32605, + "WGS 84 / UTM zone 5N"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +ellps=WGS84 +datum=WGS84 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 5N\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-153],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32605\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32606, "epsg", 32606, + "WGS 84 / UTM zone 6N"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +ellps=WGS84 +datum=WGS84 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 6N\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-147],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32606\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32607, "epsg", 32607, + "WGS 84 / UTM zone 7N"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +ellps=WGS84 +datum=WGS84 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 7N\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-141],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32607\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32608, "epsg", 32608, + "WGS 84 / UTM zone 8N"); + add_proj4text (p, 0, + "+proj=utm +zone=8 +ellps=WGS84 +datum=WGS84 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 8N\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-135],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32608\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32609, "epsg", 32609, + "WGS 84 / UTM zone 9N"); + add_proj4text (p, 0, + "+proj=utm +zone=9 +ellps=WGS84 +datum=WGS84 +units=m +no"); + add_proj4text (p, 1, "_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 9N\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-129],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32609\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32610, "epsg", 32610, + "WGS 84 / UTM zone 10N"); + add_proj4text (p, 0, + "+proj=utm +zone=10 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 10N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-123],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32610\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32611, "epsg", 32611, + "WGS 84 / UTM zone 11N"); + add_proj4text (p, 0, + "+proj=utm +zone=11 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 11N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-117],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32611\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32612, "epsg", 32612, + "WGS 84 / UTM zone 12N"); + add_proj4text (p, 0, + "+proj=utm +zone=12 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 12N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-111],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32612\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32613, "epsg", 32613, + "WGS 84 / UTM zone 13N"); + add_proj4text (p, 0, + "+proj=utm +zone=13 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 13N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-105],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",0],AUTHORITY[\"EPSG\",\"32613\"],AXIS[\"E"); + add_srs_wkt (p, 11, "asting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32614, "epsg", 32614, + "WGS 84 / UTM zone 14N"); + add_proj4text (p, 0, + "+proj=utm +zone=14 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 14N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-99],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32614\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32615, "epsg", 32615, + "WGS 84 / UTM zone 15N"); + add_proj4text (p, 0, + "+proj=utm +zone=15 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 15N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-93],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32615\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32616, "epsg", 32616, + "WGS 84 / UTM zone 16N"); + add_proj4text (p, 0, + "+proj=utm +zone=16 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 16N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-87],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32616\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32617, "epsg", 32617, + "WGS 84 / UTM zone 17N"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 17N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-81],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32617\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32618, "epsg", 32618, + "WGS 84 / UTM zone 18N"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 18N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-75],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32618\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32619, "epsg", 32619, + "WGS 84 / UTM zone 19N"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 19N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-69],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32619\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32620, "epsg", 32620, + "WGS 84 / UTM zone 20N"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 20N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-63],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32620\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32621, "epsg", 32621, + "WGS 84 / UTM zone 21N"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 21N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-57],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32621\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32622, "epsg", 32622, + "WGS 84 / UTM zone 22N"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 22N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-51],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32622\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32623, "epsg", 32623, + "WGS 84 / UTM zone 23N"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 23N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-45],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32623\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32624, "epsg", 32624, + "WGS 84 / UTM zone 24N"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 24N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-39],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32624\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32625, "epsg", 32625, + "WGS 84 / UTM zone 25N"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 25N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-33],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32625\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32626, "epsg", 32626, + "WGS 84 / UTM zone 26N"); + add_proj4text (p, 0, + "+proj=utm +zone=26 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 26N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-27],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32626\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32627, "epsg", 32627, + "WGS 84 / UTM zone 27N"); + add_proj4text (p, 0, + "+proj=utm +zone=27 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 27N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-21],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32627\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32628, "epsg", 32628, + "WGS 84 / UTM zone 28N"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 28N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-15],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32628\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32629, "epsg", 32629, + "WGS 84 / UTM zone 29N"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 29N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32629\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32630, "epsg", 32630, + "WGS 84 / UTM zone 30N"); + add_proj4text (p, 0, + "+proj=utm +zone=30 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 30N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-3],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32630\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32631, "epsg", 32631, + "WGS 84 / UTM zone 31N"); + add_proj4text (p, 0, + "+proj=utm +zone=31 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 31N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",3],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",0],AUTHORITY[\"EPSG\",\"32631\"],AXIS[\"East"); + add_srs_wkt (p, 11, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32632, "epsg", 32632, + "WGS 84 / UTM zone 32N"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",9],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",0],AUTHORITY[\"EPSG\",\"32632\"],AXIS[\"East"); + add_srs_wkt (p, 11, "ing\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32633, "epsg", 32633, + "WGS 84 / UTM zone 33N"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 33N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",15],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32633\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32634, "epsg", 32634, + "WGS 84 / UTM zone 34N"); + add_proj4text (p, 0, + "+proj=utm +zone=34 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 34N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",21],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32634\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32635, "epsg", 32635, + "WGS 84 / UTM zone 35N"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 35N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",27],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32635\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32636, "epsg", 32636, + "WGS 84 / UTM zone 36N"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 36N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",33],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32636\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32637, "epsg", 32637, + "WGS 84 / UTM zone 37N"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 37N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",39],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32637\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32638, "epsg", 32638, + "WGS 84 / UTM zone 38N"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 38N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",45],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32638\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32639, "epsg", 32639, + "WGS 84 / UTM zone 39N"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 39N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",51],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32639\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32640, "epsg", 32640, + "WGS 84 / UTM zone 40N"); + add_proj4text (p, 0, + "+proj=utm +zone=40 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 40N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",57],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32640\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32641, "epsg", 32641, + "WGS 84 / UTM zone 41N"); + add_proj4text (p, 0, + "+proj=utm +zone=41 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 41N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",63],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32641\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32642, "epsg", 32642, + "WGS 84 / UTM zone 42N"); + add_proj4text (p, 0, + "+proj=utm +zone=42 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 42N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",69],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32642\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32643, "epsg", 32643, + "WGS 84 / UTM zone 43N"); + add_proj4text (p, 0, + "+proj=utm +zone=43 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 43N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",75],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32643\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32644, "epsg", 32644, + "WGS 84 / UTM zone 44N"); + add_proj4text (p, 0, + "+proj=utm +zone=44 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 44N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",81],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32644\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32645, "epsg", 32645, + "WGS 84 / UTM zone 45N"); + add_proj4text (p, 0, + "+proj=utm +zone=45 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 45N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",87],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32645\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32646, "epsg", 32646, + "WGS 84 / UTM zone 46N"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 46N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",93],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32646\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32647, "epsg", 32647, + "WGS 84 / UTM zone 47N"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 47N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",99],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",0],AUTHORITY[\"EPSG\",\"32647\"],AXIS[\"Eas"); + add_srs_wkt (p, 11, "ting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32648, "epsg", 32648, + "WGS 84 / UTM zone 48N"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 48N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",105],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32648\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32649, "epsg", 32649, + "WGS 84 / UTM zone 49N"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 49N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",111],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32649\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32650, "epsg", 32650, + "WGS 84 / UTM zone 50N"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 50N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",117],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32650\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32651, "epsg", 32651, + "WGS 84 / UTM zone 51N"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 51N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",123],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32651\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32652, "epsg", 32652, + "WGS 84 / UTM zone 52N"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 52N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",129],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32652\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32653, "epsg", 32653, + "WGS 84 / UTM zone 53N"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 53N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",135],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32653\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32654, "epsg", 32654, + "WGS 84 / UTM zone 54N"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 54N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",141],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32654\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32655, "epsg", 32655, + "WGS 84 / UTM zone 55N"); + add_proj4text (p, 0, + "+proj=utm +zone=55 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 55N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",147],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32655\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32656, "epsg", 32656, + "WGS 84 / UTM zone 56N"); + add_proj4text (p, 0, + "+proj=utm +zone=56 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 56N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",153],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32656\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32657, "epsg", 32657, + "WGS 84 / UTM zone 57N"); + add_proj4text (p, 0, + "+proj=utm +zone=57 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 57N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",159],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32657\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32658, "epsg", 32658, + "WGS 84 / UTM zone 58N"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 58N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",165],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32658\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32659, "epsg", 32659, + "WGS 84 / UTM zone 59N"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 59N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",171],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32659\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32660, "epsg", 32660, + "WGS 84 / UTM zone 60N"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +ellps=WGS84 +datum=WGS84 +units=m +n"); + add_proj4text (p, 1, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 60N\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",177],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",0],AUTHORITY[\"EPSG\",\"32660\"],AXIS[\"Ea"); + add_srs_wkt (p, 11, "sting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32661, "epsg", 32661, "WGS 84 / UPS North"); + add_proj4text (p, 0, + "+proj=stere +lat_0=90 +lat_ts=90 +lon_0=0 +k=0.994 +x_0="); + add_proj4text (p, 1, + "2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m "); + add_proj4text (p, 2, "+no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UPS North\",GEOGCS[\"WGS 84\",DATUM[\""); + add_srs_wkt (p, 1, + "WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]]"); + add_srs_wkt (p, 3, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 4, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 5, + "122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 6, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_Stereogr"); + add_srs_wkt (p, 7, + "aphic\"],PARAMETER[\"latitude_of_origin\",90],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",0],PARAMETER[\"scale_factor\",0.994"); + add_srs_wkt (p, 9, + "],PARAMETER[\"false_easting\",2000000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",2000000],AUTHORITY[\"EPSG\",\"32661\"],AXIS["); + add_srs_wkt (p, 11, "\"Northing\",UNKNOWN],AXIS[\"Easting\",UNKNOWN]]"); + p = add_epsg_def (first, last, 32662, "epsg", 32662, + "WGS 84 / Plate Carree (deprecated)"); + add_proj4text (p, 0, + "+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ell"); + add_proj4text (p, 1, "ps=WGS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / Plate Carree (deprecated)\",GEOGCS[\"W"); + add_srs_wkt (p, 1, + "GS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,2"); + add_srs_wkt (p, 2, + "98.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"E"); + add_srs_wkt (p, 3, + "PSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG"); + add_srs_wkt (p, 4, + "\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHOR"); + add_srs_wkt (p, 5, + "ITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UN"); + add_srs_wkt (p, 6, + "IT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION["); + add_srs_wkt (p, 7, + "\"Equirectangular\"],PARAMETER[\"latitude_of_origin\",0]"); + add_srs_wkt (p, 8, + ",PARAMETER[\"central_meridian\",0],PARAMETER[\"false_eas"); + add_srs_wkt (p, 9, + "ting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EP"); + add_srs_wkt (p, 10, "SG\",\"32662\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]"); + p = add_epsg_def (first, last, 32664, "epsg", 32664, + "WGS 84 / BLM 14N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-99 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=us-ft +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / BLM 14N (ftUS)\",GEOGCS[\"WGS 84\",DAT"); + add_srs_wkt (p, 1, + "UM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.25722356"); + add_srs_wkt (p, 2, + "3,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"632"); + add_srs_wkt (p, 3, + "6\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"US surv"); + add_srs_wkt (p, 6, + "ey foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-99],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",1640416.67],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"32664\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 12, "H]]"); + p = add_epsg_def (first, last, 32665, "epsg", 32665, + "WGS 84 / BLM 15N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-93 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=us-ft +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / BLM 15N (ftUS)\",GEOGCS[\"WGS 84\",DAT"); + add_srs_wkt (p, 1, + "UM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.25722356"); + add_srs_wkt (p, 2, + "3,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"632"); + add_srs_wkt (p, 3, + "6\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"US surv"); + add_srs_wkt (p, 6, + "ey foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-93],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",1640416.67],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"32665\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 12, "H]]"); + p = add_epsg_def (first, last, 32666, "epsg", 32666, + "WGS 84 / BLM 16N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-87 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=us-ft +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / BLM 16N (ftUS)\",GEOGCS[\"WGS 84\",DAT"); + add_srs_wkt (p, 1, + "UM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.25722356"); + add_srs_wkt (p, 2, + "3,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"632"); + add_srs_wkt (p, 3, + "6\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"US surv"); + add_srs_wkt (p, 6, + "ey foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-87],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",1640416.67],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"32666\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 12, "H]]"); + p = add_epsg_def (first, last, 32667, "epsg", 32667, + "WGS 84 / BLM 17N (ftUS)"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=-81 +k=0.9996 +x_0=500000.00"); + add_proj4text (p, 1, + "1016002 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=us-ft +n"); + add_proj4text (p, 2, "o_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / BLM 17N (ftUS)\",GEOGCS[\"WGS 84\",DAT"); + add_srs_wkt (p, 1, + "UM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.25722356"); + add_srs_wkt (p, 2, + "3,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"632"); + add_srs_wkt (p, 3, + "6\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\""); + add_srs_wkt (p, 4, + "]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\""); + add_srs_wkt (p, 5, + ",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"US surv"); + add_srs_wkt (p, 6, + "ey foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\""); + add_srs_wkt (p, 7, + "]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latit"); + add_srs_wkt (p, 8, + "ude_of_origin\",0],PARAMETER[\"central_meridian\",-81],P"); + add_srs_wkt (p, 9, + "ARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_east"); + add_srs_wkt (p, 10, + "ing\",1640416.67],PARAMETER[\"false_northing\",0],AUTHOR"); + add_srs_wkt (p, 11, + "ITY[\"EPSG\",\"32667\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORT"); + add_srs_wkt (p, 12, "H]]"); + p = add_epsg_def (first, last, 32701, "epsg", 32701, + "WGS 84 / UTM zone 1S"); + add_proj4text (p, 0, + "+proj=utm +zone=1 +south +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 1S\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-177],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32701\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32702, "epsg", 32702, + "WGS 84 / UTM zone 2S"); + add_proj4text (p, 0, + "+proj=utm +zone=2 +south +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 2S\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-171],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32702\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32703, "epsg", 32703, + "WGS 84 / UTM zone 3S"); + add_proj4text (p, 0, + "+proj=utm +zone=3 +south +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 3S\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-165],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32703\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32704, "epsg", 32704, + "WGS 84 / UTM zone 4S"); + add_proj4text (p, 0, + "+proj=utm +zone=4 +south +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 4S\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-159],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32704\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32705, "epsg", 32705, + "WGS 84 / UTM zone 5S"); + add_proj4text (p, 0, + "+proj=utm +zone=5 +south +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 5S\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-153],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32705\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32706, "epsg", 32706, + "WGS 84 / UTM zone 6S"); + add_proj4text (p, 0, + "+proj=utm +zone=6 +south +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 6S\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-147],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32706\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32707, "epsg", 32707, + "WGS 84 / UTM zone 7S"); + add_proj4text (p, 0, + "+proj=utm +zone=7 +south +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 7S\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-141],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32707\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32708, "epsg", 32708, + "WGS 84 / UTM zone 8S"); + add_proj4text (p, 0, + "+proj=utm +zone=8 +south +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 8S\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-135],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32708\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32709, "epsg", 32709, + "WGS 84 / UTM zone 9S"); + add_proj4text (p, 0, + "+proj=utm +zone=9 +south +ellps=WGS84 +datum=WGS84 +unit"); + add_proj4text (p, 1, "s=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 9S\",GEOGCS[\"WGS 84\",DATUM["); + add_srs_wkt (p, 1, + "\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,A"); + add_srs_wkt (p, 2, + "UTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-129],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32709\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32710, "epsg", 32710, + "WGS 84 / UTM zone 10S"); + add_proj4text (p, 0, + "+proj=utm +zone=10 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 10S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-123],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32710\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32711, "epsg", 32711, + "WGS 84 / UTM zone 11S"); + add_proj4text (p, 0, + "+proj=utm +zone=11 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 11S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-117],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32711\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32712, "epsg", 32712, + "WGS 84 / UTM zone 12S"); + add_proj4text (p, 0, + "+proj=utm +zone=12 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 12S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-111],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32712\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32713, "epsg", 32713, + "WGS 84 / UTM zone 13S"); + add_proj4text (p, 0, + "+proj=utm +zone=13 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 13S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-105],PARAMETER[\"scale_factor\",0."); + add_srs_wkt (p, 9, + "9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fa"); + add_srs_wkt (p, 10, + "lse_northing\",10000000],AUTHORITY[\"EPSG\",\"32713\"],A"); + add_srs_wkt (p, 11, "XIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32714, "epsg", 32714, + "WGS 84 / UTM zone 14S"); + add_proj4text (p, 0, + "+proj=utm +zone=14 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 14S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-99],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32714\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32715, "epsg", 32715, + "WGS 84 / UTM zone 15S"); + add_proj4text (p, 0, + "+proj=utm +zone=15 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 15S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-93],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32715\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32716, "epsg", 32716, + "WGS 84 / UTM zone 16S"); + add_proj4text (p, 0, + "+proj=utm +zone=16 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 16S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-87],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32716\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32717, "epsg", 32717, + "WGS 84 / UTM zone 17S"); + add_proj4text (p, 0, + "+proj=utm +zone=17 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 17S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-81],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32717\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32718, "epsg", 32718, + "WGS 84 / UTM zone 18S"); + add_proj4text (p, 0, + "+proj=utm +zone=18 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 18S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-75],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32718\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32719, "epsg", 32719, + "WGS 84 / UTM zone 19S"); + add_proj4text (p, 0, + "+proj=utm +zone=19 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 19S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-69],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32719\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32720, "epsg", 32720, + "WGS 84 / UTM zone 20S"); + add_proj4text (p, 0, + "+proj=utm +zone=20 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 20S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-63],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32720\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32721, "epsg", 32721, + "WGS 84 / UTM zone 21S"); + add_proj4text (p, 0, + "+proj=utm +zone=21 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 21S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-57],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32721\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32722, "epsg", 32722, + "WGS 84 / UTM zone 22S"); + add_proj4text (p, 0, + "+proj=utm +zone=22 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 22S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-51],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32722\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32723, "epsg", 32723, + "WGS 84 / UTM zone 23S"); + add_proj4text (p, 0, + "+proj=utm +zone=23 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 23S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-45],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32723\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32724, "epsg", 32724, + "WGS 84 / UTM zone 24S"); + add_proj4text (p, 0, + "+proj=utm +zone=24 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 24S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-39],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32724\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32725, "epsg", 32725, + "WGS 84 / UTM zone 25S"); + add_proj4text (p, 0, + "+proj=utm +zone=25 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 25S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-33],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32725\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32726, "epsg", 32726, + "WGS 84 / UTM zone 26S"); + add_proj4text (p, 0, + "+proj=utm +zone=26 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 26S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-27],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32726\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32727, "epsg", 32727, + "WGS 84 / UTM zone 27S"); + add_proj4text (p, 0, + "+proj=utm +zone=27 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 27S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-21],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32727\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32728, "epsg", 32728, + "WGS 84 / UTM zone 28S"); + add_proj4text (p, 0, + "+proj=utm +zone=28 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 28S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-15],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32728\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32729, "epsg", 32729, + "WGS 84 / UTM zone 29S"); + add_proj4text (p, 0, + "+proj=utm +zone=29 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 29S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-9],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32729\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32730, "epsg", 32730, + "WGS 84 / UTM zone 30S"); + add_proj4text (p, 0, + "+proj=utm +zone=30 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 30S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",-3],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32730\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32731, "epsg", 32731, + "WGS 84 / UTM zone 31S"); + add_proj4text (p, 0, + "+proj=utm +zone=31 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 31S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",3],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"32731\"],AXIS"); + add_srs_wkt (p, 11, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32732, "epsg", 32732, + "WGS 84 / UTM zone 32S"); + add_proj4text (p, 0, + "+proj=utm +zone=32 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 32S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",9],PARAMETER[\"scale_factor\",0.999"); + add_srs_wkt (p, 9, + "6],PARAMETER[\"false_easting\",500000],PARAMETER[\"false"); + add_srs_wkt (p, 10, + "_northing\",10000000],AUTHORITY[\"EPSG\",\"32732\"],AXIS"); + add_srs_wkt (p, 11, "[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32733, "epsg", 32733, + "WGS 84 / UTM zone 33S"); + add_proj4text (p, 0, + "+proj=utm +zone=33 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 33S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",15],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32733\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32734, "epsg", 32734, + "WGS 84 / UTM zone 34S"); + add_proj4text (p, 0, + "+proj=utm +zone=34 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 34S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",21],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32734\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32735, "epsg", 32735, + "WGS 84 / UTM zone 35S"); + add_proj4text (p, 0, + "+proj=utm +zone=35 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 35S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",27],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32735\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32736, "epsg", 32736, + "WGS 84 / UTM zone 36S"); + add_proj4text (p, 0, + "+proj=utm +zone=36 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 36S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",33],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32736\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32737, "epsg", 32737, + "WGS 84 / UTM zone 37S"); + add_proj4text (p, 0, + "+proj=utm +zone=37 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 37S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",39],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32737\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32738, "epsg", 32738, + "WGS 84 / UTM zone 38S"); + add_proj4text (p, 0, + "+proj=utm +zone=38 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 38S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",45],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32738\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32739, "epsg", 32739, + "WGS 84 / UTM zone 39S"); + add_proj4text (p, 0, + "+proj=utm +zone=39 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 39S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",51],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32739\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32740, "epsg", 32740, + "WGS 84 / UTM zone 40S"); + add_proj4text (p, 0, + "+proj=utm +zone=40 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 40S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",57],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32740\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32741, "epsg", 32741, + "WGS 84 / UTM zone 41S"); + add_proj4text (p, 0, + "+proj=utm +zone=41 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 41S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",63],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32741\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32742, "epsg", 32742, + "WGS 84 / UTM zone 42S"); + add_proj4text (p, 0, + "+proj=utm +zone=42 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 42S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",69],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32742\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32743, "epsg", 32743, + "WGS 84 / UTM zone 43S"); + add_proj4text (p, 0, + "+proj=utm +zone=43 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 43S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",75],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32743\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32744, "epsg", 32744, + "WGS 84 / UTM zone 44S"); + add_proj4text (p, 0, + "+proj=utm +zone=44 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 44S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",81],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32744\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32745, "epsg", 32745, + "WGS 84 / UTM zone 45S"); + add_proj4text (p, 0, + "+proj=utm +zone=45 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 45S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",87],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32745\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32746, "epsg", 32746, + "WGS 84 / UTM zone 46S"); + add_proj4text (p, 0, + "+proj=utm +zone=46 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 46S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",93],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32746\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32747, "epsg", 32747, + "WGS 84 / UTM zone 47S"); + add_proj4text (p, 0, + "+proj=utm +zone=47 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 47S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",99],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "96],PARAMETER[\"false_easting\",500000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",10000000],AUTHORITY[\"EPSG\",\"32747\"],AXI"); + add_srs_wkt (p, 11, "S[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32748, "epsg", 32748, + "WGS 84 / UTM zone 48S"); + add_proj4text (p, 0, + "+proj=utm +zone=48 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 48S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",105],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32748\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32749, "epsg", 32749, + "WGS 84 / UTM zone 49S"); + add_proj4text (p, 0, + "+proj=utm +zone=49 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 49S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",111],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32749\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32750, "epsg", 32750, + "WGS 84 / UTM zone 50S"); + add_proj4text (p, 0, + "+proj=utm +zone=50 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 50S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",117],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32750\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32751, "epsg", 32751, + "WGS 84 / UTM zone 51S"); + add_proj4text (p, 0, + "+proj=utm +zone=51 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 51S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",123],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32751\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32752, "epsg", 32752, + "WGS 84 / UTM zone 52S"); + add_proj4text (p, 0, + "+proj=utm +zone=52 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 52S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",129],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32752\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32753, "epsg", 32753, + "WGS 84 / UTM zone 53S"); + add_proj4text (p, 0, + "+proj=utm +zone=53 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 53S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",135],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32753\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32754, "epsg", 32754, + "WGS 84 / UTM zone 54S"); + add_proj4text (p, 0, + "+proj=utm +zone=54 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 54S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",141],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32754\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32755, "epsg", 32755, + "WGS 84 / UTM zone 55S"); + add_proj4text (p, 0, + "+proj=utm +zone=55 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 55S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",147],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32755\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); +} + +static void +initialize_epsg_29 (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ + struct epsg_defs *p; + p = add_epsg_def (first, last, 32756, "epsg", 32756, + "WGS 84 / UTM zone 56S"); + add_proj4text (p, 0, + "+proj=utm +zone=56 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 56S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",153],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32756\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32757, "epsg", 32757, + "WGS 84 / UTM zone 57S"); + add_proj4text (p, 0, + "+proj=utm +zone=57 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 57S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",159],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32757\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32758, "epsg", 32758, + "WGS 84 / UTM zone 58S"); + add_proj4text (p, 0, + "+proj=utm +zone=58 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 58S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",165],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32758\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32759, "epsg", 32759, + "WGS 84 / UTM zone 59S"); + add_proj4text (p, 0, + "+proj=utm +zone=59 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 59S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",171],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32759\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32760, "epsg", 32760, + "WGS 84 / UTM zone 60S"); + add_proj4text (p, 0, + "+proj=utm +zone=60 +south +ellps=WGS84 +datum=WGS84 +uni"); + add_proj4text (p, 1, "ts=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UTM zone 60S\",GEOGCS[\"WGS 84\",DATUM"); + add_srs_wkt (p, 1, + "[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,"); + add_srs_wkt (p, 2, + "AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\""); + add_srs_wkt (p, 3, + "]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"); + add_srs_wkt (p, 4, + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\""); + add_srs_wkt (p, 5, + "9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,"); + add_srs_wkt (p, 6, + "AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Me"); + add_srs_wkt (p, 7, + "rcator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER["); + add_srs_wkt (p, 8, + "\"central_meridian\",177],PARAMETER[\"scale_factor\",0.9"); + add_srs_wkt (p, 9, + "996],PARAMETER[\"false_easting\",500000],PARAMETER[\"fal"); + add_srs_wkt (p, 10, + "se_northing\",10000000],AUTHORITY[\"EPSG\",\"32760\"],AX"); + add_srs_wkt (p, 11, "IS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); + p = add_epsg_def (first, last, 32761, "epsg", 32761, "WGS 84 / UPS South"); + add_proj4text (p, 0, + "+proj=stere +lat_0=-90 +lat_ts=-90 +lon_0=0 +k=0.994 +x_"); + add_proj4text (p, 1, + "0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units="); + add_proj4text (p, 2, "m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / UPS South\",GEOGCS[\"WGS 84\",DATUM[\""); + add_srs_wkt (p, 1, + "WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUT"); + add_srs_wkt (p, 2, + "HORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]]"); + add_srs_wkt (p, 3, + ",PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UN"); + add_srs_wkt (p, 4, + "IT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9"); + add_srs_wkt (p, 5, + "122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,A"); + add_srs_wkt (p, 6, + "UTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Polar_Stereogr"); + add_srs_wkt (p, 7, + "aphic\"],PARAMETER[\"latitude_of_origin\",-90],PARAMETER"); + add_srs_wkt (p, 8, + "[\"central_meridian\",0],PARAMETER[\"scale_factor\",0.99"); + add_srs_wkt (p, 9, + "4],PARAMETER[\"false_easting\",2000000],PARAMETER[\"fals"); + add_srs_wkt (p, 10, + "e_northing\",2000000],AUTHORITY[\"EPSG\",\"32761\"],AXIS"); + add_srs_wkt (p, 11, "[\"Northing\",UNKNOWN],AXIS[\"Easting\",UNKNOWN]]"); + p = add_epsg_def (first, last, 32766, "epsg", 32766, "WGS 84 / TM 36 SE"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=36 +k=0.9996 +x_0=500000 +y_"); + add_proj4text (p, 1, + "0=10000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"); + add_srs_wkt (p, 0, + "PROJCS[\"WGS 84 / TM 36 SE\",GEOGCS[\"WGS 84\",DATUM[\"W"); + add_srs_wkt (p, 1, + "GS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTH"); + add_srs_wkt (p, 2, + "ORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],"); + add_srs_wkt (p, 3, + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNI"); + add_srs_wkt (p, 4, + "T[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"91"); + add_srs_wkt (p, 5, + "22\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,AU"); + add_srs_wkt (p, 6, + "THORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Transverse_Merc"); + add_srs_wkt (p, 7, + "ator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\""); + add_srs_wkt (p, 8, + "central_meridian\",36],PARAMETER[\"scale_factor\",0.9996"); + add_srs_wkt (p, 9, + "],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_"); + add_srs_wkt (p, 10, + "northing\",10000000],AUTHORITY[\"EPSG\",\"32766\"],AXIS["); + add_srs_wkt (p, 11, "\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); +#if OMIT_EPSG == 0 /* resuming conditional EPSG initialization */ + + p = add_epsg_def (first, last, 40000, "gfoss.it", 40000, + "Italy mainland zone 1 GB Roma40"); + add_proj4text (p, 0, + "+proj=tmerc+lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_"); + add_proj4text (p, 1, + "0=0 +ellps=intl +units=m +towgs84=-104.1,-49.1,-9.9,0.97"); + add_proj4text (p, 2, "1,-2.917,0.714,-11.68 +no_defs"); + add_srs_wkt (p, 0, ""); + p = add_epsg_def (first, last, 40001, "gfoss.it", 40001, + "Italy mainland zone 2 GB Roma40"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=2520000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +units=m +towgs84=-104.1,-49.1,-9.9,0.9"); + add_proj4text (p, 2, "71,-2.917,0.714,-11.68 +no_defs"); + add_srs_wkt (p, 0, ""); + p = add_epsg_def (first, last, 40002, "gfoss.it", 40002, + "Italy Sardinia GB Roma40"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +units=m +towgs84=-168.6,-34.0,38.6,-0."); + add_proj4text (p, 2, "374,-0.679,-1.379,-9.48 +no_defs"); + add_srs_wkt (p, 0, ""); + p = add_epsg_def (first, last, 40003, "gfoss.it", 40003, + "Italy Sicily GB Roma40"); + add_proj4text (p, 0, + "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y"); + add_proj4text (p, 1, + "_0=0 +ellps=intl +units=m +towgs84=-50.2,-50.4,84.8,-0.6"); + add_proj4text (p, 2, "90,-2.012,0.459,-28.08 +no_defs"); + add_srs_wkt (p, 0, ""); +#endif /* full EPSG initialization enabled/disabled */ +} + +static void +initialize_epsg (struct epsg_defs **first, struct epsg_defs **last) +{ +/* initializing the EPSG defs list */ + initialize_epsg_00 (first, last); + initialize_epsg_01 (first, last); + initialize_epsg_02 (first, last); + initialize_epsg_03 (first, last); + initialize_epsg_04 (first, last); + initialize_epsg_05 (first, last); + initialize_epsg_06 (first, last); + initialize_epsg_07 (first, last); + initialize_epsg_08 (first, last); + initialize_epsg_09 (first, last); + initialize_epsg_10 (first, last); + initialize_epsg_11 (first, last); + initialize_epsg_12 (first, last); + initialize_epsg_13 (first, last); + initialize_epsg_14 (first, last); + initialize_epsg_15 (first, last); + initialize_epsg_16 (first, last); + initialize_epsg_17 (first, last); + initialize_epsg_18 (first, last); + initialize_epsg_19 (first, last); + initialize_epsg_20 (first, last); + initialize_epsg_21 (first, last); + initialize_epsg_22 (first, last); + initialize_epsg_23 (first, last); + initialize_epsg_24 (first, last); + initialize_epsg_25 (first, last); + initialize_epsg_26 (first, last); + initialize_epsg_27 (first, last); + initialize_epsg_28 (first, last); + initialize_epsg_29 (first, last); +} + +static void +free_epsg (struct epsg_defs *first) +{ +/* memory cleanup - destroying the EPSG list */ + struct epsg_defs *p = first; + struct epsg_defs *pn; + while (p) + { + pn = p->next; + free_epsg_def (p); + p = pn; + } +} + +static int +populate_spatial_ref_sys (sqlite3 * handle) +{ +/* populating the EPSG dataset into the SPATIAL_REF_SYS table */ + struct epsg_defs *first = NULL; + struct epsg_defs *last = NULL; + struct epsg_defs *p; + char sql[1024]; + char *errMsg = NULL; + int ret; + sqlite3_stmt *stmt; + +/* initializing the EPSG defs list */ + initialize_epsg (&first, &last); + +/* starting a transaction */ + ret = sqlite3_exec (handle, "BEGIN", NULL, 0, &errMsg); + if (ret != SQLITE_OK) + { + fprintf (stderr, "%s\n", errMsg); + sqlite3_free (errMsg); + goto error; + } + +/* preparing the SQL parameterized statement */ + strcpy (sql, "INSERT INTO spatial_ref_sys "); + strcat (sql, + "(srid, auth_name, auth_srid, ref_sys_name, proj4text, srs_wkt) "); + strcat (sql, "VALUES (?, ?, ?, ?, ?, ?)"); + ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL); + if (ret != SQLITE_OK) + { + fprintf (stderr, "%s\n", sqlite3_errmsg (handle)); + goto error; + } + p = first; + while (p) + { + if (p->srid < 0 || p->auth_name == NULL) + break; + sqlite3_reset (stmt); + sqlite3_clear_bindings (stmt); + sqlite3_bind_int (stmt, 1, p->srid); + sqlite3_bind_text (stmt, 2, p->auth_name, strlen (p->auth_name), + SQLITE_STATIC); + sqlite3_bind_int (stmt, 3, p->auth_srid); + sqlite3_bind_text (stmt, 4, p->ref_sys_name, strlen (p->ref_sys_name), + SQLITE_STATIC); + sqlite3_bind_text (stmt, 5, p->proj4text, strlen (p->proj4text), + SQLITE_STATIC); + if (strlen (p->srs_wkt) == 0) + sqlite3_bind_null (stmt, 6); + else + sqlite3_bind_text (stmt, 6, p->srs_wkt, strlen (p->srs_wkt), + SQLITE_STATIC); + ret = sqlite3_step (stmt); + if (ret == SQLITE_DONE || ret == SQLITE_ROW) + ; + else + { + fprintf (stderr, "%s\n", sqlite3_errmsg (handle)); + sqlite3_finalize (stmt); + goto error; + } + p = p->next; + } + sqlite3_finalize (stmt); + +/* confirming the transaction */ + ret = sqlite3_exec (handle, "COMMIT", NULL, 0, &errMsg); + if (ret != SQLITE_OK) + { + fprintf (stderr, "%s\n", errMsg); + sqlite3_free (errMsg); + goto error; + } + +/* freeing the EPSG defs list */ + free_epsg (first); + + return 1; + error: +/* trying to perform a ROLLBACK anyway */ + ret = sqlite3_exec (handle, "ROLLBACK", NULL, 0, &errMsg); + if (ret != SQLITE_OK) + { + fprintf (stderr, "%s\n", errMsg); + sqlite3_free (errMsg); + } + +/* freeing the EPSG defs list */ + free_epsg (first); + + return 0; +} + +static int +exists_spatial_ref_sys (sqlite3 * handle) +{ +/* checking if the SPATIAL_REF_SYS table exists */ + int ret; + int ok = 0; + char sql[1024]; + char **results; + int n_rows; + int n_columns; + char *err_msg = NULL; + + strcpy (sql, + "SELECT name FROM sqlite_master WHERE type = 'table' AND name LIKE 'spatial_ref_sys'"); + ret = + sqlite3_get_table (handle, sql, &results, &n_rows, &n_columns, + &err_msg); + if (ret != SQLITE_OK) + { +/* some error occurred */ + fprintf (stderr, "XX %s\n", err_msg); + sqlite3_free (err_msg); + return 0; + } + if (n_rows > 0) + ok = 1; + sqlite3_free_table (results); + return ok; +} + +static int +check_spatial_ref_sys (sqlite3 * handle) +{ +/* checking if the SPATIAL_REF_SYS table has an appropriate layout */ + int ret; + int i; + const char *name; + char sql[1024]; + char **results; + int n_rows; + int n_columns; + char *err_msg = NULL; + int rs_srid = 0; + int auth_name = 0; + int auth_srid = 0; + int srtext = 0; + int ref_sys_name = 0; + int proj4text = 0; + int srs_wkt = 0; + + strcpy (sql, "PRAGMA table_info(spatial_ref_sys)"); + ret = + sqlite3_get_table (handle, sql, &results, &n_rows, &n_columns, + &err_msg); + if (ret != SQLITE_OK) + { +/* some error occurred */ + fprintf (stderr, "%s\n", err_msg); + sqlite3_free (err_msg); + return 0; + } + if (n_rows > 0) + { + for (i = 1; i <= n_rows; i++) + { + name = results[(i * n_columns) + 1]; + if (strcasecmp (name, "srid") == 0) + rs_srid = 1; + if (strcasecmp (name, "auth_name") == 0) + auth_name = 1; + if (strcasecmp (name, "auth_srid") == 0) + auth_srid = 1; + if (strcasecmp (name, "srtext") == 0) + srtext = 1; + if (strcasecmp (name, "ref_sys_name") == 0) + ref_sys_name = 1; + if (strcasecmp (name, "proj4text") == 0) + proj4text = 1; + if (strcasecmp (name, "srs_wkt") == 0) + srs_wkt = 1; + } + } + sqlite3_free_table (results); + if (rs_srid && auth_name && auth_srid && ref_sys_name && proj4text + && srs_wkt) + ret = 1; + else + ret = 0; + return ret; +} + +static int +spatial_ref_sys_count (sqlite3 * handle) +{ +/* checking if the SPATIAL_REF_SYS table is empty */ + int ret; + int i; + int count = 0; + char sql[1024]; + char **results; + int n_rows; + int n_columns; + char *err_msg = NULL; + + strcpy (sql, "SELECT Count(*) FROM spatial_ref_sys"); + ret = + sqlite3_get_table (handle, sql, &results, &n_rows, &n_columns, + &err_msg); + if (ret != SQLITE_OK) + { +/* some error occurred */ + fprintf (stderr, "%s\n", err_msg); + sqlite3_free (err_msg); + return 0; + } + if (n_rows > 0) + { + for (i = 1; i <= n_rows; i++) + { + count = atoi (results[(i * n_columns) + 0]); + } + } + sqlite3_free_table (results); + return count; +} + +SPATIALITE_DECLARE void +spatial_ref_sys_init (sqlite3 * handle, int verbose) +{ +/* populating the EPSG dataset into the SPATIAL_REF_SYS table */ + if (!exists_spatial_ref_sys (handle)) + { + if (verbose) + fprintf (stderr, "the SPATIAL_REF_SYS table doesn't exists\n"); + return; + } + if (!check_spatial_ref_sys (handle)) + { + if (verbose) + fprintf (stderr, + "the SPATIAL_REF_SYS table has an unsupported layout\n"); + return; + } + if (spatial_ref_sys_count (handle)) + { + if (verbose) + fprintf (stderr, + "the SPATIAL_REF_SYS table already contains some row(s)\n"); + return; + } + if (populate_spatial_ref_sys (handle)) + { + if (verbose) + fprintf (stderr, + "OK: the SPATIAL_REF_SYS table was succesfully populated\n"); + return; + } +} +/**************** End file: srs_init.c **********/ + diff --git a/src/core/spatialite/sqlite3.c b/src/core/spatialite/sqlite3.c index a7e85099752..5609fe8188a 100644 --- a/src/core/spatialite/sqlite3.c +++ b/src/core/spatialite/sqlite3.c @@ -4,9 +4,232 @@ #define SQLITE_API #endif +/* +** the following macros ensure that the sqlite3 +** code internally embedded in SpatiaLite never defines +** any linker symbol potentially conflicting with +** an external sqlite3 library +*/ +#define sqlite3_version SPLite3_version +#define sqlite3_libversion SPLite3_libversion +#define sqlite3_sourceid SPLite3_sourceid +#define sqlite3_libversion_number SPLite3_libversion_number +#define sqlite3_compileoption_used SPLite3_compileoption_used +#define sqlite3_compileoption_get SPLite3_compileoption_get +#define sqlite3_threadsafe SPLite3_threadsafe +#define sqlite3_close SPLite3_close +#define sqlite3_exec SPLite3_exec +#define sqlite3_initialize SPLite3_initialize +#define sqlite3_shutdown SPLite3_shutdown +#define sqlite3_os_init SPLite3_os_init +#define sqlite3_os_end SPLite3_os_end +#define sqlite3_config SPLite3_config +#define sqlite3_db_config SPLite3_db_config +#define sqlite3_extended_result_codes SPLite3_extended_result_codes +#define sqlite3_last_insert_rowid SPLite3_last_insert_rowid +#define sqlite3_changes SPLite3_changes +#define sqlite3_total_changes SPLite3_total_changes +#define sqlite3_interrupt SPLite3_interrupt +#define sqlite3_complete SPLite3_complete +#define sqlite3_complete16 SPLite3_complete16 +#define sqlite3_busy_handler SPLite3_busy_handler +#define sqlite3_busy_timeout SPLite3_busy_timeout +#define sqlite3_get_table SPLite3_get_table +#define sqlite3_free_table SPLite3_free_table +#define sqlite3_mprintf SPLite3_mprintf +#define sqlite3_vmprintf SPLite3_vmprintf +#define sqlite3_snprintf SPLite3_snprintf +#define sqlite3_malloc SPLite3_malloc +#define sqlite3_realloc SPLite3_realloc +#define sqlite3_free SPLite3_free +#define sqlite3_memory_used SPLite3_memory_used +#define sqlite3_memory_highwater SPLite3_memory_highwater +#define sqlite3_randomness SPLite3_randomness +#define sqlite3_set_authorizer SPLite3_set_authorizer +#define sqlite3_trace SPLite3_trace +#define sqlite3_progress_handler SPLite3_progress_handler +#define sqlite3_open SPLite3_open +#define sqlite3_open16 SPLite3_open16 +#define sqlite3_open_v2 SPLite3_open_v2 +#define sqlite3_errcode SPLite3_errcode +#define sqlite3_extended_errcode SPLite3_extended_errcode +#define sqlite3_errmsg SPLite3_errmsg +#define sqlite3_errmsg16 SPLite3_errmsg16 +#define sqlite3_limit SPLite3_limit +#define sqlite3_prepare SPLite3_prepare +#define sqlite3_prepare_v2 SPLite3_prepare_v2 +#define sqlite3_prepare16 SPLite3_prepare16 +#define sqlite3_prepare16_v2 SPLite3_prepare16_v2 +#define sqlite3_sql SPLite3_sql +#define sqlite3_bind_blob SPLite3_bind_blob +#define sqlite3_bind_double SPLite3_bind_double +#define sqlite3_bind_int SPLite3_bind_int +#define sqlite3_bind_int64 SPLite3_bind_int64 +#define sqlite3_bind_null SPLite3_bind_null +#define sqlite3_bind_text SPLite3_bind_text +#define sqlite3_bind_text16 SPLite3_bind_text16 +#define sqlite3_bind_value SPLite3_bind_value +#define sqlite3_bind_zeroblob SPLite3_bind_zeroblob +#define sqlite3_bind_parameter_count SPLite3_bind_parameter_count +#define sqlite3_bind_parameter_name SPLite3_bind_parameter_name +#define sqlite3_bind_parameter_index SPLite3_bind_parameter_index +#define sqlite3_clear_bindings SPLite3_clear_bindings +#define sqlite3_column_count SPLite3_column_count +#define sqlite3_column_name SPLite3_column_name +#define sqlite3_column_name16 SPLite3_column_name16 +#define sqlite3_column_decltype SPLite3_column_decltype +#define sqlite3_column_decltype16 SPLite3_column_decltype16 +#define sqlite3_step SPLite3_step +#define sqlite3_data_count SPLite3_data_count +#define sqlite3_column_blob SPLite3_column_blob +#define sqlite3_column_bytes SPLite3_column_bytes +#define sqlite3_column_bytes16 SPLite3_column_bytes16 +#define sqlite3_column_double SPLite3_column_double +#define sqlite3_column_int SPLite3_column_int +#define sqlite3_column_int64 SPLite3_column_int64 +#define sqlite3_column_text SPLite3_column_text +#define sqlite3_column_text16 SPLite3_column_text16 +#define sqlite3_column_type SPLite3_column_type +#define sqlite3_column_value SPLite3_column_value +#define sqlite3_finalize SPLite3_finalize +#define sqlite3_reset SPLite3_reset +#define sqlite3_create_function SPLite3_create_function +#define sqlite3_create_function16 SPLite3_create_function16 +#define sqlite3_create_function_v2 SPLite3_create_function_v2 +#define sqlite3_value_blob SPLite3_value_blob +#define sqlite3_value_bytes SPLite3_value_bytes +#define sqlite3_value_bytes16 SPLite3_value_bytes16 +#define sqlite3_value_double SPLite3_value_double +#define sqlite3_value_int SPLite3_value_int +#define sqlite3_value_int64 SPLite3_value_int64 +#define sqlite3_value_text SPLite3_value_text +#define sqlite3_value_text16 SPLite3_value_text16 +#define sqlite3_value_text16le SPLite3_value_text16le +#define sqlite3_value_text16be SPLite3_value_text16be +#define sqlite3_value_type SPLite3_value_type +#define sqlite3_value_numeric_type SPLite3_value_numeric_type +#define sqlite3_aggregate_context SPLite3_aggregate_context +#define sqlite3_user_data SPLite3_user_data +#define sqlite3_context_db_handle SPLite3_context_db_handle +#define sqlite3_get_auxdata SPLite3_get_auxdata +#define sqlite3_set_auxdata SPLite3_set_auxdata +#define sqlite3_result_blob SPLite3_result_blob +#define sqlite3_result_double SPLite3_result_double +#define sqlite3_result_error SPLite3_result_error +#define sqlite3_result_error16 SPLite3_result_error16 +#define sqlite3_result_error_toobig SPLite3_result_error_toobig +#define sqlite3_result_error_nomem SPLite3_result_error_nomem +#define sqlite3_result_error_code SPLite3_result_error_code +#define sqlite3_result_int SPLite3_result_int +#define sqlite3_result_int64 SPLite3_result_int64 +#define sqlite3_result_null SPLite3_result_null +#define sqlite3_result_text SPLite3_result_text +#define sqlite3_result_text16 SPLite3_result_text16 +#define sqlite3_result_text16le SPLite3_result_text16le +#define sqlite3_result_text16be SPLite3_result_text16be +#define sqlite3_result_value SPLite3_result_value +#define sqlite3_result_zeroblob SPLite3_result_zeroblob +#define sqlite3_create_collation SPLite3_create_collation +#define sqlite3_create_collation_v2 SPLite3_create_collation_v2 +#define sqlite3_create_collation16 SPLite3_create_collation16 +#define sqlite3_collation_needed SPLite3_collation_needed +#define sqlite3_collation_needed16 SPLite3_collation_needed16 +#define sqlite3_key SPLite3_key +#define sqlite3_rekey SPLite3_rekey +#define sqlite3_activate_see SPLite3_activate_see +#define sqlite3_activate_cerod SPLite3_activate_cerod +#define sqlite3_sleep SPLite3_sleep +#define sqlite3_temp_directory SPLite3_temp_directory +#define sqlite3_get_autocommit SPLite3_get_autocommit +#define sqlite3_db_handle SPLite3_db_handle +#define sqlite3_next_stmt SPLite3_next_stmt +#define sqlite3_commit_hook SPLite3_commit_hook +#define sqlite3_rollback_hook SPLite3_rollback_hook +#define sqlite3_update_hook SPLite3_update_hook +#define sqlite3_enable_shared_cache SPLite3_enable_shared_cache +#define sqlite3_release_memory SPLite3_release_memory +#define sqlite3_soft_heap_limit64 SPLite3_soft_heap_limit64 +#define sqlite3_load_extension SPLite3_load_extension +#define sqlite3_enable_load_extension SPLite3_enable_load_extension +#define sqlite3_auto_extension SPLite3_auto_extension +#define sqlite3_reset_auto_extension SPLite3_reset_auto_extension +#define sqlite3_create_module SPLite3_create_module +#define sqlite3_create_module_v2 SPLite3_create_module_v2 +#define sqlite3_declare_vtab SPLite3_declare_vtab +#define sqlite3_overload_function SPLite3_overload_function +#define sqlite3_blob_open SPLite3_blob_open +#define sqlite3_blob_close SPLite3_blob_close +#define sqlite3_blob_bytes SPLite3_blob_bytes +#define sqlite3_blob_read SPLite3_blob_read +#define sqlite3_blob_write SPLite3_blob_write +#define sqlite3_vfs_find SPLite3_vfs_find +#define sqlite3_vfs_register SPLite3_vfs_register +#define sqlite3_vfs_unregister SPLite3_vfs_unregister +#define sqlite3_mutex_alloc SPLite3_mutex_alloc +#define sqlite3_mutex_free SPLite3_mutex_free +#define sqlite3_mutex_enter SPLite3_mutex_enter +#define sqlite3_mutex_try SPLite3_mutex_try +#define sqlite3_mutex_leave SPLite3_mutex_leave +#define sqlite3_mutex_held SPLite3_mutex_held +#define sqlite3_mutex_notheld SPLite3_mutex_notheld +#define sqlite3_db_mutex SPLite3_db_mutex +#define sqlite3_file_control SPLite3_file_control +#define sqlite3_test_control SPLite3_test_control +#define sqlite3_status SPLite3_status +#define sqlite3_db_status SPLite3_db_status +#define sqlite3_stmt_status SPLite3_stmt_status +#define sqlite3_backup_init SPLite3_backup_init +#define sqlite3_backup_step SPLite3_backup_step +#define sqlite3_backup_finish SPLite3_backup_finish +#define sqlite3_backup_remaining SPLite3_backup_remaining +#define sqlite3_backup_pagecount SPLite3_backup_pagecount +#define sqlite3_unlock_notify SPLite3_unlock_notify +#define sqlite3_strnicmp SPLite3_strnicmp +#define sqlite3_log SPLite3_log +#define sqlite3_wal_hook SPLite3_wal_hook +#define sqlite3_wal_autocheckpoint SPLite3_wal_autocheckpoint +#define sqlite3_wal_checkpoint SPLite3_wal_checkpoint +#define sqlite3_rtree_geometry_callback SPLite3_rtree_geometry_callback +#define sqlite3_memdebug_vfs_oom_test SPLite3_memdebug_vfs_oom_test +#define sqlite3_memory_alarm SPLite3_memory_alarm +#define sqlite3_soft_heap_limit SPLite3_soft_heap_limit +#define sqlite3_io_error_hit SPLite3_io_error_hit +#define sqlite3_io_error_hardhit SPLite3_io_error_hardhit +#define sqlite3_io_error_pending SPLite3_io_error_pending +#define sqlite3_io_error_persist SPLite3_io_error_persist +#define sqlite3_io_error_benign SPLite3_io_error_benign +#define sqlite3_diskfull_pending SPLite3_diskfull_pending +#define sqlite3_diskfull SPLite3_diskfull +#define sqlite3_open_file_count SPLite3_open_file_count +#define sqlite3_sync_count SPLite3_sync_count +#define sqlite3_fullsync_count SPLite3_fullsync_count +#define sqlite3_current_time SPLite3_current_time +#define sqlite3_hostid_num SPLite3_hostid_num +#define sqlite3_os_type SPLite3_os_type +#define sqlite3_win32_mbcs_to_utf8 SPLite3_win32_mbcs_to_utf8 +#define sqlite3_pager_readdb_count SPLite3_pager_readdb_count +#define sqlite3_pager_writedb_count SPLite3_pager_writedb_count +#define sqlite3_pager_writej_count SPLite3_pager_writej_count +#define sqlite3_opentemp_count SPLite3_opentemp_count +#define sqlite3_expired SPLite3_expired +#define sqlite3_aggregate_count SPLite3_aggregate_count +#define sqlite3_transfer_bindings SPLite3_transfer_bindings +#define sqlite3_search_count SPLite3_search_count +#define sqlite3_interrupt_count SPLite3_interrupt_count +#define sqlite3_sort_count SPLite3_sort_count +#define sqlite3_max_blobsize SPLite3_max_blobsize +#define sqlite3_found_count SPLite3_found_count +#define sqlite3_like_count SPLite3_like_count +#define sqlite3_xferopt_count SPLite3_xferopt_count +#define sqlite3_profile SPLite3_profile +#define sqlite3_global_recover SPLite3_global_recover +#define sqlite3_thread_cleanup SPLite3_thread_cleanup +#define sqlite3_fts3_enable_parentheses SPLite3_fts3_enable_parentheses +/* End SpatiaLite alias-MACROs */ + /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.6.20. By combining all the individual C code files into this +** version 3.7.3. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a one translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -99,8 +322,6 @@ ************************************************************************* ** ** This file defines various limits of what SQLite can process. -** -** @(#) $Id: sqliteLimit.h,v 1.10 2009/01/10 16:15:09 danielk1977 Exp $ */ /* @@ -198,6 +419,14 @@ # define SQLITE_DEFAULT_TEMP_CACHE_SIZE 500 #endif +/* +** The default number of frames to accumulate in the log file before +** checkpointing the database in WAL mode. +*/ +#ifndef SQLITE_DEFAULT_WAL_AUTOCHECKPOINT +# define SQLITE_DEFAULT_WAL_AUTOCHECKPOINT 1000 +#endif + /* ** The maximum number of attached databases. This must be between 0 ** and 30. The upper bound on 30 is because a 32-bit integer bitmap @@ -215,20 +444,21 @@ # define SQLITE_MAX_VARIABLE_NUMBER 999 #endif -/* Maximum page size. The upper bound on this value is 32768. This a limit -** imposed by the necessity of storing the value in a 2-byte unsigned integer -** and the fact that the page size must be a power of 2. +/* Maximum page size. The upper bound on this value is 65536. This a limit +** imposed by the use of 16-bit offsets within each page. ** -** If this limit is changed, then the compiled library is technically -** incompatible with an SQLite library compiled with a different limit. If -** a process operating on a database with a page-size of 65536 bytes -** crashes, then an instance of SQLite compiled with the default page-size -** limit will not be able to rollback the aborted transaction. This could -** lead to database corruption. +** Earlier versions of SQLite allowed the user to change this value at +** compile time. This is no longer permitted, on the grounds that it creates +** a library that is technically incompatible with an SQLite library +** compiled with a different limit. If a process operating on a database +** with a page-size of 65536 bytes crashes, then an instance of SQLite +** compiled with the default page-size limit will not be able to rollback +** the aborted transaction. This could lead to database corruption. */ -#ifndef SQLITE_MAX_PAGE_SIZE -# define SQLITE_MAX_PAGE_SIZE 32768 +#ifdef SQLITE_MAX_PAGE_SIZE +# undef SQLITE_MAX_PAGE_SIZE #endif +#define SQLITE_MAX_PAGE_SIZE 65536 /* @@ -285,12 +515,8 @@ ** may be executed. */ #ifndef SQLITE_MAX_TRIGGER_DEPTH -#if defined(SQLITE_SMALL_STACK) -# define SQLITE_MAX_TRIGGER_DEPTH 10 -#else # define SQLITE_MAX_TRIGGER_DEPTH 1000 #endif -#endif /************** End of sqliteLimit.h *****************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ @@ -319,51 +545,59 @@ #include #endif +/* +** The number of samples of an index that SQLite takes in order to +** construct a histogram of the table content when running ANALYZE +** and with SQLITE_ENABLE_STAT2 +*/ #define SQLITE_INDEX_SAMPLES 10 /* -** This macro is used to "hide" some ugliness in casting an int -** value to a ptr value under the MSVC 64-bit compiler. Casting -** non 64-bit values to ptr types results in a "hard" error with -** the MSVC 64-bit compiler which this attempts to avoid. +** The following macros are used to cast pointers to integers and +** integers to pointers. The way you do this varies from one compiler +** to the next, so we have developed the following set of #if statements +** to generate appropriate macros for a wide range of compilers. ** -** A simple compiler pragma or casting sequence could not be found -** to correct this in all situations, so this macro was introduced. -** -** It could be argued that the intptr_t type could be used in this -** case, but that type is not available on all compilers, or -** requires the #include of specific headers which differs between -** platforms. +** The correct "ANSI" way to do this is to use the intptr_t type. +** Unfortunately, that typedef is not available on all compilers, or +** if it is available, it requires an #include of specific headers +** that vary from one machine to the next. ** ** Ticket #3860: The llvm-gcc-4.2 compiler from Apple chokes on ** the ((void*)&((char*)0)[X]) construct. But MSVC chokes on ((void*)(X)). ** So we have to define the macros in different ways depending on the ** compiler. */ -#if defined(__GNUC__) -# if defined(HAVE_STDINT_H) -# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X)) -# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X)) -# else -# define SQLITE_INT_TO_PTR(X) ((void*)(X)) -# define SQLITE_PTR_TO_INT(X) ((int)(X)) -# endif -#else -# define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X]) -# define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0)) +#if defined(__PTRDIFF_TYPE__) /* This case should work for GCC */ +# define SQLITE_INT_TO_PTR(X) ((void*)(__PTRDIFF_TYPE__)(X)) +# define SQLITE_PTR_TO_INT(X) ((int)(__PTRDIFF_TYPE__)(X)) +#elif !defined(__GNUC__) /* Works for compilers other than LLVM */ +# define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X]) +# define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0)) +#elif defined(HAVE_STDINT_H) /* Use this case if we have ANSI headers */ +# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X)) +# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X)) +#else /* Generates a warning - but it always works */ +# define SQLITE_INT_TO_PTR(X) ((void*)(X)) +# define SQLITE_PTR_TO_INT(X) ((int)(X)) #endif - /* -** The SQLITE_THREADSAFE macro must be defined as either 0 or 1. +** The SQLITE_THREADSAFE macro must be defined as 0, 1, or 2. +** 0 means mutexes are permanently disable and the library is never +** threadsafe. 1 means the library is serialized which is the highest +** level of threadsafety. 2 means the libary is multithreaded - multiple +** threads can use SQLite as long as no two threads try to use the same +** database connection at the same time. +** ** Older versions of SQLite used an optional THREADSAFE macro. -** We support that for legacy +** We support that for legacy. */ #if !defined(SQLITE_THREADSAFE) #if defined(THREADSAFE) # define SQLITE_THREADSAFE THREADSAFE #else -# define SQLITE_THREADSAFE 1 +# define SQLITE_THREADSAFE 1 /* IMP: R-07272-22309 */ #endif #endif @@ -383,23 +617,18 @@ ** ** SQLITE_SYSTEM_MALLOC // Use normal system malloc() ** SQLITE_MEMDEBUG // Debugging version of system malloc() -** SQLITE_MEMORY_SIZE // internal allocator #1 -** SQLITE_MMAP_HEAP_SIZE // internal mmap() allocator -** SQLITE_POW2_MEMORY_SIZE // internal power-of-two allocator +** +** (Historical note: There used to be several other options, but we've +** pared it down to just these two.) ** ** If none of the above are defined, then set SQLITE_SYSTEM_MALLOC as ** the default. */ -#if defined(SQLITE_SYSTEM_MALLOC)+defined(SQLITE_MEMDEBUG)+\ - defined(SQLITE_MEMORY_SIZE)+defined(SQLITE_MMAP_HEAP_SIZE)+\ - defined(SQLITE_POW2_MEMORY_SIZE)>1 +#if defined(SQLITE_SYSTEM_MALLOC)+defined(SQLITE_MEMDEBUG)>1 # error "At most one of the following compile-time configuration options\ - is allows: SQLITE_SYSTEM_MALLOC, SQLITE_MEMDEBUG, SQLITE_MEMORY_SIZE,\ - SQLITE_MMAP_HEAP_SIZE, SQLITE_POW2_MEMORY_SIZE" + is allows: SQLITE_SYSTEM_MALLOC, SQLITE_MEMDEBUG" #endif -#if defined(SQLITE_SYSTEM_MALLOC)+defined(SQLITE_MEMDEBUG)+\ - defined(SQLITE_MEMORY_SIZE)+defined(SQLITE_MMAP_HEAP_SIZE)+\ - defined(SQLITE_POW2_MEMORY_SIZE)==0 +#if defined(SQLITE_SYSTEM_MALLOC)+defined(SQLITE_MEMDEBUG)==0 # define SQLITE_SYSTEM_MALLOC 1 #endif @@ -518,6 +747,13 @@ SQLITE_PRIVATE void sqlite3Coverage(int); # define NEVER(X) (X) #endif +/* +** Return true (non-zero) if the input is a integer that is too large +** to fit in 32-bits. This macro is used inside of various testcase() +** macros to verify that we have tested SQLite for large-file support. +*/ +#define IS_BIG_INT(X) (((X)&~(i64)0xffffffff)!=0) + /* ** The macro unlikely() is a hint that surrounds a boolean ** expression that is usually false. Macro likely() surrounds @@ -617,55 +853,43 @@ extern "C" { #endif /* -** CAPI3REF: Compile-Time Library Version Numbers {H10010} +** CAPI3REF: Compile-Time Library Version Numbers ** -** The SQLITE_VERSION and SQLITE_VERSION_NUMBER #defines in -** the sqlite3.h file specify the version of SQLite with which -** that header file is associated. -** -** The "version" of SQLite is a string of the form "W.X.Y" or "W.X.Y.Z". -** The W value is major version number and is always 3 in SQLite3. -** The W value only changes when backwards compatibility is -** broken and we intend to never break backwards compatibility. -** The X value is the minor version number and only changes when -** there are major feature enhancements that are forwards compatible -** but not backwards compatible. -** The Y value is the release number and is incremented with -** each release but resets back to 0 whenever X is incremented. -** The Z value only appears on branch releases. -** -** The SQLITE_VERSION_NUMBER is an integer that is computed as -** follows: -** -**
    -** SQLITE_VERSION_NUMBER = W*1000000 + X*1000 + Y
    -** 
    +** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header +** evaluates to a string literal that is the SQLite version in the +** format "X.Y.Z" where X is the major version number (always 3 for +** SQLite3) and Y is the minor version number and Z is the release number.)^ +** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer +** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same +** numbers used in [SQLITE_VERSION].)^ +** The SQLITE_VERSION_NUMBER for any given release of SQLite will also +** be larger than the release from which it is derived. Either Y will +** be held constant and Z will be incremented or else Y will be incremented +** and Z will be reset to zero. ** ** Since version 3.6.18, SQLite source code has been stored in the -** fossil configuration management -** system. The SQLITE_SOURCE_ID -** macro is a string which identifies a particular check-in of SQLite -** within its configuration management system. The string contains the -** date and time of the check-in (UTC) and an SHA1 hash of the entire -** source tree. +** Fossil configuration management +** system. ^The SQLITE_SOURCE_ID macro evaluates to +** a string which identifies a particular check-in of SQLite +** within its configuration management system. ^The SQLITE_SOURCE_ID +** string contains the date and time of the check-in (UTC) and an SHA1 +** hash of the entire source tree. ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. -** -** Requirements: [H10011] [H10014] */ -#define SQLITE_VERSION "3.6.20" -#define SQLITE_VERSION_NUMBER 3006020 -#define SQLITE_SOURCE_ID "2009-11-04 13:30:02 eb7a544fe49d1626bacecfe53ddc03fe082e3243" +#define SQLITE_VERSION "3.7.3" +#define SQLITE_VERSION_NUMBER 3007003 +#define SQLITE_SOURCE_ID "2010-10-08 02:34:02 2677848087c9c090efb17c1893e77d6136a9111d" /* -** CAPI3REF: Run-Time Library Version Numbers {H10020} -** KEYWORDS: sqlite3_version +** CAPI3REF: Run-Time Library Version Numbers +** KEYWORDS: sqlite3_version, sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], -** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] #defines in the header, -** but are associated with the library instead of the header file. Cautious +** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros +** but are associated with the library instead of the header file. ^(Cautious ** programmers might include assert() statements in their application to ** verify that values returned by these interfaces match the macros in ** the header, and thus insure that the application is @@ -674,19 +898,20 @@ extern "C" { **
     ** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
     ** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );
    -** assert( strcmp(sqlite3_libversion,SQLITE_VERSION)==0 );
    -** 
    +** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 ); +** )^ ** -** The sqlite3_libversion() function returns the same information as is -** in the sqlite3_version[] string constant. The function is provided -** for use in DLLs since DLL users usually do not have direct access to string -** constants within the DLL. Similarly, the sqlite3_sourceid() function -** returns the same information as is in the [SQLITE_SOURCE_ID] #define of -** the header file. +** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION] +** macro. ^The sqlite3_libversion() function returns a pointer to the +** to the sqlite3_version[] string constant. The sqlite3_libversion() +** function is provided for use in DLLs since DLL users usually do not have +** direct access to string constants within the DLL. ^The +** sqlite3_libversion_number() function returns an integer equal to +** [SQLITE_VERSION_NUMBER]. ^The sqlite3_sourceid() function returns +** a pointer to a string constant whose value is the same as the +** [SQLITE_SOURCE_ID] C preprocessor macro. ** ** See also: [sqlite_version()] and [sqlite_source_id()]. -** -** Requirements: [H10021] [H10022] [H10023] */ SQLITE_API const char sqlite3_version[] = SQLITE_VERSION; SQLITE_API const char *sqlite3_libversion(void); @@ -694,7 +919,38 @@ SQLITE_API const char *sqlite3_sourceid(void); SQLITE_API int sqlite3_libversion_number(void); /* -** CAPI3REF: Test To See If The Library Is Threadsafe {H10100} +** CAPI3REF: Run-Time Library Compilation Options Diagnostics +** +** ^The sqlite3_compileoption_used() function returns 0 or 1 +** indicating whether the specified option was defined at +** compile time. ^The SQLITE_ prefix may be omitted from the +** option name passed to sqlite3_compileoption_used(). +** +** ^The sqlite3_compileoption_get() function allows iterating +** over the list of options that were defined at compile time by +** returning the N-th compile time option string. ^If N is out of range, +** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ +** prefix is omitted from any strings returned by +** sqlite3_compileoption_get(). +** +** ^Support for the diagnostic functions sqlite3_compileoption_used() +** and sqlite3_compileoption_get() may be omitted by specifying the +** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. +** +** See also: SQL functions [sqlite_compileoption_used()] and +** [sqlite_compileoption_get()] and the [compile_options pragma]. +*/ +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS +SQLITE_API int sqlite3_compileoption_used(const char *zOptName); +SQLITE_API const char *sqlite3_compileoption_get(int N); +#endif + +/* +** CAPI3REF: Test To See If The Library Is Threadsafe +** +** ^The sqlite3_threadsafe() function returns zero if and only if +** SQLite was compiled mutexing code omitted due to the +** [SQLITE_THREADSAFE] compile-time option being set to 0. ** ** SQLite can be compiled with or without mutexes. When ** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes @@ -706,7 +962,7 @@ SQLITE_API int sqlite3_libversion_number(void); ** Enabling mutexes incurs a measurable performance penalty. ** So if speed is of utmost importance, it makes sense to disable ** the mutexes. But for maximum safety, mutexes should be enabled. -** The default behavior is for mutexes to be enabled. +** ^The default behavior is for mutexes to be enabled. ** ** This interface can be used by an application to make sure that the ** version of SQLite that it is linking against was compiled with @@ -714,21 +970,21 @@ SQLITE_API int sqlite3_libversion_number(void); ** ** This interface only reports on the compile-time mutex setting ** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with -** SQLITE_THREADSAFE=1 then mutexes are enabled by default but +** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but ** can be fully or partially disabled using a call to [sqlite3_config()] ** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD], -** or [SQLITE_CONFIG_MUTEX]. The return value of this function shows -** only the default compile-time setting, not any run-time changes -** to that setting. +** or [SQLITE_CONFIG_MUTEX]. ^(The return value of the +** sqlite3_threadsafe() function shows only the compile-time setting of +** thread safety, not any run-time changes to that setting made by +** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() +** is unchanged by calls to sqlite3_config().)^ ** ** See the [threading mode] documentation for additional information. -** -** Requirements: [H10101] [H10102] */ SQLITE_API int sqlite3_threadsafe(void); /* -** CAPI3REF: Database Connection Handle {H12000} +** CAPI3REF: Database Connection Handle ** KEYWORDS: {database connection} {database connections} ** ** Each open SQLite database is represented by a pointer to an instance of @@ -743,7 +999,7 @@ SQLITE_API int sqlite3_threadsafe(void); typedef struct sqlite3 sqlite3; /* -** CAPI3REF: 64-Bit Integer Types {H10200} +** CAPI3REF: 64-Bit Integer Types ** KEYWORDS: sqlite_int64 sqlite_uint64 ** ** Because there is no cross-platform way to specify 64-bit integer types @@ -753,7 +1009,10 @@ typedef struct sqlite3 sqlite3; ** The sqlite_int64 and sqlite_uint64 types are supported for backwards ** compatibility only. ** -** Requirements: [H10201] [H10202] +** ^The sqlite3_int64 and sqlite_int64 types can store integer values +** between -9223372036854775808 and +9223372036854775807 inclusive. ^The +** sqlite3_uint64 and sqlite_uint64 types can store integer values +** between 0 and +18446744073709551615 inclusive. */ #ifdef SQLITE_INT64_TYPE typedef SQLITE_INT64_TYPE sqlite_int64; @@ -777,24 +1036,28 @@ typedef sqlite_uint64 sqlite3_uint64; #endif /* -** CAPI3REF: Closing A Database Connection {H12010} +** CAPI3REF: Closing A Database Connection ** -** This routine is the destructor for the [sqlite3] object. +** ^The sqlite3_close() routine is the destructor for the [sqlite3] object. +** ^Calls to sqlite3_close() return SQLITE_OK if the [sqlite3] object is +** successfully destroyed and all associated resources are deallocated. ** ** Applications must [sqlite3_finalize | finalize] all [prepared statements] ** and [sqlite3_blob_close | close] all [BLOB handles] associated with -** the [sqlite3] object prior to attempting to close the object. +** the [sqlite3] object prior to attempting to close the object. ^If +** sqlite3_close() is called on a [database connection] that still has +** outstanding [prepared statements] or [BLOB handles], then it returns +** SQLITE_BUSY. ** -** If [sqlite3_close()] is invoked while a transaction is open, +** ^If [sqlite3_close()] is invoked while a transaction is open, ** the transaction is automatically rolled back. ** ** The C parameter to [sqlite3_close(C)] must be either a NULL ** pointer or an [sqlite3] object pointer obtained ** from [sqlite3_open()], [sqlite3_open16()], or ** [sqlite3_open_v2()], and not previously closed. -** -** Requirements: -** [H12011] [H12012] [H12013] [H12014] [H12015] [H12019] +** ^Calling sqlite3_close() with a NULL pointer argument is a +** harmless no-op. */ SQLITE_API int sqlite3_close(sqlite3 *); @@ -806,48 +1069,65 @@ SQLITE_API int sqlite3_close(sqlite3 *); typedef int (*sqlite3_callback)(void*,int,char**, char**); /* -** CAPI3REF: One-Step Query Execution Interface {H12100} +** CAPI3REF: One-Step Query Execution Interface ** -** The sqlite3_exec() interface is a convenient way of running one or more -** SQL statements without having to write a lot of C code. The UTF-8 encoded -** SQL statements are passed in as the second parameter to sqlite3_exec(). -** The statements are evaluated one by one until either an error or -** an interrupt is encountered, or until they are all done. The 3rd parameter -** is an optional callback that is invoked once for each row of any query -** results produced by the SQL statements. The 5th parameter tells where -** to write any error messages. +** The sqlite3_exec() interface is a convenience wrapper around +** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], +** that allows an application to run multiple statements of SQL +** without having to use a lot of C code. ** -** The error message passed back through the 5th parameter is held -** in memory obtained from [sqlite3_malloc()]. To avoid a memory leak, -** the calling application should call [sqlite3_free()] on any error -** message returned through the 5th parameter when it has finished using -** the error message. +** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, +** semicolon-separate SQL statements passed into its 2nd argument, +** in the context of the [database connection] passed in as its 1st +** argument. ^If the callback function of the 3rd argument to +** sqlite3_exec() is not NULL, then it is invoked for each result row +** coming out of the evaluated SQL statements. ^The 4th argument to +** to sqlite3_exec() is relayed through to the 1st argument of each +** callback invocation. ^If the callback pointer to sqlite3_exec() +** is NULL, then no callback is ever invoked and result rows are +** ignored. ** -** If the SQL statement in the 2nd parameter is NULL or an empty string -** or a string containing only whitespace and comments, then no SQL -** statements are evaluated and the database is not changed. +** ^If an error occurs while evaluating the SQL statements passed into +** sqlite3_exec(), then execution of the current statement stops and +** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec() +** is not NULL then any error message is written into memory obtained +** from [sqlite3_malloc()] and passed back through the 5th parameter. +** To avoid memory leaks, the application should invoke [sqlite3_free()] +** on error message strings returned through the 5th parameter of +** of sqlite3_exec() after the error message string is no longer needed. +** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors +** occur, then sqlite3_exec() sets the pointer in its 5th parameter to +** NULL before returning. ** -** The sqlite3_exec() interface is implemented in terms of -** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()]. -** The sqlite3_exec() routine does nothing to the database that cannot be done -** by [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()]. +** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec() +** routine returns SQLITE_ABORT without invoking the callback again and +** without running any subsequent SQL statements. ** -** The first parameter to [sqlite3_exec()] must be an valid and open -** [database connection]. +** ^The 2nd argument to the sqlite3_exec() callback function is the +** number of columns in the result. ^The 3rd argument to the sqlite3_exec() +** callback is an array of pointers to strings obtained as if from +** [sqlite3_column_text()], one for each column. ^If an element of a +** result row is NULL then the corresponding string pointer for the +** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the +** sqlite3_exec() callback is an array of pointers to strings where each +** entry represents the name of corresponding result column as obtained +** from [sqlite3_column_name()]. ** -** The database connection must not be closed while -** [sqlite3_exec()] is running. +** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer +** to an empty string, or a pointer that contains only whitespace and/or +** SQL comments, then no SQL statements are evaluated and the database +** is not changed. ** -** The calling function should use [sqlite3_free()] to free -** the memory that *errmsg is left pointing at once the error -** message is no longer needed. +** Restrictions: ** -** The SQL statement text in the 2nd parameter to [sqlite3_exec()] -** must remain unchanged while [sqlite3_exec()] is running. -** -** Requirements: -** [H12101] [H12102] [H12104] [H12105] [H12107] [H12110] [H12113] [H12116] -** [H12119] [H12122] [H12125] [H12131] [H12134] [H12137] [H12138] +**
      +**
    • The application must insure that the 1st parameter to sqlite3_exec() +** is a valid and open [database connection]. +**
    • The application must not close [database connection] specified by +** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. +**
    • The application must not modify the SQL statement text passed into +** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. +**
    */ SQLITE_API int sqlite3_exec( sqlite3*, /* An open database */ @@ -858,7 +1138,7 @@ SQLITE_API int sqlite3_exec( ); /* -** CAPI3REF: Result Codes {H10210} +** CAPI3REF: Result Codes ** KEYWORDS: SQLITE_OK {error code} {error codes} ** KEYWORDS: {result code} {result codes} ** @@ -885,7 +1165,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_NOTFOUND 12 /* NOT USED. Table or record not found */ #define SQLITE_FULL 13 /* Insertion failed because database is full */ #define SQLITE_CANTOPEN 14 /* Unable to open the database file */ -#define SQLITE_PROTOCOL 15 /* NOT USED. Database lock protocol error */ +#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ #define SQLITE_EMPTY 16 /* Database is empty */ #define SQLITE_SCHEMA 17 /* The database schema changed */ #define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */ @@ -902,7 +1182,7 @@ SQLITE_API int sqlite3_exec( /* end-of-error-codes */ /* -** CAPI3REF: Extended Result Codes {H10220} +** CAPI3REF: Extended Result Codes ** KEYWORDS: {extended error code} {extended error codes} ** KEYWORDS: {extended result code} {extended result codes} ** @@ -941,10 +1221,15 @@ SQLITE_API int sqlite3_exec( #define SQLITE_IOERR_LOCK (SQLITE_IOERR | (15<<8)) #define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) #define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) -#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8) ) +#define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8)) +#define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8)) +#define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) +#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) +#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) +#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) /* -** CAPI3REF: Flags For File Open Operations {H10230} +** CAPI3REF: Flags For File Open Operations ** ** These bit values are intended for use in the ** 3rd parameter to the [sqlite3_open_v2()] interface and @@ -956,6 +1241,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_DELETEONCLOSE 0x00000008 /* VFS only */ #define SQLITE_OPEN_EXCLUSIVE 0x00000010 /* VFS only */ +#define SQLITE_OPEN_AUTOPROXY 0x00000020 /* VFS only */ #define SQLITE_OPEN_MAIN_DB 0x00000100 /* VFS only */ #define SQLITE_OPEN_TEMP_DB 0x00000200 /* VFS only */ #define SQLITE_OPEN_TRANSIENT_DB 0x00000400 /* VFS only */ @@ -967,11 +1253,12 @@ SQLITE_API int sqlite3_exec( #define SQLITE_OPEN_FULLMUTEX 0x00010000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */ #define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */ +#define SQLITE_OPEN_WAL 0x00080000 /* VFS only */ /* -** CAPI3REF: Device Characteristics {H10240} +** CAPI3REF: Device Characteristics ** -** The xDeviceCapabilities method of the [sqlite3_io_methods] +** The xDeviceCharacteristics method of the [sqlite3_io_methods] ** object returns an integer which is a vector of the these ** bit values expressing I/O characteristics of the mass storage ** device that holds the file that the [sqlite3_io_methods] @@ -988,20 +1275,21 @@ SQLITE_API int sqlite3_exec( ** information is written to disk in the same order as calls ** to xWrite(). */ -#define SQLITE_IOCAP_ATOMIC 0x00000001 -#define SQLITE_IOCAP_ATOMIC512 0x00000002 -#define SQLITE_IOCAP_ATOMIC1K 0x00000004 -#define SQLITE_IOCAP_ATOMIC2K 0x00000008 -#define SQLITE_IOCAP_ATOMIC4K 0x00000010 -#define SQLITE_IOCAP_ATOMIC8K 0x00000020 -#define SQLITE_IOCAP_ATOMIC16K 0x00000040 -#define SQLITE_IOCAP_ATOMIC32K 0x00000080 -#define SQLITE_IOCAP_ATOMIC64K 0x00000100 -#define SQLITE_IOCAP_SAFE_APPEND 0x00000200 -#define SQLITE_IOCAP_SEQUENTIAL 0x00000400 +#define SQLITE_IOCAP_ATOMIC 0x00000001 +#define SQLITE_IOCAP_ATOMIC512 0x00000002 +#define SQLITE_IOCAP_ATOMIC1K 0x00000004 +#define SQLITE_IOCAP_ATOMIC2K 0x00000008 +#define SQLITE_IOCAP_ATOMIC4K 0x00000010 +#define SQLITE_IOCAP_ATOMIC8K 0x00000020 +#define SQLITE_IOCAP_ATOMIC16K 0x00000040 +#define SQLITE_IOCAP_ATOMIC32K 0x00000080 +#define SQLITE_IOCAP_ATOMIC64K 0x00000100 +#define SQLITE_IOCAP_SAFE_APPEND 0x00000200 +#define SQLITE_IOCAP_SEQUENTIAL 0x00000400 +#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800 /* -** CAPI3REF: File Locking Levels {H10250} +** CAPI3REF: File Locking Levels ** ** SQLite uses one of these integer values as the second ** argument to calls it makes to the xLock() and xUnlock() methods @@ -1014,7 +1302,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_LOCK_EXCLUSIVE 4 /* -** CAPI3REF: Synchronization Type Flags {H10260} +** CAPI3REF: Synchronization Type Flags ** ** When SQLite invokes the xSync() method of an ** [sqlite3_io_methods] object it uses a combination of @@ -1032,7 +1320,7 @@ SQLITE_API int sqlite3_exec( #define SQLITE_SYNC_DATAONLY 0x00010 /* -** CAPI3REF: OS Interface Open File Handle {H11110} +** CAPI3REF: OS Interface Open File Handle ** ** An [sqlite3_file] object represents an open file in the ** [sqlite3_vfs | OS interface layer]. Individual OS interface @@ -1048,7 +1336,7 @@ struct sqlite3_file { }; /* -** CAPI3REF: OS Interface File Virtual Methods Object {H11120} +** CAPI3REF: OS Interface File Virtual Methods Object ** ** Every file opened by the [sqlite3_vfs] xOpen method populates an ** [sqlite3_file] object (or, more commonly, a subclass of the @@ -1149,11 +1437,17 @@ struct sqlite3_io_methods { int (*xFileControl)(sqlite3_file*, int op, void *pArg); int (*xSectorSize)(sqlite3_file*); int (*xDeviceCharacteristics)(sqlite3_file*); + /* Methods above are valid for version 1 */ + int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); + int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); + void (*xShmBarrier)(sqlite3_file*); + int (*xShmUnmap)(sqlite3_file*, int deleteFlag); + /* Methods above are valid for version 2 */ /* Additional methods may be added in future releases */ }; /* -** CAPI3REF: Standard File Control Opcodes {H11310} +** CAPI3REF: Standard File Control Opcodes ** ** These integer constants are opcodes for the xFileControl method ** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] @@ -1166,14 +1460,31 @@ struct sqlite3_io_methods { ** into an integer that the pArg argument points to. This capability ** is used during testing and only needs to be supported when SQLITE_TEST ** is defined. +** +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. */ #define SQLITE_FCNTL_LOCKSTATE 1 #define SQLITE_GET_LOCKPROXYFILE 2 #define SQLITE_SET_LOCKPROXYFILE 3 #define SQLITE_LAST_ERRNO 4 +#define SQLITE_FCNTL_SIZE_HINT 5 +#define SQLITE_FCNTL_CHUNK_SIZE 6 /* -** CAPI3REF: Mutex Handle {H17110} +** CAPI3REF: Mutex Handle ** ** The mutex module within SQLite defines [sqlite3_mutex] to be an ** abstract type for a mutex object. The SQLite core never looks @@ -1185,7 +1496,7 @@ struct sqlite3_io_methods { typedef struct sqlite3_mutex sqlite3_mutex; /* -** CAPI3REF: OS Interface Object {H11140} +** CAPI3REF: OS Interface Object ** ** An instance of the sqlite3_vfs object defines the interface between ** the SQLite core and the underlying operating system. The "vfs" @@ -1218,15 +1529,19 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** The zName field holds the name of the VFS module. The name must ** be unique across all VFS modules. ** -** SQLite will guarantee that the zFilename parameter to xOpen +** ^SQLite guarantees that the zFilename parameter to xOpen ** is either a NULL pointer or string obtained -** from xFullPathname(). SQLite further guarantees that +** from xFullPathname() with an optional suffix added. +** ^If a suffix is added to the zFilename parameter, it will +** consist of a single "-" character followed by no more than +** 10 alphanumeric and/or "-" characters. +** ^SQLite further guarantees that ** the string will be valid and unchanged until xClose() is ** called. Because of the previous sentence, ** the [sqlite3_file] can safely store a pointer to the ** filename if it needs to remember the filename for some reason. -** If the zFilename parameter is xOpen is a NULL pointer then xOpen -** must invent its own temporary name for the file. Whenever the +** If the zFilename parameter to xOpen is a NULL pointer then xOpen +** must invent its own temporary name for the file. ^Whenever the ** xFilename parameter is NULL it will also be the case that the ** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. ** @@ -1237,7 +1552,7 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** If xOpen() opens a file read-only then it sets *pOutFlags to ** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. ** -** SQLite will also add one of the following flags to the xOpen() +** ^(SQLite will also add one of the following flags to the xOpen() ** call, depending on the object being opened: ** **
      @@ -1248,7 +1563,8 @@ typedef struct sqlite3_mutex sqlite3_mutex; **
    • [SQLITE_OPEN_TRANSIENT_DB] **
    • [SQLITE_OPEN_SUBJOURNAL] **
    • [SQLITE_OPEN_MASTER_JOURNAL] -**
    +**
  • [SQLITE_OPEN_WAL] +** )^ ** ** The file I/O implementation can use the object type flags to ** change the way it deals with files. For example, an application @@ -1267,10 +1583,11 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** ** ** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be -** deleted when it is closed. The [SQLITE_OPEN_DELETEONCLOSE] -** will be set for TEMP databases, journals and for subjournals. +** deleted when it is closed. ^The [SQLITE_OPEN_DELETEONCLOSE] +** will be set for TEMP databases and their journals, transient +** databases, and subjournals. ** -** The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction +** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction ** with the [SQLITE_OPEN_CREATE] flag, which are both directly ** analogous to the O_EXCL and O_CREAT flags of the POSIX open() ** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the @@ -1279,7 +1596,7 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** It is not used to indicate the file should be opened ** for exclusive access. ** -** At least szOsFile bytes of memory are allocated by SQLite +** ^At least szOsFile bytes of memory are allocated by SQLite ** to hold the [sqlite3_file] structure passed as the third ** argument to xOpen. The xOpen method does not have to ** allocate the structure; it should just fill it in. Note that @@ -1289,33 +1606,40 @@ typedef struct sqlite3_mutex sqlite3_mutex; ** element will be valid after xOpen returns regardless of the success ** or failure of the xOpen call. ** -** The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] +** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] ** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to ** test whether a file is readable and writable, or [SQLITE_ACCESS_READ] ** to test whether a file is at least readable. The file can be a ** directory. ** -** SQLite will always allocate at least mxPathname+1 bytes for the +** ^SQLite will always allocate at least mxPathname+1 bytes for the ** output buffer xFullPathname. The exact size of the output buffer ** is also passed as a parameter to both methods. If the output buffer ** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is ** handled as a fatal error by SQLite, vfs implementations should endeavor ** to prevent this by setting mxPathname to a sufficiently large value. ** -** The xRandomness(), xSleep(), and xCurrentTime() interfaces -** are not strictly a part of the filesystem, but they are +** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64() +** interfaces are not strictly a part of the filesystem, but they are ** included in the VFS structure for completeness. ** The xRandomness() function attempts to return nBytes bytes ** of good-quality randomness into zOut. The return value is ** the actual number of bytes of randomness obtained. ** The xSleep() method causes the calling thread to sleep for at -** least the number of microseconds given. The xCurrentTime() -** method returns a Julian Day Number for the current date and time. -** +** least the number of microseconds given. ^The xCurrentTime() +** method returns a Julian Day Number for the current date and time as +** a floating point value. +** ^The xCurrentTimeInt64() method returns, as an integer, the Julian +** Day Number multipled by 86400000 (the number of milliseconds in +** a 24-hour day). +** ^SQLite will use the xCurrentTimeInt64() method to get the current +** date and time if that method is available (if iVersion is 2 or +** greater and the function pointer is not NULL) and will fall back +** to xCurrentTime() if xCurrentTimeInt64() is unavailable. */ typedef struct sqlite3_vfs sqlite3_vfs; struct sqlite3_vfs { - int iVersion; /* Structure version number */ + int iVersion; /* Structure version number (currently 2) */ int szOsFile; /* Size of subclassed sqlite3_file */ int mxPathname; /* Maximum file pathname length */ sqlite3_vfs *pNext; /* Next registered VFS */ @@ -1334,48 +1658,101 @@ struct sqlite3_vfs { int (*xSleep)(sqlite3_vfs*, int microseconds); int (*xCurrentTime)(sqlite3_vfs*, double*); int (*xGetLastError)(sqlite3_vfs*, int, char *); - /* New fields may be appended in figure versions. The iVersion - ** value will increment whenever this happens. */ + /* + ** The methods above are in version 1 of the sqlite_vfs object + ** definition. Those that follow are added in version 2 or later + */ + int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); + /* + ** The methods above are in versions 1 and 2 of the sqlite_vfs object. + ** New fields may be appended in figure versions. The iVersion + ** value will increment whenever this happens. + */ }; /* -** CAPI3REF: Flags for the xAccess VFS method {H11190} +** CAPI3REF: Flags for the xAccess VFS method ** ** These integer constants can be used as the third parameter to -** the xAccess method of an [sqlite3_vfs] object. {END} They determine +** the xAccess method of an [sqlite3_vfs] object. They determine ** what kind of permissions the xAccess method is looking for. ** With SQLITE_ACCESS_EXISTS, the xAccess method ** simply checks whether the file exists. ** With SQLITE_ACCESS_READWRITE, the xAccess method -** checks whether the file is both readable and writable. +** checks whether the named directory is both readable and writable +** (in other words, if files can be added, removed, and renamed within +** the directory). +** The SQLITE_ACCESS_READWRITE constant is currently used only by the +** [temp_store_directory pragma], though this could change in a future +** release of SQLite. ** With SQLITE_ACCESS_READ, the xAccess method -** checks whether the file is readable. +** checks whether the file is readable. The SQLITE_ACCESS_READ constant is +** currently unused, though it might be used in a future release of +** SQLite. */ #define SQLITE_ACCESS_EXISTS 0 -#define SQLITE_ACCESS_READWRITE 1 -#define SQLITE_ACCESS_READ 2 +#define SQLITE_ACCESS_READWRITE 1 /* Used by PRAGMA temp_store_directory */ +#define SQLITE_ACCESS_READ 2 /* Unused */ /* -** CAPI3REF: Initialize The SQLite Library {H10130} +** CAPI3REF: Flags for the xShmLock VFS method ** -** The sqlite3_initialize() routine initializes the -** SQLite library. The sqlite3_shutdown() routine +** These integer constants define the various locking operations +** allowed by the xShmLock method of [sqlite3_io_methods]. The +** following are the only legal combinations of flags to the +** xShmLock method: +** +**
      +**
    • SQLITE_SHM_LOCK | SQLITE_SHM_SHARED +**
    • SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE +**
    • SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED +**
    • SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE +**
    +** +** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as +** was given no the corresponding lock. +** +** The xShmLock method can transition between unlocked and SHARED or +** between unlocked and EXCLUSIVE. It cannot transition between SHARED +** and EXCLUSIVE. +*/ +#define SQLITE_SHM_UNLOCK 1 +#define SQLITE_SHM_LOCK 2 +#define SQLITE_SHM_SHARED 4 +#define SQLITE_SHM_EXCLUSIVE 8 + +/* +** CAPI3REF: Maximum xShmLock index +** +** The xShmLock method on [sqlite3_io_methods] may use values +** between 0 and this upper bound as its "offset" argument. +** The SQLite core will never attempt to acquire or release a +** lock outside of this range +*/ +#define SQLITE_SHM_NLOCK 8 + + +/* +** CAPI3REF: Initialize The SQLite Library +** +** ^The sqlite3_initialize() routine initializes the +** SQLite library. ^The sqlite3_shutdown() routine ** deallocates any resources that were allocated by sqlite3_initialize(). -** This routines are designed to aid in process initialization and +** These routines are designed to aid in process initialization and ** shutdown on embedded systems. Workstation applications using ** SQLite normally do not need to invoke either of these routines. ** ** A call to sqlite3_initialize() is an "effective" call if it is ** the first time sqlite3_initialize() is invoked during the lifetime of ** the process, or if it is the first time sqlite3_initialize() is invoked -** following a call to sqlite3_shutdown(). Only an effective call +** following a call to sqlite3_shutdown(). ^(Only an effective call ** of sqlite3_initialize() does any initialization. All other calls -** are harmless no-ops. +** are harmless no-ops.)^ ** ** A call to sqlite3_shutdown() is an "effective" call if it is the first -** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only +** call to sqlite3_shutdown() since the last sqlite3_initialize(). ^(Only ** an effective call to sqlite3_shutdown() does any deinitialization. -** All other valid calls to sqlite3_shutdown() are harmless no-ops. +** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^ ** ** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown() ** is not. The sqlite3_shutdown() interface must only be called from a @@ -1383,21 +1760,21 @@ struct sqlite3_vfs { ** other SQLite resources must be deallocated prior to invoking ** sqlite3_shutdown(). ** -** Among other things, sqlite3_initialize() will invoke -** sqlite3_os_init(). Similarly, sqlite3_shutdown() +** Among other things, ^sqlite3_initialize() will invoke +** sqlite3_os_init(). Similarly, ^sqlite3_shutdown() ** will invoke sqlite3_os_end(). ** -** The sqlite3_initialize() routine returns [SQLITE_OK] on success. -** If for some reason, sqlite3_initialize() is unable to initialize +** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success. +** ^If for some reason, sqlite3_initialize() is unable to initialize ** the library (perhaps it is unable to allocate a needed resource such ** as a mutex) it returns an [error code] other than [SQLITE_OK]. ** -** The sqlite3_initialize() routine is called internally by many other +** ^The sqlite3_initialize() routine is called internally by many other ** SQLite interfaces so that an application usually does not need to ** invoke sqlite3_initialize() directly. For example, [sqlite3_open()] ** calls sqlite3_initialize() so the SQLite library will be automatically ** initialized when [sqlite3_open()] is called if it has not be initialized -** already. However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] +** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] ** compile-time option, then the automatic calls to sqlite3_initialize() ** are omitted and the application must call sqlite3_initialize() directly ** prior to using any other SQLite interface. For maximum portability, @@ -1436,8 +1813,7 @@ SQLITE_API int sqlite3_os_init(void); SQLITE_API int sqlite3_os_end(void); /* -** CAPI3REF: Configuring The SQLite Library {H14100} -** EXPERIMENTAL +** CAPI3REF: Configuring The SQLite Library ** ** The sqlite3_config() interface is used to make global configuration ** changes to SQLite in order to tune SQLite to the specific needs of @@ -1450,7 +1826,9 @@ SQLITE_API int sqlite3_os_end(void); ** threads while sqlite3_config() is running. Furthermore, sqlite3_config() ** may only be invoked prior to library initialization using ** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()]. -** Note, however, that sqlite3_config() can be called as part of the +** ^If sqlite3_config() is called after [sqlite3_initialize()] and before +** [sqlite3_shutdown()] then it will return SQLITE_MISUSE. +** Note, however, that ^sqlite3_config() can be called as part of the ** implementation of an application-defined [sqlite3_os_init()]. ** ** The first argument to sqlite3_config() is an integer @@ -1459,26 +1837,20 @@ SQLITE_API int sqlite3_os_end(void); ** vary depending on the [SQLITE_CONFIG_SINGLETHREAD | configuration option] ** in the first argument. ** -** When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. -** If the option is unknown or SQLite is unable to set the option +** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. +** ^If the option is unknown or SQLite is unable to set the option ** then this routine returns a non-zero [error code]. -** -** Requirements: -** [H14103] [H14106] [H14120] [H14123] [H14126] [H14129] [H14132] [H14135] -** [H14138] [H14141] [H14144] [H14147] [H14150] [H14153] [H14156] [H14159] -** [H14162] [H14165] [H14168] */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_config(int, ...); +SQLITE_API int sqlite3_config(int, ...); /* -** CAPI3REF: Configure database connections {H14200} -** EXPERIMENTAL +** CAPI3REF: Configure database connections ** ** The sqlite3_db_config() interface is used to make configuration ** changes to a [database connection]. The interface is similar to ** [sqlite3_config()] except that the changes apply to a single ** [database connection] (specified in the first argument). The -** sqlite3_db_config() interface can only be used immediately after +** sqlite3_db_config() interface should only be used immediately after ** the database connection is created using [sqlite3_open()], ** [sqlite3_open16()], or [sqlite3_open_v2()]. ** @@ -1489,14 +1861,13 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_config(int, ...); ** New verbs are likely to be added in future releases of SQLite. ** Additional arguments depend on the verb. ** -** Requirements: -** [H14203] [H14206] [H14209] [H14212] [H14215] +** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if +** the call is considered successful. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_config(sqlite3*, int op, ...); +SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); /* -** CAPI3REF: Memory Allocation Routines {H10155} -** EXPERIMENTAL +** CAPI3REF: Memory Allocation Routines ** ** An instance of this object defines the interface between SQLite ** and low-level memory allocation routines. @@ -1525,7 +1896,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_config(sqlite3*, int op, ...); ** The xRealloc method must work like realloc() from the standard C library ** with the exception that if the second argument to xRealloc is zero, ** xRealloc must be a no-op - it must not perform any allocation or -** deallocation. SQLite guaranteeds that the second argument to +** deallocation. ^SQLite guarantees that the second argument to ** xRealloc is always a value returned by a prior call to xRoundup. ** And so in cases where xRoundup always returns a positive number, ** xRealloc can perform exactly as the standard library realloc() and @@ -1577,8 +1948,7 @@ struct sqlite3_mem_methods { }; /* -** CAPI3REF: Configuration Options {H10160} -** EXPERIMENTAL +** CAPI3REF: Configuration Options ** ** These constants are the available integer configuration options that ** can be passed as the first argument to the [sqlite3_config()] interface. @@ -1592,22 +1962,33 @@ struct sqlite3_mem_methods { ** **
    **
    SQLITE_CONFIG_SINGLETHREAD
    -**
    There are no arguments to this option. This option disables +**
    There are no arguments to this option. ^This option sets the +** [threading mode] to Single-thread. In other words, it disables ** all mutexing and puts SQLite into a mode where it can only be used -** by a single thread.
    +** by a single thread. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to change the [threading mode] from its default +** value of Single-thread and so [sqlite3_config()] will return +** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD +** configuration option. ** **
    SQLITE_CONFIG_MULTITHREAD
    -**
    There are no arguments to this option. This option disables +**
    There are no arguments to this option. ^This option sets the +** [threading mode] to Multi-thread. In other words, it disables ** mutexing on [database connection] and [prepared statement] objects. ** The application is responsible for serializing access to ** [database connections] and [prepared statements]. But other mutexes ** are enabled so that SQLite will be safe to use in a multi-threaded ** environment as long as no two threads attempt to use the same -** [database connection] at the same time. See the [threading mode] -** documentation for additional information.
    +** [database connection] at the same time. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to set the Multi-thread [threading mode] and +** [sqlite3_config()] will return [SQLITE_ERROR] if called with the +** SQLITE_CONFIG_MULTITHREAD configuration option. ** **
    SQLITE_CONFIG_SERIALIZED
    -**
    There are no arguments to this option. This option enables +**
    There are no arguments to this option. ^This option sets the +** [threading mode] to Serialized. In other words, this option enables ** all mutexes including the recursive ** mutexes on [database connection] and [prepared statement] objects. ** In this mode (which is the default when SQLite is compiled with @@ -1615,55 +1996,62 @@ struct sqlite3_mem_methods { ** to [database connections] and [prepared statements] so that the ** application is free to use the same [database connection] or the ** same [prepared statement] in different threads at the same time. -** See the [threading mode] documentation for additional information.
    +** ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** it is not possible to set the Serialized [threading mode] and +** [sqlite3_config()] will return [SQLITE_ERROR] if called with the +** SQLITE_CONFIG_SERIALIZED configuration option. ** **
    SQLITE_CONFIG_MALLOC
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mem_methods] structure. The argument specifies ** alternative low-level memory allocation routines to be used in place of -** the memory allocation routines built into SQLite.
    +** the memory allocation routines built into SQLite.)^ ^SQLite makes +** its own private copy of the content of the [sqlite3_mem_methods] structure +** before the [sqlite3_config()] call returns. ** **
    SQLITE_CONFIG_GETMALLOC
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mem_methods] structure. The [sqlite3_mem_methods] -** structure is filled with the currently defined memory allocation routines. +** structure is filled with the currently defined memory allocation routines.)^ ** This option can be used to overload the default memory allocation ** routines with a wrapper that simulations memory allocation failure or -** tracks memory usage, for example.
    +** tracks memory usage, for example. ** **
    SQLITE_CONFIG_MEMSTATUS
    -**
    This option takes single argument of type int, interpreted as a +**
    ^This option takes single argument of type int, interpreted as a ** boolean, which enables or disables the collection of memory allocation -** statistics. When disabled, the following SQLite interfaces become -** non-operational: +** statistics. ^(When memory allocation statistics are disabled, the +** following SQLite interfaces become non-operational: **
      **
    • [sqlite3_memory_used()] **
    • [sqlite3_memory_highwater()] -**
    • [sqlite3_soft_heap_limit()] +**
    • [sqlite3_soft_heap_limit64()] **
    • [sqlite3_status()] -**
    +** )^ +** ^Memory allocation statistics are enabled by default unless SQLite is +** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory +** allocation statistics are disabled by default. **
    ** **
    SQLITE_CONFIG_SCRATCH
    -**
    This option specifies a static memory buffer that SQLite can use for +**
    ^This option specifies a static memory buffer that SQLite can use for ** scratch memory. There are three arguments: A pointer an 8-byte ** aligned memory buffer from which the scrach allocations will be ** drawn, the size of each scratch allocation (sz), ** and the maximum number of scratch allocations (N). The sz -** argument must be a multiple of 16. The sz parameter should be a few bytes -** larger than the actual scratch space required due to internal overhead. -** The first argument should pointer to an 8-byte aligned buffer +** argument must be a multiple of 16. +** The first argument must be a pointer to an 8-byte aligned buffer ** of at least sz*N bytes of memory. -** SQLite will use no more than one scratch buffer at once per thread, so -** N should be set to the expected maximum number of threads. The sz -** parameter should be 6 times the size of the largest database page size. -** Scratch buffers are used as part of the btree balance operation. If -** The btree balancer needs additional memory beyond what is provided by -** scratch buffers or if no scratch buffer space is specified, then SQLite -** goes to [sqlite3_malloc()] to obtain the memory it needs.
    +** ^SQLite will use no more than two scratch buffers per thread. So +** N should be set to twice the expected maximum number of threads. +** ^SQLite will never require a scratch buffer that is more than 6 +** times the database page size. ^If SQLite needs needs additional +** scratch memory beyond what is provided by this configuration option, then +** [sqlite3_malloc()] will be used to obtain the memory needed. ** **
    SQLITE_CONFIG_PAGECACHE
    -**
    This option specifies a static memory buffer that SQLite can use for +**
    ^This option specifies a static memory buffer that SQLite can use for ** the database page cache with the default page cache implemenation. ** This configuration should not be used if an application-define page ** cache implementation is loaded using the SQLITE_CONFIG_PCACHE option. @@ -1671,28 +2059,27 @@ struct sqlite3_mem_methods { ** memory, the size of each page buffer (sz), and the number of pages (N). ** The sz argument should be the size of the largest database page ** (a power of two between 512 and 32768) plus a little extra for each -** page header. The page header size is 20 to 40 bytes depending on -** the host architecture. It is harmless, apart from the wasted memory, +** page header. ^The page header size is 20 to 40 bytes depending on +** the host architecture. ^It is harmless, apart from the wasted memory, ** to make sz a little too large. The first ** argument should point to an allocation of at least sz*N bytes of memory. -** SQLite will use the memory provided by the first argument to satisfy its -** memory needs for the first N pages that it adds to cache. If additional +** ^SQLite will use the memory provided by the first argument to satisfy its +** memory needs for the first N pages that it adds to cache. ^If additional ** page cache memory is needed beyond what is provided by this option, then ** SQLite goes to [sqlite3_malloc()] for the additional storage space. -** The implementation might use one or more of the N buffers to hold -** memory accounting information. The pointer in the first argument must +** The pointer in the first argument must ** be aligned to an 8-byte boundary or subsequent behavior of SQLite ** will be undefined.
    ** **
    SQLITE_CONFIG_HEAP
    -**
    This option specifies a static memory buffer that SQLite will use +**
    ^This option specifies a static memory buffer that SQLite will use ** for all of its dynamic memory allocation needs beyond those provided ** for by [SQLITE_CONFIG_SCRATCH] and [SQLITE_CONFIG_PAGECACHE]. ** There are three arguments: An 8-byte aligned pointer to the memory, ** the number of bytes in the memory buffer, and the minimum allocation size. -** If the first pointer (the memory pointer) is NULL, then SQLite reverts +** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts ** to using its default memory allocator (the system malloc() implementation), -** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. If the +** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. ^If the ** memory pointer is not NULL and either [SQLITE_ENABLE_MEMSYS3] or ** [SQLITE_ENABLE_MEMSYS5] are defined, then the alternative memory ** allocator is engaged to handle all of SQLites memory allocation needs. @@ -1700,39 +2087,68 @@ struct sqlite3_mem_methods { ** boundary or subsequent behavior of SQLite will be undefined.
    ** **
    SQLITE_CONFIG_MUTEX
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mutex_methods] structure. The argument specifies ** alternative low-level mutex routines to be used in place -** the mutex routines built into SQLite.
    +** the mutex routines built into SQLite.)^ ^SQLite makes a copy of the +** content of the [sqlite3_mutex_methods] structure before the call to +** [sqlite3_config()] returns. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** the entire mutexing subsystem is omitted from the build and hence calls to +** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will +** return [SQLITE_ERROR]. ** **
    SQLITE_CONFIG_GETMUTEX
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** instance of the [sqlite3_mutex_methods] structure. The ** [sqlite3_mutex_methods] -** structure is filled with the currently defined mutex routines. +** structure is filled with the currently defined mutex routines.)^ ** This option can be used to overload the default mutex allocation ** routines with a wrapper used to track mutex usage for performance -** profiling or testing, for example.
    +** profiling or testing, for example. ^If SQLite is compiled with +** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then +** the entire mutexing subsystem is omitted from the build and hence calls to +** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will +** return [SQLITE_ERROR]. ** **
    SQLITE_CONFIG_LOOKASIDE
    -**
    This option takes two arguments that determine the default -** memory allocation lookaside optimization. The first argument is the +**
    ^(This option takes two arguments that determine the default +** memory allocation for the lookaside memory allocator on each +** [database connection]. The first argument is the ** size of each lookaside buffer slot and the second is the number of -** slots allocated to each database connection. This option sets the -** default lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] +** slots allocated to each database connection.)^ ^(This option sets the +** default lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] ** verb to [sqlite3_db_config()] can be used to change the lookaside -** configuration on individual connections.
    +** configuration on individual connections.)^ ** **
    SQLITE_CONFIG_PCACHE
    -**
    This option takes a single argument which is a pointer to +**
    ^(This option takes a single argument which is a pointer to ** an [sqlite3_pcache_methods] object. This object specifies the interface -** to a custom page cache implementation. SQLite makes a copy of the +** to a custom page cache implementation.)^ ^SQLite makes a copy of the ** object and uses it for page cache memory allocations.
    ** **
    SQLITE_CONFIG_GETPCACHE
    -**
    This option takes a single argument which is a pointer to an +**
    ^(This option takes a single argument which is a pointer to an ** [sqlite3_pcache_methods] object. SQLite copies of the current -** page cache implementation into that object.
    +** page cache implementation into that object.)^ +** +**
    SQLITE_CONFIG_LOG
    +**
    ^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a +** function with a call signature of void(*)(void*,int,const char*), +** and a pointer to void. ^If the function pointer is not NULL, it is +** invoked by [sqlite3_log()] to process each logging event. ^If the +** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. +** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is +** passed through as the first parameter to the application-defined logger +** function whenever that function is invoked. ^The second parameter to +** the logger function is a copy of the first parameter to the corresponding +** [sqlite3_log()] call and is intended to be a [result code] or an +** [extended result code]. ^The third parameter passed to the logger is +** log message after formatting via [sqlite3_snprintf()]. +** The SQLite logging interface is not reentrant; the logger function +** supplied by the application must not invoke any SQLite interface. +** In a multi-threaded application, the application-defined logger +** function must be threadsafe.
    ** **
    */ @@ -1751,10 +2167,10 @@ struct sqlite3_mem_methods { #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ #define SQLITE_CONFIG_PCACHE 14 /* sqlite3_pcache_methods* */ #define SQLITE_CONFIG_GETPCACHE 15 /* sqlite3_pcache_methods* */ +#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ /* -** CAPI3REF: Configuration Options {H10170} -** EXPERIMENTAL +** CAPI3REF: Database Connection Configuration Options ** ** These constants are the available integer configuration options that ** can be passed as the second argument to the [sqlite3_db_config()] interface. @@ -1762,24 +2178,32 @@ struct sqlite3_mem_methods { ** New configuration options may be added in future releases of SQLite. ** Existing configuration options might be discontinued. Applications ** should check the return code from [sqlite3_db_config()] to make sure that -** the call worked. The [sqlite3_db_config()] interface will return a +** the call worked. ^The [sqlite3_db_config()] interface will return a ** non-zero [error code] if a discontinued or unsupported configuration option ** is invoked. ** **
    **
    SQLITE_DBCONFIG_LOOKASIDE
    -**
    This option takes three additional arguments that determine the +**
    ^This option takes three additional arguments that determine the ** [lookaside memory allocator] configuration for the [database connection]. -** The first argument (the third parameter to [sqlite3_db_config()] is a +** ^The first argument (the third parameter to [sqlite3_db_config()] is a ** pointer to an memory buffer to use for lookaside memory. -** The first argument may be NULL in which case SQLite will allocate the -** lookaside buffer itself using [sqlite3_malloc()]. The second argument is the -** size of each lookaside buffer slot and the third argument is the number of +** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb +** may be NULL in which case SQLite will allocate the +** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the +** size of each lookaside buffer slot. ^The third argument is the number of ** slots. The size of the buffer in the first argument must be greater than ** or equal to the product of the second and third arguments. The buffer -** must be aligned to an 8-byte boundary. If the second argument is not -** a multiple of 8, it is internally rounded down to the next smaller -** multiple of 8. See also: [SQLITE_CONFIG_LOOKASIDE]
    +** must be aligned to an 8-byte boundary. ^If the second argument to +** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally +** rounded down to the next smaller multiple of 8. ^(The lookaside memory +** configuration for a database connection can only be changed when that +** connection is not currently using lookaside memory, or in other words +** when the "current value" returned by +** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero. +** Any attempt to change the lookaside memory configuration when lookaside +** memory is in use leaves the configuration unchanged and returns +** [SQLITE_BUSY].)^ ** **
    */ @@ -1787,52 +2211,49 @@ struct sqlite3_mem_methods { /* -** CAPI3REF: Enable Or Disable Extended Result Codes {H12200} +** CAPI3REF: Enable Or Disable Extended Result Codes ** -** The sqlite3_extended_result_codes() routine enables or disables the -** [extended result codes] feature of SQLite. The extended result -** codes are disabled by default for historical compatibility considerations. -** -** Requirements: -** [H12201] [H12202] +** ^The sqlite3_extended_result_codes() routine enables or disables the +** [extended result codes] feature of SQLite. ^The extended result +** codes are disabled by default for historical compatibility. */ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); /* -** CAPI3REF: Last Insert Rowid {H12220} +** CAPI3REF: Last Insert Rowid ** -** Each entry in an SQLite table has a unique 64-bit signed -** integer key called the [ROWID | "rowid"]. The rowid is always available +** ^Each entry in an SQLite table has a unique 64-bit signed +** integer key called the [ROWID | "rowid"]. ^The rowid is always available ** as an undeclared column named ROWID, OID, or _ROWID_ as long as those -** names are not also used by explicitly declared columns. If +** names are not also used by explicitly declared columns. ^If ** the table has a column of type [INTEGER PRIMARY KEY] then that column ** is another alias for the rowid. ** -** This routine returns the [rowid] of the most recent +** ^This routine returns the [rowid] of the most recent ** successful [INSERT] into the database from the [database connection] -** in the first argument. If no successful [INSERT]s +** in the first argument. ^If no successful [INSERT]s ** have ever occurred on that database connection, zero is returned. ** -** If an [INSERT] occurs within a trigger, then the [rowid] of the inserted +** ^(If an [INSERT] occurs within a trigger, then the [rowid] of the inserted ** row is returned by this routine as long as the trigger is running. ** But once the trigger terminates, the value returned by this routine -** reverts to the last value inserted before the trigger fired. +** reverts to the last value inserted before the trigger fired.)^ ** -** An [INSERT] that fails due to a constraint violation is not a +** ^An [INSERT] that fails due to a constraint violation is not a ** successful [INSERT] and does not change the value returned by this -** routine. Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, +** routine. ^Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, ** and INSERT OR ABORT make no changes to the return value of this -** routine when their insertion fails. When INSERT OR REPLACE +** routine when their insertion fails. ^(When INSERT OR REPLACE ** encounters a constraint violation, it does not fail. The ** INSERT continues to completion after deleting rows that caused ** the constraint problem so INSERT OR REPLACE will always change -** the return value of this interface. +** the return value of this interface.)^ ** -** For the purposes of this routine, an [INSERT] is considered to +** ^For the purposes of this routine, an [INSERT] is considered to ** be successful even if it is subsequently rolled back. ** -** Requirements: -** [H12221] [H12223] +** This function is accessible to SQL statements via the +** [last_insert_rowid() SQL function]. ** ** If a separate thread performs a new [INSERT] on the same ** database connection while the [sqlite3_last_insert_rowid()] @@ -1844,25 +2265,25 @@ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); /* -** CAPI3REF: Count The Number Of Rows Modified {H12240} +** CAPI3REF: Count The Number Of Rows Modified ** -** This function returns the number of database rows that were changed +** ^This function returns the number of database rows that were changed ** or inserted or deleted by the most recently completed SQL statement ** on the [database connection] specified by the first parameter. -** Only changes that are directly specified by the [INSERT], [UPDATE], +** ^(Only changes that are directly specified by the [INSERT], [UPDATE], ** or [DELETE] statement are counted. Auxiliary changes caused by -** triggers or [foreign key actions] are not counted. Use the +** triggers or [foreign key actions] are not counted.)^ Use the ** [sqlite3_total_changes()] function to find the total number of changes ** including changes caused by triggers and foreign key actions. ** -** Changes to a view that are simulated by an [INSTEAD OF trigger] +** ^Changes to a view that are simulated by an [INSTEAD OF trigger] ** are not counted. Only real table changes are counted. ** -** A "row change" is a change to a single row of a single table +** ^(A "row change" is a change to a single row of a single table ** caused by an INSERT, DELETE, or UPDATE statement. Rows that ** are changed as side effects of [REPLACE] constraint resolution, ** rollback, ABORT processing, [DROP TABLE], or by any other -** mechanisms do not count as direct row changes. +** mechanisms do not count as direct row changes.)^ ** ** A "trigger context" is a scope of execution that begins and ** ends with the script of a [CREATE TRIGGER | trigger]. @@ -1872,27 +2293,24 @@ SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); ** new trigger context is entered for the duration of that one ** trigger. Subtriggers create subcontexts for their duration. ** -** Calling [sqlite3_exec()] or [sqlite3_step()] recursively does +** ^Calling [sqlite3_exec()] or [sqlite3_step()] recursively does ** not create a new trigger context. ** -** This function returns the number of direct row changes in the +** ^This function returns the number of direct row changes in the ** most recent INSERT, UPDATE, or DELETE statement within the same ** trigger context. ** -** Thus, when called from the top level, this function returns the +** ^Thus, when called from the top level, this function returns the ** number of changes in the most recent INSERT, UPDATE, or DELETE -** that also occurred at the top level. Within the body of a trigger, +** that also occurred at the top level. ^(Within the body of a trigger, ** the sqlite3_changes() interface can be called to find the number of ** changes in the most recently completed INSERT, UPDATE, or DELETE ** statement within the body of the same trigger. ** However, the number returned does not include changes -** caused by subtriggers since those have their own context. +** caused by subtriggers since those have their own context.)^ ** -** See also the [sqlite3_total_changes()] interface and the -** [count_changes pragma]. -** -** Requirements: -** [H12241] [H12243] +** See also the [sqlite3_total_changes()] interface, the +** [count_changes pragma], and the [changes() SQL function]. ** ** If a separate thread makes changes on the same database connection ** while [sqlite3_changes()] is running then the value returned @@ -1901,26 +2319,24 @@ SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); SQLITE_API int sqlite3_changes(sqlite3*); /* -** CAPI3REF: Total Number Of Rows Modified {H12260} +** CAPI3REF: Total Number Of Rows Modified ** -** This function returns the number of row changes caused by [INSERT], +** ^This function returns the number of row changes caused by [INSERT], ** [UPDATE] or [DELETE] statements since the [database connection] was opened. -** The count includes all changes from all [CREATE TRIGGER | trigger] -** contexts and changes made by [foreign key actions]. However, +** ^(The count returned by sqlite3_total_changes() includes all changes +** from all [CREATE TRIGGER | trigger] contexts and changes made by +** [foreign key actions]. However, ** the count does not include changes used to implement [REPLACE] constraints, ** do rollbacks or ABORT processing, or [DROP TABLE] processing. The ** count does not include rows of views that fire an [INSTEAD OF trigger], ** though if the INSTEAD OF trigger makes changes of its own, those changes -** are counted. -** The changes are counted as soon as the statement that makes them is -** completed (when the statement handle is passed to [sqlite3_reset()] or -** [sqlite3_finalize()]). +** are counted.)^ +** ^The sqlite3_total_changes() function counts the changes as soon as +** the statement that makes them is completed (when the statement handle +** is passed to [sqlite3_reset()] or [sqlite3_finalize()]). ** -** See also the [sqlite3_changes()] interface and the -** [count_changes pragma]. -** -** Requirements: -** [H12261] [H12263] +** See also the [sqlite3_changes()] interface, the +** [count_changes pragma], and the [total_changes() SQL function]. ** ** If a separate thread makes changes on the same database connection ** while [sqlite3_total_changes()] is running then the value @@ -1929,75 +2345,70 @@ SQLITE_API int sqlite3_changes(sqlite3*); SQLITE_API int sqlite3_total_changes(sqlite3*); /* -** CAPI3REF: Interrupt A Long-Running Query {H12270} +** CAPI3REF: Interrupt A Long-Running Query ** -** This function causes any pending database operation to abort and +** ^This function causes any pending database operation to abort and ** return at its earliest opportunity. This routine is typically ** called in response to a user action such as pressing "Cancel" ** or Ctrl-C where the user wants a long query operation to halt ** immediately. ** -** It is safe to call this routine from a thread different from the +** ^It is safe to call this routine from a thread different from the ** thread that is currently running the database operation. But it ** is not safe to call this routine with a [database connection] that ** is closed or might close before sqlite3_interrupt() returns. ** -** If an SQL operation is very nearly finished at the time when +** ^If an SQL operation is very nearly finished at the time when ** sqlite3_interrupt() is called, then it might not have an opportunity ** to be interrupted and might continue to completion. ** -** An SQL operation that is interrupted will return [SQLITE_INTERRUPT]. -** If the interrupted SQL operation is an INSERT, UPDATE, or DELETE +** ^An SQL operation that is interrupted will return [SQLITE_INTERRUPT]. +** ^If the interrupted SQL operation is an INSERT, UPDATE, or DELETE ** that is inside an explicit transaction, then the entire transaction ** will be rolled back automatically. ** -** The sqlite3_interrupt(D) call is in effect until all currently running -** SQL statements on [database connection] D complete. Any new SQL statements +** ^The sqlite3_interrupt(D) call is in effect until all currently running +** SQL statements on [database connection] D complete. ^Any new SQL statements ** that are started after the sqlite3_interrupt() call and before the ** running statements reaches zero are interrupted as if they had been -** running prior to the sqlite3_interrupt() call. New SQL statements +** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are ** not effected by the sqlite3_interrupt(). -** A call to sqlite3_interrupt(D) that occurs when there are no running +** ^A call to sqlite3_interrupt(D) that occurs when there are no running ** SQL statements is a no-op and has no effect on SQL statements ** that are started after the sqlite3_interrupt() call returns. ** -** Requirements: -** [H12271] [H12272] -** ** If the database connection closes while [sqlite3_interrupt()] ** is running then bad things will likely happen. */ SQLITE_API void sqlite3_interrupt(sqlite3*); /* -** CAPI3REF: Determine If An SQL Statement Is Complete {H10510} +** CAPI3REF: Determine If An SQL Statement Is Complete ** ** These routines are useful during command-line input to determine if the ** currently entered text seems to form a complete SQL statement or ** if additional input is needed before sending the text into -** SQLite for parsing. These routines return 1 if the input string -** appears to be a complete SQL statement. A statement is judged to be +** SQLite for parsing. ^These routines return 1 if the input string +** appears to be a complete SQL statement. ^A statement is judged to be ** complete if it ends with a semicolon token and is not a prefix of a -** well-formed CREATE TRIGGER statement. Semicolons that are embedded within +** well-formed CREATE TRIGGER statement. ^Semicolons that are embedded within ** string literals or quoted identifier names or comments are not ** independent tokens (they are part of the token in which they are -** embedded) and thus do not count as a statement terminator. Whitespace +** embedded) and thus do not count as a statement terminator. ^Whitespace ** and comments that follow the final semicolon are ignored. ** -** These routines return 0 if the statement is incomplete. If a +** ^These routines return 0 if the statement is incomplete. ^If a ** memory allocation fails, then SQLITE_NOMEM is returned. ** -** These routines do not parse the SQL statements thus +** ^These routines do not parse the SQL statements thus ** will not detect syntactically incorrect SQL. ** -** If SQLite has not been initialized using [sqlite3_initialize()] prior +** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked ** automatically by sqlite3_complete16(). If that initialization fails, ** then the return value from sqlite3_complete16() will be non-zero -** regardless of whether or not the input SQL is complete. -** -** Requirements: [H10511] [H10512] +** regardless of whether or not the input SQL is complete.)^ ** ** The input to [sqlite3_complete()] must be a zero-terminated ** UTF-8 string. @@ -2009,27 +2420,27 @@ SQLITE_API int sqlite3_complete(const char *sql); SQLITE_API int sqlite3_complete16(const void *sql); /* -** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors {H12310} +** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors ** -** This routine sets a callback function that might be invoked whenever +** ^This routine sets a callback function that might be invoked whenever ** an attempt is made to open a database table that another thread ** or process has locked. ** -** If the busy callback is NULL, then [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] -** is returned immediately upon encountering the lock. If the busy callback -** is not NULL, then the callback will be invoked with two arguments. +** ^If the busy callback is NULL, then [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] +** is returned immediately upon encountering the lock. ^If the busy callback +** is not NULL, then the callback might be invoked with two arguments. ** -** The first argument to the handler is a copy of the void* pointer which -** is the third argument to sqlite3_busy_handler(). The second argument to -** the handler callback is the number of times that the busy handler has -** been invoked for this locking event. If the +** ^The first argument to the busy handler is a copy of the void* pointer which +** is the third argument to sqlite3_busy_handler(). ^The second argument to +** the busy handler callback is the number of times that the busy handler has +** been invoked for this locking event. ^If the ** busy callback returns 0, then no additional attempts are made to ** access the database and [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] is returned. -** If the callback returns non-zero, then another attempt +** ^If the callback returns non-zero, then another attempt ** is made to open the database for reading and the cycle repeats. ** ** The presence of a busy handler does not guarantee that it will be invoked -** when there is lock contention. If SQLite determines that invoking the busy +** when there is lock contention. ^If SQLite determines that invoking the busy ** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] ** or [SQLITE_IOERR_BLOCKED] instead of invoking the busy handler. ** Consider a scenario where one process is holding a read lock that @@ -2043,65 +2454,62 @@ SQLITE_API int sqlite3_complete16(const void *sql); ** will induce the first process to release its read lock and allow ** the second process to proceed. ** -** The default busy callback is NULL. +** ^The default busy callback is NULL. ** -** The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED] +** ^The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED] ** when SQLite is in the middle of a large transaction where all the ** changes will not fit into the in-memory cache. SQLite will ** already hold a RESERVED lock on the database file, but it needs ** to promote this lock to EXCLUSIVE so that it can spill cache ** pages into the database file without harm to concurrent -** readers. If it is unable to promote the lock, then the in-memory +** readers. ^If it is unable to promote the lock, then the in-memory ** cache will be left in an inconsistent state and so the error ** code is promoted from the relatively benign [SQLITE_BUSY] to -** the more severe [SQLITE_IOERR_BLOCKED]. This error code promotion +** the more severe [SQLITE_IOERR_BLOCKED]. ^This error code promotion ** forces an automatic rollback of the changes. See the ** ** CorruptionFollowingBusyError wiki page for a discussion of why ** this is important. ** -** There can only be a single busy handler defined for each +** ^(There can only be a single busy handler defined for each ** [database connection]. Setting a new busy handler clears any -** previously set handler. Note that calling [sqlite3_busy_timeout()] +** previously set handler.)^ ^Note that calling [sqlite3_busy_timeout()] ** will also set or clear the busy handler. ** ** The busy callback should not take any actions which modify the ** database connection that invoked the busy handler. Any such actions ** result in undefined behavior. ** -** Requirements: -** [H12311] [H12312] [H12314] [H12316] [H12318] -** ** A busy handler must not close the database connection ** or [prepared statement] that invoked the busy handler. */ SQLITE_API int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); /* -** CAPI3REF: Set A Busy Timeout {H12340} +** CAPI3REF: Set A Busy Timeout ** -** This routine sets a [sqlite3_busy_handler | busy handler] that sleeps -** for a specified amount of time when a table is locked. The handler +** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps +** for a specified amount of time when a table is locked. ^The handler ** will sleep multiple times until at least "ms" milliseconds of sleeping -** have accumulated. {H12343} After "ms" milliseconds of sleeping, +** have accumulated. ^After at least "ms" milliseconds of sleeping, ** the handler returns 0 which causes [sqlite3_step()] to return ** [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED]. ** -** Calling this routine with an argument less than or equal to zero +** ^Calling this routine with an argument less than or equal to zero ** turns off all busy handlers. ** -** There can only be a single busy handler for a particular +** ^(There can only be a single busy handler for a particular ** [database connection] any any given moment. If another busy handler ** was defined (using [sqlite3_busy_handler()]) prior to calling -** this routine, that other busy handler is cleared. -** -** Requirements: -** [H12341] [H12343] [H12344] +** this routine, that other busy handler is cleared.)^ */ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); /* -** CAPI3REF: Convenience Routines For Running Queries {H12370} +** CAPI3REF: Convenience Routines For Running Queries +** +** This is a legacy interface that is preserved for backwards compatibility. +** Use of this interface is not recommended. ** ** Definition: A result table is memory data structure created by the ** [sqlite3_get_table()] interface. A result table records the @@ -2123,7 +2531,7 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); ** It is not safe to pass a result table directly to [sqlite3_free()]. ** A result table should be deallocated using [sqlite3_free_table()]. ** -** As an example of the result table format, suppose a query result +** ^(As an example of the result table format, suppose a query result ** is as follows: ** **
    @@ -2147,15 +2555,15 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
     **        azResult[5] = "28";
     **        azResult[6] = "Cindy";
     **        azResult[7] = "21";
    -** 
    +** )^ ** -** The sqlite3_get_table() function evaluates one or more +** ^The sqlite3_get_table() function evaluates one or more ** semicolon-separated SQL statements in the zero-terminated UTF-8 -** string of its 2nd parameter. It returns a result table to the +** string of its 2nd parameter and returns a result table to the ** pointer given in its 3rd parameter. ** -** After the calling function has finished using the result, it should -** pass the pointer to the result table to sqlite3_free_table() in order to +** After the application has finished with the result from sqlite3_get_table(), +** it must pass the result table pointer to sqlite3_free_table() in order to ** release the memory that was malloced. Because of the way the ** [sqlite3_malloc()] happens within sqlite3_get_table(), the calling ** function must not try to call [sqlite3_free()] directly. Only @@ -2166,10 +2574,8 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); ** to any internal data structures of SQLite. It uses only the public ** interface defined here. As a consequence, errors that occur in the ** wrapper layer outside of the internal [sqlite3_exec()] call are not -** reflected in subsequent calls to [sqlite3_errcode()] or [sqlite3_errmsg()]. -** -** Requirements: -** [H12371] [H12373] [H12374] [H12376] [H12379] [H12382] +** reflected in subsequent calls to [sqlite3_errcode()] or +** [sqlite3_errmsg()]. */ SQLITE_API int sqlite3_get_table( sqlite3 *db, /* An open database */ @@ -2182,33 +2588,33 @@ SQLITE_API int sqlite3_get_table( SQLITE_API void sqlite3_free_table(char **result); /* -** CAPI3REF: Formatted String Printing Functions {H17400} +** CAPI3REF: Formatted String Printing Functions ** ** These routines are work-alikes of the "printf()" family of functions ** from the standard C library. ** -** The sqlite3_mprintf() and sqlite3_vmprintf() routines write their +** ^The sqlite3_mprintf() and sqlite3_vmprintf() routines write their ** results into memory obtained from [sqlite3_malloc()]. ** The strings returned by these two routines should be -** released by [sqlite3_free()]. Both routines return a +** released by [sqlite3_free()]. ^Both routines return a ** NULL pointer if [sqlite3_malloc()] is unable to allocate enough ** memory to hold the resulting string. ** -** In sqlite3_snprintf() routine is similar to "snprintf()" from +** ^(In sqlite3_snprintf() routine is similar to "snprintf()" from ** the standard C library. The result is written into the ** buffer supplied as the second parameter whose size is given by ** the first parameter. Note that the order of the -** first two parameters is reversed from snprintf(). This is an +** first two parameters is reversed from snprintf().)^ This is an ** historical accident that cannot be fixed without breaking -** backwards compatibility. Note also that sqlite3_snprintf() +** backwards compatibility. ^(Note also that sqlite3_snprintf() ** returns a pointer to its buffer instead of the number of -** characters actually written into the buffer. We admit that +** characters actually written into the buffer.)^ We admit that ** the number of characters written would be a more useful return ** value but we cannot change the implementation of sqlite3_snprintf() ** now without breaking compatibility. ** -** As long as the buffer size is greater than zero, sqlite3_snprintf() -** guarantees that the buffer is always zero-terminated. The first +** ^As long as the buffer size is greater than zero, sqlite3_snprintf() +** guarantees that the buffer is always zero-terminated. ^The first ** parameter "n" is the total size of the buffer, including space for ** the zero terminator. So the longest string that can be completely ** written will be n-1 characters. @@ -2218,9 +2624,9 @@ SQLITE_API void sqlite3_free_table(char **result); ** All of the usual printf() formatting options apply. In addition, there ** is are "%q", "%Q", and "%z" options. ** -** The %q option works like %s in that it substitutes a null-terminated +** ^(The %q option works like %s in that it substitutes a null-terminated ** string from the argument list. But %q also doubles every '\'' character. -** %q is designed for use inside a string literal. By doubling each '\'' +** %q is designed for use inside a string literal.)^ By doubling each '\'' ** character it escapes that character and allows it to be inserted into ** the string. ** @@ -2255,10 +2661,10 @@ SQLITE_API void sqlite3_free_table(char **result); ** This second example is an SQL syntax error. As a general rule you should ** always use %q instead of %s when inserting text into a string literal. ** -** The %Q option works like %q except it also adds single quotes around +** ^(The %Q option works like %q except it also adds single quotes around ** the outside of the total string. Additionally, if the parameter in the ** argument list is a NULL pointer, %Q substitutes the text "NULL" (without -** single quotes) in place of the %Q option. So, for example, one could say: +** single quotes).)^ So, for example, one could say: ** **
     **  char *zSQL = sqlite3_mprintf("INSERT INTO table VALUES(%Q)", zText);
    @@ -2269,35 +2675,32 @@ SQLITE_API void sqlite3_free_table(char **result);
     ** The code above will render a correct SQL statement in the zSQL
     ** variable even if the zText variable is a NULL pointer.
     **
    -** The "%z" formatting option works exactly like "%s" with the
    +** ^(The "%z" formatting option works like "%s" but with the
     ** addition that after the string has been read and copied into
    -** the result, [sqlite3_free()] is called on the input string. {END}
    -**
    -** Requirements:
    -** [H17403] [H17406] [H17407]
    +** the result, [sqlite3_free()] is called on the input string.)^
     */
     SQLITE_API char *sqlite3_mprintf(const char*,...);
     SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
     SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
     
     /*
    -** CAPI3REF: Memory Allocation Subsystem {H17300} 
    +** CAPI3REF: Memory Allocation Subsystem
     **
    -** The SQLite core  uses these three routines for all of its own
    +** The SQLite core uses these three routines for all of its own
     ** internal memory allocation needs. "Core" in the previous sentence
     ** does not include operating-system specific VFS implementation.  The
     ** Windows VFS uses native malloc() and free() for some operations.
     **
    -** The sqlite3_malloc() routine returns a pointer to a block
    +** ^The sqlite3_malloc() routine returns a pointer to a block
     ** of memory at least N bytes in length, where N is the parameter.
    -** If sqlite3_malloc() is unable to obtain sufficient free
    -** memory, it returns a NULL pointer.  If the parameter N to
    +** ^If sqlite3_malloc() is unable to obtain sufficient free
    +** memory, it returns a NULL pointer.  ^If the parameter N to
     ** sqlite3_malloc() is zero or negative then sqlite3_malloc() returns
     ** a NULL pointer.
     **
    -** Calling sqlite3_free() with a pointer previously returned
    +** ^Calling sqlite3_free() with a pointer previously returned
     ** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
    -** that it might be reused.  The sqlite3_free() routine is
    +** that it might be reused.  ^The sqlite3_free() routine is
     ** a no-op if is called with a NULL pointer.  Passing a NULL pointer
     ** to sqlite3_free() is harmless.  After being freed, memory
     ** should neither be read nor written.  Even reading previously freed
    @@ -2306,34 +2709,27 @@ SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
     ** might result if sqlite3_free() is called with a non-NULL pointer that
     ** was not obtained from sqlite3_malloc() or sqlite3_realloc().
     **
    -** The sqlite3_realloc() interface attempts to resize a
    +** ^(The sqlite3_realloc() interface attempts to resize a
     ** prior memory allocation to be at least N bytes, where N is the
     ** second parameter.  The memory allocation to be resized is the first
    -** parameter.  If the first parameter to sqlite3_realloc()
    +** parameter.)^ ^ If the first parameter to sqlite3_realloc()
     ** is a NULL pointer then its behavior is identical to calling
     ** sqlite3_malloc(N) where N is the second parameter to sqlite3_realloc().
    -** If the second parameter to sqlite3_realloc() is zero or
    +** ^If the second parameter to sqlite3_realloc() is zero or
     ** negative then the behavior is exactly the same as calling
     ** sqlite3_free(P) where P is the first parameter to sqlite3_realloc().
    -** sqlite3_realloc() returns a pointer to a memory allocation
    +** ^sqlite3_realloc() returns a pointer to a memory allocation
     ** of at least N bytes in size or NULL if sufficient memory is unavailable.
    -** If M is the size of the prior allocation, then min(N,M) bytes
    +** ^If M is the size of the prior allocation, then min(N,M) bytes
     ** of the prior allocation are copied into the beginning of buffer returned
     ** by sqlite3_realloc() and the prior allocation is freed.
    -** If sqlite3_realloc() returns NULL, then the prior allocation
    +** ^If sqlite3_realloc() returns NULL, then the prior allocation
     ** is not freed.
     **
    -** The memory returned by sqlite3_malloc() and sqlite3_realloc()
    -** is always aligned to at least an 8 byte boundary. {END}
    -**
    -** The default implementation of the memory allocation subsystem uses
    -** the malloc(), realloc() and free() provided by the standard C library.
    -** {H17382} However, if SQLite is compiled with the
    -** SQLITE_MEMORY_SIZE=NNN C preprocessor macro (where NNN
    -** is an integer), then SQLite create a static array of at least
    -** NNN bytes in size and uses that array for all of its dynamic
    -** memory allocation needs. {END}  Additional memory allocator options
    -** may be added in future releases.
    +** ^The memory returned by sqlite3_malloc() and sqlite3_realloc()
    +** is always aligned to at least an 8 byte boundary, or to a
    +** 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time
    +** option is used.
     **
     ** In SQLite version 3.5.0 and 3.5.1, it was possible to define
     ** the SQLITE_OMIT_MEMORY_ALLOCATION which would cause the built-in
    @@ -2348,10 +2744,6 @@ SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
     ** they are reported back as [SQLITE_CANTOPEN] or
     ** [SQLITE_IOERR] rather than [SQLITE_NOMEM].
     **
    -** Requirements:
    -** [H17303] [H17304] [H17305] [H17306] [H17310] [H17312] [H17315] [H17318]
    -** [H17321] [H17322] [H17323]
    -**
     ** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()]
     ** must be either NULL or else pointers obtained from a prior
     ** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have
    @@ -2366,20 +2758,33 @@ SQLITE_API void *sqlite3_realloc(void*, int);
     SQLITE_API void sqlite3_free(void*);
     
     /*
    -** CAPI3REF: Memory Allocator Statistics {H17370} 
    +** CAPI3REF: Memory Allocator Statistics
     **
     ** SQLite provides these two interfaces for reporting on the status
     ** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()]
     ** routines, which form the built-in memory allocation subsystem.
     **
    -** Requirements:
    -** [H17371] [H17373] [H17374] [H17375]
    +** ^The [sqlite3_memory_used()] routine returns the number of bytes
    +** of memory currently outstanding (malloced but not freed).
    +** ^The [sqlite3_memory_highwater()] routine returns the maximum
    +** value of [sqlite3_memory_used()] since the high-water mark
    +** was last reset.  ^The values returned by [sqlite3_memory_used()] and
    +** [sqlite3_memory_highwater()] include any overhead
    +** added by SQLite in its implementation of [sqlite3_malloc()],
    +** but not overhead added by the any underlying system library
    +** routines that [sqlite3_malloc()] may call.
    +**
    +** ^The memory high-water mark is reset to the current value of
    +** [sqlite3_memory_used()] if and only if the parameter to
    +** [sqlite3_memory_highwater()] is true.  ^The value returned
    +** by [sqlite3_memory_highwater(1)] is the high-water mark
    +** prior to the reset.
     */
     SQLITE_API sqlite3_int64 sqlite3_memory_used(void);
     SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
     
     /*
    -** CAPI3REF: Pseudo-Random Number Generator {H17390} 
    +** CAPI3REF: Pseudo-Random Number Generator
     **
     ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
     ** select random [ROWID | ROWIDs] when inserting new records into a table that
    @@ -2387,60 +2792,57 @@ SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
     ** the build-in random() and randomblob() SQL functions.  This interface allows
     ** applications to access the same PRNG for other purposes.
     **
    -** A call to this routine stores N bytes of randomness into buffer P.
    +** ^A call to this routine stores N bytes of randomness into buffer P.
     **
    -** The first time this routine is invoked (either internally or by
    +** ^The first time this routine is invoked (either internally or by
     ** the application) the PRNG is seeded using randomness obtained
     ** from the xRandomness method of the default [sqlite3_vfs] object.
    -** On all subsequent invocations, the pseudo-randomness is generated
    +** ^On all subsequent invocations, the pseudo-randomness is generated
     ** internally and without recourse to the [sqlite3_vfs] xRandomness
     ** method.
    -**
    -** Requirements:
    -** [H17392]
     */
     SQLITE_API void sqlite3_randomness(int N, void *P);
     
     /*
    -** CAPI3REF: Compile-Time Authorization Callbacks {H12500} 
    +** CAPI3REF: Compile-Time Authorization Callbacks
     **
    -** This routine registers a authorizer callback with a particular
    +** ^This routine registers a authorizer callback with a particular
     ** [database connection], supplied in the first argument.
    -** The authorizer callback is invoked as SQL statements are being compiled
    +** ^The authorizer callback is invoked as SQL statements are being compiled
     ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()],
    -** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()].  At various
    +** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()].  ^At various
     ** points during the compilation process, as logic is being created
     ** to perform various actions, the authorizer callback is invoked to
    -** see if those actions are allowed.  The authorizer callback should
    +** see if those actions are allowed.  ^The authorizer callback should
     ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the
     ** specific action but allow the SQL statement to continue to be
     ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
    -** rejected with an error.  If the authorizer callback returns
    +** rejected with an error.  ^If the authorizer callback returns
     ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY]
     ** then the [sqlite3_prepare_v2()] or equivalent call that triggered
     ** the authorizer will fail with an error message.
     **
     ** When the callback returns [SQLITE_OK], that means the operation
    -** requested is ok.  When the callback returns [SQLITE_DENY], the
    +** requested is ok.  ^When the callback returns [SQLITE_DENY], the
     ** [sqlite3_prepare_v2()] or equivalent call that triggered the
     ** authorizer will fail with an error message explaining that
     ** access is denied. 
     **
    -** The first parameter to the authorizer callback is a copy of the third
    -** parameter to the sqlite3_set_authorizer() interface. The second parameter
    +** ^The first parameter to the authorizer callback is a copy of the third
    +** parameter to the sqlite3_set_authorizer() interface. ^The second parameter
     ** to the callback is an integer [SQLITE_COPY | action code] that specifies
    -** the particular action to be authorized. The third through sixth parameters
    +** the particular action to be authorized. ^The third through sixth parameters
     ** to the callback are zero-terminated strings that contain additional
     ** details about the action to be authorized.
     **
    -** If the action code is [SQLITE_READ]
    +** ^If the action code is [SQLITE_READ]
     ** and the callback returns [SQLITE_IGNORE] then the
     ** [prepared statement] statement is constructed to substitute
     ** a NULL value in place of the table column that would have
     ** been read if [SQLITE_OK] had been returned.  The [SQLITE_IGNORE]
     ** return can be used to deny an untrusted user access to individual
     ** columns of a table.
    -** If the action code is [SQLITE_DELETE] and the callback returns
    +** ^If the action code is [SQLITE_DELETE] and the callback returns
     ** [SQLITE_IGNORE] then the [DELETE] operation proceeds but the
     ** [truncate optimization] is disabled and all rows are deleted individually.
     **
    @@ -2460,9 +2862,9 @@ SQLITE_API void sqlite3_randomness(int N, void *P);
     ** and limiting database size using the [max_page_count] [PRAGMA]
     ** in addition to using an authorizer.
     **
    -** Only a single authorizer can be in place on a database connection
    +** ^(Only a single authorizer can be in place on a database connection
     ** at a time.  Each call to sqlite3_set_authorizer overrides the
    -** previous call.  Disable the authorizer by installing a NULL callback.
    +** previous call.)^  ^Disable the authorizer by installing a NULL callback.
     ** The authorizer is disabled by default.
     **
     ** The authorizer callback must not do anything that will modify
    @@ -2470,20 +2872,16 @@ SQLITE_API void sqlite3_randomness(int N, void *P);
     ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
     ** database connections for the meaning of "modify" in this paragraph.
     **
    -** When [sqlite3_prepare_v2()] is used to prepare a statement, the
    +** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the
     ** statement might be re-prepared during [sqlite3_step()] due to a 
     ** schema change.  Hence, the application should ensure that the
     ** correct authorizer callback remains in place during the [sqlite3_step()].
     **
    -** Note that the authorizer callback is invoked only during
    +** ^Note that the authorizer callback is invoked only during
     ** [sqlite3_prepare()] or its variants.  Authorization is not
     ** performed during statement evaluation in [sqlite3_step()], unless
     ** as stated in the previous paragraph, sqlite3_step() invokes
     ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
    -**
    -** Requirements:
    -** [H12501] [H12502] [H12503] [H12504] [H12505] [H12506] [H12507] [H12510]
    -** [H12511] [H12512] [H12520] [H12521] [H12522]
     */
     SQLITE_API int sqlite3_set_authorizer(
       sqlite3*,
    @@ -2492,7 +2890,7 @@ SQLITE_API int sqlite3_set_authorizer(
     );
     
     /*
    -** CAPI3REF: Authorizer Return Codes {H12590} 
    +** CAPI3REF: Authorizer Return Codes
     **
     ** The [sqlite3_set_authorizer | authorizer callback function] must
     ** return either [SQLITE_OK] or one of these two constants in order
    @@ -2504,7 +2902,7 @@ SQLITE_API int sqlite3_set_authorizer(
     #define SQLITE_IGNORE 2   /* Don't allow access, but don't generate an error */
     
     /*
    -** CAPI3REF: Authorizer Action Codes {H12550} 
    +** CAPI3REF: Authorizer Action Codes
     **
     ** The [sqlite3_set_authorizer()] interface registers a callback function
     ** that is invoked to authorize certain SQL statement actions.  The
    @@ -2515,15 +2913,12 @@ SQLITE_API int sqlite3_set_authorizer(
     ** These action code values signify what kind of operation is to be
     ** authorized.  The 3rd and 4th parameters to the authorization
     ** callback function will be parameters or NULL depending on which of these
    -** codes is used as the second parameter.  The 5th parameter to the
    +** codes is used as the second parameter.  ^(The 5th parameter to the
     ** authorizer callback is the name of the database ("main", "temp",
    -** etc.) if applicable.  The 6th parameter to the authorizer callback
    +** etc.) if applicable.)^  ^The 6th parameter to the authorizer callback
     ** is the name of the inner-most trigger or view that is responsible for
     ** the access attempt or NULL if this access attempt is directly from
     ** top-level SQL code.
    -**
    -** Requirements:
    -** [H12551] [H12552] [H12553] [H12554]
     */
     /******************************************* 3rd ************ 4th ***********/
     #define SQLITE_CREATE_INDEX          1   /* Index Name      Table Name      */
    @@ -2561,72 +2956,83 @@ SQLITE_API int sqlite3_set_authorizer(
     #define SQLITE_COPY                  0   /* No longer used */
     
     /*
    -** CAPI3REF: Tracing And Profiling Functions {H12280} 
    -** EXPERIMENTAL
    +** CAPI3REF: Tracing And Profiling Functions
     **
     ** These routines register callback functions that can be used for
     ** tracing and profiling the execution of SQL statements.
     **
    -** The callback function registered by sqlite3_trace() is invoked at
    +** ^The callback function registered by sqlite3_trace() is invoked at
     ** various times when an SQL statement is being run by [sqlite3_step()].
    -** The callback returns a UTF-8 rendering of the SQL statement text
    -** as the statement first begins executing.  Additional callbacks occur
    +** ^The sqlite3_trace() callback is invoked with a UTF-8 rendering of the
    +** SQL statement text as the statement first begins executing.
    +** ^(Additional sqlite3_trace() callbacks might occur
     ** as each triggered subprogram is entered.  The callbacks for triggers
    -** contain a UTF-8 SQL comment that identifies the trigger.
    +** contain a UTF-8 SQL comment that identifies the trigger.)^
     **
    -** The callback function registered by sqlite3_profile() is invoked
    -** as each SQL statement finishes.  The profile callback contains
    +** ^The callback function registered by sqlite3_profile() is invoked
    +** as each SQL statement finishes.  ^The profile callback contains
     ** the original statement text and an estimate of wall-clock time
    -** of how long that statement took to run.
    -**
    -** Requirements:
    -** [H12281] [H12282] [H12283] [H12284] [H12285] [H12287] [H12288] [H12289]
    -** [H12290]
    +** of how long that statement took to run.  ^The profile callback
    +** time is in units of nanoseconds, however the current implementation
    +** is only capable of millisecond resolution so the six least significant
    +** digits in the time are meaningless.  Future versions of SQLite
    +** might provide greater resolution on the profiler callback.  The
    +** sqlite3_profile() function is considered experimental and is
    +** subject to change in future versions of SQLite.
     */
    -SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
    +SQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);
     SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,
        void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
     
     /*
    -** CAPI3REF: Query Progress Callbacks {H12910} 
    +** CAPI3REF: Query Progress Callbacks
     **
    -** This routine configures a callback function - the
    -** progress callback - that is invoked periodically during long
    -** running calls to [sqlite3_exec()], [sqlite3_step()] and
    -** [sqlite3_get_table()].  An example use for this
    +** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback
    +** function X to be invoked periodically during long running calls to
    +** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for
    +** database connection D.  An example use for this
     ** interface is to keep a GUI updated during a large query.
     **
    -** If the progress callback returns non-zero, the operation is
    +** ^The parameter P is passed through as the only parameter to the 
    +** callback function X.  ^The parameter N is the number of 
    +** [virtual machine instructions] that are evaluated between successive
    +** invocations of the callback X.
    +**
    +** ^Only a single progress handler may be defined at one time per
    +** [database connection]; setting a new progress handler cancels the
    +** old one.  ^Setting parameter X to NULL disables the progress handler.
    +** ^The progress handler is also disabled by setting N to a value less
    +** than 1.
    +**
    +** ^If the progress callback returns non-zero, the operation is
     ** interrupted.  This feature can be used to implement a
     ** "Cancel" button on a GUI progress dialog box.
     **
    -** The progress handler must not do anything that will modify
    +** The progress handler callback must not do anything that will modify
     ** the database connection that invoked the progress handler.
     ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
     ** database connections for the meaning of "modify" in this paragraph.
     **
    -** Requirements:
    -** [H12911] [H12912] [H12913] [H12914] [H12915] [H12916] [H12917] [H12918]
    -**
     */
     SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
     
     /*
    -** CAPI3REF: Opening A New Database Connection {H12700} 
    +** CAPI3REF: Opening A New Database Connection
     **
    -** These routines open an SQLite database file whose name is given by the
    -** filename argument. The filename argument is interpreted as UTF-8 for
    +** ^These routines open an SQLite database file whose name is given by the
    +** filename argument. ^The filename argument is interpreted as UTF-8 for
     ** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte
    -** order for sqlite3_open16(). A [database connection] handle is usually
    +** order for sqlite3_open16(). ^(A [database connection] handle is usually
     ** returned in *ppDb, even if an error occurs.  The only exception is that
     ** if SQLite is unable to allocate memory to hold the [sqlite3] object,
     ** a NULL will be written into *ppDb instead of a pointer to the [sqlite3]
    -** object. If the database is opened (and/or created) successfully, then
    -** [SQLITE_OK] is returned.  Otherwise an [error code] is returned.  The
    +** object.)^ ^(If the database is opened (and/or created) successfully, then
    +** [SQLITE_OK] is returned.  Otherwise an [error code] is returned.)^ ^The
     ** [sqlite3_errmsg()] or [sqlite3_errmsg16()] routines can be used to obtain
    -** an English language description of the error.
    +** an English language description of the error following a failure of any
    +** of the sqlite3_open() routines.
     **
    -** The default encoding for the database will be UTF-8 if
    +** ^The default encoding for the database will be UTF-8 if
     ** sqlite3_open() or sqlite3_open_v2() is called and
     ** UTF-16 in the native byte order if sqlite3_open16() is used.
     **
    @@ -2636,60 +3042,61 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
     **
     ** The sqlite3_open_v2() interface works like sqlite3_open()
     ** except that it accepts two additional parameters for additional control
    -** over the new database connection.  The flags parameter can take one of
    +** over the new database connection.  ^(The flags parameter to
    +** sqlite3_open_v2() can take one of
     ** the following three values, optionally combined with the 
     ** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE],
    -** and/or [SQLITE_OPEN_PRIVATECACHE] flags:
    +** and/or [SQLITE_OPEN_PRIVATECACHE] flags:)^
     **
     ** 
    -**
    [SQLITE_OPEN_READONLY]
    +** ^(
    [SQLITE_OPEN_READONLY]
    **
    The database is opened in read-only mode. If the database does not -** already exist, an error is returned.
    +** already exist, an error is returned.)^ ** -**
    [SQLITE_OPEN_READWRITE]
    +** ^(
    [SQLITE_OPEN_READWRITE]
    **
    The database is opened for reading and writing if possible, or reading ** only if the file is write protected by the operating system. In either -** case the database must already exist, otherwise an error is returned.
    +** case the database must already exist, otherwise an error is returned.)^ ** -**
    [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]
    +** ^(
    [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]
    **
    The database is opened for reading and writing, and is creates it if ** it does not already exist. This is the behavior that is always used for -** sqlite3_open() and sqlite3_open16().
    +** sqlite3_open() and sqlite3_open16().)^ **
    ** ** If the 3rd parameter to sqlite3_open_v2() is not one of the ** combinations shown above or one of the combinations shown above combined ** with the [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], -** [SQLITE_OPEN_SHAREDCACHE] and/or [SQLITE_OPEN_SHAREDCACHE] flags, +** [SQLITE_OPEN_SHAREDCACHE] and/or [SQLITE_OPEN_PRIVATECACHE] flags, ** then the behavior is undefined. ** -** If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection +** ^If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection ** opens in the multi-thread [threading mode] as long as the single-thread -** mode has not been set at compile-time or start-time. If the +** mode has not been set at compile-time or start-time. ^If the ** [SQLITE_OPEN_FULLMUTEX] flag is set then the database connection opens ** in the serialized [threading mode] unless single-thread was ** previously selected at compile-time or start-time. -** The [SQLITE_OPEN_SHAREDCACHE] flag causes the database connection to be +** ^The [SQLITE_OPEN_SHAREDCACHE] flag causes the database connection to be ** eligible to use [shared cache mode], regardless of whether or not shared -** cache is enabled using [sqlite3_enable_shared_cache()]. The +** cache is enabled using [sqlite3_enable_shared_cache()]. ^The ** [SQLITE_OPEN_PRIVATECACHE] flag causes the database connection to not ** participate in [shared cache mode] even if it is enabled. ** -** If the filename is ":memory:", then a private, temporary in-memory database -** is created for the connection. This in-memory database will vanish when +** ^If the filename is ":memory:", then a private, temporary in-memory database +** is created for the connection. ^This in-memory database will vanish when ** the database connection is closed. Future versions of SQLite might ** make use of additional special filenames that begin with the ":" character. ** It is recommended that when a database filename actually does begin with ** a ":" character you should prefix the filename with a pathname such as ** "./" to avoid ambiguity. ** -** If the filename is an empty string, then a private, temporary -** on-disk database will be created. This private database will be +** ^If the filename is an empty string, then a private, temporary +** on-disk database will be created. ^This private database will be ** automatically deleted as soon as the database connection is closed. ** -** The fourth parameter to sqlite3_open_v2() is the name of the +** ^The fourth parameter to sqlite3_open_v2() is the name of the ** [sqlite3_vfs] object that defines the operating system interface that -** the new database connection should use. If the fourth parameter is +** the new database connection should use. ^If the fourth parameter is ** a NULL pointer then the default [sqlite3_vfs] object is used. ** ** Note to Windows users: The encoding used for the filename argument @@ -2697,10 +3104,6 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** codepage is currently defined. Filenames containing international ** characters must be converted to UTF-8 prior to passing them into ** sqlite3_open() or sqlite3_open_v2(). -** -** Requirements: -** [H12701] [H12702] [H12703] [H12704] [H12706] [H12707] [H12709] [H12711] -** [H12712] [H12713] [H12714] [H12717] [H12719] [H12721] [H12723] */ SQLITE_API int sqlite3_open( const char *filename, /* Database filename (UTF-8) */ @@ -2718,23 +3121,23 @@ SQLITE_API int sqlite3_open_v2( ); /* -** CAPI3REF: Error Codes And Messages {H12800} +** CAPI3REF: Error Codes And Messages ** -** The sqlite3_errcode() interface returns the numeric [result code] or +** ^The sqlite3_errcode() interface returns the numeric [result code] or ** [extended result code] for the most recent failed sqlite3_* API call ** associated with a [database connection]. If a prior API call failed ** but the most recent API call succeeded, the return value from -** sqlite3_errcode() is undefined. The sqlite3_extended_errcode() +** sqlite3_errcode() is undefined. ^The sqlite3_extended_errcode() ** interface is the same except that it always returns the ** [extended result code] even when extended result codes are ** disabled. ** -** The sqlite3_errmsg() and sqlite3_errmsg16() return English-language +** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language ** text that describes the error, as either UTF-8 or UTF-16 respectively. -** Memory to hold the error message string is managed internally. +** ^(Memory to hold the error message string is managed internally. ** The application does not need to worry about freeing the result. ** However, the error string might be overwritten or deallocated by -** subsequent calls to other SQLite interface functions. +** subsequent calls to other SQLite interface functions.)^ ** ** When the serialized [threading mode] is in use, it might be the ** case that a second error occurs on a separate thread in between @@ -2749,9 +3152,6 @@ SQLITE_API int sqlite3_open_v2( ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. -** -** Requirements: -** [H12801] [H12802] [H12803] [H12807] [H12808] [H12809] */ SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); @@ -2759,7 +3159,7 @@ SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); /* -** CAPI3REF: SQL Statement Object {H13000} +** CAPI3REF: SQL Statement Object ** KEYWORDS: {prepared statement} {prepared statements} ** ** An instance of this object represents a single SQL statement. @@ -2785,25 +3185,30 @@ SQLITE_API const void *sqlite3_errmsg16(sqlite3*); typedef struct sqlite3_stmt sqlite3_stmt; /* -** CAPI3REF: Run-time Limits {H12760} +** CAPI3REF: Run-time Limits ** -** This interface allows the size of various constructs to be limited +** ^(This interface allows the size of various constructs to be limited ** on a connection by connection basis. The first parameter is the ** [database connection] whose limit is to be set or queried. The ** second parameter is one of the [limit categories] that define a ** class of constructs to be size limited. The third parameter is the -** new limit for that construct. The function returns the old limit. +** new limit for that construct.)^ ** -** If the new limit is a negative number, the limit is unchanged. -** For the limit category of SQLITE_LIMIT_XYZ there is a +** ^If the new limit is a negative number, the limit is unchanged. +** ^(For each limit category SQLITE_LIMIT_NAME there is a ** [limits | hard upper bound] -** set by a compile-time C preprocessor macro named -** [limits | SQLITE_MAX_XYZ]. -** (The "_LIMIT_" in the name is changed to "_MAX_".) -** Attempts to increase a limit above its hard upper bound are -** silently truncated to the hard upper limit. +** set at compile-time by a C preprocessor macro called +** [limits | SQLITE_MAX_NAME]. +** (The "_LIMIT_" in the name is changed to "_MAX_".))^ +** ^Attempts to increase a limit above its hard upper bound are +** silently truncated to the hard upper bound. ** -** Run time limits are intended for use in applications that manage +** ^Regardless of whether or not the limit was changed, the +** [sqlite3_limit()] interface returns the prior value of the limit. +** ^Hence, to find the current value of a limit without changing it, +** simply invoke this interface with the third parameter set to -1. +** +** Run-time limits are intended for use in applications that manage ** both their own internal database and also databases that are controlled ** by untrusted external sources. An example application might be a ** web browser that has its own databases for storing history and @@ -2817,14 +3222,11 @@ typedef struct sqlite3_stmt sqlite3_stmt; ** [max_page_count] [PRAGMA]. ** ** New run-time limit categories may be added in future releases. -** -** Requirements: -** [H12762] [H12766] [H12769] */ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); /* -** CAPI3REF: Run-Time Limit Categories {H12790} +** CAPI3REF: Run-Time Limit Categories ** KEYWORDS: {limit category} {*limit categories} ** ** These constants define various performance limits @@ -2833,43 +3235,44 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); ** Additional information is available at [limits | Limits in SQLite]. ** **
    -**
    SQLITE_LIMIT_LENGTH
    -**
    The maximum size of any string or BLOB or table row.
    +** ^(
    SQLITE_LIMIT_LENGTH
    +**
    The maximum size of any string or BLOB or table row, in bytes.
    )^ ** -**
    SQLITE_LIMIT_SQL_LENGTH
    -**
    The maximum length of an SQL statement.
    +** ^(
    SQLITE_LIMIT_SQL_LENGTH
    +**
    The maximum length of an SQL statement, in bytes.
    )^ ** -**
    SQLITE_LIMIT_COLUMN
    +** ^(
    SQLITE_LIMIT_COLUMN
    **
    The maximum number of columns in a table definition or in the ** result set of a [SELECT] or the maximum number of columns in an index -** or in an ORDER BY or GROUP BY clause.
    +** or in an ORDER BY or GROUP BY clause.)^ ** -**
    SQLITE_LIMIT_EXPR_DEPTH
    -**
    The maximum depth of the parse tree on any expression.
    +** ^(
    SQLITE_LIMIT_EXPR_DEPTH
    +**
    The maximum depth of the parse tree on any expression.
    )^ ** -**
    SQLITE_LIMIT_COMPOUND_SELECT
    -**
    The maximum number of terms in a compound SELECT statement.
    +** ^(
    SQLITE_LIMIT_COMPOUND_SELECT
    +**
    The maximum number of terms in a compound SELECT statement.
    )^ ** -**
    SQLITE_LIMIT_VDBE_OP
    +** ^(
    SQLITE_LIMIT_VDBE_OP
    **
    The maximum number of instructions in a virtual machine program -** used to implement an SQL statement.
    +** used to implement an SQL statement. This limit is not currently +** enforced, though that might be added in some future release of +** SQLite.)^ ** -**
    SQLITE_LIMIT_FUNCTION_ARG
    -**
    The maximum number of arguments on a function.
    +** ^(
    SQLITE_LIMIT_FUNCTION_ARG
    +**
    The maximum number of arguments on a function.
    )^ ** -**
    SQLITE_LIMIT_ATTACHED
    -**
    The maximum number of [ATTACH | attached databases].
    +** ^(
    SQLITE_LIMIT_ATTACHED
    +**
    The maximum number of [ATTACH | attached databases].)^
    ** -**
    SQLITE_LIMIT_LIKE_PATTERN_LENGTH
    +** ^(
    SQLITE_LIMIT_LIKE_PATTERN_LENGTH
    **
    The maximum length of the pattern argument to the [LIKE] or -** [GLOB] operators.
    +** [GLOB] operators.)^ ** -**
    SQLITE_LIMIT_VARIABLE_NUMBER
    -**
    The maximum number of variables in an SQL statement that can -** be bound.
    +** ^(
    SQLITE_LIMIT_VARIABLE_NUMBER
    +**
    The maximum index number of any [parameter] in an SQL statement.)^ ** -**
    SQLITE_LIMIT_TRIGGER_DEPTH
    -**
    The maximum depth of recursion for triggers.
    +** ^(
    SQLITE_LIMIT_TRIGGER_DEPTH
    +**
    The maximum depth of recursion for triggers.
    )^ **
    */ #define SQLITE_LIMIT_LENGTH 0 @@ -2885,7 +3288,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); #define SQLITE_LIMIT_TRIGGER_DEPTH 10 /* -** CAPI3REF: Compiling An SQL Statement {H13010} +** CAPI3REF: Compiling An SQL Statement ** KEYWORDS: {SQL statement compiler} ** ** To execute an SQL query, it must first be compiled into a byte-code @@ -2900,9 +3303,9 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); ** interfaces use UTF-8, and sqlite3_prepare16() and sqlite3_prepare16_v2() ** use UTF-16. ** -** If the nByte argument is less than zero, then zSql is read up to the -** first zero terminator. If nByte is non-negative, then it is the maximum -** number of bytes read from zSql. When nByte is non-negative, the +** ^If the nByte argument is less than zero, then zSql is read up to the +** first zero terminator. ^If nByte is non-negative, then it is the maximum +** number of bytes read from zSql. ^When nByte is non-negative, the ** zSql string ends at either the first '\000' or '\u0000' character or ** the nByte-th byte, whichever comes first. If the caller knows ** that the supplied string is nul-terminated, then there is a small @@ -2910,62 +3313,59 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); ** is equal to the number of bytes in the input string including ** the nul-terminator bytes. ** -** If pzTail is not NULL then *pzTail is made to point to the first byte +** ^If pzTail is not NULL then *pzTail is made to point to the first byte ** past the end of the first SQL statement in zSql. These routines only ** compile the first statement in zSql, so *pzTail is left pointing to ** what remains uncompiled. ** -** *ppStmt is left pointing to a compiled [prepared statement] that can be -** executed using [sqlite3_step()]. If there is an error, *ppStmt is set -** to NULL. If the input text contains no SQL (if the input is an empty +** ^*ppStmt is left pointing to a compiled [prepared statement] that can be +** executed using [sqlite3_step()]. ^If there is an error, *ppStmt is set +** to NULL. ^If the input text contains no SQL (if the input is an empty ** string or a comment) then *ppStmt is set to NULL. ** The calling procedure is responsible for deleting the compiled ** SQL statement using [sqlite3_finalize()] after it has finished with it. ** ppStmt may not be NULL. ** -** On success, [SQLITE_OK] is returned, otherwise an [error code] is returned. +** ^On success, the sqlite3_prepare() family of routines return [SQLITE_OK]; +** otherwise an [error code] is returned. ** ** The sqlite3_prepare_v2() and sqlite3_prepare16_v2() interfaces are ** recommended for all new programs. The two older interfaces are retained ** for backwards compatibility, but their use is discouraged. -** In the "v2" interfaces, the prepared statement +** ^In the "v2" interfaces, the prepared statement ** that is returned (the [sqlite3_stmt] object) contains a copy of the ** original SQL text. This causes the [sqlite3_step()] interface to -** behave a differently in three ways: +** behave differently in three ways: ** **
      **
    1. -** If the database schema changes, instead of returning [SQLITE_SCHEMA] as it +** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it ** always used to do, [sqlite3_step()] will automatically recompile the SQL -** statement and try to run it again. If the schema has changed in -** a way that makes the statement no longer valid, [sqlite3_step()] will still -** return [SQLITE_SCHEMA]. But unlike the legacy behavior, [SQLITE_SCHEMA] is -** now a fatal error. Calling [sqlite3_prepare_v2()] again will not make the -** error go away. Note: use [sqlite3_errmsg()] to find the text -** of the parsing error that results in an [SQLITE_SCHEMA] return. +** statement and try to run it again. **
    2. ** **
    3. -** When an error occurs, [sqlite3_step()] will return one of the detailed -** [error codes] or [extended error codes]. The legacy behavior was that +** ^When an error occurs, [sqlite3_step()] will return one of the detailed +** [error codes] or [extended error codes]. ^The legacy behavior was that ** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code -** and you would have to make a second call to [sqlite3_reset()] in order -** to find the underlying cause of the problem. With the "v2" prepare +** and the application would have to make a second call to [sqlite3_reset()] +** in order to find the underlying cause of the problem. With the "v2" prepare ** interfaces, the underlying reason for the error is returned immediately. **
    4. ** **
    5. -** ^If the value of a [parameter | host parameter] in the WHERE clause might -** change the query plan for a statement, then the statement may be -** automatically recompiled (as if there had been a schema change) on the first -** [sqlite3_step()] call following any change to the -** [sqlite3_bind_text | bindings] of the [parameter]. +** ^If the specific value bound to [parameter | host parameter] in the +** WHERE clause might influence the choice of query plan for a statement, +** then the statement will be automatically recompiled, as if there had been +** a schema change, on the first [sqlite3_step()] call following any change +** to the [sqlite3_bind_text | bindings] of that [parameter]. +** ^The specific value of WHERE-clause [parameter] might influence the +** choice of query plan if the parameter is the left-hand side of a [LIKE] +** or [GLOB] operator or if the parameter is compared to an indexed column +** and the [SQLITE_ENABLE_STAT2] compile-time option is enabled. +** the **
    6. **
    -** -** Requirements: -** [H13011] [H13012] [H13013] [H13014] [H13015] [H13016] [H13019] [H13021] -** */ SQLITE_API int sqlite3_prepare( sqlite3 *db, /* Database handle */ @@ -2997,24 +3397,21 @@ SQLITE_API int sqlite3_prepare16_v2( ); /* -** CAPI3REF: Retrieving Statement SQL {H13100} +** CAPI3REF: Retrieving Statement SQL ** -** This interface can be used to retrieve a saved copy of the original +** ^This interface can be used to retrieve a saved copy of the original ** SQL text used to create a [prepared statement] if that statement was ** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()]. -** -** Requirements: -** [H13101] [H13102] [H13103] */ SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); /* -** CAPI3REF: Dynamically Typed Value Object {H15000} +** CAPI3REF: Dynamically Typed Value Object ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} ** ** SQLite uses the sqlite3_value object to represent all values ** that can be stored in a database table. SQLite uses dynamic typing -** for the values it stores. Values stored in sqlite3_value objects +** for the values it stores. ^Values stored in sqlite3_value objects ** can be integers, floating point values, strings, BLOBs, or NULL. ** ** An sqlite3_value object may be either "protected" or "unprotected". @@ -3033,12 +3430,12 @@ SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); ** then there is no distinction between protected and unprotected ** sqlite3_value objects and they can be used interchangeably. However, ** for maximum code portability it is recommended that applications -** still make the distinction between between protected and unprotected +** still make the distinction between protected and unprotected ** sqlite3_value objects even when not strictly required. ** -** The sqlite3_value objects that are passed as parameters into the +** ^The sqlite3_value objects that are passed as parameters into the ** implementation of [application-defined SQL functions] are protected. -** The sqlite3_value object returned by +** ^The sqlite3_value object returned by ** [sqlite3_column_value()] is unprotected. ** Unprotected sqlite3_value objects may only be used with ** [sqlite3_result_value()] and [sqlite3_bind_value()]. @@ -3048,10 +3445,10 @@ SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); typedef struct Mem sqlite3_value; /* -** CAPI3REF: SQL Function Context Object {H16001} +** CAPI3REF: SQL Function Context Object ** ** The context in which an SQL function executes is stored in an -** sqlite3_context object. A pointer to an sqlite3_context object +** sqlite3_context object. ^A pointer to an sqlite3_context object ** is always first parameter to [application-defined SQL functions]. ** The application-defined SQL function implementation will pass this ** pointer through into calls to [sqlite3_result_int | sqlite3_result()], @@ -3062,11 +3459,11 @@ typedef struct Mem sqlite3_value; typedef struct sqlite3_context sqlite3_context; /* -** CAPI3REF: Binding Values To Prepared Statements {H13500} +** CAPI3REF: Binding Values To Prepared Statements ** KEYWORDS: {host parameter} {host parameters} {host parameter name} ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} ** -** In the SQL strings input to [sqlite3_prepare_v2()] and its variants, +** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants, ** literals may be replaced by a [parameter] that matches one of following ** templates: ** @@ -3079,72 +3476,66 @@ typedef struct sqlite3_context sqlite3_context; ** ** ** In the templates above, NNN represents an integer literal, -** and VVV represents an alphanumeric identifer. The values of these +** and VVV represents an alphanumeric identifier.)^ ^The values of these ** parameters (also called "host parameter names" or "SQL parameters") ** can be set using the sqlite3_bind_*() routines defined here. ** -** The first argument to the sqlite3_bind_*() routines is always +** ^The first argument to the sqlite3_bind_*() routines is always ** a pointer to the [sqlite3_stmt] object returned from ** [sqlite3_prepare_v2()] or its variants. ** -** The second argument is the index of the SQL parameter to be set. -** The leftmost SQL parameter has an index of 1. When the same named +** ^The second argument is the index of the SQL parameter to be set. +** ^The leftmost SQL parameter has an index of 1. ^When the same named ** SQL parameter is used more than once, second and subsequent ** occurrences have the same index as the first occurrence. -** The index for named parameters can be looked up using the -** [sqlite3_bind_parameter_index()] API if desired. The index +** ^The index for named parameters can be looked up using the +** [sqlite3_bind_parameter_index()] API if desired. ^The index ** for "?NNN" parameters is the value of NNN. -** The NNN value must be between 1 and the [sqlite3_limit()] +** ^The NNN value must be between 1 and the [sqlite3_limit()] ** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999). ** -** The third argument is the value to bind to the parameter. +** ^The third argument is the value to bind to the parameter. ** -** In those routines that have a fourth argument, its value is the +** ^(In those routines that have a fourth argument, its value is the ** number of bytes in the parameter. To be clear: the value is the -** number of bytes in the value, not the number of characters. -** If the fourth parameter is negative, the length of the string is +** number of bytes in the value, not the number of characters.)^ +** ^If the fourth parameter is negative, the length of the string is ** the number of bytes up to the first zero terminator. ** -** The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and +** ^The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and ** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or -** string after SQLite has finished with it. If the fifth argument is +** string after SQLite has finished with it. ^If the fifth argument is ** the special value [SQLITE_STATIC], then SQLite assumes that the ** information is in static, unmanaged space and does not need to be freed. -** If the fifth argument has the value [SQLITE_TRANSIENT], then +** ^If the fifth argument has the value [SQLITE_TRANSIENT], then ** SQLite makes its own private copy of the data immediately, before ** the sqlite3_bind_*() routine returns. ** -** The sqlite3_bind_zeroblob() routine binds a BLOB of length N that -** is filled with zeroes. A zeroblob uses a fixed amount of memory +** ^The sqlite3_bind_zeroblob() routine binds a BLOB of length N that +** is filled with zeroes. ^A zeroblob uses a fixed amount of memory ** (just an integer to hold its size) while it is being processed. ** Zeroblobs are intended to serve as placeholders for BLOBs whose ** content is later written using ** [sqlite3_blob_open | incremental BLOB I/O] routines. -** A negative value for the zeroblob results in a zero-length BLOB. +** ^A negative value for the zeroblob results in a zero-length BLOB. ** -** The sqlite3_bind_*() routines must be called after -** [sqlite3_prepare_v2()] (and its variants) or [sqlite3_reset()] and -** before [sqlite3_step()]. -** Bindings are not cleared by the [sqlite3_reset()] routine. -** Unbound parameters are interpreted as NULL. +** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer +** for the [prepared statement] or with a prepared statement for which +** [sqlite3_step()] has been called more recently than [sqlite3_reset()], +** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_() +** routine is passed a [prepared statement] that has been finalized, the +** result is undefined and probably harmful. ** -** These routines return [SQLITE_OK] on success or an error code if -** anything goes wrong. [SQLITE_RANGE] is returned if the parameter -** index is out of range. [SQLITE_NOMEM] is returned if malloc() fails. -** [SQLITE_MISUSE] might be returned if these routines are called on a -** virtual machine that is the wrong state or which has already been finalized. -** Detection of misuse is unreliable. Applications should not depend -** on SQLITE_MISUSE returns. SQLITE_MISUSE is intended to indicate a -** a logic error in the application. Future versions of SQLite might -** panic rather than return SQLITE_MISUSE. +** ^Bindings are not cleared by the [sqlite3_reset()] routine. +** ^Unbound parameters are interpreted as NULL. +** +** ^The sqlite3_bind_* routines return [SQLITE_OK] on success or an +** [error code] if anything goes wrong. +** ^[SQLITE_RANGE] is returned if the parameter +** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. ** ** See also: [sqlite3_bind_parameter_count()], ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13506] [H13509] [H13512] [H13515] [H13518] [H13521] [H13524] [H13527] -** [H13530] [H13533] [H13536] [H13539] [H13542] [H13545] [H13548] [H13551] -** */ SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double); @@ -3157,45 +3548,42 @@ SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); /* -** CAPI3REF: Number Of SQL Parameters {H13600} +** CAPI3REF: Number Of SQL Parameters ** -** This routine can be used to find the number of [SQL parameters] +** ^This routine can be used to find the number of [SQL parameters] ** in a [prepared statement]. SQL parameters are tokens of the ** form "?", "?NNN", ":AAA", "$AAA", or "@AAA" that serve as ** placeholders for values that are [sqlite3_bind_blob | bound] ** to the parameters at a later time. ** -** This routine actually returns the index of the largest (rightmost) +** ^(This routine actually returns the index of the largest (rightmost) ** parameter. For all forms except ?NNN, this will correspond to the -** number of unique parameters. If parameters of the ?NNN are used, -** there may be gaps in the list. +** number of unique parameters. If parameters of the ?NNN form are used, +** there may be gaps in the list.)^ ** ** See also: [sqlite3_bind_blob|sqlite3_bind()], ** [sqlite3_bind_parameter_name()], and ** [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13601] */ SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*); /* -** CAPI3REF: Name Of A Host Parameter {H13620} +** CAPI3REF: Name Of A Host Parameter ** -** This routine returns a pointer to the name of the n-th -** [SQL parameter] in a [prepared statement]. -** SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA" +** ^The sqlite3_bind_parameter_name(P,N) interface returns +** the name of the N-th [SQL parameter] in the [prepared statement] P. +** ^(SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA" ** have a name which is the string "?NNN" or ":AAA" or "@AAA" or "$AAA" ** respectively. ** In other words, the initial ":" or "$" or "@" or "?" -** is included as part of the name. -** Parameters of the form "?" without a following integer have no name -** and are also referred to as "anonymous parameters". +** is included as part of the name.)^ +** ^Parameters of the form "?" without a following integer have no name +** and are referred to as "nameless" or "anonymous parameters". ** -** The first host parameter has an index of 1, not 0. +** ^The first host parameter has an index of 1, not 0. ** -** If the value n is out of range or if the n-th parameter is -** nameless, then NULL is returned. The returned string is +** ^If the value N is out of range or if the N-th parameter is +** nameless, then NULL is returned. ^The returned string is ** always in UTF-8 encoding even if the named parameter was ** originally specified as UTF-16 in [sqlite3_prepare16()] or ** [sqlite3_prepare16_v2()]. @@ -3203,125 +3591,110 @@ SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*); ** See also: [sqlite3_bind_blob|sqlite3_bind()], ** [sqlite3_bind_parameter_count()], and ** [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13621] */ SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int); /* -** CAPI3REF: Index Of A Parameter With A Given Name {H13640} +** CAPI3REF: Index Of A Parameter With A Given Name ** -** Return the index of an SQL parameter given its name. The +** ^Return the index of an SQL parameter given its name. ^The ** index value returned is suitable for use as the second -** parameter to [sqlite3_bind_blob|sqlite3_bind()]. A zero -** is returned if no matching parameter is found. The parameter +** parameter to [sqlite3_bind_blob|sqlite3_bind()]. ^A zero +** is returned if no matching parameter is found. ^The parameter ** name must be given in UTF-8 even if the original statement ** was prepared from UTF-16 text using [sqlite3_prepare16_v2()]. ** ** See also: [sqlite3_bind_blob|sqlite3_bind()], ** [sqlite3_bind_parameter_count()], and ** [sqlite3_bind_parameter_index()]. -** -** Requirements: -** [H13641] */ SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); /* -** CAPI3REF: Reset All Bindings On A Prepared Statement {H13660} +** CAPI3REF: Reset All Bindings On A Prepared Statement ** -** Contrary to the intuition of many, [sqlite3_reset()] does not reset +** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset ** the [sqlite3_bind_blob | bindings] on a [prepared statement]. -** Use this routine to reset all host parameters to NULL. -** -** Requirements: -** [H13661] +** ^Use this routine to reset all host parameters to NULL. */ SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*); /* -** CAPI3REF: Number Of Columns In A Result Set {H13710} +** CAPI3REF: Number Of Columns In A Result Set ** -** Return the number of columns in the result set returned by the -** [prepared statement]. This routine returns 0 if pStmt is an SQL +** ^Return the number of columns in the result set returned by the +** [prepared statement]. ^This routine returns 0 if pStmt is an SQL ** statement that does not return data (for example an [UPDATE]). ** -** Requirements: -** [H13711] +** See also: [sqlite3_data_count()] */ SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt); /* -** CAPI3REF: Column Names In A Result Set {H13720} +** CAPI3REF: Column Names In A Result Set ** -** These routines return the name assigned to a particular column -** in the result set of a [SELECT] statement. The sqlite3_column_name() +** ^These routines return the name assigned to a particular column +** in the result set of a [SELECT] statement. ^The sqlite3_column_name() ** interface returns a pointer to a zero-terminated UTF-8 string ** and sqlite3_column_name16() returns a pointer to a zero-terminated -** UTF-16 string. The first parameter is the [prepared statement] -** that implements the [SELECT] statement. The second parameter is the -** column number. The leftmost column is number 0. +** UTF-16 string. ^The first parameter is the [prepared statement] +** that implements the [SELECT] statement. ^The second parameter is the +** column number. ^The leftmost column is number 0. ** -** The returned string pointer is valid until either the [prepared statement] +** ^The returned string pointer is valid until either the [prepared statement] ** is destroyed by [sqlite3_finalize()] or until the next call to ** sqlite3_column_name() or sqlite3_column_name16() on the same column. ** -** If sqlite3_malloc() fails during the processing of either routine +** ^If sqlite3_malloc() fails during the processing of either routine ** (for example during a conversion from UTF-8 to UTF-16) then a ** NULL pointer is returned. ** -** The name of a result column is the value of the "AS" clause for +** ^The name of a result column is the value of the "AS" clause for ** that column, if there is an AS clause. If there is no AS clause ** then the name of the column is unspecified and may change from ** one release of SQLite to the next. -** -** Requirements: -** [H13721] [H13723] [H13724] [H13725] [H13726] [H13727] */ SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N); SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N); /* -** CAPI3REF: Source Of Data In A Query Result {H13740} +** CAPI3REF: Source Of Data In A Query Result ** -** These routines provide a means to determine what column of what -** table in which database a result of a [SELECT] statement comes from. -** The name of the database or table or column can be returned as -** either a UTF-8 or UTF-16 string. The _database_ routines return +** ^These routines provide a means to determine the database, table, and +** table column that is the origin of a particular result column in +** [SELECT] statement. +** ^The name of the database or table or column can be returned as +** either a UTF-8 or UTF-16 string. ^The _database_ routines return ** the database name, the _table_ routines return the table name, and ** the origin_ routines return the column name. -** The returned string is valid until the [prepared statement] is destroyed +** ^The returned string is valid until the [prepared statement] is destroyed ** using [sqlite3_finalize()] or until the same information is requested ** again in a different encoding. ** -** The names returned are the original un-aliased names of the +** ^The names returned are the original un-aliased names of the ** database, table, and column. ** -** The first argument to the following calls is a [prepared statement]. -** These functions return information about the Nth column returned by +** ^The first argument to these interfaces is a [prepared statement]. +** ^These functions return information about the Nth result column returned by ** the statement, where N is the second function argument. +** ^The left-most column is column 0 for these routines. ** -** If the Nth column returned by the statement is an expression or +** ^If the Nth column returned by the statement is an expression or ** subquery and is not a column value, then all of these functions return -** NULL. These routine might also return NULL if a memory allocation error -** occurs. Otherwise, they return the name of the attached database, table -** and column that query result column was extracted from. +** NULL. ^These routine might also return NULL if a memory allocation error +** occurs. ^Otherwise, they return the name of the attached database, table, +** or column that query result column was extracted from. ** -** As with all other SQLite APIs, those postfixed with "16" return -** UTF-16 encoded strings, the other functions return UTF-8. {END} +** ^As with all other SQLite APIs, those whose names end with "16" return +** UTF-16 encoded strings and the other functions return UTF-8. ** -** These APIs are only available if the library was compiled with the -** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined. +** ^These APIs are only available if the library was compiled with the +** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. ** -** {A13751} ** If two or more threads call one or more of these routines against the same ** prepared statement and column at the same time then the results are ** undefined. ** -** Requirements: -** [H13741] [H13742] [H13743] [H13744] [H13745] [H13746] [H13748] -** ** If two or more threads call one or more ** [sqlite3_column_database_name | column metadata interfaces] ** for the same [prepared statement] and result column @@ -3335,17 +3708,17 @@ SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); /* -** CAPI3REF: Declared Datatype Of A Query Result {H13760} +** CAPI3REF: Declared Datatype Of A Query Result ** -** The first parameter is a [prepared statement]. +** ^(The first parameter is a [prepared statement]. ** If this statement is a [SELECT] statement and the Nth column of the ** returned result set of that [SELECT] is a table column (not an ** expression or subquery) then the declared type of the table -** column is returned. If the Nth column of the result set is an +** column is returned.)^ ^If the Nth column of the result set is an ** expression or subquery, then a NULL pointer is returned. -** The returned string is always UTF-8 encoded. {END} +** ^The returned string is always UTF-8 encoded. ** -** For example, given the database schema: +** ^(For example, given the database schema: ** ** CREATE TABLE t1(c1 VARIANT); ** @@ -3354,23 +3727,20 @@ SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); ** SELECT c1 + 1, c1 FROM t1; ** ** this routine would return the string "VARIANT" for the second result -** column (i==1), and a NULL pointer for the first result column (i==0). +** column (i==1), and a NULL pointer for the first result column (i==0).)^ ** -** SQLite uses dynamic run-time typing. So just because a column +** ^SQLite uses dynamic run-time typing. ^So just because a column ** is declared to contain a particular type does not mean that the ** data stored in that column is of the declared type. SQLite is -** strongly typed, but the typing is dynamic not static. Type +** strongly typed, but the typing is dynamic not static. ^Type ** is associated with individual values, not with the containers ** used to hold those values. -** -** Requirements: -** [H13761] [H13762] [H13763] */ SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int); SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); /* -** CAPI3REF: Evaluate An SQL Statement {H13200} +** CAPI3REF: Evaluate An SQL Statement ** ** After a [prepared statement] has been prepared using either ** [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] or one of the legacy @@ -3384,35 +3754,35 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** new "v2" interface is recommended for new applications but the legacy ** interface will continue to be supported. ** -** In the legacy interface, the return value will be either [SQLITE_BUSY], +** ^In the legacy interface, the return value will be either [SQLITE_BUSY], ** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. -** With the "v2" interface, any of the other [result codes] or +** ^With the "v2" interface, any of the other [result codes] or ** [extended result codes] might be returned as well. ** -** [SQLITE_BUSY] means that the database engine was unable to acquire the -** database locks it needs to do its job. If the statement is a [COMMIT] +** ^[SQLITE_BUSY] means that the database engine was unable to acquire the +** database locks it needs to do its job. ^If the statement is a [COMMIT] ** or occurs outside of an explicit transaction, then you can retry the ** statement. If the statement is not a [COMMIT] and occurs within a ** explicit transaction then you should rollback the transaction before ** continuing. ** -** [SQLITE_DONE] means that the statement has finished executing +** ^[SQLITE_DONE] means that the statement has finished executing ** successfully. sqlite3_step() should not be called again on this virtual ** machine without first calling [sqlite3_reset()] to reset the virtual ** machine back to its initial state. ** -** If the SQL statement being executed returns any data, then [SQLITE_ROW] +** ^If the SQL statement being executed returns any data, then [SQLITE_ROW] ** is returned each time a new row of data is ready for processing by the ** caller. The values may be accessed using the [column access functions]. ** sqlite3_step() is called again to retrieve the next row of data. ** -** [SQLITE_ERROR] means that a run-time error (such as a constraint +** ^[SQLITE_ERROR] means that a run-time error (such as a constraint ** violation) has occurred. sqlite3_step() should not be called again on ** the VM. More information may be found by calling [sqlite3_errmsg()]. -** With the legacy interface, a more specific error code (for example, +** ^With the legacy interface, a more specific error code (for example, ** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) ** can be obtained by calling [sqlite3_reset()] on the -** [prepared statement]. In the "v2" interface, +** [prepared statement]. ^In the "v2" interface, ** the more specific error code is returned directly by sqlite3_step(). ** ** [SQLITE_MISUSE] means that the this routine was called inappropriately. @@ -3422,6 +3792,14 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** be the case that the same database connection is being used by two or ** more threads at the same moment in time. ** +** For all versions of SQLite up to and including 3.6.23.1, it was required +** after sqlite3_step() returned anything other than [SQLITE_ROW] that +** [sqlite3_reset()] be called before any subsequent invocation of +** sqlite3_step(). Failure to invoke [sqlite3_reset()] in this way would +** result in an [SQLITE_MISUSE] return from sqlite3_step(). But after +** version 3.6.23.1, sqlite3_step() began calling [sqlite3_reset()] +** automatically in this circumstance rather than returning [SQLITE_MISUSE]. +** ** Goofy Interface Alert: In the legacy interface, the sqlite3_step() ** API always returns a generic error code, [SQLITE_ERROR], following any ** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call @@ -3433,27 +3811,28 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, ** then the more specific [error codes] are returned directly ** by sqlite3_step(). The use of the "v2" interface is recommended. -** -** Requirements: -** [H13202] [H15304] [H15306] [H15308] [H15310] */ SQLITE_API int sqlite3_step(sqlite3_stmt*); /* -** CAPI3REF: Number of columns in a result set {H13770} +** CAPI3REF: Number of columns in a result set ** -** Returns the number of values in the current row of the result set. +** ^The sqlite3_data_count(P) interface returns the number of columns in the +** current row of the result set of [prepared statement] P. +** ^If prepared statement P does not have results ready to return +** (via calls to the [sqlite3_column_int | sqlite3_column_*()] of +** interfaces) then sqlite3_data_count(P) returns 0. +** ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer. ** -** Requirements: -** [H13771] [H13772] +** See also: [sqlite3_column_count()] */ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); /* -** CAPI3REF: Fundamental Datatypes {H10265} +** CAPI3REF: Fundamental Datatypes ** KEYWORDS: SQLITE_TEXT ** -** {H10266} Every value in SQLite has one of five fundamental datatypes: +** ^(Every value in SQLite has one of five fundamental datatypes: ** **
      **
    • 64-bit signed integer @@ -3461,7 +3840,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); **
    • string **
    • BLOB **
    • NULL -**
    {END} +** )^ ** ** These constants are codes for each of those types. ** @@ -3482,18 +3861,18 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); #define SQLITE3_TEXT 3 /* -** CAPI3REF: Result Values From A Query {H13800} +** CAPI3REF: Result Values From A Query ** KEYWORDS: {column access functions} ** -** These routines form the "result set query" interface. +** These routines form the "result set" interface. ** -** These routines return information about a single column of the current -** result row of a query. In every case the first argument is a pointer +** ^These routines return information about a single column of the current +** result row of a query. ^In every case the first argument is a pointer ** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*] ** that was returned from [sqlite3_prepare_v2()] or one of its variants) ** and the second argument is the index of the column for which information -** should be returned. The leftmost column of the result set has the index 0. -** The number of columns in the result can be determined using +** should be returned. ^The leftmost column of the result set has the index 0. +** ^The number of columns in the result can be determined using ** [sqlite3_column_count()]. ** ** If the SQL statement does not currently point to a valid row, or if the @@ -3508,9 +3887,9 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** are called from a different thread while any of these routines ** are pending, then the results are undefined. ** -** The sqlite3_column_type() routine returns the +** ^The sqlite3_column_type() routine returns the ** [SQLITE_INTEGER | datatype code] for the initial data type -** of the result column. The returned value is one of [SQLITE_INTEGER], +** of the result column. ^The returned value is one of [SQLITE_INTEGER], ** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL]. The value ** returned by sqlite3_column_type() is only meaningful if no type ** conversions have occurred as described below. After a type conversion, @@ -3518,27 +3897,35 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** versions of SQLite may change the behavior of sqlite3_column_type() ** following a type conversion. ** -** If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() +** ^If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() ** routine returns the number of bytes in that BLOB or string. -** If the result is a UTF-16 string, then sqlite3_column_bytes() converts +** ^If the result is a UTF-16 string, then sqlite3_column_bytes() converts ** the string to UTF-8 and then returns the number of bytes. -** If the result is a numeric value then sqlite3_column_bytes() uses +** ^If the result is a numeric value then sqlite3_column_bytes() uses ** [sqlite3_snprintf()] to convert that value to a UTF-8 string and returns ** the number of bytes in that string. -** The value returned does not include the zero terminator at the end -** of the string. For clarity: the value returned is the number of +** ^If the result is NULL, then sqlite3_column_bytes() returns zero. +** +** ^If the result is a BLOB or UTF-16 string then the sqlite3_column_bytes16() +** routine returns the number of bytes in that BLOB or string. +** ^If the result is a UTF-8 string, then sqlite3_column_bytes16() converts +** the string to UTF-16 and then returns the number of bytes. +** ^If the result is a numeric value then sqlite3_column_bytes16() uses +** [sqlite3_snprintf()] to convert that value to a UTF-16 string and returns +** the number of bytes in that string. +** ^If the result is NULL, then sqlite3_column_bytes16() returns zero. +** +** ^The values returned by [sqlite3_column_bytes()] and +** [sqlite3_column_bytes16()] do not include the zero terminators at the end +** of the string. ^For clarity: the values returned by +** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of ** bytes in the string, not the number of characters. ** -** Strings returned by sqlite3_column_text() and sqlite3_column_text16(), -** even empty strings, are always zero terminated. The return -** value from sqlite3_column_blob() for a zero-length BLOB is an arbitrary -** pointer, possibly even a NULL pointer. +** ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(), +** even empty strings, are always zero terminated. ^The return +** value from sqlite3_column_blob() for a zero-length BLOB is a NULL pointer. ** -** The sqlite3_column_bytes16() routine is similar to sqlite3_column_bytes() -** but leaves the result in UTF-16 in native byte order instead of UTF-8. -** The zero terminator is not included in this count. -** -** The object returned by [sqlite3_column_value()] is an +** ^The object returned by [sqlite3_column_value()] is an ** [unprotected sqlite3_value] object. An unprotected sqlite3_value object ** may only be used with [sqlite3_bind_value()] and [sqlite3_result_value()]. ** If the [unprotected sqlite3_value] object returned by @@ -3546,10 +3933,10 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** to routines like [sqlite3_value_int()], [sqlite3_value_text()], ** or [sqlite3_value_bytes()], then the behavior is undefined. ** -** These routines attempt to convert the value where appropriate. For +** These routines attempt to convert the value where appropriate. ^For ** example, if the internal representation is FLOAT and a text result ** is requested, [sqlite3_snprintf()] is used internally to perform the -** conversion automatically. The following table details the conversions +** conversion automatically. ^(The following table details the conversions ** that are applied: ** **
    @@ -3573,7 +3960,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** BLOB FLOAT Convert to TEXT then use atof() ** BLOB TEXT Add a zero terminator if needed ** -**
    +**
    )^ ** ** The table above makes reference to standard C library functions atoi() ** and atof(). SQLite does not really use these functions. It has its @@ -3599,9 +3986,9 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** to UTF-8.
  • ** ** -** Conversions between UTF-16be and UTF-16le are always done in place and do +** ^Conversions between UTF-16be and UTF-16le are always done in place and do ** not invalidate a prior pointer, though of course the content of the buffer -** that the prior pointer points to will have been modified. Other kinds +** that the prior pointer references will have been modified. Other kinds ** of conversion are done in place when it is possible, but sometimes they ** are not possible and in those cases prior pointers are invalidated. ** @@ -3622,22 +4009,18 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16() ** with calls to sqlite3_column_bytes(). ** -** The pointers returned are valid until a type conversion occurs as +** ^The pointers returned are valid until a type conversion occurs as ** described above, or until [sqlite3_step()] or [sqlite3_reset()] or -** [sqlite3_finalize()] is called. The memory space used to hold strings +** [sqlite3_finalize()] is called. ^The memory space used to hold strings ** and BLOBs is freed automatically. Do not pass the pointers returned ** [sqlite3_column_blob()], [sqlite3_column_text()], etc. into ** [sqlite3_free()]. ** -** If a memory allocation error occurs during the evaluation of any +** ^(If a memory allocation error occurs during the evaluation of any ** of these routines, a default value is returned. The default value ** is either the integer 0, the floating point number 0.0, or a NULL ** pointer. Subsequent calls to [sqlite3_errcode()] will return -** [SQLITE_NOMEM]. -** -** Requirements: -** [H13803] [H13806] [H13809] [H13812] [H13815] [H13818] [H13821] [H13824] -** [H13827] [H13830] +** [SQLITE_NOMEM].)^ */ SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol); SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol); @@ -3651,135 +4034,142 @@ SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol); SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol); /* -** CAPI3REF: Destroy A Prepared Statement Object {H13300} +** CAPI3REF: Destroy A Prepared Statement Object ** -** The sqlite3_finalize() function is called to delete a [prepared statement]. -** If the statement was executed successfully or not executed at all, then -** SQLITE_OK is returned. If execution of the statement failed then an -** [error code] or [extended error code] is returned. +** ^The sqlite3_finalize() function is called to delete a [prepared statement]. +** ^If the most recent evaluation of the statement encountered no errors or +** or if the statement is never been evaluated, then sqlite3_finalize() returns +** SQLITE_OK. ^If the most recent evaluation of statement S failed, then +** sqlite3_finalize(S) returns the appropriate [error code] or +** [extended error code]. ** -** This routine can be called at any point during the execution of the -** [prepared statement]. If the virtual machine has not -** completed execution when this routine is called, that is like -** encountering an error or an [sqlite3_interrupt | interrupt]. -** Incomplete updates may be rolled back and transactions canceled, -** depending on the circumstances, and the -** [error code] returned will be [SQLITE_ABORT]. +** ^The sqlite3_finalize(S) routine can be called at any point during +** the life cycle of [prepared statement] S: +** before statement S is ever evaluated, after +** one or more calls to [sqlite3_reset()], or after any call +** to [sqlite3_step()] regardless of whether or not the statement has +** completed execution. ** -** Requirements: -** [H11302] [H11304] +** ^Invoking sqlite3_finalize() on a NULL pointer is a harmless no-op. +** +** The application must finalize every [prepared statement] in order to avoid +** resource leaks. It is a grievous error for the application to try to use +** a prepared statement after it has been finalized. Any use of a prepared +** statement after it has been finalized can result in undefined and +** undesirable behavior such as segfaults and heap corruption. */ SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt); /* -** CAPI3REF: Reset A Prepared Statement Object {H13330} +** CAPI3REF: Reset A Prepared Statement Object ** ** The sqlite3_reset() function is called to reset a [prepared statement] ** object back to its initial state, ready to be re-executed. -** Any SQL statement variables that had values bound to them using +** ^Any SQL statement variables that had values bound to them using ** the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values. ** Use [sqlite3_clear_bindings()] to reset the bindings. ** -** {H11332} The [sqlite3_reset(S)] interface resets the [prepared statement] S -** back to the beginning of its program. +** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S +** back to the beginning of its program. ** -** {H11334} If the most recent call to [sqlite3_step(S)] for the -** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], -** or if [sqlite3_step(S)] has never before been called on S, -** then [sqlite3_reset(S)] returns [SQLITE_OK]. +** ^If the most recent call to [sqlite3_step(S)] for the +** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], +** or if [sqlite3_step(S)] has never before been called on S, +** then [sqlite3_reset(S)] returns [SQLITE_OK]. ** -** {H11336} If the most recent call to [sqlite3_step(S)] for the -** [prepared statement] S indicated an error, then -** [sqlite3_reset(S)] returns an appropriate [error code]. +** ^If the most recent call to [sqlite3_step(S)] for the +** [prepared statement] S indicated an error, then +** [sqlite3_reset(S)] returns an appropriate [error code]. ** -** {H11338} The [sqlite3_reset(S)] interface does not change the values -** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. +** ^The [sqlite3_reset(S)] interface does not change the values +** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. */ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); /* -** CAPI3REF: Create Or Redefine SQL Functions {H16100} +** CAPI3REF: Create Or Redefine SQL Functions ** KEYWORDS: {function creation routines} ** KEYWORDS: {application-defined SQL function} ** KEYWORDS: {application-defined SQL functions} ** -** These two functions (collectively known as "function creation routines") +** ^These functions (collectively known as "function creation routines") ** are used to add SQL functions or aggregates or to redefine the behavior -** of existing SQL functions or aggregates. The only difference between the -** two is that the second parameter, the name of the (scalar) function or -** aggregate, is encoded in UTF-8 for sqlite3_create_function() and UTF-16 -** for sqlite3_create_function16(). +** of existing SQL functions or aggregates. The only differences between +** these routines are the text encoding expected for +** the the second parameter (the name of the function being created) +** and the presence or absence of a destructor callback for +** the application data pointer. ** -** The first parameter is the [database connection] to which the SQL -** function is to be added. If a single program uses more than one database -** connection internally, then SQL functions must be added individually to -** each database connection. +** ^The first parameter is the [database connection] to which the SQL +** function is to be added. ^If an application uses more than one database +** connection then application-defined SQL functions must be added +** to each database connection separately. ** -** The second parameter is the name of the SQL function to be created or -** redefined. The length of the name is limited to 255 bytes, exclusive of -** the zero-terminator. Note that the name length limit is in bytes, not -** characters. Any attempt to create a function with a longer name -** will result in [SQLITE_ERROR] being returned. +** ^The second parameter is the name of the SQL function to be created or +** redefined. ^The length of the name is limited to 255 bytes in a UTF-8 +** representation, exclusive of the zero-terminator. ^Note that the name +** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. +** ^Any attempt to create a function with a longer name +** will result in [SQLITE_MISUSE] being returned. ** -** The third parameter (nArg) +** ^The third parameter (nArg) ** is the number of arguments that the SQL function or -** aggregate takes. If this parameter is -1, then the SQL function or +** aggregate takes. ^If this parameter is -1, then the SQL function or ** aggregate may take any number of arguments between 0 and the limit ** set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]). If the third ** parameter is less than -1 or greater than 127 then the behavior is ** undefined. ** -** The fourth parameter, eTextRep, specifies what +** ^The fourth parameter, eTextRep, specifies what ** [SQLITE_UTF8 | text encoding] this SQL function prefers for -** its parameters. Any SQL function implementation should be able to work -** work with UTF-8, UTF-16le, or UTF-16be. But some implementations may be -** more efficient with one encoding than another. An application may +** its parameters. Every SQL function implementation must be able to work +** with UTF-8, UTF-16le, or UTF-16be. But some implementations may be +** more efficient with one encoding than another. ^An application may ** invoke sqlite3_create_function() or sqlite3_create_function16() multiple ** times with the same function but with different values of eTextRep. -** When multiple implementations of the same function are available, SQLite +** ^When multiple implementations of the same function are available, SQLite ** will pick the one that involves the least amount of data conversion. ** If there is only a single implementation which does not care what text ** encoding is used, then the fourth argument should be [SQLITE_ANY]. ** -** The fifth parameter is an arbitrary pointer. The implementation of the -** function can gain access to this pointer using [sqlite3_user_data()]. +** ^(The fifth parameter is an arbitrary pointer. The implementation of the +** function can gain access to this pointer using [sqlite3_user_data()].)^ ** -** The seventh, eighth and ninth parameters, xFunc, xStep and xFinal, are +** ^The seventh, eighth and ninth parameters, xFunc, xStep and xFinal, are ** pointers to C-language functions that implement the SQL function or -** aggregate. A scalar SQL function requires an implementation of the xFunc -** callback only, NULL pointers should be passed as the xStep and xFinal -** parameters. An aggregate SQL function requires an implementation of xStep -** and xFinal and NULL should be passed for xFunc. To delete an existing -** SQL function or aggregate, pass NULL for all three function callbacks. +** aggregate. ^A scalar SQL function requires an implementation of the xFunc +** callback only; NULL pointers must be passed as the xStep and xFinal +** parameters. ^An aggregate SQL function requires an implementation of xStep +** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing +** SQL function or aggregate, pass NULL poiners for all three function +** callbacks. ** -** It is permitted to register multiple implementations of the same +** ^If the tenth parameter to sqlite3_create_function_v2() is not NULL, +** then it is invoked when the function is deleted, either by being +** overloaded or when the database connection closes. +** ^When the destructure callback of the tenth parameter is invoked, it +** is passed a single argument which is a copy of the pointer which was +** the fifth parameter to sqlite3_create_function_v2(). +** +** ^It is permitted to register multiple implementations of the same ** functions with the same name but with either differing numbers of -** arguments or differing preferred text encodings. SQLite will use +** arguments or differing preferred text encodings. ^SQLite will use ** the implementation that most closely matches the way in which the -** SQL function is used. A function implementation with a non-negative +** SQL function is used. ^A function implementation with a non-negative ** nArg parameter is a better match than a function implementation with -** a negative nArg. A function where the preferred text encoding +** a negative nArg. ^A function where the preferred text encoding ** matches the database encoding is a better ** match than a function where the encoding is different. -** A function where the encoding difference is between UTF16le and UTF16be +** ^A function where the encoding difference is between UTF16le and UTF16be ** is a closer match than a function where the encoding difference is ** between UTF8 and UTF16. ** -** Built-in functions may be overloaded by new application-defined functions. -** The first application-defined function with a given name overrides all -** built-in functions in the same [database connection] with the same name. -** Subsequent application-defined functions of the same name only override -** prior application-defined functions that are an exact match for the -** number of parameters and preferred encoding. +** ^Built-in functions may be overloaded by new application-defined functions. ** -** An application-defined function is permitted to call other +** ^An application-defined function is permitted to call other ** SQLite interfaces. However, such calls must not ** close the database connection nor finalize or reset the prepared ** statement in which the function is running. -** -** Requirements: -** [H16103] [H16106] [H16109] [H16112] [H16118] [H16121] [H16127] -** [H16130] [H16133] [H16136] [H16139] [H16142] */ SQLITE_API int sqlite3_create_function( sqlite3 *db, @@ -3801,9 +4191,20 @@ SQLITE_API int sqlite3_create_function16( void (*xStep)(sqlite3_context*,int,sqlite3_value**), void (*xFinal)(sqlite3_context*) ); +SQLITE_API int sqlite3_create_function_v2( + sqlite3 *db, + const char *zFunctionName, + int nArg, + int eTextRep, + void *pApp, + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*), + void(*xDestroy)(void*) +); /* -** CAPI3REF: Text Encodings {H10267} +** CAPI3REF: Text Encodings ** ** These constant define integer codes that represent the various ** text encodings supported by SQLite. @@ -3835,7 +4236,7 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 #endif /* -** CAPI3REF: Obtaining SQL Function Parameter Values {H15100} +** CAPI3REF: Obtaining SQL Function Parameter Values ** ** The C-language implementation of SQL functions and aggregates uses ** this set of interface routines to access the parameter values on @@ -3853,22 +4254,22 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 ** Any attempt to use these routines on an [unprotected sqlite3_value] ** object results in undefined behavior. ** -** These routines work just like the corresponding [column access functions] +** ^These routines work just like the corresponding [column access functions] ** except that these routines take a single [protected sqlite3_value] object ** pointer instead of a [sqlite3_stmt*] pointer and an integer column number. ** -** The sqlite3_value_text16() interface extracts a UTF-16 string -** in the native byte-order of the host machine. The +** ^The sqlite3_value_text16() interface extracts a UTF-16 string +** in the native byte-order of the host machine. ^The ** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces ** extract UTF-16 strings as big-endian and little-endian respectively. ** -** The sqlite3_value_numeric_type() interface attempts to apply +** ^(The sqlite3_value_numeric_type() interface attempts to apply ** numeric affinity to the value. This means that an attempt is ** made to convert the value to an integer or floating point. If ** such a conversion is possible without loss of information (in other ** words, if the value is a string that looks like a number) ** then the conversion is performed. Otherwise no conversion occurs. -** The [SQLITE_INTEGER | datatype] after conversion is returned. +** The [SQLITE_INTEGER | datatype] after conversion is returned.)^ ** ** Please pay particular attention to the fact that the pointer returned ** from [sqlite3_value_blob()], [sqlite3_value_text()], or @@ -3878,10 +4279,6 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 ** ** These routines must be called from the same thread as ** the SQL function that supplied the [sqlite3_value*] parameters. -** -** Requirements: -** [H15103] [H15106] [H15109] [H15112] [H15115] [H15118] [H15121] [H15124] -** [H15127] [H15130] [H15133] [H15136] */ SQLITE_API const void *sqlite3_value_blob(sqlite3_value*); SQLITE_API int sqlite3_value_bytes(sqlite3_value*); @@ -3897,66 +4294,73 @@ SQLITE_API int sqlite3_value_type(sqlite3_value*); SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*); /* -** CAPI3REF: Obtain Aggregate Function Context {H16210} +** CAPI3REF: Obtain Aggregate Function Context ** -** The implementation of aggregate SQL functions use this routine to allocate -** a structure for storing their state. +** Implementations of aggregate SQL functions use this +** routine to allocate memory for storing their state. ** -** The first time the sqlite3_aggregate_context() routine is called for a -** particular aggregate, SQLite allocates nBytes of memory, zeroes out that -** memory, and returns a pointer to it. On second and subsequent calls to -** sqlite3_aggregate_context() for the same aggregate function index, -** the same buffer is returned. The implementation of the aggregate can use -** the returned buffer to accumulate data. +** ^The first time the sqlite3_aggregate_context(C,N) routine is called +** for a particular aggregate function, SQLite +** allocates N of memory, zeroes out that memory, and returns a pointer +** to the new memory. ^On second and subsequent calls to +** sqlite3_aggregate_context() for the same aggregate function instance, +** the same buffer is returned. Sqlite3_aggregate_context() is normally +** called once for each invocation of the xStep callback and then one +** last time when the xFinal callback is invoked. ^(When no rows match +** an aggregate query, the xStep() callback of the aggregate function +** implementation is never called and xFinal() is called exactly once. +** In those cases, sqlite3_aggregate_context() might be called for the +** first time from within xFinal().)^ ** -** SQLite automatically frees the allocated buffer when the aggregate -** query concludes. +** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer if N is +** less than or equal to zero or if a memory allocate error occurs. ** -** The first parameter should be a copy of the +** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is +** determined by the N parameter on first successful call. Changing the +** value of N in subsequent call to sqlite3_aggregate_context() within +** the same aggregate function instance will not resize the memory +** allocation.)^ +** +** ^SQLite automatically frees the memory allocated by +** sqlite3_aggregate_context() when the aggregate query concludes. +** +** The first parameter must be a copy of the ** [sqlite3_context | SQL function context] that is the first parameter -** to the callback routine that implements the aggregate function. +** to the xStep or xFinal callback routine that implements the aggregate +** function. ** ** This routine must be called from the same thread in which ** the aggregate SQL function is running. -** -** Requirements: -** [H16211] [H16213] [H16215] [H16217] */ SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes); /* -** CAPI3REF: User Data For Functions {H16240} +** CAPI3REF: User Data For Functions ** -** The sqlite3_user_data() interface returns a copy of +** ^The sqlite3_user_data() interface returns a copy of ** the pointer that was the pUserData parameter (the 5th parameter) ** of the [sqlite3_create_function()] ** and [sqlite3_create_function16()] routines that originally -** registered the application defined function. {END} -** -** This routine must be called from the same thread in which -** the application-defined function is running. -** -** Requirements: -** [H16243] -*/ -SQLITE_API void *sqlite3_user_data(sqlite3_context*); - -/* -** CAPI3REF: Database Connection For Functions {H16250} -** -** The sqlite3_context_db_handle() interface returns a copy of -** the pointer to the [database connection] (the 1st parameter) -** of the [sqlite3_create_function()] -** and [sqlite3_create_function16()] routines that originally ** registered the application defined function. ** -** Requirements: -** [H16253] +** This routine must be called from the same thread in which +** the application-defined function is running. +*/ +SQLITE_API void *sqlite3_user_data(sqlite3_context*); + +/* +** CAPI3REF: Database Connection For Functions +** +** ^The sqlite3_context_db_handle() interface returns a copy of +** the pointer to the [database connection] (the 1st parameter) +** of the [sqlite3_create_function()] +** and [sqlite3_create_function16()] routines that originally +** registered the application defined function. */ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); /* -** CAPI3REF: Function Auxiliary Data {H16270} +** CAPI3REF: Function Auxiliary Data ** ** The following two functions may be used by scalar SQL functions to ** associate metadata with argument values. If the same value is passed to @@ -3969,48 +4373,45 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** invocations of the same function so that the original pattern string ** does not need to be recompiled on each invocation. ** -** The sqlite3_get_auxdata() interface returns a pointer to the metadata +** ^The sqlite3_get_auxdata() interface returns a pointer to the metadata ** associated by the sqlite3_set_auxdata() function with the Nth argument -** value to the application-defined function. If no metadata has been ever +** value to the application-defined function. ^If no metadata has been ever ** been set for the Nth argument of the function, or if the corresponding ** function parameter has changed since the meta-data was set, ** then sqlite3_get_auxdata() returns a NULL pointer. ** -** The sqlite3_set_auxdata() interface saves the metadata +** ^The sqlite3_set_auxdata() interface saves the metadata ** pointed to by its 3rd parameter as the metadata for the N-th ** argument of the application-defined function. Subsequent ** calls to sqlite3_get_auxdata() might return this data, if it has ** not been destroyed. -** If it is not NULL, SQLite will invoke the destructor +** ^If it is not NULL, SQLite will invoke the destructor ** function given by the 4th parameter to sqlite3_set_auxdata() on ** the metadata when the corresponding function parameter changes ** or when the SQL statement completes, whichever comes first. ** ** SQLite is free to call the destructor and drop metadata on any -** parameter of any function at any time. The only guarantee is that +** parameter of any function at any time. ^The only guarantee is that ** the destructor will be called before the metadata is dropped. ** -** In practice, metadata is preserved between function calls for +** ^(In practice, metadata is preserved between function calls for ** expressions that are constant at compile time. This includes literal -** values and SQL variables. +** values and [parameters].)^ ** ** These routines must be called from the same thread in which ** the SQL function is running. -** -** Requirements: -** [H16272] [H16274] [H16276] [H16277] [H16278] [H16279] */ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); /* -** CAPI3REF: Constants Defining Special Destructor Behavior {H10280} +** CAPI3REF: Constants Defining Special Destructor Behavior ** ** These are special values for the destructor that is passed in as the -** final argument to routines like [sqlite3_result_blob()]. If the destructor +** final argument to routines like [sqlite3_result_blob()]. ^If the destructor ** argument is SQLITE_STATIC, it means that the content pointer is constant -** and will never change. It does not need to be destroyed. The +** and will never change. It does not need to be destroyed. ^The ** SQLITE_TRANSIENT value means that the content will likely change in ** the near future and that SQLite should make its own private copy of ** the content before returning. @@ -4023,7 +4424,7 @@ typedef void (*sqlite3_destructor_type)(void*); #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) /* -** CAPI3REF: Setting The Result Of An SQL Function {H16400} +** CAPI3REF: Setting The Result Of An SQL Function ** ** These routines are used by the xFunc or xFinal callbacks that ** implement SQL functions and aggregates. See @@ -4034,103 +4435,98 @@ typedef void (*sqlite3_destructor_type)(void*); ** functions used to bind values to host parameters in prepared statements. ** Refer to the [SQL parameter] documentation for additional information. ** -** The sqlite3_result_blob() interface sets the result from +** ^The sqlite3_result_blob() interface sets the result from ** an application-defined function to be the BLOB whose content is pointed ** to by the second parameter and which is N bytes long where N is the ** third parameter. ** -** The sqlite3_result_zeroblob() interfaces set the result of +** ^The sqlite3_result_zeroblob() interfaces set the result of ** the application-defined function to be a BLOB containing all zero ** bytes and N bytes in size, where N is the value of the 2nd parameter. ** -** The sqlite3_result_double() interface sets the result from +** ^The sqlite3_result_double() interface sets the result from ** an application-defined function to be a floating point value specified ** by its 2nd argument. ** -** The sqlite3_result_error() and sqlite3_result_error16() functions +** ^The sqlite3_result_error() and sqlite3_result_error16() functions ** cause the implemented SQL function to throw an exception. -** SQLite uses the string pointed to by the +** ^SQLite uses the string pointed to by the ** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16() -** as the text of an error message. SQLite interprets the error -** message string from sqlite3_result_error() as UTF-8. SQLite +** as the text of an error message. ^SQLite interprets the error +** message string from sqlite3_result_error() as UTF-8. ^SQLite ** interprets the string from sqlite3_result_error16() as UTF-16 in native -** byte order. If the third parameter to sqlite3_result_error() +** byte order. ^If the third parameter to sqlite3_result_error() ** or sqlite3_result_error16() is negative then SQLite takes as the error ** message all text up through the first zero character. -** If the third parameter to sqlite3_result_error() or +** ^If the third parameter to sqlite3_result_error() or ** sqlite3_result_error16() is non-negative then SQLite takes that many ** bytes (not characters) from the 2nd parameter as the error message. -** The sqlite3_result_error() and sqlite3_result_error16() +** ^The sqlite3_result_error() and sqlite3_result_error16() ** routines make a private copy of the error message text before ** they return. Hence, the calling function can deallocate or ** modify the text after they return without harm. -** The sqlite3_result_error_code() function changes the error code -** returned by SQLite as a result of an error in a function. By default, -** the error code is SQLITE_ERROR. A subsequent call to sqlite3_result_error() +** ^The sqlite3_result_error_code() function changes the error code +** returned by SQLite as a result of an error in a function. ^By default, +** the error code is SQLITE_ERROR. ^A subsequent call to sqlite3_result_error() ** or sqlite3_result_error16() resets the error code to SQLITE_ERROR. ** -** The sqlite3_result_toobig() interface causes SQLite to throw an error -** indicating that a string or BLOB is to long to represent. +** ^The sqlite3_result_toobig() interface causes SQLite to throw an error +** indicating that a string or BLOB is too long to represent. ** -** The sqlite3_result_nomem() interface causes SQLite to throw an error +** ^The sqlite3_result_nomem() interface causes SQLite to throw an error ** indicating that a memory allocation failed. ** -** The sqlite3_result_int() interface sets the return value +** ^The sqlite3_result_int() interface sets the return value ** of the application-defined function to be the 32-bit signed integer ** value given in the 2nd argument. -** The sqlite3_result_int64() interface sets the return value +** ^The sqlite3_result_int64() interface sets the return value ** of the application-defined function to be the 64-bit signed integer ** value given in the 2nd argument. ** -** The sqlite3_result_null() interface sets the return value +** ^The sqlite3_result_null() interface sets the return value ** of the application-defined function to be NULL. ** -** The sqlite3_result_text(), sqlite3_result_text16(), +** ^The sqlite3_result_text(), sqlite3_result_text16(), ** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces ** set the return value of the application-defined function to be ** a text string which is represented as UTF-8, UTF-16 native byte order, ** UTF-16 little endian, or UTF-16 big endian, respectively. -** SQLite takes the text result from the application from +** ^SQLite takes the text result from the application from ** the 2nd parameter of the sqlite3_result_text* interfaces. -** If the 3rd parameter to the sqlite3_result_text* interfaces +** ^If the 3rd parameter to the sqlite3_result_text* interfaces ** is negative, then SQLite takes result text from the 2nd parameter ** through the first zero character. -** If the 3rd parameter to the sqlite3_result_text* interfaces +** ^If the 3rd parameter to the sqlite3_result_text* interfaces ** is non-negative, then as many bytes (not characters) of the text ** pointed to by the 2nd parameter are taken as the application-defined ** function result. -** If the 4th parameter to the sqlite3_result_text* interfaces +** ^If the 4th parameter to the sqlite3_result_text* interfaces ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that ** function as the destructor on the text or BLOB result when it has ** finished using that result. -** If the 4th parameter to the sqlite3_result_text* interfaces or to +** ^If the 4th parameter to the sqlite3_result_text* interfaces or to ** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite ** assumes that the text or BLOB result is in constant space and does not ** copy the content of the parameter nor call a destructor on the content ** when it has finished using that result. -** If the 4th parameter to the sqlite3_result_text* interfaces +** ^If the 4th parameter to the sqlite3_result_text* interfaces ** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT ** then SQLite makes a copy of the result into space obtained from ** from [sqlite3_malloc()] before it returns. ** -** The sqlite3_result_value() interface sets the result of +** ^The sqlite3_result_value() interface sets the result of ** the application-defined function to be a copy the -** [unprotected sqlite3_value] object specified by the 2nd parameter. The +** [unprotected sqlite3_value] object specified by the 2nd parameter. ^The ** sqlite3_result_value() interface makes a copy of the [sqlite3_value] ** so that the [sqlite3_value] specified in the parameter may change or ** be deallocated after sqlite3_result_value() returns without harm. -** A [protected sqlite3_value] object may always be used where an +** ^A [protected sqlite3_value] object may always be used where an ** [unprotected sqlite3_value] object is required, so either ** kind of [sqlite3_value] object can be used with this interface. ** ** If these routines are called from within the different thread ** than the one containing the application-defined function that received ** the [sqlite3_context] pointer, the results are undefined. -** -** Requirements: -** [H16403] [H16406] [H16409] [H16412] [H16415] [H16418] [H16421] [H16424] -** [H16427] [H16430] [H16433] [H16436] [H16439] [H16442] [H16445] [H16448] -** [H16451] [H16454] [H16457] [H16460] [H16463] */ SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); SQLITE_API void sqlite3_result_double(sqlite3_context*, double); @@ -4150,67 +4546,87 @@ SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*); SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n); /* -** CAPI3REF: Define New Collating Sequences {H16600} +** CAPI3REF: Define New Collating Sequences ** -** These functions are used to add new collation sequences to the -** [database connection] specified as the first argument. +** ^These functions add, remove, or modify a [collation] associated +** with the [database connection] specified as the first argument. ** -** The name of the new collation sequence is specified as a UTF-8 string +** ^The name of the collation is a UTF-8 string ** for sqlite3_create_collation() and sqlite3_create_collation_v2() -** and a UTF-16 string for sqlite3_create_collation16(). In all cases -** the name is passed as the second function argument. +** and a UTF-16 string in native byte order for sqlite3_create_collation16(). +** ^Collation names that compare equal according to [sqlite3_strnicmp()] are +** considered to be the same name. ** -** The third argument may be one of the constants [SQLITE_UTF8], -** [SQLITE_UTF16LE], or [SQLITE_UTF16BE], indicating that the user-supplied -** routine expects to be passed pointers to strings encoded using UTF-8, -** UTF-16 little-endian, or UTF-16 big-endian, respectively. The -** third argument might also be [SQLITE_UTF16] to indicate that the routine -** expects pointers to be UTF-16 strings in the native byte order, or the -** argument can be [SQLITE_UTF16_ALIGNED] if the -** the routine expects pointers to 16-bit word aligned strings -** of UTF-16 in the native byte order. +** ^(The third argument (eTextRep) must be one of the constants: +**
      +**
    • [SQLITE_UTF8], +**
    • [SQLITE_UTF16LE], +**
    • [SQLITE_UTF16BE], +**
    • [SQLITE_UTF16], or +**
    • [SQLITE_UTF16_ALIGNED]. +**
    )^ +** ^The eTextRep argument determines the encoding of strings passed +** to the collating function callback, xCallback. +** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep +** force strings to be UTF16 with native byte order. +** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin +** on an even byte address. ** -** A pointer to the user supplied routine must be passed as the fifth -** argument. If it is NULL, this is the same as deleting the collation -** sequence (so that SQLite cannot call it anymore). -** Each time the application supplied function is invoked, it is passed -** as its first parameter a copy of the void* passed as the fourth argument -** to sqlite3_create_collation() or sqlite3_create_collation16(). +** ^The fourth argument, pArg, is a application data pointer that is passed +** through as the first argument to the collating function callback. ** -** The remaining arguments to the application-supplied routine are two strings, -** each represented by a (length, data) pair and encoded in the encoding -** that was passed as the third argument when the collation sequence was -** registered. {END} The application defined collation routine should -** return negative, zero or positive if the first string is less than, -** equal to, or greater than the second string. i.e. (STRING1 - STRING2). +** ^The fifth argument, xCallback, is a pointer to the collating function. +** ^Multiple collating functions can be registered using the same name but +** with different eTextRep parameters and SQLite will use whichever +** function requires the least amount of data transformation. +** ^If the xCallback argument is NULL then the collating function is +** deleted. ^When all collating functions having the same name are deleted, +** that collation is no longer usable. ** -** The sqlite3_create_collation_v2() works like sqlite3_create_collation() -** except that it takes an extra argument which is a destructor for -** the collation. The destructor is called when the collation is -** destroyed and is passed a copy of the fourth parameter void* pointer -** of the sqlite3_create_collation_v2(). -** Collations are destroyed when they are overridden by later calls to the -** collation creation functions or when the [database connection] is closed -** using [sqlite3_close()]. +** ^The collating function callback is invoked with a copy of the pArg +** application data pointer and with two strings in the encoding specified +** by the eTextRep argument. The collating function must return an +** integer that is negative, zero, or positive +** if the first string is less than, equal to, or greater than the second, +** respectively. A collating function must alway return the same answer +** given the same inputs. If two or more collating functions are registered +** to the same collation name (using different eTextRep values) then all +** must give an equivalent answer when invoked with equivalent strings. +** The collating function must obey the following properties for all +** strings A, B, and C: +** +**
      +**
    1. If A==B then B==A. +**
    2. If A==B and B==C then A==C. +**
    3. If A<B THEN B>A. +**
    4. If A<B and B<C then A<C. +**
    +** +** If a collating function fails any of the above constraints and that +** collating function is registered and used, then the behavior of SQLite +** is undefined. +** +** ^The sqlite3_create_collation_v2() works like sqlite3_create_collation() +** with the addition that the xDestroy callback is invoked on pArg when +** the collating function is deleted. +** ^Collating functions are deleted when they are overridden by later +** calls to the collation creation functions or when the +** [database connection] is closed using [sqlite3_close()]. ** ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. -** -** Requirements: -** [H16603] [H16604] [H16606] [H16609] [H16612] [H16615] [H16618] [H16621] -** [H16624] [H16627] [H16630] */ SQLITE_API int sqlite3_create_collation( sqlite3*, const char *zName, int eTextRep, - void*, + void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); SQLITE_API int sqlite3_create_collation_v2( sqlite3*, const char *zName, int eTextRep, - void*, + void *pArg, int(*xCompare)(void*,int,const void*,int,const void*), void(*xDestroy)(void*) ); @@ -4218,38 +4634,35 @@ SQLITE_API int sqlite3_create_collation16( sqlite3*, const void *zName, int eTextRep, - void*, + void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); /* -** CAPI3REF: Collation Needed Callbacks {H16700} +** CAPI3REF: Collation Needed Callbacks ** -** To avoid having to register all collation sequences before a database +** ^To avoid having to register all collation sequences before a database ** can be used, a single callback function may be registered with the -** [database connection] to be called whenever an undefined collation +** [database connection] to be invoked whenever an undefined collation ** sequence is required. ** -** If the function is registered using the sqlite3_collation_needed() API, +** ^If the function is registered using the sqlite3_collation_needed() API, ** then it is passed the names of undefined collation sequences as strings -** encoded in UTF-8. {H16703} If sqlite3_collation_needed16() is used, +** encoded in UTF-8. ^If sqlite3_collation_needed16() is used, ** the names are passed as UTF-16 in machine native byte order. -** A call to either function replaces any existing callback. +** ^A call to either function replaces the existing collation-needed callback. ** -** When the callback is invoked, the first argument passed is a copy +** ^(When the callback is invoked, the first argument passed is a copy ** of the second argument to sqlite3_collation_needed() or ** sqlite3_collation_needed16(). The second argument is the database ** connection. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE], ** or [SQLITE_UTF16LE], indicating the most desirable form of the collation ** sequence function required. The fourth parameter is the name of the -** required collation sequence. +** required collation sequence.)^ ** ** The callback function should register the desired collation using ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or ** [sqlite3_create_collation_v2()]. -** -** Requirements: -** [H16702] [H16704] [H16706] */ SQLITE_API int sqlite3_collation_needed( sqlite3*, @@ -4262,6 +4675,7 @@ SQLITE_API int sqlite3_collation_needed16( void(*)(void*,sqlite3*,int eTextRep,const void*) ); +#ifdef SQLITE_HAS_CODEC /* ** Specify the key for an encrypted database. This routine should be ** called right after sqlite3_open(). @@ -4288,7 +4702,26 @@ SQLITE_API int sqlite3_rekey( ); /* -** CAPI3REF: Suspend Execution For A Short Time {H10530} +** Specify the activation key for a SEE database. Unless +** activated, none of the SEE routines will work. +*/ +SQLITE_API void sqlite3_activate_see( + const char *zPassPhrase /* Activation phrase */ +); +#endif + +#ifdef SQLITE_ENABLE_CEROD +/* +** Specify the activation key for a CEROD database. Unless +** activated, none of the CEROD routines will work. +*/ +SQLITE_API void sqlite3_activate_cerod( + const char *zPassPhrase /* Activation phrase */ +); +#endif + +/* +** CAPI3REF: Suspend Execution For A Short Time ** ** The sqlite3_sleep() function causes the current thread to suspend execution ** for at least a number of milliseconds specified in its parameter. @@ -4298,19 +4731,21 @@ SQLITE_API int sqlite3_rekey( ** the nearest second. The number of milliseconds of sleep actually ** requested from the operating system is returned. ** -** SQLite implements this interface by calling the xSleep() -** method of the default [sqlite3_vfs] object. -** -** Requirements: [H10533] [H10536] +** ^SQLite implements this interface by calling the xSleep() +** method of the default [sqlite3_vfs] object. If the xSleep() method +** of the default VFS is not implemented correctly, or not implemented at +** all, then the behavior of sqlite3_sleep() may deviate from the description +** in the previous paragraphs. */ SQLITE_API int sqlite3_sleep(int); /* -** CAPI3REF: Name Of The Folder Holding Temporary Files {H10310} +** CAPI3REF: Name Of The Folder Holding Temporary Files ** -** If this global variable is made to point to a string which is +** ^(If this global variable is made to point to a string which is ** the name of a folder (a.k.a. directory), then all temporary files -** created by SQLite will be placed in that directory. If this variable +** created by SQLite when using a built-in [sqlite3_vfs | VFS] +** will be placed in that directory.)^ ^If this variable ** is a NULL pointer, then SQLite performs a search for an appropriate ** temporary file directory. ** @@ -4323,8 +4758,8 @@ SQLITE_API int sqlite3_sleep(int); ** routines have been called and that this variable remain unchanged ** thereafter. ** -** The [temp_store_directory pragma] may modify this variable and cause -** it to point to memory obtained from [sqlite3_malloc]. Furthermore, +** ^The [temp_store_directory pragma] may modify this variable and cause +** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, ** the [temp_store_directory pragma] always assumes that any string ** that this variable points to is held in memory obtained from ** [sqlite3_malloc] and the pragma may attempt to free that memory @@ -4336,14 +4771,14 @@ SQLITE_API int sqlite3_sleep(int); SQLITE_API char *sqlite3_temp_directory; /* -** CAPI3REF: Test For Auto-Commit Mode {H12930} +** CAPI3REF: Test For Auto-Commit Mode ** KEYWORDS: {autocommit mode} ** -** The sqlite3_get_autocommit() interface returns non-zero or +** ^The sqlite3_get_autocommit() interface returns non-zero or ** zero if the given database connection is or is not in autocommit mode, -** respectively. Autocommit mode is on by default. -** Autocommit mode is disabled by a [BEGIN] statement. -** Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK]. +** respectively. ^Autocommit mode is on by default. +** ^Autocommit mode is disabled by a [BEGIN] statement. +** ^Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK]. ** ** If certain kinds of errors occur on a statement within a multi-statement ** transaction (errors including [SQLITE_FULL], [SQLITE_IOERR], @@ -4355,58 +4790,55 @@ SQLITE_API char *sqlite3_temp_directory; ** If another thread changes the autocommit status of the database ** connection while this routine is running, then the return value ** is undefined. -** -** Requirements: [H12931] [H12932] [H12933] [H12934] */ SQLITE_API int sqlite3_get_autocommit(sqlite3*); /* -** CAPI3REF: Find The Database Handle Of A Prepared Statement {H13120} +** CAPI3REF: Find The Database Handle Of A Prepared Statement ** -** The sqlite3_db_handle interface returns the [database connection] handle -** to which a [prepared statement] belongs. The [database connection] -** returned by sqlite3_db_handle is the same [database connection] that was the first argument +** ^The sqlite3_db_handle interface returns the [database connection] handle +** to which a [prepared statement] belongs. ^The [database connection] +** returned by sqlite3_db_handle is the same [database connection] +** that was the first argument ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to ** create the statement in the first place. -** -** Requirements: [H13123] */ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); /* -** CAPI3REF: Find the next prepared statement {H13140} +** CAPI3REF: Find the next prepared statement ** -** This interface returns a pointer to the next [prepared statement] after -** pStmt associated with the [database connection] pDb. If pStmt is NULL +** ^This interface returns a pointer to the next [prepared statement] after +** pStmt associated with the [database connection] pDb. ^If pStmt is NULL ** then this interface returns a pointer to the first prepared statement -** associated with the database connection pDb. If no prepared statement +** associated with the database connection pDb. ^If no prepared statement ** satisfies the conditions of this routine, it returns NULL. ** ** The [database connection] pointer D in a call to ** [sqlite3_next_stmt(D,S)] must refer to an open database ** connection and in particular must not be a NULL pointer. -** -** Requirements: [H13143] [H13146] [H13149] [H13152] */ SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); /* -** CAPI3REF: Commit And Rollback Notification Callbacks {H12950} +** CAPI3REF: Commit And Rollback Notification Callbacks ** -** The sqlite3_commit_hook() interface registers a callback +** ^The sqlite3_commit_hook() interface registers a callback ** function to be invoked whenever a transaction is [COMMIT | committed]. -** Any callback set by a previous call to sqlite3_commit_hook() +** ^Any callback set by a previous call to sqlite3_commit_hook() ** for the same database connection is overridden. -** The sqlite3_rollback_hook() interface registers a callback +** ^The sqlite3_rollback_hook() interface registers a callback ** function to be invoked whenever a transaction is [ROLLBACK | rolled back]. -** Any callback set by a previous call to sqlite3_commit_hook() +** ^Any callback set by a previous call to sqlite3_rollback_hook() ** for the same database connection is overridden. -** The pArg argument is passed through to the callback. -** If the callback on a commit hook function returns non-zero, +** ^The pArg argument is passed through to the callback. +** ^If the callback on a commit hook function returns non-zero, ** then the commit is converted into a rollback. ** -** If another function was previously registered, its -** pArg value is returned. Otherwise NULL is returned. +** ^The sqlite3_commit_hook(D,C,P) and sqlite3_rollback_hook(D,C,P) functions +** return the P argument from the previous call of the same function +** on the same [database connection] D, or NULL for +** the first call for each function on D. ** ** The callback implementation must not do anything that will modify ** the database connection that invoked the callback. Any actions @@ -4416,59 +4848,52 @@ SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their ** database connections for the meaning of "modify" in this paragraph. ** -** Registering a NULL function disables the callback. +** ^Registering a NULL function disables the callback. ** -** When the commit hook callback routine returns zero, the [COMMIT] -** operation is allowed to continue normally. If the commit hook +** ^When the commit hook callback routine returns zero, the [COMMIT] +** operation is allowed to continue normally. ^If the commit hook ** returns non-zero, then the [COMMIT] is converted into a [ROLLBACK]. -** The rollback hook is invoked on a rollback that results from a commit +** ^The rollback hook is invoked on a rollback that results from a commit ** hook returning non-zero, just as it would be with any other rollback. ** -** For the purposes of this API, a transaction is said to have been +** ^For the purposes of this API, a transaction is said to have been ** rolled back if an explicit "ROLLBACK" statement is executed, or ** an error or constraint causes an implicit rollback to occur. -** The rollback callback is not invoked if a transaction is +** ^The rollback callback is not invoked if a transaction is ** automatically rolled back because the database connection is closed. -** The rollback callback is not invoked if a transaction is -** rolled back because a commit callback returned non-zero. -** Check on this ** ** See also the [sqlite3_update_hook()] interface. -** -** Requirements: -** [H12951] [H12952] [H12953] [H12954] [H12955] -** [H12961] [H12962] [H12963] [H12964] */ SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); /* -** CAPI3REF: Data Change Notification Callbacks {H12970} +** CAPI3REF: Data Change Notification Callbacks ** -** The sqlite3_update_hook() interface registers a callback function +** ^The sqlite3_update_hook() interface registers a callback function ** with the [database connection] identified by the first argument ** to be invoked whenever a row is updated, inserted or deleted. -** Any callback set by a previous call to this function +** ^Any callback set by a previous call to this function ** for the same database connection is overridden. ** -** The second argument is a pointer to the function to invoke when a +** ^The second argument is a pointer to the function to invoke when a ** row is updated, inserted or deleted. -** The first argument to the callback is a copy of the third argument +** ^The first argument to the callback is a copy of the third argument ** to sqlite3_update_hook(). -** The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], +** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], ** or [SQLITE_UPDATE], depending on the operation that caused the callback ** to be invoked. -** The third and fourth arguments to the callback contain pointers to the +** ^The third and fourth arguments to the callback contain pointers to the ** database and table name containing the affected row. -** The final callback parameter is the [rowid] of the row. -** In the case of an update, this is the [rowid] after the update takes place. +** ^The final callback parameter is the [rowid] of the row. +** ^In the case of an update, this is the [rowid] after the update takes place. ** -** The update hook is not invoked when internal system tables are -** modified (i.e. sqlite_master and sqlite_sequence). +** ^(The update hook is not invoked when internal system tables are +** modified (i.e. sqlite_master and sqlite_sequence).)^ ** -** In the current implementation, the update hook +** ^In the current implementation, the update hook ** is not invoked when duplication rows are deleted because of an -** [ON CONFLICT | ON CONFLICT REPLACE] clause. Nor is the update hook +** [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook ** invoked when rows are deleted using the [truncate optimization]. ** The exceptions defined in this paragraph might change in a future ** release of SQLite. @@ -4480,14 +4905,13 @@ SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their ** database connections for the meaning of "modify" in this paragraph. ** -** If another function was previously registered, its pArg value -** is returned. Otherwise NULL is returned. +** ^The sqlite3_update_hook(D,C,P) function +** returns the P argument from the previous call +** on the same [database connection] D, or NULL for +** the first call on D. ** ** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()] ** interfaces. -** -** Requirements: -** [H12971] [H12973] [H12975] [H12977] [H12979] [H12981] [H12983] [H12986] */ SQLITE_API void *sqlite3_update_hook( sqlite3*, @@ -4496,112 +4920,134 @@ SQLITE_API void *sqlite3_update_hook( ); /* -** CAPI3REF: Enable Or Disable Shared Pager Cache {H10330} +** CAPI3REF: Enable Or Disable Shared Pager Cache ** KEYWORDS: {shared cache} ** -** This routine enables or disables the sharing of the database cache +** ^(This routine enables or disables the sharing of the database cache ** and schema data structures between [database connection | connections] ** to the same database. Sharing is enabled if the argument is true -** and disabled if the argument is false. +** and disabled if the argument is false.)^ ** -** Cache sharing is enabled and disabled for an entire process. +** ^Cache sharing is enabled and disabled for an entire process. ** This is a change as of SQLite version 3.5.0. In prior versions of SQLite, ** sharing was enabled or disabled for each thread separately. ** -** The cache sharing mode set by this interface effects all subsequent +** ^(The cache sharing mode set by this interface effects all subsequent ** calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()]. ** Existing database connections continue use the sharing mode -** that was in effect at the time they were opened. +** that was in effect at the time they were opened.)^ ** -** Virtual tables cannot be used with a shared cache. When shared -** cache is enabled, the [sqlite3_create_module()] API used to register -** virtual tables will always return an error. +** ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled +** successfully. An [error code] is returned otherwise.)^ ** -** This routine returns [SQLITE_OK] if shared cache was enabled or disabled -** successfully. An [error code] is returned otherwise. -** -** Shared cache is disabled by default. But this might change in +** ^Shared cache is disabled by default. But this might change in ** future releases of SQLite. Applications that care about shared ** cache setting should set it explicitly. ** ** See Also: [SQLite Shared-Cache Mode] -** -** Requirements: [H10331] [H10336] [H10337] [H10339] */ SQLITE_API int sqlite3_enable_shared_cache(int); /* -** CAPI3REF: Attempt To Free Heap Memory {H17340} +** CAPI3REF: Attempt To Free Heap Memory ** -** The sqlite3_release_memory() interface attempts to free N bytes +** ^The sqlite3_release_memory() interface attempts to free N bytes ** of heap memory by deallocating non-essential memory allocations -** held by the database library. {END} Memory used to cache database +** held by the database library. Memory used to cache database ** pages to improve performance is an example of non-essential memory. -** sqlite3_release_memory() returns the number of bytes actually freed, +** ^sqlite3_release_memory() returns the number of bytes actually freed, ** which might be more or less than the amount requested. -** -** Requirements: [H17341] [H17342] +** ^The sqlite3_release_memory() routine is a no-op returning zero +** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. */ SQLITE_API int sqlite3_release_memory(int); /* -** CAPI3REF: Impose A Limit On Heap Size {H17350} +** CAPI3REF: Impose A Limit On Heap Size ** -** The sqlite3_soft_heap_limit() interface places a "soft" limit -** on the amount of heap memory that may be allocated by SQLite. -** If an internal allocation is requested that would exceed the -** soft heap limit, [sqlite3_release_memory()] is invoked one or -** more times to free up some space before the allocation is performed. +** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the +** soft limit on the amount of heap memory that may be allocated by SQLite. +** ^SQLite strives to keep heap memory utilization below the soft heap +** limit by reducing the number of pages held in the page cache +** as heap memory usages approaches the limit. +** ^The soft heap limit is "soft" because even though SQLite strives to stay +** below the limit, it will exceed the limit rather than generate +** an [SQLITE_NOMEM] error. In other words, the soft heap limit +** is advisory only. ** -** The limit is called "soft", because if [sqlite3_release_memory()] -** cannot free sufficient memory to prevent the limit from being exceeded, -** the memory is allocated anyway and the current operation proceeds. +** ^The return value from sqlite3_soft_heap_limit64() is the size of +** the soft heap limit prior to the call. ^If the argument N is negative +** then no change is made to the soft heap limit. Hence, the current +** size of the soft heap limit can be determined by invoking +** sqlite3_soft_heap_limit64() with a negative argument. ** -** A negative or zero value for N means that there is no soft heap limit and -** [sqlite3_release_memory()] will only be called when memory is exhausted. -** The default value for the soft heap limit is zero. +** ^If the argument N is zero then the soft heap limit is disabled. ** -** SQLite makes a best effort to honor the soft heap limit. -** But if the soft heap limit cannot be honored, execution will -** continue without error or notification. This is why the limit is -** called a "soft" limit. It is advisory only. +** ^(The soft heap limit is not enforced in the current implementation +** if one or more of following conditions are true: ** -** Prior to SQLite version 3.5.0, this routine only constrained the memory -** allocated by a single thread - the same thread in which this routine -** runs. Beginning with SQLite version 3.5.0, the soft heap limit is -** applied to all threads. The value specified for the soft heap limit -** is an upper bound on the total memory allocation for all threads. In -** version 3.5.0 there is no mechanism for limiting the heap usage for -** individual threads. +**
      +**
    • The soft heap limit is set to zero. +**
    • Memory accounting is disabled using a combination of the +** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and +** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. +**
    • An alternative page cache implementation is specifed using +** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...). +**
    • The page cache allocates from its own memory pool supplied +** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than +** from the heap. +**
    )^ ** -** Requirements: -** [H16351] [H16352] [H16353] [H16354] [H16355] [H16358] +** Beginning with SQLite version 3.7.3, the soft heap limit is enforced +** regardless of whether or not the [SQLITE_ENABLE_MEMORY_MANAGEMENT] +** compile-time option is invoked. With [SQLITE_ENABLE_MEMORY_MANAGEMENT], +** the soft heap limit is enforced on every memory allocation. Without +** [SQLITE_ENABLE_MEMORY_MANAGEMENT], the soft heap limit is only enforced +** when memory is allocated by the page cache. Testing suggests that because +** the page cache is the predominate memory user in SQLite, most +** applications will achieve adequate soft heap limit enforcement without +** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. +** +** The circumstances under which SQLite will enforce the soft heap limit may +** changes in future releases of SQLite. */ -SQLITE_API void sqlite3_soft_heap_limit(int); +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); /* -** CAPI3REF: Extract Metadata About A Column Of A Table {H12850} +** CAPI3REF: Deprecated Soft Heap Limit Interface +** DEPRECATED ** -** This routine returns metadata about a specific column of a specific +** This is a deprecated version of the [sqlite3_soft_heap_limit64()] +** interface. This routine is provided for historical compatibility +** only. All new applications should use the +** [sqlite3_soft_heap_limit64()] interface rather than this one. +*/ +SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); + + +/* +** CAPI3REF: Extract Metadata About A Column Of A Table +** +** ^This routine returns metadata about a specific column of a specific ** database table accessible using the [database connection] handle ** passed as the first function argument. ** -** The column is identified by the second, third and fourth parameters to -** this function. The second parameter is either the name of the database -** (i.e. "main", "temp" or an attached database) containing the specified -** table or NULL. If it is NULL, then all attached databases are searched +** ^The column is identified by the second, third and fourth parameters to +** this function. ^The second parameter is either the name of the database +** (i.e. "main", "temp", or an attached database) containing the specified +** table or NULL. ^If it is NULL, then all attached databases are searched ** for the table using the same algorithm used by the database engine to ** resolve unqualified table references. ** -** The third and fourth parameters to this function are the table and column +** ^The third and fourth parameters to this function are the table and column ** name of the desired column, respectively. Neither of these parameters ** may be NULL. ** -** Metadata is returned by writing to the memory locations passed as the 5th -** and subsequent parameters to this function. Any of these arguments may be +** ^Metadata is returned by writing to the memory locations passed as the 5th +** and subsequent parameters to this function. ^Any of these arguments may be ** NULL, in which case the corresponding element of metadata is omitted. ** -**
    +** ^(
    ** **
    Parameter Output
    Type
    Description ** @@ -4611,17 +5057,17 @@ SQLITE_API void sqlite3_soft_heap_limit(int); **
    8th int True if column is part of the PRIMARY KEY **
    9th int True if column is [AUTOINCREMENT] **
    -**
    +**
    )^ ** -** The memory pointed to by the character pointers returned for the +** ^The memory pointed to by the character pointers returned for the ** declaration type and collation sequence is valid only until the next ** call to any SQLite API function. ** -** If the specified table is actually a view, an [error code] is returned. +** ^If the specified table is actually a view, an [error code] is returned. ** -** If the specified column is "rowid", "oid" or "_rowid_" and an +** ^If the specified column is "rowid", "oid" or "_rowid_" and an ** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output -** parameters are set for the explicitly declared column. If there is no +** parameters are set for the explicitly declared column. ^(If there is no ** explicitly declared [INTEGER PRIMARY KEY] column, then the output ** parameters are set as follows: ** @@ -4631,14 +5077,14 @@ SQLITE_API void sqlite3_soft_heap_limit(int); ** not null: 0 ** primary key: 1 ** auto increment: 0 -** +** )^ ** -** This function may load one or more schemas from database files. If an +** ^(This function may load one or more schemas from database files. If an ** error occurs during this process, or if the requested table or column ** cannot be found, an [error code] is returned and an error message left -** in the [database connection] (to be retrieved using sqlite3_errmsg()). +** in the [database connection] (to be retrieved using sqlite3_errmsg()).)^ ** -** This API is only available if the library was compiled with the +** ^This API is only available if the library was compiled with the ** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined. */ SQLITE_API int sqlite3_table_column_metadata( @@ -4654,30 +5100,29 @@ SQLITE_API int sqlite3_table_column_metadata( ); /* -** CAPI3REF: Load An Extension {H12600} +** CAPI3REF: Load An Extension ** -** This interface loads an SQLite extension library from the named file. +** ^This interface loads an SQLite extension library from the named file. ** -** {H12601} The sqlite3_load_extension() interface attempts to load an -** SQLite extension library contained in the file zFile. +** ^The sqlite3_load_extension() interface attempts to load an +** SQLite extension library contained in the file zFile. ** -** {H12602} The entry point is zProc. +** ^The entry point is zProc. +** ^zProc may be 0, in which case the name of the entry point +** defaults to "sqlite3_extension_init". +** ^The sqlite3_load_extension() interface returns +** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. +** ^If an error occurs and pzErrMsg is not 0, then the +** [sqlite3_load_extension()] interface shall attempt to +** fill *pzErrMsg with error message text stored in memory +** obtained from [sqlite3_malloc()]. The calling function +** should free this memory by calling [sqlite3_free()]. ** -** {H12603} zProc may be 0, in which case the name of the entry point -** defaults to "sqlite3_extension_init". +** ^Extension loading must be enabled using +** [sqlite3_enable_load_extension()] prior to calling this API, +** otherwise an error will be returned. ** -** {H12604} The sqlite3_load_extension() interface shall return -** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. -** -** {H12605} If an error occurs and pzErrMsg is not 0, then the -** [sqlite3_load_extension()] interface shall attempt to -** fill *pzErrMsg with error message text stored in memory -** obtained from [sqlite3_malloc()]. {END} The calling function -** should free this memory by calling [sqlite3_free()]. -** -** {H12606} Extension loading must be enabled using -** [sqlite3_enable_load_extension()] prior to calling this API, -** otherwise an error will be returned. +** See also the [load_extension() SQL function]. */ SQLITE_API int sqlite3_load_extension( sqlite3 *db, /* Load the extension into this database connection */ @@ -4687,67 +5132,66 @@ SQLITE_API int sqlite3_load_extension( ); /* -** CAPI3REF: Enable Or Disable Extension Loading {H12620} +** CAPI3REF: Enable Or Disable Extension Loading ** -** So as not to open security holes in older applications that are +** ^So as not to open security holes in older applications that are ** unprepared to deal with extension loading, and as a means of disabling ** extension loading while evaluating user-entered SQL, the following API ** is provided to turn the [sqlite3_load_extension()] mechanism on and off. ** -** Extension loading is off by default. See ticket #1863. -** -** {H12621} Call the sqlite3_enable_load_extension() routine with onoff==1 -** to turn extension loading on and call it with onoff==0 to turn -** it back off again. -** -** {H12622} Extension loading is off by default. +** ^Extension loading is off by default. See ticket #1863. +** ^Call the sqlite3_enable_load_extension() routine with onoff==1 +** to turn extension loading on and call it with onoff==0 to turn +** it back off again. */ SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff); /* -** CAPI3REF: Automatically Load An Extensions {H12640} +** CAPI3REF: Automatically Load Statically Linked Extensions ** -** This API can be invoked at program startup in order to register -** one or more statically linked extensions that will be available -** to all new [database connections]. {END} +** ^This interface causes the xEntryPoint() function to be invoked for +** each new [database connection] that is created. The idea here is that +** xEntryPoint() is the entry point for a statically linked SQLite extension +** that is to be automatically loaded into all new database connections. ** -** This routine stores a pointer to the extension in an array that is -** obtained from [sqlite3_malloc()]. If you run a memory leak checker -** on your program and it reports a leak because of this array, invoke -** [sqlite3_reset_auto_extension()] prior to shutdown to free the memory. +** ^(Even though the function prototype shows that xEntryPoint() takes +** no arguments and returns void, SQLite invokes xEntryPoint() with three +** arguments and expects and integer result as if the signature of the +** entry point where as follows: ** -** {H12641} This function registers an extension entry point that is -** automatically invoked whenever a new [database connection] -** is opened using [sqlite3_open()], [sqlite3_open16()], -** or [sqlite3_open_v2()]. +**
    +**    int xEntryPoint(
    +**      sqlite3 *db,
    +**      const char **pzErrMsg,
    +**      const struct sqlite3_api_routines *pThunk
    +**    );
    +** 
    )^ ** -** {H12642} Duplicate extensions are detected so calling this routine -** multiple times with the same extension is harmless. +** If the xEntryPoint routine encounters an error, it should make *pzErrMsg +** point to an appropriate error message (obtained from [sqlite3_mprintf()]) +** and return an appropriate [error code]. ^SQLite ensures that *pzErrMsg +** is NULL before calling the xEntryPoint(). ^SQLite will invoke +** [sqlite3_free()] on *pzErrMsg after xEntryPoint() returns. ^If any +** xEntryPoint() returns an error, the [sqlite3_open()], [sqlite3_open16()], +** or [sqlite3_open_v2()] call that provoked the xEntryPoint() will fail. ** -** {H12643} This routine stores a pointer to the extension in an array -** that is obtained from [sqlite3_malloc()]. +** ^Calling sqlite3_auto_extension(X) with an entry point X that is already +** on the list of automatic extensions is a harmless no-op. ^No entry point +** will be called more than once for each database connection that is opened. ** -** {H12644} Automatic extensions apply across all threads. +** See also: [sqlite3_reset_auto_extension()]. */ SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void)); /* -** CAPI3REF: Reset Automatic Extension Loading {H12660} +** CAPI3REF: Reset Automatic Extension Loading ** -** This function disables all previously registered automatic -** extensions. {END} It undoes the effect of all prior -** [sqlite3_auto_extension()] calls. -** -** {H12661} This function disables all previously registered -** automatic extensions. -** -** {H12662} This function disables automatic extensions in all threads. +** ^This interface disables all automatic extensions previously +** registered using [sqlite3_auto_extension()]. */ SQLITE_API void sqlite3_reset_auto_extension(void); /* -****** EXPERIMENTAL - subject to change without notice ************** -** ** The interface to the virtual-table mechanism is currently considered ** to be experimental. The interface might change in incompatible ways. ** If this is a problem for you, do not use the interface at this time. @@ -4765,18 +5209,17 @@ typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor; typedef struct sqlite3_module sqlite3_module; /* -** CAPI3REF: Virtual Table Object {H18000} +** CAPI3REF: Virtual Table Object ** KEYWORDS: sqlite3_module {virtual table module} -** EXPERIMENTAL ** ** This structure, sometimes called a a "virtual table module", ** defines the implementation of a [virtual tables]. ** This structure consists mostly of methods for the module. ** -** A virtual table module is created by filling in a persistent +** ^A virtual table module is created by filling in a persistent ** instance of this structure and passing a pointer to that instance ** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** The registration remains valid until it is replaced by a different +** ^The registration remains valid until it is replaced by a different ** module or until the [database connection] closes. The content ** of this structure must not change while it is registered with ** any database connection. @@ -4812,52 +5255,54 @@ struct sqlite3_module { }; /* -** CAPI3REF: Virtual Table Indexing Information {H18100} +** CAPI3REF: Virtual Table Indexing Information ** KEYWORDS: sqlite3_index_info -** EXPERIMENTAL ** -** The sqlite3_index_info structure and its substructures is used to +** The sqlite3_index_info structure and its substructures is used as part +** of the [virtual table] interface to ** pass information into and receive the reply from the [xBestIndex] ** method of a [virtual table module]. The fields under **Inputs** are the ** inputs to xBestIndex and are read-only. xBestIndex inserts its ** results into the **Outputs** fields. ** -** The aConstraint[] array records WHERE clause constraints of the form: +** ^(The aConstraint[] array records WHERE clause constraints of the form: ** -**
    column OP expr
    +**
    column OP expr
    ** -** where OP is =, <, <=, >, or >=. The particular operator is -** stored in aConstraint[].op. The index of the column is stored in -** aConstraint[].iColumn. aConstraint[].usable is TRUE if the +** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is +** stored in aConstraint[].op using one of the +** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ +** ^(The index of the column is stored in +** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the ** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot. +** is usable) and false if it cannot.)^ ** -** The optimizer automatically inverts terms of the form "expr OP column" +** ^The optimizer automatically inverts terms of the form "expr OP column" ** and makes other simplifications to the WHERE clause in an attempt to ** get as many WHERE clause terms into the form shown above as possible. -** The aConstraint[] array only reports WHERE clause terms in the correct -** form that refer to the particular virtual table being queried. +** ^The aConstraint[] array only reports WHERE clause terms that are +** relevant to the particular virtual table being queried. ** -** Information about the ORDER BY clause is stored in aOrderBy[]. -** Each term of aOrderBy records a column of the ORDER BY clause. +** ^Information about the ORDER BY clause is stored in aOrderBy[]. +** ^Each term of aOrderBy records a column of the ORDER BY clause. ** ** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. If argvIndex>0 then +** about what parameters to pass to xFilter. ^If argvIndex>0 then ** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. If aConstraintUsage[].omit +** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit ** is true, then the constraint is assumed to be fully handled by the -** virtual table and is not checked again by SQLite. +** virtual table and is not checked again by SQLite.)^ ** -** The idxNum and idxPtr values are recorded and passed into the +** ^The idxNum and idxPtr values are recorded and passed into the ** [xFilter] method. -** [sqlite3_free()] is used to free idxPtr if and only iff +** ^[sqlite3_free()] is used to free idxPtr if and only if ** needToFreeIdxPtr is true. ** -** The orderByConsumed means that output from [xFilter]/[xNext] will occur in +** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in ** the correct order to satisfy the ORDER BY clause so that no separate ** sorting step is required. ** -** The estimatedCost value is an estimate of the cost of doing the +** ^The estimatedCost value is an estimate of the cost of doing the ** particular lookup. A full scan of a table with N entries should have ** a cost of N. A binary search of a table of N entries should have a ** cost of approximately log(N). @@ -4887,6 +5332,15 @@ struct sqlite3_index_info { int orderByConsumed; /* True if output is already ordered */ double estimatedCost; /* Estimated cost of using this index */ }; + +/* +** CAPI3REF: Virtual Table Constraint Operator Codes +** +** These macros defined the allowed values for the +** [sqlite3_index_info].aConstraint[].op field. Each value represents +** an operator that is part of a constraint term in the wHERE clause of +** a query that uses a [virtual table]. +*/ #define SQLITE_INDEX_CONSTRAINT_EQ 2 #define SQLITE_INDEX_CONSTRAINT_GT 4 #define SQLITE_INDEX_CONSTRAINT_LE 8 @@ -4895,43 +5349,35 @@ struct sqlite3_index_info { #define SQLITE_INDEX_CONSTRAINT_MATCH 64 /* -** CAPI3REF: Register A Virtual Table Implementation {H18200} -** EXPERIMENTAL +** CAPI3REF: Register A Virtual Table Implementation ** -** This routine is used to register a new [virtual table module] name. -** Module names must be registered before -** creating a new [virtual table] using the module, or before using a +** ^These routines are used to register a new [virtual table module] name. +** ^Module names must be registered before +** creating a new [virtual table] using the module and before using a ** preexisting [virtual table] for the module. ** -** The module name is registered on the [database connection] specified -** by the first parameter. The name of the module is given by the -** second parameter. The third parameter is a pointer to -** the implementation of the [virtual table module]. The fourth +** ^The module name is registered on the [database connection] specified +** by the first parameter. ^The name of the module is given by the +** second parameter. ^The third parameter is a pointer to +** the implementation of the [virtual table module]. ^The fourth ** parameter is an arbitrary client data pointer that is passed through ** into the [xCreate] and [xConnect] methods of the virtual table module ** when a new virtual table is be being created or reinitialized. ** -** This interface has exactly the same effect as calling -** [sqlite3_create_module_v2()] with a NULL client data destructor. +** ^The sqlite3_create_module_v2() interface has a fifth parameter which +** is a pointer to a destructor for the pClientData. ^SQLite will +** invoke the destructor function (if it is not NULL) when SQLite +** no longer needs the pClientData pointer. ^The sqlite3_create_module() +** interface is equivalent to sqlite3_create_module_v2() with a NULL +** destructor. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_create_module( +SQLITE_API int sqlite3_create_module( sqlite3 *db, /* SQLite connection to register module with */ const char *zName, /* Name of the module */ const sqlite3_module *p, /* Methods for the module */ void *pClientData /* Client data for xCreate/xConnect */ ); - -/* -** CAPI3REF: Register A Virtual Table Implementation {H18210} -** EXPERIMENTAL -** -** This routine is identical to the [sqlite3_create_module()] method, -** except that it has an extra parameter to specify -** a destructor function for the client data pointer. SQLite will -** invoke the destructor function (if it is not NULL) when SQLite -** no longer needs the pClientData pointer. -*/ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_create_module_v2( +SQLITE_API int sqlite3_create_module_v2( sqlite3 *db, /* SQLite connection to register module with */ const char *zName, /* Name of the module */ const sqlite3_module *p, /* Methods for the module */ @@ -4940,21 +5386,20 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_create_module_v2( ); /* -** CAPI3REF: Virtual Table Instance Object {H18010} +** CAPI3REF: Virtual Table Instance Object ** KEYWORDS: sqlite3_vtab -** EXPERIMENTAL ** ** Every [virtual table module] implementation uses a subclass -** of the following structure to describe a particular instance +** of this object to describe a particular instance ** of the [virtual table]. Each subclass will ** be tailored to the specific needs of the module implementation. ** The purpose of this superclass is to define certain fields that are ** common to all module implementations. ** -** Virtual tables methods can set an error message by assigning a +** ^Virtual tables methods can set an error message by assigning a ** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should ** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. After the error message +** prior to assigning a new string to zErrMsg. ^After the error message ** is delivered up to the client application, the string will be automatically ** freed by sqlite3_free() and the zErrMsg field will be zeroed. */ @@ -4966,16 +5411,15 @@ struct sqlite3_vtab { }; /* -** CAPI3REF: Virtual Table Cursor Object {H18020} +** CAPI3REF: Virtual Table Cursor Object ** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** EXPERIMENTAL ** ** Every [virtual table module] implementation uses a subclass of the ** following structure to describe cursors that point into the ** [virtual table] and are used ** to loop through the virtual table. Cursors are created using the ** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cussors are used +** by the [sqlite3_module.xClose | xClose] method. Cursors are used ** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods ** of the module. Each module implementation will define ** the content of a cursor structure to suit its own needs. @@ -4989,34 +5433,32 @@ struct sqlite3_vtab_cursor { }; /* -** CAPI3REF: Declare The Schema Of A Virtual Table {H18280} -** EXPERIMENTAL +** CAPI3REF: Declare The Schema Of A Virtual Table ** -** The [xCreate] and [xConnect] methods of a +** ^The [xCreate] and [xConnect] methods of a ** [virtual table module] call this interface ** to declare the format (the names and datatypes of the columns) of ** the virtual tables they implement. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_declare_vtab(sqlite3*, const char *zSQL); +SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL); /* -** CAPI3REF: Overload A Function For A Virtual Table {H18300} -** EXPERIMENTAL +** CAPI3REF: Overload A Function For A Virtual Table ** -** Virtual tables can provide alternative implementations of functions +** ^(Virtual tables can provide alternative implementations of functions ** using the [xFindFunction] method of the [virtual table module]. ** But global versions of those functions -** must exist in order to be overloaded. +** must exist in order to be overloaded.)^ ** -** This API makes sure a global version of a function with a particular +** ^(This API makes sure a global version of a function with a particular ** name and number of parameters exists. If no such function exists -** before this API is called, a new function is created. The implementation +** before this API is called, a new function is created.)^ ^The implementation ** of the new function always causes an exception to be thrown. So ** the new function is not good for anything by itself. Its only ** purpose is to be a placeholder function that can be overloaded ** by a [virtual table]. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); +SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); /* ** The interface to the virtual-table mechanism defined above (back up @@ -5026,82 +5468,77 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_overload_function(sqlite3*, const cha ** ** When the virtual-table mechanism stabilizes, we will declare the ** interface fixed, support it indefinitely, and remove this comment. -** -****** EXPERIMENTAL - subject to change without notice ************** */ /* -** CAPI3REF: A Handle To An Open BLOB {H17800} +** CAPI3REF: A Handle To An Open BLOB ** KEYWORDS: {BLOB handle} {BLOB handles} ** ** An instance of this object represents an open BLOB on which ** [sqlite3_blob_open | incremental BLOB I/O] can be performed. -** Objects of this type are created by [sqlite3_blob_open()] +** ^Objects of this type are created by [sqlite3_blob_open()] ** and destroyed by [sqlite3_blob_close()]. -** The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces +** ^The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces ** can be used to read or write small subsections of the BLOB. -** The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes. +** ^The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes. */ typedef struct sqlite3_blob sqlite3_blob; /* -** CAPI3REF: Open A BLOB For Incremental I/O {H17810} +** CAPI3REF: Open A BLOB For Incremental I/O ** -** This interfaces opens a [BLOB handle | handle] to the BLOB located +** ^(This interfaces opens a [BLOB handle | handle] to the BLOB located ** in row iRow, column zColumn, table zTable in database zDb; ** in other words, the same BLOB that would be selected by: ** **
     **     SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
    -** 
    {END} +** )^ ** -** If the flags parameter is non-zero, then the BLOB is opened for read -** and write access. If it is zero, the BLOB is opened for read access. -** It is not possible to open a column that is part of an index or primary +** ^If the flags parameter is non-zero, then the BLOB is opened for read +** and write access. ^If it is zero, the BLOB is opened for read access. +** ^It is not possible to open a column that is part of an index or primary ** key for writing. ^If [foreign key constraints] are enabled, it is ** not possible to open a column that is part of a [child key] for writing. ** -** Note that the database name is not the filename that contains +** ^Note that the database name is not the filename that contains ** the database but rather the symbolic name of the database that -** is assigned when the database is connected using [ATTACH]. -** For the main database file, the database name is "main". -** For TEMP tables, the database name is "temp". +** appears after the AS keyword when the database is connected using [ATTACH]. +** ^For the main database file, the database name is "main". +** ^For TEMP tables, the database name is "temp". ** -** On success, [SQLITE_OK] is returned and the new [BLOB handle] is written +** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is written ** to *ppBlob. Otherwise an [error code] is returned and *ppBlob is set -** to be a null pointer. -** This function sets the [database connection] error code and message +** to be a null pointer.)^ +** ^This function sets the [database connection] error code and message ** accessible via [sqlite3_errcode()] and [sqlite3_errmsg()] and related -** functions. Note that the *ppBlob variable is always initialized in a +** functions. ^Note that the *ppBlob variable is always initialized in a ** way that makes it safe to invoke [sqlite3_blob_close()] on *ppBlob ** regardless of the success or failure of this routine. ** -** If the row that a BLOB handle points to is modified by an +** ^(If the row that a BLOB handle points to is modified by an ** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects ** then the BLOB handle is marked as "expired". ** This is true if any column of the row is changed, even a column -** other than the one the BLOB handle is open on. -** Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for +** other than the one the BLOB handle is open on.)^ +** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for ** a expired BLOB handle fail with an return code of [SQLITE_ABORT]. -** Changes written into a BLOB prior to the BLOB expiring are not -** rollback by the expiration of the BLOB. Such changes will eventually -** commit if the transaction continues to completion. +** ^(Changes written into a BLOB prior to the BLOB expiring are not +** rolled back by the expiration of the BLOB. Such changes will eventually +** commit if the transaction continues to completion.)^ ** -** Use the [sqlite3_blob_bytes()] interface to determine the size of -** the opened blob. The size of a blob may not be changed by this +** ^Use the [sqlite3_blob_bytes()] interface to determine the size of +** the opened blob. ^The size of a blob may not be changed by this ** interface. Use the [UPDATE] SQL command to change the size of a ** blob. ** -** The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces +** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces ** and the built-in [zeroblob] SQL function can be used, if desired, ** to create an empty, zero-filled blob in which to read or write using ** this interface. ** ** To avoid a resource leak, every open [BLOB handle] should eventually ** be released by a call to [sqlite3_blob_close()]. -** -** Requirements: -** [H17813] [H17814] [H17816] [H17819] [H17821] [H17824] */ SQLITE_API int sqlite3_blob_open( sqlite3*, @@ -5114,37 +5551,34 @@ SQLITE_API int sqlite3_blob_open( ); /* -** CAPI3REF: Close A BLOB Handle {H17830} +** CAPI3REF: Close A BLOB Handle ** -** Closes an open [BLOB handle]. +** ^Closes an open [BLOB handle]. ** -** Closing a BLOB shall cause the current transaction to commit +** ^Closing a BLOB shall cause the current transaction to commit ** if there are no other BLOBs, no pending prepared statements, and the ** database connection is in [autocommit mode]. -** If any writes were made to the BLOB, they might be held in cache +** ^If any writes were made to the BLOB, they might be held in cache ** until the close operation if they will fit. ** -** Closing the BLOB often forces the changes +** ^(Closing the BLOB often forces the changes ** out to disk and so if any I/O errors occur, they will likely occur ** at the time when the BLOB is closed. Any errors that occur during -** closing are reported as a non-zero return value. +** closing are reported as a non-zero return value.)^ ** -** The BLOB is closed unconditionally. Even if this routine returns -** an error code, the BLOB is still closed. +** ^(The BLOB is closed unconditionally. Even if this routine returns +** an error code, the BLOB is still closed.)^ ** -** Calling this routine with a null pointer (which as would be returned -** by failed call to [sqlite3_blob_open()]) is a harmless no-op. -** -** Requirements: -** [H17833] [H17836] [H17839] +** ^Calling this routine with a null pointer (such as would be returned +** by a failed call to [sqlite3_blob_open()]) is a harmless no-op. */ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); /* -** CAPI3REF: Return The Size Of An Open BLOB {H17840} +** CAPI3REF: Return The Size Of An Open BLOB ** -** Returns the size in bytes of the BLOB accessible via the -** successfully opened [BLOB handle] in its only argument. The +** ^Returns the size in bytes of the BLOB accessible via the +** successfully opened [BLOB handle] in its only argument. ^The ** incremental blob I/O routines can only read or overwriting existing ** blob content; they cannot change the size of a blob. ** @@ -5152,30 +5586,27 @@ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); ** by a prior successful call to [sqlite3_blob_open()] and which has not ** been closed by [sqlite3_blob_close()]. Passing any other pointer in ** to this routine results in undefined and probably undesirable behavior. -** -** Requirements: -** [H17843] */ SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *); /* -** CAPI3REF: Read Data From A BLOB Incrementally {H17850} +** CAPI3REF: Read Data From A BLOB Incrementally ** -** This function is used to read data from an open [BLOB handle] into a +** ^(This function is used to read data from an open [BLOB handle] into a ** caller-supplied buffer. N bytes of data are copied into buffer Z -** from the open BLOB, starting at offset iOffset. +** from the open BLOB, starting at offset iOffset.)^ ** -** If offset iOffset is less than N bytes from the end of the BLOB, -** [SQLITE_ERROR] is returned and no data is read. If N or iOffset is +** ^If offset iOffset is less than N bytes from the end of the BLOB, +** [SQLITE_ERROR] is returned and no data is read. ^If N or iOffset is ** less than zero, [SQLITE_ERROR] is returned and no data is read. -** The size of the blob (and hence the maximum value of N+iOffset) +** ^The size of the blob (and hence the maximum value of N+iOffset) ** can be determined using the [sqlite3_blob_bytes()] interface. ** -** An attempt to read from an expired [BLOB handle] fails with an +** ^An attempt to read from an expired [BLOB handle] fails with an ** error code of [SQLITE_ABORT]. ** -** On success, SQLITE_OK is returned. -** Otherwise, an [error code] or an [extended error code] is returned. +** ^(On success, sqlite3_blob_read() returns SQLITE_OK. +** Otherwise, an [error code] or an [extended error code] is returned.)^ ** ** This routine only works on a [BLOB handle] which has been created ** by a prior successful call to [sqlite3_blob_open()] and which has not @@ -5183,40 +5614,37 @@ SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *); ** to this routine results in undefined and probably undesirable behavior. ** ** See also: [sqlite3_blob_write()]. -** -** Requirements: -** [H17853] [H17856] [H17859] [H17862] [H17863] [H17865] [H17868] */ SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); /* -** CAPI3REF: Write Data Into A BLOB Incrementally {H17870} +** CAPI3REF: Write Data Into A BLOB Incrementally ** -** This function is used to write data into an open [BLOB handle] from a -** caller-supplied buffer. N bytes of data are copied from the buffer Z +** ^This function is used to write data into an open [BLOB handle] from a +** caller-supplied buffer. ^N bytes of data are copied from the buffer Z ** into the open BLOB, starting at offset iOffset. ** -** If the [BLOB handle] passed as the first argument was not opened for +** ^If the [BLOB handle] passed as the first argument was not opened for ** writing (the flags parameter to [sqlite3_blob_open()] was zero), ** this function returns [SQLITE_READONLY]. ** -** This function may only modify the contents of the BLOB; it is +** ^This function may only modify the contents of the BLOB; it is ** not possible to increase the size of a BLOB using this API. -** If offset iOffset is less than N bytes from the end of the BLOB, -** [SQLITE_ERROR] is returned and no data is written. If N is +** ^If offset iOffset is less than N bytes from the end of the BLOB, +** [SQLITE_ERROR] is returned and no data is written. ^If N is ** less than zero [SQLITE_ERROR] is returned and no data is written. ** The size of the BLOB (and hence the maximum value of N+iOffset) ** can be determined using the [sqlite3_blob_bytes()] interface. ** -** An attempt to write to an expired [BLOB handle] fails with an -** error code of [SQLITE_ABORT]. Writes to the BLOB that occurred +** ^An attempt to write to an expired [BLOB handle] fails with an +** error code of [SQLITE_ABORT]. ^Writes to the BLOB that occurred ** before the [BLOB handle] expired are not rolled back by the ** expiration of the handle, though of course those changes might ** have been overwritten by the statement that expired the BLOB handle ** or by other independent statements. ** -** On success, SQLITE_OK is returned. -** Otherwise, an [error code] or an [extended error code] is returned. +** ^(On success, sqlite3_blob_write() returns SQLITE_OK. +** Otherwise, an [error code] or an [extended error code] is returned.)^ ** ** This routine only works on a [BLOB handle] which has been created ** by a prior successful call to [sqlite3_blob_open()] and which has not @@ -5224,15 +5652,11 @@ SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); ** to this routine results in undefined and probably undesirable behavior. ** ** See also: [sqlite3_blob_read()]. -** -** Requirements: -** [H17873] [H17874] [H17875] [H17876] [H17877] [H17879] [H17882] [H17885] -** [H17888] */ SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); /* -** CAPI3REF: Virtual File System Objects {H11200} +** CAPI3REF: Virtual File System Objects ** ** A virtual filesystem (VFS) is an [sqlite3_vfs] object ** that SQLite uses to interact @@ -5241,34 +5665,31 @@ SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOff ** New VFSes can be registered and existing VFSes can be unregistered. ** The following interfaces are provided. ** -** The sqlite3_vfs_find() interface returns a pointer to a VFS given its name. -** Names are case sensitive. -** Names are zero-terminated UTF-8 strings. -** If there is no match, a NULL pointer is returned. -** If zVfsName is NULL then the default VFS is returned. +** ^The sqlite3_vfs_find() interface returns a pointer to a VFS given its name. +** ^Names are case sensitive. +** ^Names are zero-terminated UTF-8 strings. +** ^If there is no match, a NULL pointer is returned. +** ^If zVfsName is NULL then the default VFS is returned. ** -** New VFSes are registered with sqlite3_vfs_register(). -** Each new VFS becomes the default VFS if the makeDflt flag is set. -** The same VFS can be registered multiple times without injury. -** To make an existing VFS into the default VFS, register it again +** ^New VFSes are registered with sqlite3_vfs_register(). +** ^Each new VFS becomes the default VFS if the makeDflt flag is set. +** ^The same VFS can be registered multiple times without injury. +** ^To make an existing VFS into the default VFS, register it again ** with the makeDflt flag set. If two different VFSes with the ** same name are registered, the behavior is undefined. If a ** VFS is registered with a name that is NULL or an empty string, ** then the behavior is undefined. ** -** Unregister a VFS with the sqlite3_vfs_unregister() interface. -** If the default VFS is unregistered, another VFS is chosen as -** the default. The choice for the new VFS is arbitrary. -** -** Requirements: -** [H11203] [H11206] [H11209] [H11212] [H11215] [H11218] +** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. +** ^(If the default VFS is unregistered, another VFS is chosen as +** the default. The choice for the new VFS is arbitrary.)^ */ SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName); SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); /* -** CAPI3REF: Mutexes {H17000} +** CAPI3REF: Mutexes ** ** The SQLite core uses these routines for thread ** synchronization. Though they are intended for internal @@ -5277,7 +5698,7 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); ** ** The SQLite source code contains multiple implementations ** of these mutex routines. An appropriate implementation -** is selected automatically at compile-time. The following +** is selected automatically at compile-time. ^(The following ** implementations are available in the SQLite core: ** **
      @@ -5285,26 +5706,26 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); **
    • SQLITE_MUTEX_PTHREAD **
    • SQLITE_MUTEX_W32 **
    • SQLITE_MUTEX_NOOP -**
    +** )^ ** -** The SQLITE_MUTEX_NOOP implementation is a set of routines +** ^The SQLITE_MUTEX_NOOP implementation is a set of routines ** that does no real locking and is appropriate for use in -** a single-threaded application. The SQLITE_MUTEX_OS2, +** a single-threaded application. ^The SQLITE_MUTEX_OS2, ** SQLITE_MUTEX_PTHREAD, and SQLITE_MUTEX_W32 implementations ** are appropriate for use on OS/2, Unix, and Windows. ** -** If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor +** ^(If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor ** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex ** implementation is included with the library. In this case the ** application must supply a custom mutex implementation using the ** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function ** before calling sqlite3_initialize() or any other public sqlite3_ -** function that calls sqlite3_initialize(). +** function that calls sqlite3_initialize().)^ ** -** {H17011} The sqlite3_mutex_alloc() routine allocates a new -** mutex and returns a pointer to it. {H17012} If it returns NULL -** that means that a mutex could not be allocated. {H17013} SQLite -** will unwind its stack and return an error. {H17014} The argument +** ^The sqlite3_mutex_alloc() routine allocates a new +** mutex and returns a pointer to it. ^If it returns NULL +** that means that a mutex could not be allocated. ^SQLite +** will unwind its stack and return an error. ^(The argument ** to sqlite3_mutex_alloc() is one of these integer constants: ** **
      @@ -5316,64 +5737,66 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); **
    • SQLITE_MUTEX_STATIC_PRNG **
    • SQLITE_MUTEX_STATIC_LRU **
    • SQLITE_MUTEX_STATIC_LRU2 -**
    +** )^ ** -** {H17015} The first two constants cause sqlite3_mutex_alloc() to create -** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE -** is used but not necessarily so when SQLITE_MUTEX_FAST is used. {END} +** ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) +** cause sqlite3_mutex_alloc() to create +** a new mutex. ^The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +** is used but not necessarily so when SQLITE_MUTEX_FAST is used. ** The mutex implementation does not need to make a distinction ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does -** not want to. {H17016} But SQLite will only request a recursive mutex in -** cases where it really needs one. {END} If a faster non-recursive mutex +** not want to. ^SQLite will only request a recursive mutex in +** cases where it really needs one. ^If a faster non-recursive mutex ** implementation is available on the host platform, the mutex subsystem ** might return such a mutex in response to SQLITE_MUTEX_FAST. ** -** {H17017} The other allowed parameters to sqlite3_mutex_alloc() each return -** a pointer to a static preexisting mutex. {END} Six static mutexes are +** ^The other allowed parameters to sqlite3_mutex_alloc() (anything other +** than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return +** a pointer to a static preexisting mutex. ^Six static mutexes are ** used by the current version of SQLite. Future versions of SQLite ** may add additional static mutexes. Static mutexes are for internal ** use by SQLite only. Applications that use SQLite mutexes should ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or ** SQLITE_MUTEX_RECURSIVE. ** -** {H17018} Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() -** returns a different mutex on every call. {H17034} But for the static +** returns a different mutex on every call. ^But for the static ** mutex types, the same mutex is returned on every call that has ** the same type number. ** -** {H17019} The sqlite3_mutex_free() routine deallocates a previously -** allocated dynamic mutex. {H17020} SQLite is careful to deallocate every -** dynamic mutex that it allocates. {A17021} The dynamic mutexes must not be in -** use when they are deallocated. {A17022} Attempting to deallocate a static -** mutex results in undefined behavior. {H17023} SQLite never deallocates -** a static mutex. {END} +** ^The sqlite3_mutex_free() routine deallocates a previously +** allocated dynamic mutex. ^SQLite is careful to deallocate every +** dynamic mutex that it allocates. The dynamic mutexes must not be in +** use when they are deallocated. Attempting to deallocate a static +** mutex results in undefined behavior. ^SQLite never deallocates +** a static mutex. ** -** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt -** to enter a mutex. {H17024} If another thread is already within the mutex, +** ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +** to enter a mutex. ^If another thread is already within the mutex, ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return -** SQLITE_BUSY. {H17025} The sqlite3_mutex_try() interface returns [SQLITE_OK] -** upon successful entry. {H17026} Mutexes created using +** SQLITE_BUSY. ^The sqlite3_mutex_try() interface returns [SQLITE_OK] +** upon successful entry. ^(Mutexes created using ** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread. -** {H17027} In such cases the, +** In such cases the, ** mutex must be exited an equal number of times before another thread -** can enter. {A17028} If the same thread tries to enter any other +** can enter.)^ ^(If the same thread tries to enter any other ** kind of mutex more than once, the behavior is undefined. -** {H17029} SQLite will never exhibit -** such behavior in its own use of mutexes. +** SQLite will never exhibit +** such behavior in its own use of mutexes.)^ ** -** Some systems (for example, Windows 95) do not support the operation +** ^(Some systems (for example, Windows 95) do not support the operation ** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() -** will always return SQLITE_BUSY. {H17030} The SQLite core only ever uses -** sqlite3_mutex_try() as an optimization so this is acceptable behavior. +** will always return SQLITE_BUSY. The SQLite core only ever uses +** sqlite3_mutex_try() as an optimization so this is acceptable behavior.)^ ** -** {H17031} The sqlite3_mutex_leave() routine exits a mutex that was -** previously entered by the same thread. {A17032} The behavior +** ^The sqlite3_mutex_leave() routine exits a mutex that was +** previously entered by the same thread. ^(The behavior ** is undefined if the mutex is not currently entered by the -** calling thread or is not currently allocated. {H17033} SQLite will -** never do either. {END} +** calling thread or is not currently allocated. SQLite will +** never do either.)^ ** -** If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or +** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** behave as no-ops. ** @@ -5386,8 +5809,7 @@ SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); /* -** CAPI3REF: Mutex Methods Object {H17120} -** EXPERIMENTAL +** CAPI3REF: Mutex Methods Object ** ** An instance of this structure defines the low-level routines ** used to allocate and use mutexes. @@ -5402,19 +5824,19 @@ SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); ** output variable when querying the system for the current mutex ** implementation, using the [SQLITE_CONFIG_GETMUTEX] option. ** -** The xMutexInit method defined by this structure is invoked as +** ^The xMutexInit method defined by this structure is invoked as ** part of system initialization by the sqlite3_initialize() function. -** {H17001} The xMutexInit routine shall be called by SQLite once for each +** ^The xMutexInit routine is called by SQLite exactly once for each ** effective call to [sqlite3_initialize()]. ** -** The xMutexEnd method defined by this structure is invoked as +** ^The xMutexEnd method defined by this structure is invoked as ** part of system shutdown by the sqlite3_shutdown() function. The ** implementation of this method is expected to release all outstanding ** resources obtained by the mutex methods implementation, especially -** those obtained by the xMutexInit method. {H17003} The xMutexEnd() -** interface shall be invoked once for each call to [sqlite3_shutdown()]. +** those obtained by the xMutexInit method. ^The xMutexEnd() +** interface is invoked exactly once for each call to [sqlite3_shutdown()]. ** -** The remaining seven methods defined by this structure (xMutexAlloc, +** ^(The remaining seven methods defined by this structure (xMutexAlloc, ** xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and ** xMutexNotheld) implement the following interfaces (respectively): ** @@ -5426,7 +5848,7 @@ SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); **
  • [sqlite3_mutex_leave()]
  • **
  • [sqlite3_mutex_held()]
  • **
  • [sqlite3_mutex_notheld()]
  • -** +** )^ ** ** The only difference is that the public sqlite3_XXX functions enumerated ** above silently ignore any invocations that pass a NULL pointer instead @@ -5436,17 +5858,17 @@ SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); ** (i.e. it is acceptable to provide an implementation that segfaults if ** it is passed a NULL pointer). ** -** The xMutexInit() method must be threadsafe. It must be harmless to -** invoke xMutexInit() mutiple times within the same process and without +** The xMutexInit() method must be threadsafe. ^It must be harmless to +** invoke xMutexInit() multiple times within the same process and without ** intervening calls to xMutexEnd(). Second and subsequent calls to ** xMutexInit() must be no-ops. ** -** xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] -** and its associates). Similarly, xMutexAlloc() must not use SQLite memory -** allocation for a static mutex. However xMutexAlloc() may use SQLite +** ^xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] +** and its associates). ^Similarly, xMutexAlloc() must not use SQLite memory +** allocation for a static mutex. ^However xMutexAlloc() may use SQLite ** memory allocation for a fast or recursive mutex. ** -** SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is +** ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is ** called, but only if the prior call to xMutexInit returned SQLITE_OK. ** If xMutexInit fails in any way, it is expected to clean up after itself ** prior to returning. @@ -5465,39 +5887,41 @@ struct sqlite3_mutex_methods { }; /* -** CAPI3REF: Mutex Verification Routines {H17080} +** CAPI3REF: Mutex Verification Routines ** ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines -** are intended for use inside assert() statements. {H17081} The SQLite core +** are intended for use inside assert() statements. ^The SQLite core ** never uses these routines except inside an assert() and applications -** are advised to follow the lead of the core. {H17082} The core only +** are advised to follow the lead of the core. ^The SQLite core only ** provides implementations for these routines when it is compiled -** with the SQLITE_DEBUG flag. {A17087} External mutex implementations +** with the SQLITE_DEBUG flag. ^External mutex implementations ** are only required to provide these routines if SQLITE_DEBUG is ** defined and if NDEBUG is not defined. ** -** {H17083} These routines should return true if the mutex in their argument +** ^These routines should return true if the mutex in their argument ** is held or not held, respectively, by the calling thread. ** -** {X17084} The implementation is not required to provided versions of these +** ^The implementation is not required to provided versions of these ** routines that actually work. If the implementation does not provide working ** versions of these routines, it should at least provide stubs that always ** return true so that one does not get spurious assertion failures. ** -** {H17085} If the argument to sqlite3_mutex_held() is a NULL pointer then -** the routine should return 1. {END} This seems counter-intuitive since +** ^If the argument to sqlite3_mutex_held() is a NULL pointer then +** the routine should return 1. This seems counter-intuitive since ** clearly the mutex cannot be held if it does not exist. But the ** the reason the mutex does not exist is because the build is not ** using mutexes. And we do not want the assert() containing the ** call to sqlite3_mutex_held() to fail, so a non-zero return is -** the appropriate thing to do. {H17086} The sqlite3_mutex_notheld() +** the appropriate thing to do. ^The sqlite3_mutex_notheld() ** interface should also return 1 when given a NULL pointer. */ +#ifndef NDEBUG SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*); SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); +#endif /* -** CAPI3REF: Mutex Types {H17001} +** CAPI3REF: Mutex Types ** ** The [sqlite3_mutex_alloc()] interface takes a single argument ** which is one of these integer constants. @@ -5517,48 +5941,50 @@ SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); #define SQLITE_MUTEX_STATIC_LRU2 7 /* lru page list */ /* -** CAPI3REF: Retrieve the mutex for a database connection {H17002} +** CAPI3REF: Retrieve the mutex for a database connection ** -** This interface returns a pointer the [sqlite3_mutex] object that +** ^This interface returns a pointer the [sqlite3_mutex] object that ** serializes access to the [database connection] given in the argument ** when the [threading mode] is Serialized. -** If the [threading mode] is Single-thread or Multi-thread then this +** ^If the [threading mode] is Single-thread or Multi-thread then this ** routine returns a NULL pointer. */ SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*); /* -** CAPI3REF: Low-Level Control Of Database Files {H11300} +** CAPI3REF: Low-Level Control Of Database Files ** -** {H11301} The [sqlite3_file_control()] interface makes a direct call to the +** ^The [sqlite3_file_control()] interface makes a direct call to the ** xFileControl method for the [sqlite3_io_methods] object associated -** with a particular database identified by the second argument. {H11302} The -** name of the database is the name assigned to the database by the -** ATTACH SQL command that opened the -** database. {H11303} To control the main database file, use the name "main" -** or a NULL pointer. {H11304} The third and fourth parameters to this routine +** with a particular database identified by the second argument. ^The +** name of the database "main" for the main database or "temp" for the +** TEMP database, or the name that appears after the AS keyword for +** databases that are added using the [ATTACH] SQL command. +** ^A NULL pointer can be used in place of "main" to refer to the +** main database file. +** ^The third and fourth parameters to this routine ** are passed directly through to the second and third parameters of -** the xFileControl method. {H11305} The return value of the xFileControl +** the xFileControl method. ^The return value of the xFileControl ** method becomes the return value of this routine. ** -** {H11306} If the second parameter (zDbName) does not match the name of any -** open database file, then SQLITE_ERROR is returned. {H11307} This error +** ^If the second parameter (zDbName) does not match the name of any +** open database file, then SQLITE_ERROR is returned. ^This error ** code is not remembered and will not be recalled by [sqlite3_errcode()] -** or [sqlite3_errmsg()]. {A11308} The underlying xFileControl method might -** also return SQLITE_ERROR. {A11309} There is no way to distinguish between +** or [sqlite3_errmsg()]. The underlying xFileControl method might +** also return SQLITE_ERROR. There is no way to distinguish between ** an incorrect zDbName and an SQLITE_ERROR return from the underlying -** xFileControl method. {END} +** xFileControl method. ** ** See also: [SQLITE_FCNTL_LOCKSTATE] */ SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); /* -** CAPI3REF: Testing Interface {H11400} +** CAPI3REF: Testing Interface ** -** The sqlite3_test_control() interface is used to read out internal +** ^The sqlite3_test_control() interface is used to read out internal ** state of SQLite and to inject faults into SQLite for testing -** purposes. The first parameter is an operation code that determines +** purposes. ^The first parameter is an operation code that determines ** the number, meaning, and operation of all subsequent parameters. ** ** This interface is not for use by applications. It exists solely @@ -5573,7 +5999,7 @@ SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void* SQLITE_API int sqlite3_test_control(int op, ...); /* -** CAPI3REF: Testing Interface Operation Codes {H11410} +** CAPI3REF: Testing Interface Operation Codes ** ** These constants are the valid operation code parameters used ** as the first argument to [sqlite3_test_control()]. @@ -5583,6 +6009,7 @@ SQLITE_API int sqlite3_test_control(int op, ...); ** Applications should not use any of these parameters or the ** [sqlite3_test_control()] interface. */ +#define SQLITE_TESTCTRL_FIRST 5 #define SQLITE_TESTCTRL_PRNG_SAVE 5 #define SQLITE_TESTCTRL_PRNG_RESTORE 6 #define SQLITE_TESTCTRL_PRNG_RESET 7 @@ -5593,27 +6020,31 @@ SQLITE_API int sqlite3_test_control(int op, ...); #define SQLITE_TESTCTRL_ASSERT 12 #define SQLITE_TESTCTRL_ALWAYS 13 #define SQLITE_TESTCTRL_RESERVE 14 +#define SQLITE_TESTCTRL_OPTIMIZATIONS 15 +#define SQLITE_TESTCTRL_ISKEYWORD 16 +#define SQLITE_TESTCTRL_PGHDRSZ 17 +#define SQLITE_TESTCTRL_SCRATCHMALLOC 18 +#define SQLITE_TESTCTRL_LAST 18 /* -** CAPI3REF: SQLite Runtime Status {H17200} -** EXPERIMENTAL +** CAPI3REF: SQLite Runtime Status ** -** This interface is used to retrieve runtime status information -** about the preformance of SQLite, and optionally to reset various -** highwater marks. The first argument is an integer code for -** the specific parameter to measure. Recognized integer codes -** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...]. -** The current value of the parameter is returned into *pCurrent. -** The highest recorded value is returned in *pHighwater. If the +** ^This interface is used to retrieve runtime status information +** about the performance of SQLite, and optionally to reset various +** highwater marks. ^The first argument is an integer code for +** the specific parameter to measure. ^(Recognized integer codes +** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...].)^ +** ^The current value of the parameter is returned into *pCurrent. +** ^The highest recorded value is returned in *pHighwater. ^If the ** resetFlag is true, then the highest record value is reset after -** *pHighwater is written. Some parameters do not record the highest +** *pHighwater is written. ^(Some parameters do not record the highest ** value. For those parameters -** nothing is written into *pHighwater and the resetFlag is ignored. -** Other parameters record only the highwater mark and not the current -** value. For these latter parameters nothing is written into *pCurrent. +** nothing is written into *pHighwater and the resetFlag is ignored.)^ +** ^(Other parameters record only the highwater mark and not the current +** value. For these latter parameters nothing is written into *pCurrent.)^ ** -** This routine returns SQLITE_OK on success and a non-zero -** [error code] on failure. +** ^The sqlite3_status() routine returns SQLITE_OK on success and a +** non-zero [error code] on failure. ** ** This routine is threadsafe but is not atomic. This routine can be ** called while other threads are running the same or different SQLite @@ -5624,18 +6055,17 @@ SQLITE_API int sqlite3_test_control(int op, ...); ** ** See also: [sqlite3_db_status()] */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); +SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); /* -** CAPI3REF: Status Parameters {H17250} -** EXPERIMENTAL +** CAPI3REF: Status Parameters ** ** These integer constants designate various run-time status parameters ** that can be returned by [sqlite3_status()]. ** **
    -**
    SQLITE_STATUS_MEMORY_USED
    +** ^(
    SQLITE_STATUS_MEMORY_USED
    **
    This parameter is the current amount of memory checked out ** using [sqlite3_malloc()], either directly or indirectly. The ** figure includes calls made to [sqlite3_malloc()] by the application @@ -5643,63 +6073,66 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pH ** controlled by [SQLITE_CONFIG_SCRATCH] and auxiliary page-cache ** memory controlled by [SQLITE_CONFIG_PAGECACHE] is not included in ** this parameter. The amount returned is the sum of the allocation -** sizes as reported by the xSize method in [sqlite3_mem_methods].
    +** sizes as reported by the xSize method in [sqlite3_mem_methods].)^ ** -**
    SQLITE_STATUS_MALLOC_SIZE
    +** ^(
    SQLITE_STATUS_MALLOC_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their ** internal equivalents). Only the value returned in the ** *pHighwater parameter to [sqlite3_status()] is of interest. -** The value written into the *pCurrent parameter is undefined.
    +** The value written into the *pCurrent parameter is undefined.)^ ** -**
    SQLITE_STATUS_PAGECACHE_USED
    +** ^(
    SQLITE_STATUS_MALLOC_COUNT
    +**
    This parameter records the number of separate memory allocations.
    )^ +** +** ^(
    SQLITE_STATUS_PAGECACHE_USED
    **
    This parameter returns the number of pages used out of the ** [pagecache memory allocator] that was configured using ** [SQLITE_CONFIG_PAGECACHE]. The -** value returned is in pages, not in bytes.
    +** value returned is in pages, not in bytes.)^ ** -**
    SQLITE_STATUS_PAGECACHE_OVERFLOW
    +** ^(
    SQLITE_STATUS_PAGECACHE_OVERFLOW
    **
    This parameter returns the number of bytes of page cache -** allocation which could not be statisfied by the [SQLITE_CONFIG_PAGECACHE] +** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] ** buffer and where forced to overflow to [sqlite3_malloc()]. The ** returned value includes allocations that overflowed because they ** where too large (they were larger than the "sz" parameter to ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because -** no space was left in the page cache.
    +** no space was left in the page cache.)^ ** -**
    SQLITE_STATUS_PAGECACHE_SIZE
    +** ^(
    SQLITE_STATUS_PAGECACHE_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [pagecache memory allocator]. Only the value returned in the ** *pHighwater parameter to [sqlite3_status()] is of interest. -** The value written into the *pCurrent parameter is undefined.
    +** The value written into the *pCurrent parameter is undefined.)^ ** -**
    SQLITE_STATUS_SCRATCH_USED
    +** ^(
    SQLITE_STATUS_SCRATCH_USED
    **
    This parameter returns the number of allocations used out of the ** [scratch memory allocator] configured using ** [SQLITE_CONFIG_SCRATCH]. The value returned is in allocations, not ** in bytes. Since a single thread may only have one scratch allocation ** outstanding at time, this parameter also reports the number of threads -** using scratch memory at the same time.
    +** using scratch memory at the same time.)^ ** -**
    SQLITE_STATUS_SCRATCH_OVERFLOW
    +** ^(
    SQLITE_STATUS_SCRATCH_OVERFLOW
    **
    This parameter returns the number of bytes of scratch memory -** allocation which could not be statisfied by the [SQLITE_CONFIG_SCRATCH] +** allocation which could not be satisfied by the [SQLITE_CONFIG_SCRATCH] ** buffer and where forced to overflow to [sqlite3_malloc()]. The values ** returned include overflows because the requested allocation was too ** larger (that is, because the requested allocation was larger than the ** "sz" parameter to [SQLITE_CONFIG_SCRATCH]) and because no scratch buffer ** slots were available. -**
    +** )^ ** -**
    SQLITE_STATUS_SCRATCH_SIZE
    +** ^(
    SQLITE_STATUS_SCRATCH_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [scratch memory allocator]. Only the value returned in the ** *pHighwater parameter to [sqlite3_status()] is of interest. -** The value written into the *pCurrent parameter is undefined.
    +** The value written into the *pCurrent parameter is undefined.)^ ** -**
    SQLITE_STATUS_PARSER_STACK
    +** ^(
    SQLITE_STATUS_PARSER_STACK
    **
    This parameter records the deepest parser stack. It is only -** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].
    +** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].)^ **
    ** ** New status parameters may be added from time to time. @@ -5713,30 +6146,34 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_status(int op, int *pCurrent, int *pH #define SQLITE_STATUS_PARSER_STACK 6 #define SQLITE_STATUS_PAGECACHE_SIZE 7 #define SQLITE_STATUS_SCRATCH_SIZE 8 +#define SQLITE_STATUS_MALLOC_COUNT 9 /* -** CAPI3REF: Database Connection Status {H17500} -** EXPERIMENTAL +** CAPI3REF: Database Connection Status ** -** This interface is used to retrieve runtime status information -** about a single [database connection]. The first argument is the -** database connection object to be interrogated. The second argument -** is the parameter to interrogate. Currently, the only allowed value -** for the second parameter is [SQLITE_DBSTATUS_LOOKASIDE_USED]. -** Additional options will likely appear in future releases of SQLite. +** ^This interface is used to retrieve runtime status information +** about a single [database connection]. ^The first argument is the +** database connection object to be interrogated. ^The second argument +** is an integer constant, taken from the set of +** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros, that +** determines the parameter to interrogate. The set of +** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros is likely +** to grow in future releases of SQLite. ** -** The current value of the requested parameter is written into *pCur -** and the highest instantaneous value is written into *pHiwtr. If +** ^The current value of the requested parameter is written into *pCur +** and the highest instantaneous value is written into *pHiwtr. ^If ** the resetFlg is true, then the highest instantaneous value is ** reset back down to the current value. ** +** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a +** non-zero [error code] on failure. +** ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); +SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); /* -** CAPI3REF: Status Parameters for database connections {H17520} -** EXPERIMENTAL +** CAPI3REF: Status Parameters for database connections ** ** These constants are the available integer "verbs" that can be passed as ** the second argument to the [sqlite3_db_status()] interface. @@ -5748,43 +6185,66 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_db_status(sqlite3*, int op, int *pCur ** if a discontinued or unsupported verb is invoked. ** **
    -**
    SQLITE_DBSTATUS_LOOKASIDE_USED
    +** ^(
    SQLITE_DBSTATUS_LOOKASIDE_USED
    **
    This parameter returns the number of lookaside memory slots currently -** checked out.
    +** checked out.)^ +** +** ^(
    SQLITE_DBSTATUS_CACHE_USED
    +**
    This parameter returns the approximate number of of bytes of heap +** memory used by all pager caches associated with the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. +** +** ^(
    SQLITE_DBSTATUS_SCHEMA_USED
    +**
    This parameter returns the approximate number of of bytes of heap +** memory used to store the schema for all databases associated +** with the connection - main, temp, and any [ATTACH]-ed databases.)^ +** ^The full amount of memory used by the schemas is reported, even if the +** schema memory is shared with other database connections due to +** [shared cache mode] being enabled. +** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. +** +** ^(
    SQLITE_DBSTATUS_STMT_USED
    +**
    This parameter returns the approximate number of of bytes of heap +** and lookaside memory used by all prepared statements associated with +** the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0. +**
    **
    */ #define SQLITE_DBSTATUS_LOOKASIDE_USED 0 +#define SQLITE_DBSTATUS_CACHE_USED 1 +#define SQLITE_DBSTATUS_SCHEMA_USED 2 +#define SQLITE_DBSTATUS_STMT_USED 3 +#define SQLITE_DBSTATUS_MAX 3 /* Largest defined DBSTATUS */ /* -** CAPI3REF: Prepared Statement Status {H17550} -** EXPERIMENTAL +** CAPI3REF: Prepared Statement Status ** -** Each prepared statement maintains various +** ^(Each prepared statement maintains various ** [SQLITE_STMTSTATUS_SORT | counters] that measure the number -** of times it has performed specific operations. These counters can +** of times it has performed specific operations.)^ These counters can ** be used to monitor the performance characteristics of the prepared ** statements. For example, if the number of table steps greatly exceeds ** the number of table searches or result rows, that would tend to indicate ** that the prepared statement is using a full table scan rather than ** an index. ** -** This interface is used to retrieve and reset counter values from +** ^(This interface is used to retrieve and reset counter values from ** a [prepared statement]. The first argument is the prepared statement ** object to be interrogated. The second argument ** is an integer code for a specific [SQLITE_STMTSTATUS_SORT | counter] -** to be interrogated. -** The current value of the requested counter is returned. -** If the resetFlg is true, then the counter is reset to zero after this +** to be interrogated.)^ +** ^The current value of the requested counter is returned. +** ^If the resetFlg is true, then the counter is reset to zero after this ** interface call returns. ** ** See also: [sqlite3_status()] and [sqlite3_db_status()]. */ -SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); +SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); /* -** CAPI3REF: Status Parameters for prepared statements {H17570} -** EXPERIMENTAL +** CAPI3REF: Status Parameters for prepared statements ** ** These preprocessor macros define integer codes that name counter ** values associated with the [sqlite3_stmt_status()] interface. @@ -5792,24 +6252,31 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_stmt_status(sqlite3_stmt*, int op,int ** **
    **
    SQLITE_STMTSTATUS_FULLSCAN_STEP
    -**
    This is the number of times that SQLite has stepped forward in +**
    ^This is the number of times that SQLite has stepped forward in ** a table as part of a full table scan. Large numbers for this counter ** may indicate opportunities for performance improvement through ** careful use of indices.
    ** **
    SQLITE_STMTSTATUS_SORT
    -**
    This is the number of sort operations that have occurred. +**
    ^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to ** improvement performance through careful use of indices.
    ** +**
    SQLITE_STMTSTATUS_AUTOINDEX
    +**
    ^This is the number of rows inserted into transient indices that +** were created automatically in order to help joins run faster. +** A non-zero value in this counter may indicate an opportunity to +** improvement performance by adding permanent indices that do not +** need to be reinitialized each time the statement is run.
    +** **
    */ #define SQLITE_STMTSTATUS_FULLSCAN_STEP 1 #define SQLITE_STMTSTATUS_SORT 2 +#define SQLITE_STMTSTATUS_AUTOINDEX 3 /* ** CAPI3REF: Custom Page Cache Object -** EXPERIMENTAL ** ** The sqlite3_pcache type is opaque. It is implemented by ** the pluggable module. The SQLite core has no knowledge of @@ -5824,84 +6291,96 @@ typedef struct sqlite3_pcache sqlite3_pcache; /* ** CAPI3REF: Application Defined Page Cache. ** KEYWORDS: {page cache} -** EXPERIMENTAL ** -** The [sqlite3_config]([SQLITE_CONFIG_PCACHE], ...) interface can +** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE], ...) interface can ** register an alternative page cache implementation by passing in an -** instance of the sqlite3_pcache_methods structure. The majority of the -** heap memory used by SQLite is used by the page cache to cache data read -** from, or ready to be written to, the database file. By implementing a -** custom page cache using this API, an application can control more -** precisely the amount of memory consumed by SQLite, the way in which +** instance of the sqlite3_pcache_methods structure.)^ +** In many applications, most of the heap memory allocated by +** SQLite is used for the page cache. +** By implementing a +** custom page cache using this API, an application can better control +** the amount of memory consumed by SQLite, the way in which ** that memory is allocated and released, and the policies used to ** determine exactly which parts of a database file are cached and for ** how long. ** -** The contents of the sqlite3_pcache_methods structure are copied to an +** The alternative page cache mechanism is an +** extreme measure that is only needed by the most demanding applications. +** The built-in page cache is recommended for most uses. +** +** ^(The contents of the sqlite3_pcache_methods structure are copied to an ** internal buffer by SQLite within the call to [sqlite3_config]. Hence ** the application may discard the parameter after the call to -** [sqlite3_config()] returns. +** [sqlite3_config()] returns.)^ ** -** The xInit() method is called once for each call to [sqlite3_initialize()] -** (usually only once during the lifetime of the process). It is passed -** a copy of the sqlite3_pcache_methods.pArg value. It can be used to set -** up global structures and mutexes required by the custom page cache -** implementation. +** ^(The xInit() method is called once for each effective +** call to [sqlite3_initialize()])^ +** (usually only once during the lifetime of the process). ^(The xInit() +** method is passed a copy of the sqlite3_pcache_methods.pArg value.)^ +** The intent of the xInit() method is to set up global data structures +** required by the custom page cache implementation. +** ^(If the xInit() method is NULL, then the +** built-in default page cache is used instead of the application defined +** page cache.)^ ** -** The xShutdown() method is called from within [sqlite3_shutdown()], -** if the application invokes this API. It can be used to clean up +** ^The xShutdown() method is called by [sqlite3_shutdown()]. +** It can be used to clean up ** any outstanding resources before process shutdown, if required. +** ^The xShutdown() method may be NULL. ** -** SQLite holds a [SQLITE_MUTEX_RECURSIVE] mutex when it invokes -** the xInit method, so the xInit method need not be threadsafe. The +** ^SQLite automatically serializes calls to the xInit method, +** so the xInit method need not be threadsafe. ^The ** xShutdown method is only called from [sqlite3_shutdown()] so it does ** not need to be threadsafe either. All other methods must be threadsafe ** in multithreaded applications. ** -** SQLite will never invoke xInit() more than once without an intervening +** ^SQLite will never invoke xInit() more than once without an intervening ** call to xShutdown(). ** -** The xCreate() method is used to construct a new cache instance. SQLite -** will typically create one cache instance for each open database file, -** though this is not guaranteed. The +** ^SQLite invokes the xCreate() method to construct a new cache instance. +** SQLite will typically create one cache instance for each open database file, +** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. szPage will not be a power of two. szPage +** be allocated by the cache. ^szPage will not be a power of two. ^szPage ** will the page size of the database file that is to be cached plus an ** increment (here called "R") of about 100 or 200. SQLite will use the ** extra R bytes on each page to store metadata about the underlying ** database page on disk. The value of R depends ** on the SQLite version, the target platform, and how SQLite was compiled. -** R is constant for a particular build of SQLite. The second argument to +** ^R is constant for a particular build of SQLite. ^The second argument to ** xCreate(), bPurgeable, is true if the cache being created will ** be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation ** does not have to do anything special based with the value of bPurgeable; -** it is purely advisory. On a cache where bPurgeable is false, SQLite will +** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. -** In other words, a cache created with bPurgeable set to false will +** ^In other words, calls to xUnpin() on a cache with bPurgeable set to +** false will always have the "discard" flag set to true. +** ^Hence, a cache created with bPurgeable false will ** never contain any unpinned pages. ** -** The xCachesize() method may be called at any time by SQLite to set the +** ^(The xCachesize() method may be called at any time by SQLite to set the ** suggested maximum cache-size (number of pages stored by) the cache ** instance passed as the first argument. This is the value configured using -** the SQLite "[PRAGMA cache_size]" command. As with the bPurgeable parameter, -** the implementation is not required to do anything with this +** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable +** parameter, the implementation is not required to do anything with this ** value; it is advisory only. ** -** The xPagecount() method should return the number of pages currently -** stored in the cache. +** The xPagecount() method must return the number of pages currently +** stored in the cache, both pinned and unpinned. ** -** The xFetch() method is used to fetch a page and return a pointer to it. -** A 'page', in this context, is a buffer of szPage bytes aligned at an -** 8-byte boundary. The page to be fetched is determined by the key. The -** mimimum key value is 1. After it has been retrieved using xFetch, the page +** The xFetch() method locates a page in the cache and returns a pointer to +** the page, or a NULL pointer. +** A "page", in this context, means a buffer of szPage bytes aligned at an +** 8-byte boundary. The page to be fetched is determined by the key. ^The +** mimimum key value is 1. After it has been retrieved using xFetch, the page ** is considered to be "pinned". ** ** If the requested page is already in the page cache, then the page cache ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the -** behavior of the cache implementation is determined by the value of the -** createFlag parameter passed to xFetch, according to the following table: +** behavior of the cache implementation should use the value of the createFlag +** parameter to help it determined what action to take: ** ** **
    createFlag Behaviour when page is not already in cache @@ -5912,29 +6391,28 @@ typedef struct sqlite3_pcache sqlite3_pcache; ** NULL if allocating a new page is effectively impossible. **
    ** -** SQLite will normally invoke xFetch() with a createFlag of 0 or 1. If -** a call to xFetch() with createFlag==1 returns NULL, then SQLite will +** ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1. SQLite +** will only use a createFlag of 2 after a prior call with a createFlag of 1 +** failed.)^ In between the to xFetch() calls, SQLite may ** attempt to unpin one or more cache pages by spilling the content of -** pinned pages to disk and synching the operating system disk cache. After -** attempting to unpin pages, the xFetch() method will be invoked again with -** a createFlag of 2. +** pinned pages to disk and synching the operating system disk cache. ** -** xUnpin() is called by SQLite with a pointer to a currently pinned page -** as its second argument. If the third parameter, discard, is non-zero, -** then the page should be evicted from the cache. In this case SQLite -** assumes that the next time the page is retrieved from the cache using -** the xFetch() method, it will be zeroed. If the discard parameter is -** zero, then the page is considered to be unpinned. The cache implementation +** ^xUnpin() is called by SQLite with a pointer to a currently pinned page +** as its second argument. If the third parameter, discard, is non-zero, +** then the page must be evicted from the cache. +** ^If the discard parameter is +** zero, then the page may be discarded or retained at the discretion of +** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** -** The cache is not required to perform any reference counting. A single +** The cache must not perform any reference counting. A single ** call to xUnpin() unpins the page regardless of the number of prior calls ** to xFetch(). ** ** The xRekey() method is used to change the key value associated with the -** page passed as the second argument from oldKey to newKey. If the cache -** previously contains an entry associated with newKey, it should be -** discarded. Any prior cache entry associated with newKey is guaranteed not +** page passed as the second argument. If the cache +** previously contains an entry associated with newKey, it must be +** discarded. ^Any prior cache entry associated with newKey is guaranteed not ** to be pinned. ** ** When SQLite calls the xTruncate() method, the cache must discard all @@ -5943,8 +6421,8 @@ typedef struct sqlite3_pcache sqlite3_pcache; ** of these pages are pinned, they are implicitly unpinned, meaning that ** they can be safely discarded. ** -** The xDestroy() method is used to delete a cache allocated by xCreate(). -** All resources associated with the specified cache should be freed. After +** ^The xDestroy() method is used to delete a cache allocated by xCreate(). +** All resources associated with the specified cache should be freed. ^After ** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] ** handle invalid, and will not use it with any other sqlite3_pcache_methods ** functions. @@ -5966,10 +6444,9 @@ struct sqlite3_pcache_methods { /* ** CAPI3REF: Online Backup Object -** EXPERIMENTAL ** ** The sqlite3_backup object records state information about an ongoing -** online backup operation. The sqlite3_backup object is created by +** online backup operation. ^The sqlite3_backup object is created by ** a call to [sqlite3_backup_init()] and is destroyed by a call to ** [sqlite3_backup_finish()]. ** @@ -5979,22 +6456,21 @@ typedef struct sqlite3_backup sqlite3_backup; /* ** CAPI3REF: Online Backup API. -** EXPERIMENTAL ** -** This API is used to overwrite the contents of one database with that -** of another. It is useful either for creating backups of databases or +** The backup API copies the content of one database into another. +** It is useful either for creating backups of databases or ** for copying in-memory databases to or from persistent files. ** ** See Also: [Using the SQLite Online Backup API] ** -** Exclusive access is required to the destination database for the -** duration of the operation. However the source database is only -** read-locked while it is actually being read, it is not locked -** continuously for the entire operation. Thus, the backup may be -** performed on a live database without preventing other users from -** writing to the database for an extended period of time. +** ^Exclusive access is required to the destination database for the +** duration of the operation. ^However the source database is only +** read-locked while it is actually being read; it is not locked +** continuously for the entire backup operation. ^Thus, the backup may be +** performed on a live source database without preventing other users from +** reading or writing to the source database while the backup is underway. ** -** To perform a backup operation: +** ^(To perform a backup operation: **
      **
    1. sqlite3_backup_init() is called once to initialize the ** backup, @@ -6002,143 +6478,152 @@ typedef struct sqlite3_backup sqlite3_backup; ** the data between the two databases, and finally **
    2. sqlite3_backup_finish() is called to release all resources ** associated with the backup operation. -**
    +** )^ ** There should be exactly one call to sqlite3_backup_finish() for each ** successful call to sqlite3_backup_init(). ** ** sqlite3_backup_init() ** -** The first two arguments passed to [sqlite3_backup_init()] are the database -** handle associated with the destination database and the database name -** used to attach the destination database to the handle. The database name -** is "main" for the main database, "temp" for the temporary database, or -** the name specified as part of the [ATTACH] statement if the destination is -** an attached database. The third and fourth arguments passed to -** sqlite3_backup_init() identify the [database connection] -** and database name used -** to access the source database. The values passed for the source and -** destination [database connection] parameters must not be the same. +** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the +** [database connection] associated with the destination database +** and the database name, respectively. +** ^The database name is "main" for the main database, "temp" for the +** temporary database, or the name specified after the AS keyword in +** an [ATTACH] statement for an attached database. +** ^The S and M arguments passed to +** sqlite3_backup_init(D,N,S,M) identify the [database connection] +** and database name of the source database, respectively. +** ^The source and destination [database connections] (parameters S and D) +** must be different or else sqlite3_backup_init(D,N,S,M) will file with +** an error. ** -** If an error occurs within sqlite3_backup_init(), then NULL is returned -** and an error code and error message written into the [database connection] -** passed as the first argument. They may be retrieved using the -** [sqlite3_errcode()], [sqlite3_errmsg()], and [sqlite3_errmsg16()] functions. -** Otherwise, if successful, a pointer to an [sqlite3_backup] object is -** returned. This pointer may be used with the sqlite3_backup_step() and +** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is +** returned and an error code and error message are store3d in the +** destination [database connection] D. +** ^The error code and message for the failed call to sqlite3_backup_init() +** can be retrieved using the [sqlite3_errcode()], [sqlite3_errmsg()], and/or +** [sqlite3_errmsg16()] functions. +** ^A successful call to sqlite3_backup_init() returns a pointer to an +** [sqlite3_backup] object. +** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and ** sqlite3_backup_finish() functions to perform the specified backup ** operation. ** ** sqlite3_backup_step() ** -** Function [sqlite3_backup_step()] is used to copy up to nPage pages between -** the source and destination databases, where nPage is the value of the -** second parameter passed to sqlite3_backup_step(). If nPage is a negative -** value, all remaining source pages are copied. If the required pages are -** successfully copied, but there are still more pages to copy before the -** backup is complete, it returns [SQLITE_OK]. If no error occured and there -** are no more pages to copy, then [SQLITE_DONE] is returned. If an error -** occurs, then an SQLite error code is returned. As well as [SQLITE_OK] and +** ^Function sqlite3_backup_step(B,N) will copy up to N pages between +** the source and destination databases specified by [sqlite3_backup] object B. +** ^If N is negative, all remaining source pages are copied. +** ^If sqlite3_backup_step(B,N) successfully copies N pages and there +** are still more pages to be copied, then the function resturns [SQLITE_OK]. +** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages +** from source to destination, then it returns [SQLITE_DONE]. +** ^If an error occurs while running sqlite3_backup_step(B,N), +** then an [error code] is returned. ^As well as [SQLITE_OK] and ** [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY], ** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an ** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code. ** -** As well as the case where the destination database file was opened for -** read-only access, sqlite3_backup_step() may return [SQLITE_READONLY] if -** the destination is an in-memory database with a different page size -** from the source database. +** ^(The sqlite3_backup_step() might return [SQLITE_READONLY] if +**
      +**
    1. the destination database was opened read-only, or +**
    2. the destination database is using write-ahead-log journaling +** and the destination and source page sizes differ, or +**
    3. The destination database is an in-memory database and the +** destination and source page sizes differ. +**
    )^ ** -** If sqlite3_backup_step() cannot obtain a required file-system lock, then +** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then ** the [sqlite3_busy_handler | busy-handler function] -** is invoked (if one is specified). If the +** is invoked (if one is specified). ^If the ** busy-handler returns non-zero before the lock is available, then -** [SQLITE_BUSY] is returned to the caller. In this case the call to -** sqlite3_backup_step() can be retried later. If the source +** [SQLITE_BUSY] is returned to the caller. ^In this case the call to +** sqlite3_backup_step() can be retried later. ^If the source ** [database connection] ** is being used to write to the source database when sqlite3_backup_step() -** is called, then [SQLITE_LOCKED] is returned immediately. Again, in this -** case the call to sqlite3_backup_step() can be retried later on. If +** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this +** case the call to sqlite3_backup_step() can be retried later on. ^(If ** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or ** [SQLITE_READONLY] is returned, then ** there is no point in retrying the call to sqlite3_backup_step(). These -** errors are considered fatal. At this point the application must accept +** errors are considered fatal.)^ The application must accept ** that the backup operation has failed and pass the backup operation handle ** to the sqlite3_backup_finish() to release associated resources. ** -** Following the first call to sqlite3_backup_step(), an exclusive lock is -** obtained on the destination file. It is not released until either +** ^The first call to sqlite3_backup_step() obtains an exclusive lock +** on the destination file. ^The exclusive lock is not released until either ** sqlite3_backup_finish() is called or the backup operation is complete -** and sqlite3_backup_step() returns [SQLITE_DONE]. Additionally, each time -** a call to sqlite3_backup_step() is made a [shared lock] is obtained on -** the source database file. This lock is released before the -** sqlite3_backup_step() call returns. Because the source database is not -** locked between calls to sqlite3_backup_step(), it may be modified mid-way -** through the backup procedure. If the source database is modified by an +** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to +** sqlite3_backup_step() obtains a [shared lock] on the source database that +** lasts for the duration of the sqlite3_backup_step() call. +** ^Because the source database is not locked between calls to +** sqlite3_backup_step(), the source database may be modified mid-way +** through the backup process. ^If the source database is modified by an ** external process or via a database connection other than the one being -** used by the backup operation, then the backup will be transparently -** restarted by the next call to sqlite3_backup_step(). If the source +** used by the backup operation, then the backup will be automatically +** restarted by the next call to sqlite3_backup_step(). ^If the source ** database is modified by the using the same database connection as is used -** by the backup operation, then the backup database is transparently +** by the backup operation, then the backup database is automatically ** updated at the same time. ** ** sqlite3_backup_finish() ** -** Once sqlite3_backup_step() has returned [SQLITE_DONE], or when the -** application wishes to abandon the backup operation, the [sqlite3_backup] -** object should be passed to sqlite3_backup_finish(). This releases all -** resources associated with the backup operation. If sqlite3_backup_step() -** has not yet returned [SQLITE_DONE], then any active write-transaction on the -** destination database is rolled back. The [sqlite3_backup] object is invalid +** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the +** application wishes to abandon the backup operation, the application +** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). +** ^The sqlite3_backup_finish() interfaces releases all +** resources associated with the [sqlite3_backup] object. +** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any +** active write-transaction on the destination database is rolled back. +** The [sqlite3_backup] object is invalid ** and may not be used following a call to sqlite3_backup_finish(). ** -** The value returned by sqlite3_backup_finish is [SQLITE_OK] if no error -** occurred, regardless or whether or not sqlite3_backup_step() was called -** a sufficient number of times to complete the backup operation. Or, if -** an out-of-memory condition or IO error occured during a call to -** sqlite3_backup_step() then [SQLITE_NOMEM] or an -** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] error code -** is returned. In this case the error code and an error message are -** written to the destination [database connection]. +** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no +** sqlite3_backup_step() errors occurred, regardless or whether or not +** sqlite3_backup_step() completed. +** ^If an out-of-memory condition or IO error occurred during any prior +** sqlite3_backup_step() call on the same [sqlite3_backup] object, then +** sqlite3_backup_finish() returns the corresponding [error code]. ** -** A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() is -** not a permanent error and does not affect the return value of +** ^A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() +** is not a permanent error and does not affect the return value of ** sqlite3_backup_finish(). ** ** sqlite3_backup_remaining(), sqlite3_backup_pagecount() ** -** Each call to sqlite3_backup_step() sets two values stored internally -** by an [sqlite3_backup] object. The number of pages still to be backed -** up, which may be queried by sqlite3_backup_remaining(), and the total -** number of pages in the source database file, which may be queried by -** sqlite3_backup_pagecount(). +** ^Each call to sqlite3_backup_step() sets two values inside +** the [sqlite3_backup] object: the number of pages still to be backed +** up and the total number of pages in the source database file. +** The sqlite3_backup_remaining() and sqlite3_backup_pagecount() interfaces +** retrieve these two values, respectively. ** -** The values returned by these functions are only updated by -** sqlite3_backup_step(). If the source database is modified during a backup +** ^The values returned by these functions are only updated by +** sqlite3_backup_step(). ^If the source database is modified during a backup ** operation, then the values are not updated to account for any extra ** pages that need to be updated or the size of the source database file ** changing. ** ** Concurrent Usage of Database Handles ** -** The source [database connection] may be used by the application for other +** ^The source [database connection] may be used by the application for other ** purposes while a backup operation is underway or being initialized. -** If SQLite is compiled and configured to support threadsafe database +** ^If SQLite is compiled and configured to support threadsafe database ** connections, then the source database connection may be used concurrently ** from within other threads. ** -** However, the application must guarantee that the destination database -** connection handle is not passed to any other API (by any thread) after +** However, the application must guarantee that the destination +** [database connection] is not passed to any other API (by any thread) after ** sqlite3_backup_init() is called and before the corresponding call to -** sqlite3_backup_finish(). Unfortunately SQLite does not currently check -** for this, if the application does use the destination [database connection] -** for some other purpose during a backup operation, things may appear to -** work correctly but in fact be subtly malfunctioning. Use of the -** destination database connection while a backup is in progress might -** also cause a mutex deadlock. +** sqlite3_backup_finish(). SQLite does not currently check to see +** if the application incorrectly accesses the destination [database connection] +** and so no error code is reported, but the operations may malfunction +** nevertheless. Use of the destination database connection while a +** backup is in progress might also also cause a mutex deadlock. ** -** Furthermore, if running in [shared cache mode], the application must +** If running in [shared cache mode], the application must ** guarantee that the shared cache used by the destination database ** is not accessed while the backup is running. In practice this means -** that the application must guarantee that the file-system file being +** that the application must guarantee that the disk file being ** backed up to is not accessed by any connection within the process, ** not just the specific connection that was passed to sqlite3_backup_init(). ** @@ -6162,50 +6647,49 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); /* ** CAPI3REF: Unlock Notification -** EXPERIMENTAL ** -** When running in shared-cache mode, a database operation may fail with +** ^When running in shared-cache mode, a database operation may fail with ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or ** individual tables within the shared-cache cannot be obtained. See ** [SQLite Shared-Cache Mode] for a description of shared-cache locking. -** This API may be used to register a callback that SQLite will invoke +** ^This API may be used to register a callback that SQLite will invoke ** when the connection currently holding the required lock relinquishes it. -** This API is only available if the library was compiled with the +** ^This API is only available if the library was compiled with the ** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. ** ** See Also: [Using the SQLite Unlock Notification Feature]. ** -** Shared-cache locks are released when a database connection concludes +** ^Shared-cache locks are released when a database connection concludes ** its current transaction, either by committing it or rolling it back. ** -** When a connection (known as the blocked connection) fails to obtain a +** ^When a connection (known as the blocked connection) fails to obtain a ** shared-cache lock and SQLITE_LOCKED is returned to the caller, the ** identity of the database connection (the blocking connection) that -** has locked the required resource is stored internally. After an +** has locked the required resource is stored internally. ^After an ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. The +** when the blocking connections current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connections transaction. ** -** If sqlite3_unlock_notify() is called in a multi-threaded application, +** ^(If sqlite3_unlock_notify() is called in a multi-threaded application, ** there is a chance that the blocking connection will have already ** concluded its transaction by the time sqlite3_unlock_notify() is invoked. ** If this happens, then the specified callback is invoked immediately, -** from within the call to sqlite3_unlock_notify(). +** from within the call to sqlite3_unlock_notify().)^ ** -** If the blocked connection is attempting to obtain a write-lock on a +** ^If the blocked connection is attempting to obtain a write-lock on a ** shared-cache table, and more than one other connection currently holds ** a read-lock on the same table, then SQLite arbitrarily selects one of ** the other connections to use as the blocking connection. ** -** There may be at most one unlock-notify callback registered by a +** ^(There may be at most one unlock-notify callback registered by a ** blocked connection. If sqlite3_unlock_notify() is called when the ** blocked connection already has a registered unlock-notify callback, -** then the new callback replaces the old. If sqlite3_unlock_notify() is +** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is cancelled. The blocked connections +** unlock-notify callback is canceled. ^The blocked connections ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -6213,7 +6697,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** any sqlite3_xxx API functions from within an unlock-notify callback, a ** crash or deadlock may be the result. ** -** Unless deadlock is detected (see below), sqlite3_unlock_notify() always +** ^Unless deadlock is detected (see below), sqlite3_unlock_notify() always ** returns SQLITE_OK. ** ** Callback Invocation Details @@ -6227,7 +6711,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** When a blocking connections transaction is concluded, there may be ** more than one blocked connection that has registered for an unlock-notify -** callback. If two or more such blocked connections have specified the +** callback. ^If two or more such blocked connections have specified the ** same callback function, then instead of invoking the callback function ** multiple times, it is invoked once with the set of void* context pointers ** specified by the blocked connections bundled together into an array. @@ -6245,16 +6729,16 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** will proceed and the system may remain deadlocked indefinitely. ** ** To avoid this scenario, the sqlite3_unlock_notify() performs deadlock -** detection. If a given call to sqlite3_unlock_notify() would put the +** detection. ^If a given call to sqlite3_unlock_notify() would put the ** system in a deadlocked state, then SQLITE_LOCKED is returned and no ** unlock-notify callback is registered. The system is said to be in ** a deadlocked state if connection A has registered for an unlock-notify ** callback on the conclusion of connection B's transaction, and connection ** B has itself registered for an unlock-notify callback when connection -** A's transaction is concluded. Indirect deadlock is also detected, so +** A's transaction is concluded. ^Indirect deadlock is also detected, so ** the system is also considered to be deadlocked if connection B has ** registered for an unlock-notify callback on the conclusion of connection -** C's transaction, where connection C is waiting on connection A. Any +** C's transaction, where connection C is waiting on connection A. ^Any ** number of levels of indirection are allowed. ** ** The "DROP TABLE" Exception @@ -6270,10 +6754,10 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** or "DROP INDEX" query, an infinite loop might be the result. ** ** One way around this problem is to check the extended error code returned -** by an sqlite3_step() call. If there is a blocking connection, then the +** by an sqlite3_step() call. ^(If there is a blocking connection, then the ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in ** the special "DROP TABLE/INDEX" case, the extended error code is just -** SQLITE_LOCKED. +** SQLITE_LOCKED.)^ */ SQLITE_API int sqlite3_unlock_notify( sqlite3 *pBlocked, /* Waiting connection */ @@ -6284,15 +6768,120 @@ SQLITE_API int sqlite3_unlock_notify( /* ** CAPI3REF: String Comparison -** EXPERIMENTAL ** -** The [sqlite3_strnicmp()] API allows applications and extensions to +** ^The [sqlite3_strnicmp()] API allows applications and extensions to ** compare the contents of two buffers containing UTF-8 strings in a -** case-indendent fashion, using the same definition of case independence +** case-independent fashion, using the same definition of case independence ** that SQLite uses internally when comparing identifiers. */ SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); +/* +** CAPI3REF: Error Logging Interface +** +** ^The [sqlite3_log()] interface writes a message into the error log +** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. +** ^If logging is enabled, the zFormat string and subsequent arguments are +** used with [sqlite3_snprintf()] to generate the final output string. +** +** The sqlite3_log() interface is intended for use by extensions such as +** virtual tables, collating functions, and SQL functions. While there is +** nothing to prevent an application from calling sqlite3_log(), doing so +** is considered bad form. +** +** The zFormat string must not be NULL. +** +** To avoid deadlocks and other threading problems, the sqlite3_log() routine +** will not use dynamically allocated memory. The log message is stored in +** a fixed-length buffer on the stack. If the log message is longer than +** a few hundred characters, it will be truncated to the length of the +** buffer. +*/ +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); + +/* +** CAPI3REF: Write-Ahead Log Commit Hook +** +** ^The [sqlite3_wal_hook()] function is used to register a callback that +** will be invoked each time a database connection commits data to a +** [write-ahead log] (i.e. whenever a transaction is committed in +** [journal_mode | journal_mode=WAL mode]). +** +** ^The callback is invoked by SQLite after the commit has taken place and +** the associated write-lock on the database released, so the implementation +** may read, write or [checkpoint] the database as required. +** +** ^The first parameter passed to the callback function when it is invoked +** is a copy of the third parameter passed to sqlite3_wal_hook() when +** registering the callback. ^The second is a copy of the database handle. +** ^The third parameter is the name of the database that was written to - +** either "main" or the name of an [ATTACH]-ed database. ^The fourth parameter +** is the number of pages currently in the write-ahead log file, +** including those that were just committed. +** +** The callback function should normally return [SQLITE_OK]. ^If an error +** code is returned, that error will propagate back up through the +** SQLite code base to cause the statement that provoked the callback +** to report an error, though the commit will have still occurred. If the +** callback returns [SQLITE_ROW] or [SQLITE_DONE], or if it returns a value +** that does not correspond to any valid SQLite error code, the results +** are undefined. +** +** A single database handle may have at most a single write-ahead log callback +** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any +** previously registered write-ahead log callback. ^Note that the +** [sqlite3_wal_autocheckpoint()] interface and the +** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will +** those overwrite any prior [sqlite3_wal_hook()] settings. +*/ +SQLITE_API void *sqlite3_wal_hook( + sqlite3*, + int(*)(void *,sqlite3*,const char*,int), + void* +); + +/* +** CAPI3REF: Configure an auto-checkpoint +** +** ^The [sqlite3_wal_autocheckpoint(D,N)] is a wrapper around +** [sqlite3_wal_hook()] that causes any database on [database connection] D +** to automatically [checkpoint] +** after committing a transaction if there are N or +** more frames in the [write-ahead log] file. ^Passing zero or +** a negative value as the nFrame parameter disables automatic +** checkpoints entirely. +** +** ^The callback registered by this function replaces any existing callback +** registered using [sqlite3_wal_hook()]. ^Likewise, registering a callback +** using [sqlite3_wal_hook()] disables the automatic checkpoint mechanism +** configured by this function. +** +** ^The [wal_autocheckpoint pragma] can be used to invoke this interface +** from SQL. +** +** ^Every new [database connection] defaults to having the auto-checkpoint +** enabled with a threshold of 1000 pages. The use of this interface +** is only necessary if the default setting is found to be suboptimal +** for a particular application. +*/ +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N); + +/* +** CAPI3REF: Checkpoint a database +** +** ^The [sqlite3_wal_checkpoint(D,X)] interface causes database named X +** on [database connection] D to be [checkpointed]. ^If X is NULL or an +** empty string, then a checkpoint is run on all databases of +** connection D. ^If the database connection D is not in +** [WAL | write-ahead log mode] then this interface is a harmless no-op. +** +** ^The [wal_checkpoint pragma] can be used to invoke this interface +** from SQL. ^The [sqlite3_wal_autocheckpoint()] interface and the +** [wal_autocheckpoint pragma] can be used to cause this interface to be +** run whenever the WAL reaches a certain size threshold. +*/ +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); + /* ** Undo the hack that converts floating point types to integer for ** builds on processors without floating point support. @@ -6306,6 +6895,62 @@ SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); #endif #endif +/* +** 2010 August 30 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +*/ + +#ifndef _SQLITE3RTREE_H_ +#define _SQLITE3RTREE_H_ + + +#if 0 +extern "C" { +#endif + +typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry; + +/* +** Register a geometry callback named zGeom that can be used as part of an +** R-Tree geometry query as follows: +** +** SELECT ... FROM WHERE MATCH $zGeom(... params ...) +*/ +SQLITE_API int sqlite3_rtree_geometry_callback( + sqlite3 *db, + const char *zGeom, + int (*xGeom)(sqlite3_rtree_geometry *, int nCoord, double *aCoord, int *pRes), + void *pContext +); + + +/* +** A pointer to a structure of the following type is passed as the first +** argument to callbacks registered using rtree_geometry_callback(). +*/ +struct sqlite3_rtree_geometry { + void *pContext; /* Copy of pContext passed to s_r_g_c() */ + int nParam; /* Size of array aParam[] */ + double *aParam; /* Parameters passed to SQL geom function */ + void *pUser; /* Callback implementation user data */ + void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */ +}; + + +#if 0 +} /* end of the 'extern "C"' block */ +#endif + +#endif /* ifndef _SQLITE3RTREE_H_ */ + /************** End of sqlite3.h *********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ @@ -6324,8 +6969,6 @@ SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); ************************************************************************* ** This is the header file for the generic hash-table implemenation ** used in SQLite. -** -** $Id: hash.h,v 1.15 2009/05/02 13:29:38 drh Exp $ */ #ifndef _SQLITE_HASH_H_ #define _SQLITE_HASH_H_ @@ -6518,30 +7161,30 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); #define TK_REFERENCES 102 #define TK_AUTOINCR 103 #define TK_ON 104 -#define TK_DELETE 105 -#define TK_UPDATE 106 -#define TK_SET 107 -#define TK_DEFERRABLE 108 -#define TK_FOREIGN 109 -#define TK_DROP 110 -#define TK_UNION 111 -#define TK_ALL 112 -#define TK_EXCEPT 113 -#define TK_INTERSECT 114 -#define TK_SELECT 115 -#define TK_DISTINCT 116 -#define TK_DOT 117 -#define TK_FROM 118 -#define TK_JOIN 119 -#define TK_USING 120 -#define TK_ORDER 121 -#define TK_GROUP 122 -#define TK_HAVING 123 -#define TK_LIMIT 124 -#define TK_WHERE 125 -#define TK_INTO 126 -#define TK_VALUES 127 -#define TK_INSERT 128 +#define TK_INSERT 105 +#define TK_DELETE 106 +#define TK_UPDATE 107 +#define TK_SET 108 +#define TK_DEFERRABLE 109 +#define TK_FOREIGN 110 +#define TK_DROP 111 +#define TK_UNION 112 +#define TK_ALL 113 +#define TK_EXCEPT 114 +#define TK_INTERSECT 115 +#define TK_SELECT 116 +#define TK_DISTINCT 117 +#define TK_DOT 118 +#define TK_FROM 119 +#define TK_JOIN 120 +#define TK_USING 121 +#define TK_ORDER 122 +#define TK_GROUP 123 +#define TK_HAVING 124 +#define TK_LIMIT 125 +#define TK_WHERE 126 +#define TK_INTO 127 +#define TK_VALUES 128 #define TK_INTEGER 129 #define TK_FLOAT 130 #define TK_BLOB 131 @@ -6586,6 +7229,7 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); */ #ifdef SQLITE_OMIT_FLOATING_POINT # define double sqlite_int64 +# define float sqlite_int64 # define LONGDOUBLE_TYPE sqlite_int64 # ifndef SQLITE_BIG_DBL # define SQLITE_BIG_DBL (((sqlite3_int64)1)<<50) @@ -6610,20 +7254,6 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); #define OMIT_TEMPDB 0 #endif -/* -** If the following macro is set to 1, then NULL values are considered -** distinct when determining whether or not two entries are the same -** in a UNIQUE index. This is the way PostgreSQL, Oracle, DB2, MySQL, -** OCELOT, and Firebird all work. The SQL92 spec explicitly says this -** is the way things are suppose to work. -** -** If the following macro is set to 0, the NULLs are indistinct for -** a UNIQUE index. In this mode, you can only have a single NULL entry -** for a column declared UNIQUE. This is the way Informix and SQL Server -** work. -*/ -#define NULL_DISTINCT_FOR_UNIQUE 1 - /* ** The "file format" number is an integer that is incremented whenever ** the VDBE-level file format changes. The following macros define the @@ -6635,6 +7265,10 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); # define SQLITE_DEFAULT_FILE_FORMAT 1 #endif +/* +** Determine whether triggers are recursive by default. This can be +** changed at run-time using a pragma. +*/ #ifndef SQLITE_DEFAULT_RECURSIVE_TRIGGERS # define SQLITE_DEFAULT_RECURSIVE_TRIGGERS 0 #endif @@ -6766,9 +7400,19 @@ SQLITE_PRIVATE const int sqlite3one; #define ROUNDDOWN8(x) ((x)&~7) /* -** Assert that the pointer X is aligned to an 8-byte boundary. +** Assert that the pointer X is aligned to an 8-byte boundary. This +** macro is used only within assert() to verify that the code gets +** all alignment restrictions correct. +** +** Except, if SQLITE_4_BYTE_ALIGNED_MALLOC is defined, then the +** underlying malloc() implemention might return us 4-byte aligned +** pointers. In that case, only verify 4-byte alignment. */ -#define EIGHT_BYTE_ALIGNMENT(X) ((((char*)(X) - (char*)0)&7)==0) +#ifdef SQLITE_4_BYTE_ALIGNED_MALLOC +# define EIGHT_BYTE_ALIGNMENT(X) ((((char*)(X) - (char*)0)&3)==0) +#else +# define EIGHT_BYTE_ALIGNMENT(X) ((((char*)(X) - (char*)0)&7)==0) +#endif /* @@ -6869,7 +7513,6 @@ typedef struct AggInfo AggInfo; typedef struct AuthContext AuthContext; typedef struct AutoincInfo AutoincInfo; typedef struct Bitvec Bitvec; -typedef struct RowSet RowSet; typedef struct CollSeq CollSeq; typedef struct Column Column; typedef struct Db Db; @@ -6878,6 +7521,7 @@ typedef struct Expr Expr; typedef struct ExprList ExprList; typedef struct ExprSpan ExprSpan; typedef struct FKey FKey; +typedef struct FuncDestructor FuncDestructor; typedef struct FuncDef FuncDef; typedef struct FuncDefHash FuncDefHash; typedef struct IdList IdList; @@ -6890,6 +7534,7 @@ typedef struct LookasideSlot LookasideSlot; typedef struct Module Module; typedef struct NameContext NameContext; typedef struct Parse Parse; +typedef struct RowSet RowSet; typedef struct Savepoint Savepoint; typedef struct Select Select; typedef struct SrcList SrcList; @@ -6897,9 +7542,9 @@ typedef struct StrAccum StrAccum; typedef struct Table Table; typedef struct TableLock TableLock; typedef struct Token Token; +typedef struct Trigger Trigger; typedef struct TriggerPrg TriggerPrg; typedef struct TriggerStep TriggerStep; -typedef struct Trigger Trigger; typedef struct UnpackedRecord UnpackedRecord; typedef struct VTable VTable; typedef struct Walker Walker; @@ -6928,8 +7573,6 @@ typedef struct WhereLevel WhereLevel; ** This header file defines the interface that the sqlite B-Tree file ** subsystem. See comments in the source code for a detailed description ** of what each interface routine does. -** -** @(#) $Id: btree.h,v 1.120 2009/07/22 00:35:24 drh Exp $ */ #ifndef _BTREE_H_ #define _BTREE_H_ @@ -6985,12 +7628,11 @@ SQLITE_PRIVATE int sqlite3BtreeOpen( ** NOTE: These values must match the corresponding PAGER_ values in ** pager.h. */ -#define BTREE_OMIT_JOURNAL 1 /* Do not use journal. No argument */ +#define BTREE_OMIT_JOURNAL 1 /* Do not create or use a rollback journal */ #define BTREE_NO_READLOCK 2 /* Omit readlocks on readonly files */ -#define BTREE_MEMORY 4 /* In-memory DB. No argument */ -#define BTREE_READONLY 8 /* Open the database in read-only mode */ -#define BTREE_READWRITE 16 /* Open for both reading and writing */ -#define BTREE_CREATE 32 /* Create the database if it does not exist */ +#define BTREE_MEMORY 4 /* This is an in-memory DB */ +#define BTREE_SINGLE 8 /* The file contains at most 1 b-tree */ +#define BTREE_UNORDERED 16 /* Use of a hash implementation is OK */ SQLITE_PRIVATE int sqlite3BtreeClose(Btree*); SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree*,int); @@ -6999,6 +7641,8 @@ SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree*); SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve, int eFix); SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree*); SQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree*,int); +SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree*); +SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree*,int); SQLITE_PRIVATE int sqlite3BtreeGetReserve(Btree*); SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *, int); SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *); @@ -7024,11 +7668,17 @@ SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *, Btree *); SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *); /* The flags parameter to sqlite3BtreeCreateTable can be the bitwise OR -** of the following flags: +** of the flags shown below. +** +** Every SQLite table must have either BTREE_INTKEY or BTREE_BLOBKEY set. +** With BTREE_INTKEY, the table key is a 64-bit integer and arbitrary data +** is stored in the leaves. (BTREE_INTKEY is used for SQL tables.) With +** BTREE_BLOBKEY, the key is an arbitrary BLOB and no content is stored +** anywhere - the key is the content. (BTREE_BLOBKEY is used for SQL +** indices.) */ #define BTREE_INTKEY 1 /* Table has only 64-bit signed integer keys */ -#define BTREE_ZERODATA 2 /* Table has keys only - no data */ -#define BTREE_LEAFDATA 4 /* Data stored in leaves only. Implies INTKEY */ +#define BTREE_BLOBKEY 2 /* Table has keys only - no data */ SQLITE_PRIVATE int sqlite3BtreeDropTable(Btree*, int, int*); SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree*, int, int*); @@ -7066,6 +7716,7 @@ SQLITE_PRIVATE int sqlite3BtreeCursor( BtCursor *pCursor /* Space to write cursor structure */ ); SQLITE_PRIVATE int sqlite3BtreeCursorSize(void); +SQLITE_PRIVATE void sqlite3BtreeCursorZero(BtCursor*); SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor*); SQLITE_PRIVATE int sqlite3BtreeMovetoUnpacked( @@ -7101,6 +7752,8 @@ SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor*, u32 offset, u32 amt, void*); SQLITE_PRIVATE void sqlite3BtreeCacheOverflow(BtCursor *); SQLITE_PRIVATE void sqlite3BtreeClearCursor(BtCursor *); +SQLITE_PRIVATE int sqlite3BtreeSetVersion(Btree *pBt, int iVersion); + #ifndef NDEBUG SQLITE_PRIVATE int sqlite3BtreeCursorIsValid(BtCursor*); #endif @@ -7114,6 +7767,10 @@ SQLITE_PRIVATE int sqlite3BtreeCursorInfo(BtCursor*, int*, int); SQLITE_PRIVATE void sqlite3BtreeCursorList(Btree*); #endif +#ifndef SQLITE_OMIT_WAL +SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree*); +#endif + /* ** If we are not using shared cache, then there is no need to ** use mutexes to access the BtShared structures. So make the @@ -7177,8 +7834,6 @@ SQLITE_PRIVATE int sqlite3BtreeHoldsAllMutexes(sqlite3*); ** This header defines the interface to the virtual database engine ** or VDBE. The VDBE implements an abstract machine that runs a ** simple program to access and modify the underlying database. -** -** $Id: vdbe.h,v 1.142 2009/07/24 17:58:53 danielk1977 Exp $ */ #ifndef _SQLITE_VDBE_H_ #define _SQLITE_VDBE_H_ @@ -7206,7 +7861,7 @@ typedef struct SubProgram SubProgram; struct VdbeOp { u8 opcode; /* What operation to perform */ signed char p4type; /* One of the P4_xxx constants for p4 */ - u8 opflags; /* Not currently used */ + u8 opflags; /* Mask of the OPFLG_* flags in opcodes.h */ u8 p5; /* Fifth parameter is an unsigned character */ int p1; /* First operand */ int p2; /* Second parameter (often the jump destination) */ @@ -7245,8 +7900,8 @@ struct SubProgram { int nOp; /* Elements in aOp[] */ int nMem; /* Number of memory cells required */ int nCsr; /* Number of cursors required */ - int nRef; /* Number of pointers to this structure */ void *token; /* id that may be used to recursive triggers */ + SubProgram *pNext; /* Next sub-program already visited */ }; /* @@ -7393,83 +8048,83 @@ typedef struct VdbeOpList VdbeOpList; #define OP_VerifyCookie 37 #define OP_OpenRead 38 #define OP_OpenWrite 39 -#define OP_OpenEphemeral 40 -#define OP_OpenPseudo 41 -#define OP_Close 42 -#define OP_SeekLt 43 -#define OP_SeekLe 44 -#define OP_SeekGe 45 -#define OP_SeekGt 46 -#define OP_Seek 47 -#define OP_NotFound 48 -#define OP_Found 49 -#define OP_IsUnique 50 -#define OP_NotExists 51 -#define OP_Sequence 52 -#define OP_NewRowid 53 -#define OP_Insert 54 -#define OP_InsertInt 55 -#define OP_Delete 56 -#define OP_ResetCount 57 -#define OP_RowKey 58 -#define OP_RowData 59 -#define OP_Rowid 60 -#define OP_NullRow 61 -#define OP_Last 62 -#define OP_Sort 63 -#define OP_Rewind 64 -#define OP_Prev 65 -#define OP_Next 66 -#define OP_IdxInsert 67 -#define OP_IdxDelete 70 -#define OP_IdxRowid 71 -#define OP_IdxLT 72 -#define OP_IdxGE 81 -#define OP_Destroy 92 -#define OP_Clear 95 -#define OP_CreateIndex 96 -#define OP_CreateTable 97 -#define OP_ParseSchema 98 -#define OP_LoadAnalysis 99 -#define OP_DropTable 100 -#define OP_DropIndex 101 -#define OP_DropTrigger 102 -#define OP_IntegrityCk 103 -#define OP_RowSetAdd 104 -#define OP_RowSetRead 105 -#define OP_RowSetTest 106 -#define OP_Program 107 -#define OP_Param 108 -#define OP_FkCounter 109 -#define OP_FkIfZero 110 -#define OP_MemMax 111 -#define OP_IfPos 112 -#define OP_IfNeg 113 -#define OP_IfZero 114 -#define OP_AggStep 115 -#define OP_AggFinal 116 -#define OP_Vacuum 117 -#define OP_IncrVacuum 118 -#define OP_Expire 119 -#define OP_TableLock 120 -#define OP_VBegin 121 -#define OP_VCreate 122 -#define OP_VDestroy 123 -#define OP_VOpen 124 -#define OP_VFilter 125 -#define OP_VColumn 126 -#define OP_VNext 127 -#define OP_VRename 128 -#define OP_VUpdate 129 -#define OP_Pagecount 131 -#define OP_Trace 132 -#define OP_Noop 133 -#define OP_Explain 134 +#define OP_OpenAutoindex 40 +#define OP_OpenEphemeral 41 +#define OP_OpenPseudo 42 +#define OP_Close 43 +#define OP_SeekLt 44 +#define OP_SeekLe 45 +#define OP_SeekGe 46 +#define OP_SeekGt 47 +#define OP_Seek 48 +#define OP_NotFound 49 +#define OP_Found 50 +#define OP_IsUnique 51 +#define OP_NotExists 52 +#define OP_Sequence 53 +#define OP_NewRowid 54 +#define OP_Insert 55 +#define OP_InsertInt 56 +#define OP_Delete 57 +#define OP_ResetCount 58 +#define OP_RowKey 59 +#define OP_RowData 60 +#define OP_Rowid 61 +#define OP_NullRow 62 +#define OP_Last 63 +#define OP_Sort 64 +#define OP_Rewind 65 +#define OP_Prev 66 +#define OP_Next 67 +#define OP_IdxInsert 70 +#define OP_IdxDelete 71 +#define OP_IdxRowid 72 +#define OP_IdxLT 81 +#define OP_IdxGE 92 +#define OP_Destroy 95 +#define OP_Clear 96 +#define OP_CreateIndex 97 +#define OP_CreateTable 98 +#define OP_ParseSchema 99 +#define OP_LoadAnalysis 100 +#define OP_DropTable 101 +#define OP_DropIndex 102 +#define OP_DropTrigger 103 +#define OP_IntegrityCk 104 +#define OP_RowSetAdd 105 +#define OP_RowSetRead 106 +#define OP_RowSetTest 107 +#define OP_Program 108 +#define OP_Param 109 +#define OP_FkCounter 110 +#define OP_FkIfZero 111 +#define OP_MemMax 112 +#define OP_IfPos 113 +#define OP_IfNeg 114 +#define OP_IfZero 115 +#define OP_AggStep 116 +#define OP_AggFinal 117 +#define OP_Checkpoint 118 +#define OP_JournalMode 119 +#define OP_Vacuum 120 +#define OP_IncrVacuum 121 +#define OP_Expire 122 +#define OP_TableLock 123 +#define OP_VBegin 124 +#define OP_VCreate 125 +#define OP_VDestroy 126 +#define OP_VOpen 127 +#define OP_VFilter 128 +#define OP_VColumn 129 +#define OP_VNext 131 +#define OP_VRename 132 +#define OP_VUpdate 133 +#define OP_Pagecount 134 +#define OP_Trace 135 +#define OP_Noop 136 +#define OP_Explain 137 /* The following opcode values are never used */ -#define OP_NotUsed_135 135 -#define OP_NotUsed_136 136 -#define OP_NotUsed_137 137 #define OP_NotUsed_138 138 #define OP_NotUsed_139 139 #define OP_NotUsed_140 140 @@ -7484,25 +8139,26 @@ typedef struct VdbeOpList VdbeOpList; #define OPFLG_IN1 0x0004 /* in1: P1 is an input */ #define OPFLG_IN2 0x0008 /* in2: P2 is an input */ #define OPFLG_IN3 0x0010 /* in3: P3 is an input */ -#define OPFLG_OUT3 0x0020 /* out3: P3 is an output */ +#define OPFLG_OUT2 0x0020 /* out2: P2 is an output */ +#define OPFLG_OUT3 0x0040 /* out3: P3 is an output */ #define OPFLG_INITIALIZER {\ -/* 0 */ 0x00, 0x01, 0x01, 0x04, 0x04, 0x10, 0x00, 0x02,\ -/* 8 */ 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x04, 0x04,\ -/* 16 */ 0x00, 0x00, 0x00, 0x04, 0x04, 0x05, 0x04, 0x00,\ +/* 0 */ 0x00, 0x01, 0x05, 0x04, 0x04, 0x10, 0x00, 0x02,\ +/* 8 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x24, 0x24,\ +/* 16 */ 0x00, 0x00, 0x00, 0x24, 0x04, 0x05, 0x04, 0x00,\ /* 24 */ 0x00, 0x01, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02,\ /* 32 */ 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00,\ -/* 40 */ 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x08,\ -/* 48 */ 0x11, 0x11, 0x11, 0x11, 0x02, 0x02, 0x00, 0x00,\ -/* 56 */ 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x01,\ -/* 64 */ 0x01, 0x01, 0x01, 0x08, 0x2c, 0x2c, 0x00, 0x02,\ -/* 72 */ 0x11, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\ -/* 80 */ 0x15, 0x11, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,\ -/* 88 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x02, 0x04, 0x02, 0x00,\ -/* 96 */ 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ -/* 104 */ 0x08, 0x21, 0x15, 0x01, 0x02, 0x00, 0x01, 0x08,\ -/* 112 */ 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00,\ -/* 120 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01,\ -/* 128 */ 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,\ +/* 40 */ 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11,\ +/* 48 */ 0x08, 0x11, 0x11, 0x11, 0x11, 0x02, 0x02, 0x00,\ +/* 56 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01,\ +/* 64 */ 0x01, 0x01, 0x01, 0x01, 0x4c, 0x4c, 0x08, 0x00,\ +/* 72 */ 0x02, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\ +/* 80 */ 0x15, 0x01, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c, 0x4c,\ +/* 88 */ 0x4c, 0x4c, 0x4c, 0x4c, 0x01, 0x24, 0x02, 0x02,\ +/* 96 */ 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\ +/* 104 */ 0x00, 0x0c, 0x45, 0x15, 0x01, 0x02, 0x00, 0x01,\ +/* 112 */ 0x08, 0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x02,\ +/* 120 */ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ +/* 128 */ 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x00,\ /* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04,\ /* 144 */ 0x04, 0x04,} @@ -7519,6 +8175,7 @@ SQLITE_PRIVATE int sqlite3VdbeAddOp1(Vdbe*,int,int); SQLITE_PRIVATE int sqlite3VdbeAddOp2(Vdbe*,int,int,int); SQLITE_PRIVATE int sqlite3VdbeAddOp3(Vdbe*,int,int,int,int); SQLITE_PRIVATE int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int); +SQLITE_PRIVATE int sqlite3VdbeAddOp4Int(Vdbe*,int,int,int,int,int); SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp); SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1); SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2); @@ -7530,7 +8187,9 @@ SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N) SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int); SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int); SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*); +SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*); SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*); +SQLITE_PRIVATE void sqlite3VdbeDeleteObject(sqlite3*,Vdbe*); SQLITE_PRIVATE void sqlite3VdbeMakeReady(Vdbe*,int,int,int,int,int,int); SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe*); SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe*, int); @@ -7548,14 +8207,20 @@ SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe*); SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, int); SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe*,Vdbe*); SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*); -SQLITE_PRIVATE void sqlite3VdbeProgramDelete(sqlite3 *, SubProgram *, int); SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetValue(Vdbe*, int, u8); SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int); +#ifndef SQLITE_OMIT_TRACE +SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*); +#endif SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int); SQLITE_PRIVATE void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord*); SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*); +#ifndef SQLITE_OMIT_TRIGGER +SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *); +#endif + #ifndef NDEBUG SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe*, const char*, ...); @@ -7587,8 +8252,6 @@ SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe*, const char*, ...); ** This header file defines the interface that the sqlite page cache ** subsystem. The page cache subsystem reads and writes a file a page ** at a time and provides a journal for rollback. -** -** @(#) $Id: pager.h,v 1.104 2009/07/24 19:01:19 drh Exp $ */ #ifndef _PAGER_H_ @@ -7636,6 +8299,7 @@ typedef struct PgHdr DbPage; */ #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */ #define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */ +#define PAGER_MEMORY 0x0004 /* In-memory database */ /* ** Valid values for the second argument to sqlite3PagerLockingMode(). @@ -7645,14 +8309,15 @@ typedef struct PgHdr DbPage; #define PAGER_LOCKINGMODE_EXCLUSIVE 1 /* -** Valid values for the second argument to sqlite3PagerJournalMode(). +** Numeric constants that encode the journalmode. */ -#define PAGER_JOURNALMODE_QUERY -1 +#define PAGER_JOURNALMODE_QUERY (-1) /* Query the value of journalmode */ #define PAGER_JOURNALMODE_DELETE 0 /* Commit by deleting journal file */ #define PAGER_JOURNALMODE_PERSIST 1 /* Commit by zeroing journal header */ #define PAGER_JOURNALMODE_OFF 2 /* Journal omitted. */ #define PAGER_JOURNALMODE_TRUNCATE 3 /* Commit by truncating journal */ #define PAGER_JOURNALMODE_MEMORY 4 /* In-memory journal file */ +#define PAGER_JOURNALMODE_WAL 5 /* Use write-ahead logging */ /* ** The remainder of this file contains the declarations of the functions @@ -7675,12 +8340,14 @@ SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*); /* Functions used to configure a Pager object. */ SQLITE_PRIVATE void sqlite3PagerSetBusyhandler(Pager*, int(*)(void *), void *); -SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, u16*, int); +SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, u32*, int); SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager*, int); SQLITE_PRIVATE void sqlite3PagerSetCachesize(Pager*, int); SQLITE_PRIVATE void sqlite3PagerSetSafetyLevel(Pager*,int,int); SQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *, int); -SQLITE_PRIVATE int sqlite3PagerJournalMode(Pager *, int); +SQLITE_PRIVATE int sqlite3PagerSetJournalMode(Pager *, int); +SQLITE_PRIVATE int sqlite3PagerGetJournalMode(Pager*); +SQLITE_PRIVATE int sqlite3PagerOkToChangeJournalMode(Pager*); SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *, i64); SQLITE_PRIVATE sqlite3_backup **sqlite3PagerBackupPtr(Pager*); @@ -7700,9 +8367,10 @@ SQLITE_PRIVATE void *sqlite3PagerGetData(DbPage *); SQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *); /* Functions used to manage pager transactions and savepoints. */ -SQLITE_PRIVATE int sqlite3PagerPagecount(Pager*, int*); +SQLITE_PRIVATE void sqlite3PagerPagecount(Pager*, int*); SQLITE_PRIVATE int sqlite3PagerBegin(Pager*, int exFlag, int); SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager*,const char *zMaster, int); +SQLITE_PRIVATE int sqlite3PagerExclusiveLock(Pager*); SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager); SQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager*); SQLITE_PRIVATE int sqlite3PagerRollback(Pager*); @@ -7710,9 +8378,16 @@ SQLITE_PRIVATE int sqlite3PagerOpenSavepoint(Pager *pPager, int n); SQLITE_PRIVATE int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint); SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager); +SQLITE_PRIVATE int sqlite3PagerCheckpoint(Pager *pPager); +SQLITE_PRIVATE int sqlite3PagerWalSupported(Pager *pPager); +SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager); +SQLITE_PRIVATE int sqlite3PagerOpenWal(Pager *pPager, int *pisOpen); +SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager); + /* Functions used to query pager state and configuration. */ SQLITE_PRIVATE u8 sqlite3PagerIsreadonly(Pager*); SQLITE_PRIVATE int sqlite3PagerRefcount(Pager*); +SQLITE_PRIVATE int sqlite3PagerMemUsed(Pager*); SQLITE_PRIVATE const char *sqlite3PagerFilename(Pager*); SQLITE_PRIVATE const sqlite3_vfs *sqlite3PagerVfs(Pager*); SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager*); @@ -7724,6 +8399,10 @@ SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*); /* Functions used to truncate the database file. */ SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno); +#if defined(SQLITE_HAS_CODEC) && !defined(SQLITE_OMIT_WAL) +SQLITE_PRIVATE void *sqlite3PagerCodec(DbPage *); +#endif + /* Functions to support testing and debugging. */ #if !defined(NDEBUG) || defined(SQLITE_TEST) SQLITE_PRIVATE Pgno sqlite3PagerPagenumber(DbPage*); @@ -7758,8 +8437,6 @@ SQLITE_PRIVATE void sqlite3PagerRefdump(Pager*); ************************************************************************* ** This header file defines the interface that the sqlite page cache ** subsystem. -** -** @(#) $Id: pcache.h,v 1.20 2009/07/25 11:46:49 danielk1977 Exp $ */ #ifndef _PCACHE_H_ @@ -7926,8 +8603,6 @@ SQLITE_PRIVATE void sqlite3PCacheSetDefault(void); ** ** This header file is #include-ed by sqliteInt.h and thus ends up ** being included by every source file. -** -** $Id: os.h,v 1.108 2009/02/05 16:31:46 drh Exp $ */ #ifndef _SQLITE_OS_H_ #define _SQLITE_OS_H_ @@ -8129,7 +8804,11 @@ SQLITE_PRIVATE void sqlite3PCacheSetDefault(void); ** 1GB boundary. ** */ -#define PENDING_BYTE sqlite3PendingByte +#ifdef SQLITE_OMIT_WSD +# define PENDING_BYTE (0x40000000) +#else +# define PENDING_BYTE sqlite3PendingByte +#endif #define RESERVED_BYTE (PENDING_BYTE+1) #define SHARED_FIRST (PENDING_BYTE+2) #define SHARED_SIZE 510 @@ -8155,6 +8834,10 @@ SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file*,int,void*); #define SQLITE_FCNTL_DB_UNCHANGED 0xca093fa0 SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id); SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id); +SQLITE_PRIVATE int sqlite3OsShmMap(sqlite3_file *,int,int,int,void volatile **); +SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int, int, int); +SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id); +SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int); /* ** Functions for accessing sqlite3_vfs methods @@ -8171,7 +8854,7 @@ SQLITE_PRIVATE void sqlite3OsDlClose(sqlite3_vfs *, void *); #endif /* SQLITE_OMIT_LOAD_EXTENSION */ SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *, int, char *); SQLITE_PRIVATE int sqlite3OsSleep(sqlite3_vfs *, int); -SQLITE_PRIVATE int sqlite3OsCurrentTime(sqlite3_vfs *, double*); +SQLITE_PRIVATE int sqlite3OsCurrentTimeInt64(sqlite3_vfs *, sqlite3_int64*); /* ** Convenience functions for opening and closing files using @@ -8206,8 +8889,6 @@ SQLITE_PRIVATE int sqlite3OsCloseFree(sqlite3_file *); ** NOTE: source files should *not* #include this header file directly. ** Source files should #include the sqliteInt.h file and let that file ** include this one indirectly. -** -** $Id: mutex.h,v 1.9 2008/10/07 15:25:48 drh Exp $ */ @@ -8253,8 +8934,8 @@ SQLITE_PRIVATE int sqlite3OsCloseFree(sqlite3_file *); #define sqlite3_mutex_enter(X) #define sqlite3_mutex_try(X) SQLITE_OK #define sqlite3_mutex_leave(X) -#define sqlite3_mutex_held(X) 1 -#define sqlite3_mutex_notheld(X) 1 +#define sqlite3_mutex_held(X) ((void)(X),1) +#define sqlite3_mutex_notheld(X) ((void)(X),1) #define sqlite3MutexAlloc(X) ((sqlite3_mutex*)8) #define sqlite3MutexInit() SQLITE_OK #define sqlite3MutexEnd() @@ -8281,14 +8962,6 @@ struct Db { /* ** An instance of the following structure stores a database schema. -** -** If there are no virtual tables configured in this schema, the -** Schema.db variable is set to NULL. After the first virtual table -** has been added, it is set to point to the database connection -** used to create the connection. Once a virtual table has been -** added to the Schema structure and the Schema.db variable populated, -** only that database connection may use the Schema to prepare -** statements. */ struct Schema { int schema_cookie; /* Database schema version number for this file */ @@ -8301,14 +8974,11 @@ struct Schema { u8 enc; /* Text encoding used by this database */ u16 flags; /* Flags associated with this schema */ int cache_size; /* Number of pages to use in the cache */ -#ifndef SQLITE_OMIT_VIRTUALTABLE - sqlite3 *db; /* "Owner" connection. See comment above */ -#endif }; /* ** These macros can be used to test, set, or clear bits in the -** Db.flags field. +** Db.pSchema->flags field. */ #define DbHasProperty(D,I,P) (((D)->aDb[I].pSchema->flags&(P))==(P)) #define DbHasAnyProperty(D,I,P) (((D)->aDb[I].pSchema->flags&(P))!=0) @@ -8316,7 +8986,7 @@ struct Schema { #define DbClearProperty(D,I,P) (D)->aDb[I].pSchema->flags&=~(P) /* -** Allowed values for the DB.flags field. +** Allowed values for the DB.pSchema->flags field. ** ** The DB_SchemaLoaded flag is set after the database schema has been ** read into internal hash tables. @@ -8380,7 +9050,7 @@ struct FuncDefHash { }; /* -** Each database is an instance of the following structure. +** Each database connection is an instance of the following structure. ** ** The sqlite.lastRowid records the last insert rowid generated by an ** insert statement. Inserts on views do not affect its value. Each @@ -8417,8 +9087,8 @@ struct sqlite3 { u8 temp_store; /* 1: file 2: memory 0: default */ u8 mallocFailed; /* True if we have seen a malloc failure */ u8 dfltLockMode; /* Default locking-mode for attached dbs */ - u8 dfltJournalMode; /* Default journal mode for attached dbs */ signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */ + u8 suppressErr; /* Do not issue error messages if true */ int nextPagesize; /* Pagesize after VACUUM if >0 */ int nTable; /* Number of tables in the database */ CollSeq *pDfltColl; /* The default collating sequence (BINARY) */ @@ -8449,6 +9119,10 @@ struct sqlite3 { void (*xRollbackCallback)(void*); /* Invoked at every commit. */ void *pUpdateArg; void (*xUpdateCallback)(void*,int, const char*,const char*,sqlite_int64); +#ifndef SQLITE_OMIT_WAL + int (*xWalCallback)(void *, sqlite3 *, const char *, int); + void *pWalArg; +#endif void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*); void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*); void *pCollNeededArg; @@ -8487,6 +9161,7 @@ struct sqlite3 { int nStatement; /* Number of nested statement-transactions */ u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */ i64 nDeferredCons; /* Net deferred constraints this transaction. */ + int *pnBytesFreed; /* If not NULL, increment this in DbFree() */ #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY /* The following variables are all protected by the STATIC_MASTER @@ -8513,37 +9188,46 @@ struct sqlite3 { #define ENC(db) ((db)->aDb[0].pSchema->enc) /* -** Possible values for the sqlite.flags and or Db.flags fields. -** -** On sqlite.flags, the SQLITE_InTrans value means that we have -** executed a BEGIN. On Db.flags, SQLITE_InTrans means a statement -** transaction is active on that particular database file. +** Possible values for the sqlite3.flags. */ -#define SQLITE_VdbeTrace 0x00000001 /* True to trace VDBE execution */ -#define SQLITE_InTrans 0x00000008 /* True if in a transaction */ -#define SQLITE_InternChanges 0x00000010 /* Uncommitted Hash table changes */ -#define SQLITE_FullColNames 0x00000020 /* Show full column names on SELECT */ -#define SQLITE_ShortColNames 0x00000040 /* Show short columns names */ -#define SQLITE_CountRows 0x00000080 /* Count rows changed by INSERT, */ +#define SQLITE_VdbeTrace 0x00000100 /* True to trace VDBE execution */ +#define SQLITE_InternChanges 0x00000200 /* Uncommitted Hash table changes */ +#define SQLITE_FullColNames 0x00000400 /* Show full column names on SELECT */ +#define SQLITE_ShortColNames 0x00000800 /* Show short columns names */ +#define SQLITE_CountRows 0x00001000 /* Count rows changed by INSERT, */ /* DELETE, or UPDATE and return */ /* the count using a callback. */ -#define SQLITE_NullCallback 0x00000100 /* Invoke the callback once if the */ +#define SQLITE_NullCallback 0x00002000 /* Invoke the callback once if the */ /* result set is empty */ -#define SQLITE_SqlTrace 0x00000200 /* Debug print SQL as it executes */ -#define SQLITE_VdbeListing 0x00000400 /* Debug listings of VDBE programs */ -#define SQLITE_WriteSchema 0x00000800 /* OK to update SQLITE_MASTER */ -#define SQLITE_NoReadlock 0x00001000 /* Readlocks are omitted when +#define SQLITE_SqlTrace 0x00004000 /* Debug print SQL as it executes */ +#define SQLITE_VdbeListing 0x00008000 /* Debug listings of VDBE programs */ +#define SQLITE_WriteSchema 0x00010000 /* OK to update SQLITE_MASTER */ +#define SQLITE_NoReadlock 0x00020000 /* Readlocks are omitted when ** accessing read-only databases */ -#define SQLITE_IgnoreChecks 0x00002000 /* Do not enforce check constraints */ -#define SQLITE_ReadUncommitted 0x00004000 /* For shared-cache mode */ -#define SQLITE_LegacyFileFmt 0x00008000 /* Create new databases in format 1 */ -#define SQLITE_FullFSync 0x00010000 /* Use full fsync on the backend */ -#define SQLITE_LoadExtension 0x00020000 /* Enable load_extension */ +#define SQLITE_IgnoreChecks 0x00040000 /* Do not enforce check constraints */ +#define SQLITE_ReadUncommitted 0x0080000 /* For shared-cache mode */ +#define SQLITE_LegacyFileFmt 0x00100000 /* Create new databases in format 1 */ +#define SQLITE_FullFSync 0x00200000 /* Use full fsync on the backend */ +#define SQLITE_LoadExtension 0x00400000 /* Enable load_extension */ +#define SQLITE_RecoveryMode 0x00800000 /* Ignore schema errors */ +#define SQLITE_ReverseOrder 0x01000000 /* Reverse unordered SELECTs */ +#define SQLITE_RecTriggers 0x02000000 /* Enable recursive triggers */ +#define SQLITE_ForeignKeys 0x04000000 /* Enforce foreign key constraints */ +#define SQLITE_AutoIndex 0x08000000 /* Enable automatic indexes */ +#define SQLITE_PreferBuiltin 0x10000000 /* Preference to built-in funcs */ -#define SQLITE_RecoveryMode 0x00040000 /* Ignore schema errors */ -#define SQLITE_ReverseOrder 0x00100000 /* Reverse unordered SELECTs */ -#define SQLITE_RecTriggers 0x00200000 /* Enable recursive triggers */ -#define SQLITE_ForeignKeys 0x00400000 /* Enforce foreign key constraints */ +/* +** Bits of the sqlite3.flags field that are used by the +** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface. +** These must be the low-order bits of the flags field. +*/ +#define SQLITE_QueryFlattener 0x01 /* Disable query flattening */ +#define SQLITE_ColumnCache 0x02 /* Disable the column cache */ +#define SQLITE_IndexSort 0x04 /* Disable indexes for sorting */ +#define SQLITE_IndexSearch 0x08 /* Disable indexes for searching */ +#define SQLITE_IndexCover 0x10 /* Disable index covering table */ +#define SQLITE_GroupByOrder 0x20 /* Disable GROUPBY cover of ORDERBY */ +#define SQLITE_OptMask 0xff /* Mask of all disablable opts */ /* ** Possible values for the sqlite.magic field. @@ -8573,6 +9257,27 @@ struct FuncDef { void (*xFinalize)(sqlite3_context*); /* Aggregate finalizer */ char *zName; /* SQL name of the function. */ FuncDef *pHash; /* Next with a different name but the same hash */ + FuncDestructor *pDestructor; /* Reference counted destructor function */ +}; + +/* +** This structure encapsulates a user-function destructor callback (as +** configured using create_function_v2()) and a reference counter. When +** create_function_v2() is called to create a function with a destructor, +** a single object of this type is allocated. FuncDestructor.nRef is set to +** the number of FuncDef objects created (either 1 or 3, depending on whether +** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor +** member of each of the new FuncDef objects is set to point to the allocated +** FuncDestructor. +** +** Thereafter, when one of the FuncDef objects is deleted, the reference +** count on this object is decremented. When it reaches 0, the destructor +** is invoked and the FuncDestructor structure freed. +*/ +struct FuncDestructor { + int nRef; + void (*xDestroy)(void *); + void *pUserData; }; /* @@ -8584,6 +9289,7 @@ struct FuncDef { #define SQLITE_FUNC_NEEDCOLL 0x08 /* sqlite3GetFuncCollSeq() might be called */ #define SQLITE_FUNC_PRIVATE 0x10 /* Allowed for internal use only */ #define SQLITE_FUNC_COUNT 0x20 /* Built-in count(*) aggregate */ +#define SQLITE_FUNC_COALESCE 0x40 /* Built-in coalesce() or ifnull() function */ /* ** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are @@ -8612,15 +9318,15 @@ struct FuncDef { */ #define FUNCTION(zName, nArg, iArg, bNC, xFunc) \ {nArg, SQLITE_UTF8, bNC*SQLITE_FUNC_NEEDCOLL, \ - SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0} + SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0} #define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \ {nArg, SQLITE_UTF8, bNC*SQLITE_FUNC_NEEDCOLL, \ - pArg, 0, xFunc, 0, 0, #zName, 0} + pArg, 0, xFunc, 0, 0, #zName, 0, 0} #define LIKEFUNC(zName, nArg, arg, flags) \ - {nArg, SQLITE_UTF8, flags, (void *)arg, 0, likeFunc, 0, 0, #zName, 0} + {nArg, SQLITE_UTF8, flags, (void *)arg, 0, likeFunc, 0, 0, #zName, 0, 0} #define AGGREGATE(zName, nArg, arg, nc, xStep, xFinal) \ {nArg, SQLITE_UTF8, nc*SQLITE_FUNC_NEEDCOLL, \ - SQLITE_INT_TO_PTR(arg), 0, 0, xStep,xFinal,#zName,0} + SQLITE_INT_TO_PTR(arg), 0, 0, xStep,xFinal,#zName,0,0} /* ** All current savepoints are stored in a linked list starting at @@ -8834,13 +9540,13 @@ struct VTable { ** of a SELECT statement. */ struct Table { - sqlite3 *dbMem; /* DB connection used for lookaside allocations. */ char *zName; /* Name of the table or view */ int iPKey; /* If not negative, use aCol[iPKey] as the primary key */ int nCol; /* Number of columns in this table */ Column *aCol; /* Information about each column */ Index *pIndex; /* List of SQL indexes on this table. */ int tnum; /* Root BTree node for this table (see note above) */ + unsigned nRowEst; /* Estimated rows in table - from sqlite_stat1 table */ Select *pSelect; /* NULL for tables. Points to definition if a view. */ u16 nRef; /* Number of pointers to this Table */ u8 tabFlags; /* Mask of TF_* values */ @@ -8971,9 +9677,9 @@ struct FKey { */ struct KeyInfo { sqlite3 *db; /* The database connection */ - u8 enc; /* Text encoding - one of the TEXT_Utf* values */ + u8 enc; /* Text encoding - one of the SQLITE_UTF* values */ u16 nField; /* Number of entries in aColl[] */ - u8 *aSortOrder; /* If defined an aSortOrder[i] is true, sort DESC */ + u8 *aSortOrder; /* Sort order for each column. May be NULL */ CollSeq *aColl[1]; /* Collating sequence for each term of the key */ }; @@ -9133,7 +9839,7 @@ struct AggInfo { ** the option is available (at compile-time). */ #if SQLITE_MAX_VARIABLE_NUMBER<=32767 -typedef i64 ynVar; +typedef i16 ynVar; #else typedef int ynVar; #endif @@ -9256,14 +9962,13 @@ struct Expr { #define EP_DblQuoted 0x0040 /* token.z was originally in "..." */ #define EP_InfixFunc 0x0080 /* True for an infix function: LIKE, GLOB, etc */ #define EP_ExpCollate 0x0100 /* Collating sequence specified explicitly */ -#define EP_AnyAff 0x0200 /* Can take a cached column of any affinity */ -#define EP_FixedDest 0x0400 /* Result needed in a specific register */ -#define EP_IntValue 0x0800 /* Integer value contained in u.iValue */ -#define EP_xIsSelect 0x1000 /* x.pSelect is valid (otherwise x.pList is) */ +#define EP_FixedDest 0x0200 /* Result needed in a specific register */ +#define EP_IntValue 0x0400 /* Integer value contained in u.iValue */ +#define EP_xIsSelect 0x0800 /* x.pSelect is valid (otherwise x.pList is) */ -#define EP_Reduced 0x2000 /* Expr struct is EXPR_REDUCEDSIZE bytes only */ -#define EP_TokenOnly 0x4000 /* Expr struct is EXPR_TOKENONLYSIZE bytes only */ -#define EP_Static 0x8000 /* Held in memory not obtained from malloc() */ +#define EP_Reduced 0x1000 /* Expr struct is EXPR_REDUCEDSIZE bytes only */ +#define EP_TokenOnly 0x2000 /* Expr struct is EXPR_TOKENONLYSIZE bytes only */ +#define EP_Static 0x4000 /* Held in memory not obtained from malloc() */ /* ** The following are the meanings of bits in the Expr.flags2 field. @@ -9394,6 +10099,9 @@ typedef u64 Bitmask; ** and the next table on the list. The parser builds the list this way. ** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each ** jointype expresses the join between the table and the previous table. +** +** In the colUsed field, the high-order bit (bit 63) is set if the table +** contains more than 63 columns and the 64-th or later column is used. */ struct SrcList { i16 nSrc; /* Number of tables or subqueries in the FROM clause */ @@ -9505,9 +10213,10 @@ struct WhereLevel { #define WHERE_ORDERBY_MAX 0x0002 /* ORDER BY processing for max() func */ #define WHERE_ONEPASS_DESIRED 0x0004 /* Want to do one-pass UPDATE/DELETE */ #define WHERE_DUPLICATES_OK 0x0008 /* Ok to return a row more than once */ -#define WHERE_OMIT_OPEN 0x0010 /* Table cursor are already open */ +#define WHERE_OMIT_OPEN 0x0010 /* Table cursors are already open */ #define WHERE_OMIT_CLOSE 0x0020 /* Omit close of table & index cursors */ #define WHERE_FORCE_TABLE 0x0040 /* Do not use an index-only search */ +#define WHERE_ONETABLE_ONLY 0x0080 /* Only code the 1st table in pTabList */ /* ** The WHERE clause processing routine has two halves. The @@ -9520,12 +10229,14 @@ struct WhereInfo { Parse *pParse; /* Parsing and code generating context */ u16 wctrlFlags; /* Flags originally passed to sqlite3WhereBegin() */ u8 okOnePass; /* Ok to use one-pass algorithm for UPDATE or DELETE */ + u8 untestedTerms; /* Not all WHERE terms resolved by outer loop */ SrcList *pTabList; /* List of tables in the join */ int iTop; /* The very beginning of the WHERE loop */ int iContinue; /* Jump here to continue with next record */ int iBreak; /* Jump here to break out of the loop */ int nLevel; /* Number of nested loop */ struct WhereClause *pWC; /* Decomposition of the WHERE clause */ + double savedNQueryLoop; /* pParse->nQueryLoop outside the WHERE loop */ WhereLevel a[1]; /* Information about each nest loop in WHERE */ }; @@ -9683,15 +10394,16 @@ struct AutoincInfo { ** The Parse.pTriggerPrg list never contains two entries with the same ** values for both pTrigger and orconf. ** -** The TriggerPrg.oldmask variable is set to a mask of old.* columns +** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns ** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). +** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to +** a mask of new.* columns used by the program. */ struct TriggerPrg { Trigger *pTrigger; /* Trigger this program was coded from */ int orconf; /* Default ON CONFLICT policy */ SubProgram *pProgram; /* Program implementing pTrigger/orconf */ - u32 oldmask; /* Mask of old.* columns accessed */ + u32 aColmask[2]; /* Masks of old.*, new.* columns accessed */ TriggerPrg *pNext; /* Next entry in Parse.pTriggerPrg list */ }; @@ -9738,7 +10450,6 @@ struct Parse { struct yColCache { int iTable; /* Table cursor number */ int iColumn; /* Table column number */ - u8 affChange; /* True if this register has had an affinity change */ u8 tempReg; /* iReg is a temp register that needs to be freed */ int iLevel; /* Nesting level */ int iReg; /* Reg with value of this column. 0 means none. */ @@ -9763,9 +10474,11 @@ struct Parse { Parse *pToplevel; /* Parse structure for main program (or NULL) */ Table *pTriggerTab; /* Table triggers are being coded for */ u32 oldmask; /* Mask of old.* columns referenced */ + u32 newmask; /* Mask of new.* columns referenced */ u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */ u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */ u8 disableTriggers; /* True to disable triggers */ + double nQueryLoop; /* Estimated number of iterations of a query */ /* Above is constant between recursions. Below is reset before and after ** each recursion */ @@ -9936,7 +10649,7 @@ struct StrAccum { int nAlloc; /* Amount of space allocated in zText */ int mxAlloc; /* Maximum allowed string length */ u8 mallocFailed; /* Becomes true if any memory allocation fails */ - u8 useMalloc; /* True if zText is enlargeable using realloc */ + u8 useMalloc; /* 0: none, 1: sqlite3DbMalloc, 2: sqlite3_malloc */ u8 tooBig; /* Becomes true if string size exceeds limits */ }; @@ -9986,6 +10699,8 @@ struct Sqlite3Config { int isPCacheInit; /* True after malloc is initialized */ sqlite3_mutex *pInitMutex; /* Mutex used by sqlite3_initialize() */ int nRefInitMutex; /* Number of users of pInitMutex */ + void (*xLog)(void*,int,const char*); /* Function for logging */ + void *pLogArg; /* First argument to xLog() */ }; /* @@ -10027,16 +10742,27 @@ SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker*, Select*); } /* -** The SQLITE_CORRUPT_BKPT macro can be either a constant (for production -** builds) or a function call (for debugging). If it is a function call, -** it allows the operator to set a breakpoint at the spot where database -** corruption is first detected. +** The SQLITE_*_BKPT macros are substitutes for the error codes with +** the same name but without the _BKPT suffix. These macros invoke +** routines that report the line-number on which the error originated +** using sqlite3_log(). The routines also provide a convenient place +** to set a debugger breakpoint. */ -#ifdef SQLITE_DEBUG -SQLITE_PRIVATE int sqlite3Corrupt(void); -# define SQLITE_CORRUPT_BKPT sqlite3Corrupt() -#else -# define SQLITE_CORRUPT_BKPT SQLITE_CORRUPT +SQLITE_PRIVATE int sqlite3CorruptError(int); +SQLITE_PRIVATE int sqlite3MisuseError(int); +SQLITE_PRIVATE int sqlite3CantopenError(int); +#define SQLITE_CORRUPT_BKPT sqlite3CorruptError(__LINE__) +#define SQLITE_MISUSE_BKPT sqlite3MisuseError(__LINE__) +#define SQLITE_CANTOPEN_BKPT sqlite3CantopenError(__LINE__) + + +/* +** FTS4 is really an extension for FTS3. It is enabled using the +** SQLITE_ENABLE_FTS3 macro. But to avoid confusion we also all +** the SQLITE_ENABLE_FTS4 macro to serve as an alisse for SQLITE_ENABLE_FTS3. +*/ +#if defined(SQLITE_ENABLE_FTS4) && !defined(SQLITE_ENABLE_FTS3) +# define SQLITE_ENABLE_FTS3 #endif /* @@ -10075,7 +10801,6 @@ SQLITE_PRIVATE int sqlite3Corrupt(void); ** Internal function prototypes */ SQLITE_PRIVATE int sqlite3StrICmp(const char *, const char *); -SQLITE_PRIVATE int sqlite3IsNumber(const char*, int*, u8); SQLITE_PRIVATE int sqlite3Strlen30(const char*); #define sqlite3StrNICmp sqlite3_strnicmp @@ -10099,7 +10824,7 @@ SQLITE_PRIVATE void *sqlite3PageMalloc(int); SQLITE_PRIVATE void sqlite3PageFree(void*); SQLITE_PRIVATE void sqlite3MemSetDefault(void); SQLITE_PRIVATE void sqlite3BenignMallocHooks(void (*)(void), void (*)(void)); -SQLITE_PRIVATE int sqlite3MemoryAlarm(void (*)(void*, sqlite3_int64, int), void*, sqlite3_int64); +SQLITE_PRIVATE int sqlite3HeapNearlyFull(void); /* ** On systems with ample stack space and that support alloca(), make @@ -10128,7 +10853,8 @@ SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys5(void); #ifndef SQLITE_MUTEX_OMIT -SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void); +SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void); +SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3NoopMutex(void); SQLITE_PRIVATE sqlite3_mutex *sqlite3MutexAlloc(int); SQLITE_PRIVATE int sqlite3MutexInit(void); SQLITE_PRIVATE int sqlite3MutexEnd(void); @@ -10138,9 +10864,16 @@ SQLITE_PRIVATE int sqlite3StatusValue(int); SQLITE_PRIVATE void sqlite3StatusAdd(int, int); SQLITE_PRIVATE void sqlite3StatusSet(int, int); -SQLITE_PRIVATE int sqlite3IsNaN(double); +#ifndef SQLITE_OMIT_FLOATING_POINT +SQLITE_PRIVATE int sqlite3IsNaN(double); +#else +# define sqlite3IsNaN(X) 0 +#endif SQLITE_PRIVATE void sqlite3VXPrintf(StrAccum*, int, const char*, va_list); +#ifndef SQLITE_OMIT_TRACE +SQLITE_PRIVATE void sqlite3XPrintf(StrAccum*, const char*, ...); +#endif SQLITE_PRIVATE char *sqlite3MPrintf(sqlite3*,const char*, ...); SQLITE_PRIVATE char *sqlite3VMPrintf(sqlite3*,const char*, va_list); SQLITE_PRIVATE char *sqlite3MAppendf(sqlite3*,char*,const char*,...); @@ -10152,7 +10885,6 @@ SQLITE_PRIVATE void *sqlite3TestTextToPtr(const char*); #endif SQLITE_PRIVATE void sqlite3SetString(char **, sqlite3*, const char*, ...); SQLITE_PRIVATE void sqlite3ErrorMsg(Parse*, const char*, ...); -SQLITE_PRIVATE void sqlite3ErrorClear(Parse*); SQLITE_PRIVATE int sqlite3Dequote(char*); SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char*, int); SQLITE_PRIVATE int sqlite3RunParser(Parse*, const char*, char **); @@ -10168,7 +10900,6 @@ SQLITE_PRIVATE Expr *sqlite3PExpr(Parse*, int, Expr*, Expr*, const Token*); SQLITE_PRIVATE Expr *sqlite3ExprAnd(sqlite3*,Expr*, Expr*); SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*); SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*); -SQLITE_PRIVATE void sqlite3ExprClear(sqlite3*, Expr*); SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*); SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*); SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int); @@ -10215,7 +10946,7 @@ SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse*,Table*); #endif SQLITE_PRIVATE void sqlite3DropTable(Parse*, SrcList*, int, int); -SQLITE_PRIVATE void sqlite3DeleteTable(Table*); +SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3*, Table*); #ifndef SQLITE_OMIT_AUTOINCREMENT SQLITE_PRIVATE void sqlite3AutoincrementBegin(Parse *pParse); SQLITE_PRIVATE void sqlite3AutoincrementEnd(Parse *pParse); @@ -10254,16 +10985,16 @@ SQLITE_PRIVATE void sqlite3DeleteFrom(Parse*, SrcList*, Expr*); SQLITE_PRIVATE void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int); SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**, u16); SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo*); -SQLITE_PRIVATE int sqlite3ExprCodeGetColumn(Parse*, Table*, int, int, int, int); +SQLITE_PRIVATE int sqlite3ExprCodeGetColumn(Parse*, Table*, int, int, int); +SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable(Vdbe*, Table*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCodeMove(Parse*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCacheStore(Parse*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCachePush(Parse*); SQLITE_PRIVATE void sqlite3ExprCachePop(Parse*, int); -SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse*, int); +SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse*, int, int); SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse*); SQLITE_PRIVATE void sqlite3ExprCacheAffinityChange(Parse*, int, int); -SQLITE_PRIVATE void sqlite3ExprHardCopy(Parse*,int,int); SQLITE_PRIVATE int sqlite3ExprCode(Parse*, Expr*, int); SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse*, Expr*, int*); SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse*, Expr*, int); @@ -10281,6 +11012,7 @@ SQLITE_PRIVATE void sqlite3Vacuum(Parse*); SQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*); SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3*, Token*); SQLITE_PRIVATE int sqlite3ExprCompare(Expr*, Expr*); +SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList*, ExprList*); SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*); SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*); SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*); @@ -10298,6 +11030,9 @@ SQLITE_PRIVATE int sqlite3ExprIsConstant(Expr*); SQLITE_PRIVATE int sqlite3ExprIsConstantNotJoin(Expr*); SQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr*); SQLITE_PRIVATE int sqlite3ExprIsInteger(Expr*, int*); +SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr*); +SQLITE_PRIVATE void sqlite3ExprCodeIsNullJump(Vdbe*, const Expr*, int, int); +SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char); SQLITE_PRIVATE int sqlite3IsRowid(const char*); SQLITE_PRIVATE void sqlite3GenerateRowDelete(Parse*, Table*, int, int, int, Trigger *, int); SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int*); @@ -10320,13 +11055,6 @@ SQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,int) SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3*); SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(void); SQLITE_PRIVATE void sqlite3RegisterGlobalFunctions(void); -#ifdef SQLITE_DEBUG -SQLITE_PRIVATE int sqlite3SafetyOn(sqlite3*); -SQLITE_PRIVATE int sqlite3SafetyOff(sqlite3*); -#else -# define sqlite3SafetyOn(A) 0 -# define sqlite3SafetyOff(A) 0 -#endif SQLITE_PRIVATE int sqlite3SafetyCheckOk(sqlite3*); SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3*); SQLITE_PRIVATE void sqlite3ChangeCookie(Parse*, int); @@ -10355,7 +11083,7 @@ SQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep(sqlite3*,Token*,ExprList* SQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep(sqlite3*,Token*, Expr*); SQLITE_PRIVATE void sqlite3DeleteTrigger(sqlite3*, Trigger*); SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*); -SQLITE_PRIVATE u32 sqlite3TriggerOldmask(Parse*,Trigger*,ExprList*,Table*,int); +SQLITE_PRIVATE u32 sqlite3TriggerColmask(Parse*,Trigger*,ExprList*,int,int,Table*,int); # define sqlite3ParseToplevel(p) ((p)->pToplevel ? (p)->pToplevel : (p)) #else # define sqlite3TriggersExist(B,C,D,E,F) 0 @@ -10366,7 +11094,7 @@ SQLITE_PRIVATE u32 sqlite3TriggerOldmask(Parse*,Trigger*,ExprList*,Table*,int) # define sqlite3CodeRowTriggerDirect(A,B,C,D,E,F) # define sqlite3TriggerList(X, Y) 0 # define sqlite3ParseToplevel(p) p -# define sqlite3TriggerOldmask(A,B,C,D,E) 0 +# define sqlite3TriggerColmask(A,B,C,D,E,F,G) 0 #endif SQLITE_PRIVATE int sqlite3JoinType(Parse*, Token*, Token*, Token*); @@ -10386,17 +11114,14 @@ SQLITE_PRIVATE int sqlite3AuthReadCol(Parse*, const char *, const char *, int) #endif SQLITE_PRIVATE void sqlite3Attach(Parse*, Expr*, Expr*, Expr*); SQLITE_PRIVATE void sqlite3Detach(Parse*, Expr*); -SQLITE_PRIVATE int sqlite3BtreeFactory(sqlite3 *db, const char *zFilename, - int omitJournal, int nCache, int flags, Btree **ppBtree); SQLITE_PRIVATE int sqlite3FixInit(DbFixer*, Parse*, int, const char*, const Token*); SQLITE_PRIVATE int sqlite3FixSrcList(DbFixer*, SrcList*); SQLITE_PRIVATE int sqlite3FixSelect(DbFixer*, Select*); SQLITE_PRIVATE int sqlite3FixExpr(DbFixer*, Expr*); SQLITE_PRIVATE int sqlite3FixExprList(DbFixer*, ExprList*); SQLITE_PRIVATE int sqlite3FixTriggerStep(DbFixer*, TriggerStep*); -SQLITE_PRIVATE int sqlite3AtoF(const char *z, double*); +SQLITE_PRIVATE int sqlite3AtoF(const char *z, double*, int, u8); SQLITE_PRIVATE int sqlite3GetInt32(const char *, int*); -SQLITE_PRIVATE int sqlite3FitsIn64Bits(const char *, int); SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *pData, int nChar); SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte); SQLITE_PRIVATE int sqlite3Utf8Read(const u8*, const u8**); @@ -10442,7 +11167,7 @@ SQLITE_PRIVATE void sqlite3TableAffinityStr(Vdbe *, Table *); SQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2); SQLITE_PRIVATE int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity); SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr); -SQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*); +SQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*, int, u8); SQLITE_PRIVATE void sqlite3Error(sqlite3*, int, const char*,...); SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3*, const char *z, int n); SQLITE_PRIVATE int sqlite3TwoPartName(Parse *, Token *, Token *, Token **); @@ -10451,7 +11176,8 @@ SQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse); SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int); SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char*zName); SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr); -SQLITE_PRIVATE Expr *sqlite3ExprSetColl(Parse *pParse, Expr *, Token *); +SQLITE_PRIVATE Expr *sqlite3ExprSetColl(Expr*, CollSeq*); +SQLITE_PRIVATE Expr *sqlite3ExprSetCollByToken(Parse *pParse, Expr*, Token*); SQLITE_PRIVATE int sqlite3CheckCollSeq(Parse *, CollSeq *); SQLITE_PRIVATE int sqlite3CheckObjectName(Parse *, const char *); SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *, int); @@ -10462,22 +11188,26 @@ SQLITE_PRIVATE void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, void(*)(void*)); SQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value*); SQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(sqlite3 *); -SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *, const void*, int); +SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *, const void*, int, u8); #ifdef SQLITE_ENABLE_STAT2 SQLITE_PRIVATE char *sqlite3Utf8to16(sqlite3 *, u8, char *, int, int *); #endif SQLITE_PRIVATE int sqlite3ValueFromExpr(sqlite3 *, Expr *, u8, u8, sqlite3_value **); SQLITE_PRIVATE void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8); #ifndef SQLITE_AMALGAMATION +SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[]; SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[]; SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[]; +SQLITE_PRIVATE const Token sqlite3IntTokens[]; SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config; SQLITE_PRIVATE SQLITE_WSD FuncDefHash sqlite3GlobalFunctions; +#ifndef SQLITE_OMIT_WSD SQLITE_PRIVATE int sqlite3PendingByte; #endif +#endif SQLITE_PRIVATE void sqlite3RootPageMoved(Db*, int, int); SQLITE_PRIVATE void sqlite3Reindex(Parse*, Token*, Token*); -SQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3*); +SQLITE_PRIVATE void sqlite3AlterFunctions(void); SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*); SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *); SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...); @@ -10497,7 +11227,7 @@ SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*); SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*); SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *, const char *); SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3*,int iDB); -SQLITE_PRIVATE void sqlite3DeleteIndexSamples(Index*); +SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3*,Index*); SQLITE_PRIVATE void sqlite3DefaultRowEst(Index*); SQLITE_PRIVATE void sqlite3RegisterLikeFunctions(sqlite3*, int); SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*); @@ -10508,7 +11238,9 @@ SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *); SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *, Index *); SQLITE_PRIVATE int sqlite3CreateFunc(sqlite3 *, const char *, int, int, void *, void (*)(sqlite3_context*,int,sqlite3_value **), - void (*)(sqlite3_context*,int,sqlite3_value **), void (*)(sqlite3_context*)); + void (*)(sqlite3_context*,int,sqlite3_value **), void (*)(sqlite3_context*), + FuncDestructor *pDestructor +); SQLITE_PRIVATE int sqlite3ApiExit(sqlite3 *db, int); SQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *); @@ -10559,7 +11291,7 @@ SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char*); # define sqlite3VtabUnlock(X) # define sqlite3VtabUnlockList(X) #else -SQLITE_PRIVATE void sqlite3VtabClear(Table*); +SQLITE_PRIVATE void sqlite3VtabClear(sqlite3 *db, Table*); SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, char **); SQLITE_PRIVATE int sqlite3VtabRollback(sqlite3 *db); SQLITE_PRIVATE int sqlite3VtabCommit(sqlite3 *db); @@ -10579,12 +11311,16 @@ SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3*, int, const char *); SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *, VTable *); SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(sqlite3 *,FuncDef*, int nArg, Expr*); SQLITE_PRIVATE void sqlite3InvalidFunction(sqlite3_context*,int,sqlite3_value**); +SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int); SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *); SQLITE_PRIVATE int sqlite3Reprepare(Vdbe*); SQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*); SQLITE_PRIVATE CollSeq *sqlite3BinaryCompareCollSeq(Parse *, Expr *, Expr *); SQLITE_PRIVATE int sqlite3TempInMemory(const sqlite3*); SQLITE_PRIVATE VTable *sqlite3GetVTable(sqlite3*, Table*); +SQLITE_PRIVATE const char *sqlite3JournalModename(int); +SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3*, int); +SQLITE_PRIVATE int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int); /* Declarations for functions in fkey.c. All of these are replaced by ** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign @@ -10608,9 +11344,9 @@ SQLITE_PRIVATE FKey *sqlite3FkReferences(Table *); #define sqlite3FkRequired(a,b,c,d) 0 #endif #ifndef SQLITE_OMIT_FOREIGN_KEY -SQLITE_PRIVATE void sqlite3FkDelete(Table*); +SQLITE_PRIVATE void sqlite3FkDelete(sqlite3 *, Table*); #else - #define sqlite3FkDelete(a) + #define sqlite3FkDelete(a,b) #endif @@ -10691,7 +11427,50 @@ SQLITE_PRIVATE void (*sqlite3IoTrace)(const char*,...); # define sqlite3VdbeIOTraceSql(X) #endif +/* +** These routines are available for the mem2.c debugging memory allocator +** only. They are used to verify that different "types" of memory +** allocations are properly tracked by the system. +** +** sqlite3MemdebugSetType() sets the "type" of an allocation to one of +** the MEMTYPE_* macros defined below. The type must be a bitmask with +** a single bit set. +** +** sqlite3MemdebugHasType() returns true if any of the bits in its second +** argument match the type set by the previous sqlite3MemdebugSetType(). +** sqlite3MemdebugHasType() is intended for use inside assert() statements. +** +** sqlite3MemdebugNoType() returns true if none of the bits in its second +** argument match the type set by the previous sqlite3MemdebugSetType(). +** +** Perhaps the most important point is the difference between MEMTYPE_HEAP +** and MEMTYPE_LOOKASIDE. If an allocation is MEMTYPE_LOOKASIDE, that means +** it might have been allocated by lookaside, except the allocation was +** too large or lookaside was already full. It is important to verify +** that allocations that might have been satisfied by lookaside are not +** passed back to non-lookaside free() routines. Asserts such as the +** example above are placed on the non-lookaside free() routines to verify +** this constraint. +** +** All of this is no-op for a production build. It only comes into +** play when the SQLITE_MEMDEBUG compile-time option is used. +*/ +#ifdef SQLITE_MEMDEBUG +SQLITE_PRIVATE void sqlite3MemdebugSetType(void*,u8); +SQLITE_PRIVATE int sqlite3MemdebugHasType(void*,u8); +SQLITE_PRIVATE int sqlite3MemdebugNoType(void*,u8); +#else +# define sqlite3MemdebugSetType(X,Y) /* no-op */ +# define sqlite3MemdebugHasType(X,Y) 1 +# define sqlite3MemdebugNoType(X,Y) 1 #endif +#define MEMTYPE_HEAP 0x01 /* General heap allocations */ +#define MEMTYPE_LOOKASIDE 0x02 /* Might have been lookaside memory */ +#define MEMTYPE_SCRATCH 0x04 /* Scratch allocations */ +#define MEMTYPE_PCACHE 0x08 /* Page cache allocations */ +#define MEMTYPE_DB 0x10 /* Uses sqlite3DbMalloc, not sqlite_malloc */ + +#endif /* _SQLITEINT_H_ */ /************** End of sqliteInt.h *******************************************/ /************** Begin file global.c ******************************************/ @@ -10710,7 +11489,6 @@ SQLITE_PRIVATE void (*sqlite3IoTrace)(const char*,...); ** This file contains definitions of global variables and contants. */ - /* An array to map all upper-case characters into their corresponding ** lower-case character. ** @@ -10766,6 +11544,7 @@ SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[] = { ** isalnum() 0x06 ** isxdigit() 0x08 ** toupper() 0x20 +** SQLite identifier character 0x40 ** ** Bit 0x20 is set if the mapped character requires translation to upper ** case. i.e. if the character is a lower-case ASCII character. @@ -10777,6 +11556,11 @@ SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[] = { ** Standard function tolower() is implemented using the sqlite3UpperToLower[] ** array. tolower() is used more often than toupper() by SQLite. ** +** Bit 0x40 is set if the character non-alphanumeric and can be used in an +** SQLite identifier. Identifiers are alphanumerics, "_", "$", and any +** non-ASCII UTF character. Hence the test for whether or not a character is +** part of an identifier is 0x46. +** ** SQLite's versions are identical to the standard versions assuming a ** locale of "C". They are implemented as macros in sqliteInt.h. */ @@ -10786,7 +11570,7 @@ SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, /* 08..0f ........ */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10..17 ........ */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 18..1f ........ */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 20..27 !"#$%&' */ + 0x01, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, /* 20..27 !"#$%&' */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 28..2f ()*+,-./ */ 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, /* 30..37 01234567 */ 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 38..3f 89:;<=>? */ @@ -10794,29 +11578,29 @@ SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = { 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x02, /* 40..47 @ABCDEFG */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* 48..4f HIJKLMNO */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* 50..57 PQRSTUVW */ - 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, /* 58..5f XYZ[\]^_ */ + 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, /* 58..5f XYZ[\]^_ */ 0x00, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x22, /* 60..67 `abcdefg */ 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, /* 68..6f hijklmno */ 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, /* 70..77 pqrstuvw */ 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, /* 78..7f xyz{|}~. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 80..87 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 88..8f ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 90..97 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 98..9f ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a0..a7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a8..af ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b0..b7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b8..bf ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 80..87 ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 88..8f ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 90..97 ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 98..9f ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* a0..a7 ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* a8..af ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* b0..b7 ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* b8..bf ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c0..c7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c8..cf ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d0..d7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d8..df ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* e0..e7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* e8..ef ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* f0..f7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* f8..ff ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* c0..c7 ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* c8..cf ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* d0..d7 ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* d8..df ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* e0..e7 ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* e8..ef ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* f0..f7 ........ */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 /* f8..ff ........ */ }; #endif @@ -10855,6 +11639,8 @@ SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config = { 0, /* isPCacheInit */ 0, /* pInitMutex */ 0, /* nRefInitMutex */ + 0, /* xLog */ + 0, /* pLogArg */ }; @@ -10865,6 +11651,15 @@ SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config = { */ SQLITE_PRIVATE SQLITE_WSD FuncDefHash sqlite3GlobalFunctions; +/* +** Constant tokens for values 0 and 1. +*/ +SQLITE_PRIVATE const Token sqlite3IntTokens[] = { + { "0", 1 }, + { "1", 1 } +}; + + /* ** The value of the "pending" byte must be 0x40000000 (1 byte past the ** 1-gibabyte boundary) in a compatible database. SQLite never uses @@ -10883,9 +11678,411 @@ SQLITE_PRIVATE SQLITE_WSD FuncDefHash sqlite3GlobalFunctions; ** Changing the pending byte during operating results in undefined ** and dileterious behavior. */ +#ifndef SQLITE_OMIT_WSD SQLITE_PRIVATE int sqlite3PendingByte = 0x40000000; +#endif + +/* +** Properties of opcodes. The OPFLG_INITIALIZER macro is +** created by mkopcodeh.awk during compilation. Data is obtained +** from the comments following the "case OP_xxxx:" statements in +** the vdbe.c file. +*/ +SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER; /************** End of global.c **********************************************/ +/************** Begin file ctime.c *******************************************/ +/* +** 2010 February 23 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file implements routines used to report what compile-time options +** SQLite was built with. +*/ + +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS + + +/* +** An array of names of all compile-time options. This array should +** be sorted A-Z. +** +** This array looks large, but in a typical installation actually uses +** only a handful of compile-time options, so most times this array is usually +** rather short and uses little memory space. +*/ +static const char * const azCompileOpt[] = { + +/* These macros are provided to "stringify" the value of the define +** for those options in which the value is meaningful. */ +#define CTIMEOPT_VAL_(opt) #opt +#define CTIMEOPT_VAL(opt) CTIMEOPT_VAL_(opt) + +#ifdef SQLITE_32BIT_ROWID + "32BIT_ROWID", +#endif +#ifdef SQLITE_4_BYTE_ALIGNED_MALLOC + "4_BYTE_ALIGNED_MALLOC", +#endif +#ifdef SQLITE_CASE_SENSITIVE_LIKE + "CASE_SENSITIVE_LIKE", +#endif +#ifdef SQLITE_CHECK_PAGES + "CHECK_PAGES", +#endif +#ifdef SQLITE_COVERAGE_TEST + "COVERAGE_TEST", +#endif +#ifdef SQLITE_DEBUG + "DEBUG", +#endif +#ifdef SQLITE_DEFAULT_LOCKING_MODE + "DEFAULT_LOCKING_MODE=" CTIMEOPT_VAL(SQLITE_DEFAULT_LOCKING_MODE), +#endif +#ifdef SQLITE_DISABLE_DIRSYNC + "DISABLE_DIRSYNC", +#endif +#ifdef SQLITE_DISABLE_LFS + "DISABLE_LFS", +#endif +#ifdef SQLITE_ENABLE_ATOMIC_WRITE + "ENABLE_ATOMIC_WRITE", +#endif +#ifdef SQLITE_ENABLE_CEROD + "ENABLE_CEROD", +#endif +#ifdef SQLITE_ENABLE_COLUMN_METADATA + "ENABLE_COLUMN_METADATA", +#endif +#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT + "ENABLE_EXPENSIVE_ASSERT", +#endif +#ifdef SQLITE_ENABLE_FTS1 + "ENABLE_FTS1", +#endif +#ifdef SQLITE_ENABLE_FTS2 + "ENABLE_FTS2", +#endif +#ifdef SQLITE_ENABLE_FTS3 + "ENABLE_FTS3", +#endif +#ifdef SQLITE_ENABLE_FTS3_PARENTHESIS + "ENABLE_FTS3_PARENTHESIS", +#endif +#ifdef SQLITE_ENABLE_FTS4 + "ENABLE_FTS4", +#endif +#ifdef SQLITE_ENABLE_ICU + "ENABLE_ICU", +#endif +#ifdef SQLITE_ENABLE_IOTRACE + "ENABLE_IOTRACE", +#endif +#ifdef SQLITE_ENABLE_LOAD_EXTENSION + "ENABLE_LOAD_EXTENSION", +#endif +#ifdef SQLITE_ENABLE_LOCKING_STYLE + "ENABLE_LOCKING_STYLE=" CTIMEOPT_VAL(SQLITE_ENABLE_LOCKING_STYLE), +#endif +#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT + "ENABLE_MEMORY_MANAGEMENT", +#endif +#ifdef SQLITE_ENABLE_MEMSYS3 + "ENABLE_MEMSYS3", +#endif +#ifdef SQLITE_ENABLE_MEMSYS5 + "ENABLE_MEMSYS5", +#endif +#ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK + "ENABLE_OVERSIZE_CELL_CHECK", +#endif +#ifdef SQLITE_ENABLE_RTREE + "ENABLE_RTREE", +#endif +#ifdef SQLITE_ENABLE_STAT2 + "ENABLE_STAT2", +#endif +#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY + "ENABLE_UNLOCK_NOTIFY", +#endif +#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT + "ENABLE_UPDATE_DELETE_LIMIT", +#endif +#ifdef SQLITE_HAS_CODEC + "HAS_CODEC", +#endif +#ifdef SQLITE_HAVE_ISNAN + "HAVE_ISNAN", +#endif +#ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX + "HOMEGROWN_RECURSIVE_MUTEX", +#endif +#ifdef SQLITE_IGNORE_AFP_LOCK_ERRORS + "IGNORE_AFP_LOCK_ERRORS", +#endif +#ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS + "IGNORE_FLOCK_LOCK_ERRORS", +#endif +#ifdef SQLITE_INT64_TYPE + "INT64_TYPE", +#endif +#ifdef SQLITE_LOCK_TRACE + "LOCK_TRACE", +#endif +#ifdef SQLITE_MEMDEBUG + "MEMDEBUG", +#endif +#ifdef SQLITE_MIXED_ENDIAN_64BIT_FLOAT + "MIXED_ENDIAN_64BIT_FLOAT", +#endif +#ifdef SQLITE_NO_SYNC + "NO_SYNC", +#endif +#ifdef SQLITE_OMIT_ALTERTABLE + "OMIT_ALTERTABLE", +#endif +#ifdef SQLITE_OMIT_ANALYZE + "OMIT_ANALYZE", +#endif +#ifdef SQLITE_OMIT_ATTACH + "OMIT_ATTACH", +#endif +#ifdef SQLITE_OMIT_AUTHORIZATION + "OMIT_AUTHORIZATION", +#endif +#ifdef SQLITE_OMIT_AUTOINCREMENT + "OMIT_AUTOINCREMENT", +#endif +#ifdef SQLITE_OMIT_AUTOINIT + "OMIT_AUTOINIT", +#endif +#ifdef SQLITE_OMIT_AUTOMATIC_INDEX + "OMIT_AUTOMATIC_INDEX", +#endif +#ifdef SQLITE_OMIT_AUTOVACUUM + "OMIT_AUTOVACUUM", +#endif +#ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION + "OMIT_BETWEEN_OPTIMIZATION", +#endif +#ifdef SQLITE_OMIT_BLOB_LITERAL + "OMIT_BLOB_LITERAL", +#endif +#ifdef SQLITE_OMIT_BTREECOUNT + "OMIT_BTREECOUNT", +#endif +#ifdef SQLITE_OMIT_BUILTIN_TEST + "OMIT_BUILTIN_TEST", +#endif +#ifdef SQLITE_OMIT_CAST + "OMIT_CAST", +#endif +#ifdef SQLITE_OMIT_CHECK + "OMIT_CHECK", +#endif +/* // redundant +** #ifdef SQLITE_OMIT_COMPILEOPTION_DIAGS +** "OMIT_COMPILEOPTION_DIAGS", +** #endif +*/ +#ifdef SQLITE_OMIT_COMPLETE + "OMIT_COMPLETE", +#endif +#ifdef SQLITE_OMIT_COMPOUND_SELECT + "OMIT_COMPOUND_SELECT", +#endif +#ifdef SQLITE_OMIT_DATETIME_FUNCS + "OMIT_DATETIME_FUNCS", +#endif +#ifdef SQLITE_OMIT_DECLTYPE + "OMIT_DECLTYPE", +#endif +#ifdef SQLITE_OMIT_DEPRECATED + "OMIT_DEPRECATED", +#endif +#ifdef SQLITE_OMIT_DISKIO + "OMIT_DISKIO", +#endif +#ifdef SQLITE_OMIT_EXPLAIN + "OMIT_EXPLAIN", +#endif +#ifdef SQLITE_OMIT_FLAG_PRAGMAS + "OMIT_FLAG_PRAGMAS", +#endif +#ifdef SQLITE_OMIT_FLOATING_POINT + "OMIT_FLOATING_POINT", +#endif +#ifdef SQLITE_OMIT_FOREIGN_KEY + "OMIT_FOREIGN_KEY", +#endif +#ifdef SQLITE_OMIT_GET_TABLE + "OMIT_GET_TABLE", +#endif +#ifdef SQLITE_OMIT_INCRBLOB + "OMIT_INCRBLOB", +#endif +#ifdef SQLITE_OMIT_INTEGRITY_CHECK + "OMIT_INTEGRITY_CHECK", +#endif +#ifdef SQLITE_OMIT_LIKE_OPTIMIZATION + "OMIT_LIKE_OPTIMIZATION", +#endif +#ifdef SQLITE_OMIT_LOAD_EXTENSION + "OMIT_LOAD_EXTENSION", +#endif +#ifdef SQLITE_OMIT_LOCALTIME + "OMIT_LOCALTIME", +#endif +#ifdef SQLITE_OMIT_LOOKASIDE + "OMIT_LOOKASIDE", +#endif +#ifdef SQLITE_OMIT_MEMORYDB + "OMIT_MEMORYDB", +#endif +#ifdef SQLITE_OMIT_OR_OPTIMIZATION + "OMIT_OR_OPTIMIZATION", +#endif +#ifdef SQLITE_OMIT_PAGER_PRAGMAS + "OMIT_PAGER_PRAGMAS", +#endif +#ifdef SQLITE_OMIT_PRAGMA + "OMIT_PRAGMA", +#endif +#ifdef SQLITE_OMIT_PROGRESS_CALLBACK + "OMIT_PROGRESS_CALLBACK", +#endif +#ifdef SQLITE_OMIT_QUICKBALANCE + "OMIT_QUICKBALANCE", +#endif +#ifdef SQLITE_OMIT_REINDEX + "OMIT_REINDEX", +#endif +#ifdef SQLITE_OMIT_SCHEMA_PRAGMAS + "OMIT_SCHEMA_PRAGMAS", +#endif +#ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS + "OMIT_SCHEMA_VERSION_PRAGMAS", +#endif +#ifdef SQLITE_OMIT_SHARED_CACHE + "OMIT_SHARED_CACHE", +#endif +#ifdef SQLITE_OMIT_SUBQUERY + "OMIT_SUBQUERY", +#endif +#ifdef SQLITE_OMIT_TCL_VARIABLE + "OMIT_TCL_VARIABLE", +#endif +#ifdef SQLITE_OMIT_TEMPDB + "OMIT_TEMPDB", +#endif +#ifdef SQLITE_OMIT_TRACE + "OMIT_TRACE", +#endif +#ifdef SQLITE_OMIT_TRIGGER + "OMIT_TRIGGER", +#endif +#ifdef SQLITE_OMIT_TRUNCATE_OPTIMIZATION + "OMIT_TRUNCATE_OPTIMIZATION", +#endif +#ifdef SQLITE_OMIT_UTF16 + "OMIT_UTF16", +#endif +#ifdef SQLITE_OMIT_VACUUM + "OMIT_VACUUM", +#endif +#ifdef SQLITE_OMIT_VIEW + "OMIT_VIEW", +#endif +#ifdef SQLITE_OMIT_VIRTUALTABLE + "OMIT_VIRTUALTABLE", +#endif +#ifdef SQLITE_OMIT_WAL + "OMIT_WAL", +#endif +#ifdef SQLITE_OMIT_WSD + "OMIT_WSD", +#endif +#ifdef SQLITE_OMIT_XFER_OPT + "OMIT_XFER_OPT", +#endif +#ifdef SQLITE_PERFORMANCE_TRACE + "PERFORMANCE_TRACE", +#endif +#ifdef SQLITE_PROXY_DEBUG + "PROXY_DEBUG", +#endif +#ifdef SQLITE_SECURE_DELETE + "SECURE_DELETE", +#endif +#ifdef SQLITE_SMALL_STACK + "SMALL_STACK", +#endif +#ifdef SQLITE_SOUNDEX + "SOUNDEX", +#endif +#ifdef SQLITE_TCL + "TCL", +#endif +#ifdef SQLITE_TEMP_STORE + "TEMP_STORE=" CTIMEOPT_VAL(SQLITE_TEMP_STORE), +#endif +#ifdef SQLITE_TEST + "TEST", +#endif +#ifdef SQLITE_THREADSAFE + "THREADSAFE=" CTIMEOPT_VAL(SQLITE_THREADSAFE), +#endif +#ifdef SQLITE_USE_ALLOCA + "USE_ALLOCA", +#endif +#ifdef SQLITE_ZERO_MALLOC + "ZERO_MALLOC" +#endif +}; + +/* +** Given the name of a compile-time option, return true if that option +** was used and false if not. +** +** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix +** is not required for a match. +*/ +SQLITE_API int sqlite3_compileoption_used(const char *zOptName){ + int i, n; + if( sqlite3StrNICmp(zOptName, "SQLITE_", 7)==0 ) zOptName += 7; + n = sqlite3Strlen30(zOptName); + + /* Since ArraySize(azCompileOpt) is normally in single digits, a + ** linear search is adequate. No need for a binary search. */ + for(i=0; i=0 && NaDb[] (or -1) */ + i64 lastRowid; /* Last rowid from a Next or NextIdx operation */ + Bool zeroed; /* True if zeroed out and ready for reuse */ + Bool rowidIsValid; /* True if lastRowid is valid */ + Bool atFirst; /* True if pointing to first entry */ + Bool useRandomRowid; /* Generate new record numbers semi-randomly */ + Bool nullRow; /* True if pointing to a row with no data */ + Bool deferredMoveto; /* A call to sqlite3BtreeMoveto() is needed */ + Bool isTable; /* True if a table requiring integer keys */ + Bool isIndex; /* True if an index containing keys only - no data */ + Bool isOrdered; /* True if the underlying table is BTREE_UNORDERED */ + i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */ + Btree *pBt; /* Separate file holding temporary table */ + int pseudoTableReg; /* Register holding pseudotable content. */ + KeyInfo *pKeyInfo; /* Info about index keys needed by index cursors */ + int nField; /* Number of fields in the header */ + i64 seqCount; /* Sequence counter */ + sqlite3_vtab_cursor *pVtabCursor; /* The cursor for a virtual table */ + const sqlite3_module *pModule; /* Module for cursor pVtabCursor */ + + /* Result of last sqlite3BtreeMoveto() done by an OP_NotExists or + ** OP_IsUnique opcode on this cursor. */ + int seekResult; + + /* Cached information about the header for the data record that the + ** cursor is currently pointing to. Only valid if cacheStatus matches + ** Vdbe.cacheCtr. Vdbe.cacheCtr will never take on the value of + ** CACHE_STALE and so setting cacheStatus=CACHE_STALE guarantees that + ** the cache is out of date. + ** + ** aRow might point to (ephemeral) data for the current row, or it might + ** be NULL. + */ + u32 cacheStatus; /* Cache is valid if this matches Vdbe.cacheCtr */ + int payloadSize; /* Total number of bytes in the record */ + u32 *aType; /* Type values for all entries in the record */ + u32 *aOffset; /* Cached offsets to the start of each columns data */ + u8 *aRow; /* Data for the current row, if all on one page */ +}; +typedef struct VdbeCursor VdbeCursor; + +/* +** When a sub-program is executed (OP_Program), a structure of this type +** is allocated to store the current value of the program counter, as +** well as the current memory cell array and various other frame specific +** values stored in the Vdbe struct. When the sub-program is finished, +** these values are copied back to the Vdbe from the VdbeFrame structure, +** restoring the state of the VM to as it was before the sub-program +** began executing. +** +** Frames are stored in a linked list headed at Vdbe.pParent. Vdbe.pParent +** is the parent of the current frame, or zero if the current frame +** is the main Vdbe program. +*/ +typedef struct VdbeFrame VdbeFrame; +struct VdbeFrame { + Vdbe *v; /* VM this frame belongs to */ + int pc; /* Program Counter */ + Op *aOp; /* Program instructions */ + int nOp; /* Size of aOp array */ + Mem *aMem; /* Array of memory cells */ + int nMem; /* Number of entries in aMem */ + VdbeCursor **apCsr; /* Element of Vdbe cursors */ + u16 nCursor; /* Number of entries in apCsr */ + void *token; /* Copy of SubProgram.token */ + int nChildMem; /* Number of memory cells for child frame */ + int nChildCsr; /* Number of cursors for child frame */ + i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */ + int nChange; /* Statement changes (Vdbe.nChanges) */ + VdbeFrame *pParent; /* Parent of this frame */ +}; + +#define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))]) + +/* +** A value for VdbeCursor.cacheValid that means the cache is always invalid. +*/ +#define CACHE_STALE 0 + +/* +** Internally, the vdbe manipulates nearly all SQL values as Mem +** structures. Each Mem struct may cache multiple representations (string, +** integer etc.) of the same value. A value (and therefore Mem structure) +** has the following properties: +** +** Each value has a manifest type. The manifest type of the value stored +** in a Mem struct is returned by the MemType(Mem*) macro. The type is +** one of SQLITE_NULL, SQLITE_INTEGER, SQLITE_REAL, SQLITE_TEXT or +** SQLITE_BLOB. +*/ +struct Mem { + union { + i64 i; /* Integer value. */ + int nZero; /* Used when bit MEM_Zero is set in flags */ + FuncDef *pDef; /* Used only when flags==MEM_Agg */ + RowSet *pRowSet; /* Used only when flags==MEM_RowSet */ + VdbeFrame *pFrame; /* Used when flags==MEM_Frame */ + } u; + double r; /* Real value */ + sqlite3 *db; /* The associated database connection */ + char *z; /* String or BLOB value */ + int n; /* Number of characters in string value, excluding '\0' */ + u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */ + u8 type; /* One of SQLITE_NULL, SQLITE_TEXT, SQLITE_INTEGER, etc */ + u8 enc; /* SQLITE_UTF8, SQLITE_UTF16BE, SQLITE_UTF16LE */ +#ifdef SQLITE_DEBUG + Mem *pScopyFrom; /* This Mem is a shallow copy of pScopyFrom */ + void *pFiller; /* So that sizeof(Mem) is a multiple of 8 */ +#endif + void (*xDel)(void *); /* If not null, call this function to delete Mem.z */ + char *zMalloc; /* Dynamic buffer allocated by sqlite3_malloc() */ +}; + +/* One or more of the following flags are set to indicate the validOK +** representations of the value stored in the Mem struct. +** +** If the MEM_Null flag is set, then the value is an SQL NULL value. +** No other flags may be set in this case. +** +** If the MEM_Str flag is set then Mem.z points at a string representation. +** Usually this is encoded in the same unicode encoding as the main +** database (see below for exceptions). If the MEM_Term flag is also +** set, then the string is nul terminated. The MEM_Int and MEM_Real +** flags may coexist with the MEM_Str flag. +** +** Multiple of these values can appear in Mem.flags. But only one +** at a time can appear in Mem.type. +*/ +#define MEM_Null 0x0001 /* Value is NULL */ +#define MEM_Str 0x0002 /* Value is a string */ +#define MEM_Int 0x0004 /* Value is an integer */ +#define MEM_Real 0x0008 /* Value is a real number */ +#define MEM_Blob 0x0010 /* Value is a BLOB */ +#define MEM_RowSet 0x0020 /* Value is a RowSet object */ +#define MEM_Frame 0x0040 /* Value is a VdbeFrame object */ +#define MEM_Invalid 0x0080 /* Value is undefined */ +#define MEM_TypeMask 0x00ff /* Mask of type bits */ + +/* Whenever Mem contains a valid string or blob representation, one of +** the following flags must be set to determine the memory management +** policy for Mem.z. The MEM_Term flag tells us whether or not the +** string is \000 or \u0000 terminated +*/ +#define MEM_Term 0x0200 /* String rep is nul terminated */ +#define MEM_Dyn 0x0400 /* Need to call sqliteFree() on Mem.z */ +#define MEM_Static 0x0800 /* Mem.z points to a static string */ +#define MEM_Ephem 0x1000 /* Mem.z points to an ephemeral string */ +#define MEM_Agg 0x2000 /* Mem.z points to an agg function context */ +#define MEM_Zero 0x4000 /* Mem.i contains count of 0s appended to blob */ +#ifdef SQLITE_OMIT_INCRBLOB + #undef MEM_Zero + #define MEM_Zero 0x0000 +#endif + +/* +** Clear any existing type flags from a Mem and replace them with f +*/ +#define MemSetTypeFlag(p, f) \ + ((p)->flags = ((p)->flags&~(MEM_TypeMask|MEM_Zero))|f) + +/* +** Return true if a memory cell is not marked as invalid. This macro +** is for use inside assert() statements only. +*/ +#ifdef SQLITE_DEBUG +#define memIsValid(M) ((M)->flags & MEM_Invalid)==0 +#endif + + +/* A VdbeFunc is just a FuncDef (defined in sqliteInt.h) that contains +** additional information about auxiliary information bound to arguments +** of the function. This is used to implement the sqlite3_get_auxdata() +** and sqlite3_set_auxdata() APIs. The "auxdata" is some auxiliary data +** that can be associated with a constant argument to a function. This +** allows functions such as "regexp" to compile their constant regular +** expression argument once and reused the compiled code for multiple +** invocations. +*/ +struct VdbeFunc { + FuncDef *pFunc; /* The definition of the function */ + int nAux; /* Number of entries allocated for apAux[] */ + struct AuxData { + void *pAux; /* Aux data for the i-th argument */ + void (*xDelete)(void *); /* Destructor for the aux data */ + } apAux[1]; /* One slot for each function argument */ +}; + +/* +** The "context" argument for a installable function. A pointer to an +** instance of this structure is the first argument to the routines used +** implement the SQL functions. +** +** There is a typedef for this structure in sqlite.h. So all routines, +** even the public interface to SQLite, can use a pointer to this structure. +** But this file is the only place where the internal details of this +** structure are known. +** +** This structure is defined inside of vdbeInt.h because it uses substructures +** (Mem) which are only defined there. +*/ +struct sqlite3_context { + FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ + VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */ + Mem s; /* The return value is stored here */ + Mem *pMem; /* Memory cell used to store aggregate context */ + int isError; /* Error code returned by the function. */ + CollSeq *pColl; /* Collating sequence */ +}; + +/* +** A Set structure is used for quick testing to see if a value +** is part of a small set. Sets are used to implement code like +** this: +** x.y IN ('hi','hoo','hum') +*/ +typedef struct Set Set; +struct Set { + Hash hash; /* A set is just a hash table */ + HashElem *prev; /* Previously accessed hash elemen */ +}; + +/* +** An instance of the virtual machine. This structure contains the complete +** state of the virtual machine. +** +** The "sqlite3_stmt" structure pointer that is returned by sqlite3_compile() +** is really a pointer to an instance of this structure. +** +** The Vdbe.inVtabMethod variable is set to non-zero for the duration of +** any virtual table method invocations made by the vdbe program. It is +** set to 2 for xDestroy method calls and 1 for all other methods. This +** variable is used for two purposes: to allow xDestroy methods to execute +** "DROP TABLE" statements and to prevent some nasty side effects of +** malloc failure when SQLite is invoked recursively by a virtual table +** method function. +*/ +struct Vdbe { + sqlite3 *db; /* The database connection that owns this statement */ + Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */ + int nOp; /* Number of instructions in the program */ + int nOpAlloc; /* Number of slots allocated for aOp[] */ + Op *aOp; /* Space to hold the virtual machine's program */ + int nLabel; /* Number of labels used */ + int nLabelAlloc; /* Number of slots allocated in aLabel[] */ + int *aLabel; /* Space to hold the labels */ + Mem **apArg; /* Arguments to currently executing user function */ + Mem *aColName; /* Column names to return */ + Mem *pResultSet; /* Pointer to an array of results */ + u16 nResColumn; /* Number of columns in one row of the result set */ + u16 nCursor; /* Number of slots in apCsr[] */ + VdbeCursor **apCsr; /* One element of this array for each open cursor */ + u8 errorAction; /* Recovery action to do in case of an error */ + u8 okVar; /* True if azVar[] has been initialized */ + ynVar nVar; /* Number of entries in aVar[] */ + Mem *aVar; /* Values for the OP_Variable opcode. */ + char **azVar; /* Name of variables */ + u32 magic; /* Magic number for sanity checking */ + int nMem; /* Number of memory locations currently allocated */ + Mem *aMem; /* The memory locations */ + u32 cacheCtr; /* VdbeCursor row cache generation counter */ + int pc; /* The program counter */ + int rc; /* Value to return */ + char *zErrMsg; /* Error message written here */ + u8 explain; /* True if EXPLAIN present on SQL command */ + u8 changeCntOn; /* True to update the change-counter */ + u8 expired; /* True if the VM needs to be recompiled */ + u8 runOnlyOnce; /* Automatically expire on reset */ + u8 minWriteFileFormat; /* Minimum file format for writable database files */ + u8 inVtabMethod; /* See comments above */ + u8 usesStmtJournal; /* True if uses a statement journal */ + u8 readOnly; /* True for read-only statements */ + u8 isPrepareV2; /* True if prepared with prepare_v2() */ + int nChange; /* Number of db changes made since last reset */ + int btreeMask; /* Bitmask of db->aDb[] entries referenced */ + i64 startTime; /* Time when query started - used for profiling */ + BtreeMutexArray aMutex; /* An array of Btree used here and needing locks */ + int aCounter[3]; /* Counters used by sqlite3_stmt_status() */ + char *zSql; /* Text of the SQL statement that generated this */ + void *pFree; /* Free this when deleting the vdbe */ + i64 nFkConstraint; /* Number of imm. FK constraints this VM */ + i64 nStmtDefCons; /* Number of def. constraints when stmt started */ + int iStatement; /* Statement number (or 0 if has not opened stmt) */ +#ifdef SQLITE_DEBUG + FILE *trace; /* Write an execution trace here, if not NULL */ +#endif + VdbeFrame *pFrame; /* Parent frame */ + int nFrame; /* Number of frames in pFrame list */ + u32 expmask; /* Binding to these vars invalidates VM */ + SubProgram *pProgram; /* Linked list of all sub-programs used by VM */ +}; + +/* +** The following are allowed values for Vdbe.magic +*/ +#define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */ +#define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */ +#define VDBE_MAGIC_HALT 0x519c2973 /* VDBE has completed execution */ +#define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */ + +/* +** Function prototypes +*/ +SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *, VdbeCursor*); +void sqliteVdbePopStack(Vdbe*,int); +SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor*); +#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE) +SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE*, int, Op*); +#endif +SQLITE_PRIVATE u32 sqlite3VdbeSerialTypeLen(u32); +SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem*, int); +SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int); +SQLITE_PRIVATE u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*); +SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc*, int); + +int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *); +SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(VdbeCursor*,UnpackedRecord*,int*); +SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor *, i64 *); +SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); +SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*); +SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*); +SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*); +SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int); +SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*); +SQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem*, const Mem*); +SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem*, const Mem*, int); +SQLITE_PRIVATE void sqlite3VdbeMemMove(Mem*, Mem*); +SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem*); +SQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*)); +SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem*, i64); +#ifdef SQLITE_OMIT_FLOATING_POINT +# define sqlite3VdbeMemSetDouble sqlite3VdbeMemSetInt64 +#else +SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem*, double); +#endif +SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem*); +SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem*,int); +SQLITE_PRIVATE void sqlite3VdbeMemSetRowSet(Mem*); +SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem*); +SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem*, int); +SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem*); +SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem*); +SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem*); +SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem*); +SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem*); +SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem*); +SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*); +SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p); +SQLITE_PRIVATE void sqlite3VdbeMemReleaseExternal(Mem *p); +SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem*, FuncDef*); +SQLITE_PRIVATE const char *sqlite3OpcodeName(int); +SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve); +SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int); +SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame*); +SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *); +SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem); + +#ifdef SQLITE_DEBUG +SQLITE_PRIVATE void sqlite3VdbeMemPrepareToChange(Vdbe*,Mem*); +#endif + +#ifndef SQLITE_OMIT_FOREIGN_KEY +SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *, int); +#else +# define sqlite3VdbeCheckFk(p,i) 0 +#endif + +#ifndef SQLITE_OMIT_SHARED_CACHE +SQLITE_PRIVATE void sqlite3VdbeMutexArrayEnter(Vdbe *p); +#else +# define sqlite3VdbeMutexArrayEnter(p) +#endif + +SQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem*, u8); +#ifdef SQLITE_DEBUG +SQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe*); +SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf); +#endif +SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem); + +#ifndef SQLITE_OMIT_INCRBLOB +SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *); +#else + #define sqlite3VdbeMemExpandBlob(x) SQLITE_OK +#endif + +#endif /* !defined(_VDBEINT_H_) */ + +/************** End of vdbeInt.h *********************************************/ +/************** Continuing where we left off in status.c *********************/ /* ** Variables in which to record status information. */ typedef struct sqlite3StatType sqlite3StatType; static SQLITE_WSD struct sqlite3StatType { - int nowValue[9]; /* Current value */ - int mxValue[9]; /* Maximum value */ + int nowValue[10]; /* Current value */ + int mxValue[10]; /* Maximum value */ } sqlite3Stat = { {0,}, {0,} }; @@ -10973,7 +12608,7 @@ SQLITE_PRIVATE void sqlite3StatusSet(int op, int X){ SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){ wsdStatInit; if( op<0 || op>=ArraySize(wsdStat.nowValue) ){ - return SQLITE_MISUSE; + return SQLITE_MISUSE_BKPT; } *pCurrent = wsdStat.nowValue[op]; *pHighwater = wsdStat.mxValue[op]; @@ -10993,6 +12628,8 @@ SQLITE_API int sqlite3_db_status( int *pHighwater, /* Write high-water mark here */ int resetFlag /* Reset high-water mark if true */ ){ + int rc = SQLITE_OK; /* Return code */ + sqlite3_mutex_enter(db->mutex); switch( op ){ case SQLITE_DBSTATUS_LOOKASIDE_USED: { *pCurrent = db->lookaside.nOut; @@ -11002,11 +12639,97 @@ SQLITE_API int sqlite3_db_status( } break; } + + /* + ** Return an approximation for the amount of memory currently used + ** by all pagers associated with the given database connection. The + ** highwater mark is meaningless and is returned as zero. + */ + case SQLITE_DBSTATUS_CACHE_USED: { + int totalUsed = 0; + int i; + sqlite3BtreeEnterAll(db); + for(i=0; inDb; i++){ + Btree *pBt = db->aDb[i].pBt; + if( pBt ){ + Pager *pPager = sqlite3BtreePager(pBt); + totalUsed += sqlite3PagerMemUsed(pPager); + } + } + sqlite3BtreeLeaveAll(db); + *pCurrent = totalUsed; + *pHighwater = 0; + break; + } + + /* + ** *pCurrent gets an accurate estimate of the amount of memory used + ** to store the schema for all databases (main, temp, and any ATTACHed + ** databases. *pHighwater is set to zero. + */ + case SQLITE_DBSTATUS_SCHEMA_USED: { + int i; /* Used to iterate through schemas */ + int nByte = 0; /* Used to accumulate return value */ + + db->pnBytesFreed = &nByte; + for(i=0; inDb; i++){ + Schema *pSchema = db->aDb[i].pSchema; + if( ALWAYS(pSchema!=0) ){ + HashElem *p; + + nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * ( + pSchema->tblHash.count + + pSchema->trigHash.count + + pSchema->idxHash.count + + pSchema->fkeyHash.count + ); + nByte += sqlite3MallocSize(pSchema->tblHash.ht); + nByte += sqlite3MallocSize(pSchema->trigHash.ht); + nByte += sqlite3MallocSize(pSchema->idxHash.ht); + nByte += sqlite3MallocSize(pSchema->fkeyHash.ht); + + for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){ + sqlite3DeleteTrigger(db, (Trigger*)sqliteHashData(p)); + } + for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){ + sqlite3DeleteTable(db, (Table *)sqliteHashData(p)); + } + } + } + db->pnBytesFreed = 0; + + *pHighwater = 0; + *pCurrent = nByte; + break; + } + + /* + ** *pCurrent gets an accurate estimate of the amount of memory used + ** to store all prepared statements. + ** *pHighwater is set to zero. + */ + case SQLITE_DBSTATUS_STMT_USED: { + struct Vdbe *pVdbe; /* Used to iterate through VMs */ + int nByte = 0; /* Used to accumulate return value */ + + db->pnBytesFreed = &nByte; + for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pNext){ + sqlite3VdbeDeleteObject(db, pVdbe); + } + db->pnBytesFreed = 0; + + *pHighwater = 0; + *pCurrent = nByte; + + break; + } + default: { - return SQLITE_ERROR; + rc = SQLITE_ERROR; } } - return SQLITE_OK; + sqlite3_mutex_leave(db->mutex); + return rc; } /************** End of status.c **********************************************/ @@ -11029,8 +12752,6 @@ SQLITE_API int sqlite3_db_status( ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: date.c,v 1.107 2009/05/03 20:23:53 drh Exp $ -** ** SQLite processes all times and dates as Julian Day numbers. The ** dates and times are stored as the number of days since noon ** in Greenwich on November 24, 4714 B.C. according to the Gregorian @@ -11145,12 +12866,6 @@ end_getDigits: return cnt; } -/* -** Read text from z[] and convert into a floating point number. Return -** the number of digits converted. -*/ -#define getValue sqlite3AtoF - /* ** Parse a timezone extension on the end of a date-time. ** The extension is of the form: @@ -11326,10 +13041,8 @@ static int parseYyyyMmDd(const char *zDate, DateTime *p){ ** Set the time to the current time reported by the VFS */ static void setDateTimeToCurrent(sqlite3_context *context, DateTime *p){ - double r; sqlite3 *db = sqlite3_context_db_handle(context); - sqlite3OsCurrentTime(db->pVfs, &r); - p->iJD = (sqlite3_int64)(r*86400000.0 + 0.5); + sqlite3OsCurrentTimeInt64(db->pVfs, &p->iJD); p->validJD = 1; } @@ -11354,7 +13067,7 @@ static int parseDateOrTime( const char *zDate, DateTime *p ){ - int isRealNum; /* Return from sqlite3IsNumber(). Not used */ + double r; if( parseYyyyMmDd(zDate,p)==0 ){ return 0; }else if( parseHhMmSs(zDate, p)==0 ){ @@ -11362,9 +13075,7 @@ static int parseDateOrTime( }else if( sqlite3StrICmp(zDate,"now")==0){ setDateTimeToCurrent(context, p); return 0; - }else if( sqlite3IsNumber(zDate, &isRealNum, SQLITE_UTF8) ){ - double r; - getValue(zDate, &r); + }else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8) ){ p->iJD = (sqlite3_int64)(r*86400000.0 + 0.5); p->validJD = 1; return 0; @@ -11585,8 +13296,9 @@ static int parseModifier(const char *zMod, DateTime *p){ ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ** date is already on the appropriate weekday, this is a no-op. */ - if( strncmp(z, "weekday ", 8)==0 && getValue(&z[8],&r)>0 - && (n=(int)r)==r && n>=0 && r<7 ){ + if( strncmp(z, "weekday ", 8)==0 + && sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8) + && (n=(int)r)==r && n>=0 && r<7 ){ sqlite3_int64 Z; computeYMD_HMS(p); p->validTZ = 0; @@ -11641,8 +13353,11 @@ static int parseModifier(const char *zMod, DateTime *p){ case '8': case '9': { double rRounder; - n = getValue(z, &r); - assert( n>=1 ); + for(n=1; z[n] && z[n]!=':' && !sqlite3Isspace(z[n]); n++){} + if( !sqlite3AtoF(z, &r, n, SQLITE_UTF8) ){ + rc = 1; + break; + } if( z[n]==':' ){ /* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the ** specified number of hours, minutes, seconds, and fractional seconds @@ -12050,22 +13765,15 @@ static void currentTimeFunc( time_t t; char *zFormat = (char *)sqlite3_user_data(context); sqlite3 *db; - double rT; + sqlite3_int64 iT; char zBuf[20]; UNUSED_PARAMETER(argc); UNUSED_PARAMETER(argv); db = sqlite3_context_db_handle(context); - sqlite3OsCurrentTime(db->pVfs, &rT); -#ifndef SQLITE_OMIT_FLOATING_POINT - t = 86400.0*(rT - 2440587.5) + 0.5; -#else - /* without floating point support, rT will have - ** already lost fractional day precision. - */ - t = 86400 * (rT - 2440587) - 43200; -#endif + sqlite3OsCurrentTimeInt64(db->pVfs, &iT); + t = iT/1000 - 10000*(sqlite3_int64)21086676; #ifdef HAVE_GMTIME_R { struct tm sNow; @@ -12104,8 +13812,8 @@ SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(void){ FUNCTION(current_date, 0, 0, 0, cdateFunc ), #else STR_FUNCTION(current_time, 0, "%H:%M:%S", 0, currentTimeFunc), - STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d", 0, currentTimeFunc), - STR_FUNCTION(current_date, 0, "%Y-%m-%d %H:%M:%S", 0, currentTimeFunc), + STR_FUNCTION(current_date, 0, "%Y-%m-%d", 0, currentTimeFunc), + STR_FUNCTION(current_timestamp, 0, "%Y-%m-%d %H:%M:%S", 0, currentTimeFunc), #endif }; int i; @@ -12133,8 +13841,6 @@ SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(void){ ** ** This file contains OS interface code that is common to all ** architectures. -** -** $Id: os.c,v 1.127 2009/07/27 11:41:21 danielk1977 Exp $ */ #define _SQLITE_OS_C_ 1 #undef _SQLITE_OS_C_ @@ -12156,8 +13862,10 @@ SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(void){ ** sqlite3OsLock() ** */ -#if defined(SQLITE_TEST) && (SQLITE_OS_WIN==0) - #define DO_OS_MALLOC_TEST(x) if (!x || !sqlite3IsMemJournal(x)) { \ +#if defined(SQLITE_TEST) +SQLITE_API int sqlite3_memdebug_vfs_oom_test = 1; + #define DO_OS_MALLOC_TEST(x) \ + if (sqlite3_memdebug_vfs_oom_test && (!x || !sqlite3IsMemJournal(x))) { \ void *pTstAlloc = sqlite3Malloc(10); \ if (!pTstAlloc) return SQLITE_IOERR_NOMEM; \ sqlite3_free(pTstAlloc); \ @@ -12220,6 +13928,24 @@ SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){ SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id){ return id->pMethods->xDeviceCharacteristics(id); } +SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int offset, int n, int flags){ + return id->pMethods->xShmLock(id, offset, n, flags); +} +SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id){ + id->pMethods->xShmBarrier(id); +} +SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int deleteFlag){ + return id->pMethods->xShmUnmap(id, deleteFlag); +} +SQLITE_PRIVATE int sqlite3OsShmMap( + sqlite3_file *id, /* Database file handle */ + int iPage, + int pgsz, + int bExtend, /* True to extend file if necessary */ + void volatile **pp /* OUT: Pointer to mapping */ +){ + return id->pMethods->xShmMap(id, iPage, pgsz, bExtend, pp); +} /* ** The next group of routines are convenience wrappers around the @@ -12234,11 +13960,11 @@ SQLITE_PRIVATE int sqlite3OsOpen( ){ int rc; DO_OS_MALLOC_TEST(0); - /* 0x7f1f is a mask of SQLITE_OPEN_ flags that are valid to be passed + /* 0x87f3f is a mask of SQLITE_OPEN_ flags that are valid to be passed ** down into the VFS layer. Some SQLITE_OPEN_ flags (for example, ** SQLITE_OPEN_FULLMUTEX or SQLITE_OPEN_SHAREDCACHE) are blocked before ** reaching the VFS. */ - rc = pVfs->xOpen(pVfs, zPath, pFile, flags & 0x7f1f, pFlagsOut); + rc = pVfs->xOpen(pVfs, zPath, pFile, flags & 0x87f3f, pFlagsOut); assert( rc==SQLITE_OK || pFile->pMethods==0 ); return rc; } @@ -12260,6 +13986,7 @@ SQLITE_PRIVATE int sqlite3OsFullPathname( int nPathOut, char *zPathOut ){ + zPathOut[0] = 0; return pVfs->xFullPathname(pVfs, zPath, nPathOut, zPathOut); } #ifndef SQLITE_OMIT_LOAD_EXTENSION @@ -12282,8 +14009,22 @@ SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufO SQLITE_PRIVATE int sqlite3OsSleep(sqlite3_vfs *pVfs, int nMicro){ return pVfs->xSleep(pVfs, nMicro); } -SQLITE_PRIVATE int sqlite3OsCurrentTime(sqlite3_vfs *pVfs, double *pTimeOut){ - return pVfs->xCurrentTime(pVfs, pTimeOut); +SQLITE_PRIVATE int sqlite3OsCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *pTimeOut){ + int rc; + /* IMPLEMENTATION-OF: R-49045-42493 SQLite will use the xCurrentTimeInt64() + ** method to get the current date and time if that method is available + ** (if iVersion is 2 or greater and the function pointer is not NULL) and + ** will fall back to xCurrentTime() if xCurrentTimeInt64() is + ** unavailable. + */ + if( pVfs->iVersion>=2 && pVfs->xCurrentTimeInt64 ){ + rc = pVfs->xCurrentTimeInt64(pVfs, pTimeOut); + }else{ + double r; + rc = pVfs->xCurrentTime(pVfs, &r); + *pTimeOut = (sqlite3_int64)(r*86400000.0); + } + return rc; } SQLITE_PRIVATE int sqlite3OsOpenMalloc( @@ -12431,10 +14172,6 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs *pVfs){ ** ************************************************************************* ** -** $Id: fault.c,v 1.11 2008/09/02 00:52:52 drh Exp $ -*/ - -/* ** This file contains code to support the concept of "benign" ** malloc failures (when the xMalloc() or xRealloc() method of the ** sqlite3_mem_methods structure fails to allocate a block of memory @@ -12529,8 +14266,6 @@ SQLITE_PRIVATE void sqlite3EndBenignMalloc(void){ ** here always fail. SQLite will not operate with these drivers. These ** are merely placeholders. Real drivers must be substituted using ** sqlite3_config() before SQLite will operate. -** -** $Id: mem0.c,v 1.1 2008/10/28 18:58:20 drh Exp $ */ /* @@ -12593,8 +14328,6 @@ SQLITE_PRIVATE void sqlite3MemSetDefault(void){ ** ** This file contains implementations of the low-level memory allocation ** routines specified in the sqlite3_mem_methods object. -** -** $Id: mem1.c,v 1.30 2009/03/23 04:33:33 danielk1977 Exp $ */ /* @@ -12620,6 +14353,9 @@ static void *sqlite3MemMalloc(int nByte){ if( p ){ p[0] = nByte; p++; + }else{ + testcase( sqlite3GlobalConfig.xLog!=0 ); + sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte); } return (void *)p; } @@ -12639,6 +14375,18 @@ static void sqlite3MemFree(void *pPrior){ free(p); } +/* +** Report the allocated size of a prior return from xMalloc() +** or xRealloc(). +*/ +static int sqlite3MemSize(void *pPrior){ + sqlite3_int64 *p; + if( pPrior==0 ) return 0; + p = (sqlite3_int64*)pPrior; + p--; + return (int)p[0]; +} + /* ** Like realloc(). Resize an allocation previously obtained from ** sqlite3MemMalloc(). @@ -12652,29 +14400,21 @@ static void sqlite3MemFree(void *pPrior){ static void *sqlite3MemRealloc(void *pPrior, int nByte){ sqlite3_int64 *p = (sqlite3_int64*)pPrior; assert( pPrior!=0 && nByte>0 ); - nByte = ROUND8(nByte); - p = (sqlite3_int64*)pPrior; + assert( nByte==ROUND8(nByte) ); /* EV: R-46199-30249 */ p--; p = realloc(p, nByte+8 ); if( p ){ p[0] = nByte; p++; + }else{ + testcase( sqlite3GlobalConfig.xLog!=0 ); + sqlite3_log(SQLITE_NOMEM, + "failed memory resize %u to %u bytes", + sqlite3MemSize(pPrior), nByte); } return (void*)p; } -/* -** Report the allocated size of a prior return from xMalloc() -** or xRealloc(). -*/ -static int sqlite3MemSize(void *pPrior){ - sqlite3_int64 *p; - if( pPrior==0 ) return 0; - p = (sqlite3_int64*)pPrior; - p--; - return (int)p[0]; -} - /* ** Round up a request size to the next valid allocation size. */ @@ -12742,8 +14482,6 @@ SQLITE_PRIVATE void sqlite3MemSetDefault(void){ ** ** This file contains implementations of the low-level memory allocation ** routines specified in the sqlite3_mem_methods object. -** -** $Id: mem2.c,v 1.45 2009/03/23 04:33:33 danielk1977 Exp $ */ /* @@ -12781,7 +14519,8 @@ struct MemBlockHdr { struct MemBlockHdr *pNext, *pPrev; /* Linked list of all unfreed memory */ char nBacktrace; /* Number of backtraces on this alloc */ char nBacktraceSlots; /* Available backtrace slots */ - short nTitle; /* Bytes of title; includes '\0' */ + u8 nTitle; /* Bytes of title; includes '\0' */ + u8 eType; /* Allocation type code */ int iForeGuard; /* Guard word for sanity */ }; @@ -12934,6 +14673,31 @@ static int sqlite3MemRoundup(int n){ return ROUND8(n); } +/* +** Fill a buffer with pseudo-random bytes. This is used to preset +** the content of a new memory allocation to unpredictable values and +** to clear the content of a freed allocation to unpredictable values. +*/ +static void randomFill(char *pBuf, int nByte){ + unsigned int x, y, r; + x = SQLITE_PTR_TO_INT(pBuf); + y = nByte | 1; + while( nByte >= 4 ){ + x = (x>>1) ^ (-(x&1) & 0xd0000001); + y = y*1103515245 + 12345; + r = x ^ y; + *(int*)pBuf = r; + pBuf += 4; + nByte -= 4; + } + while( nByte-- > 0 ){ + x = (x>>1) ^ (-(x&1) & 0xd0000001); + y = y*1103515245 + 12345; + r = x ^ y; + *(pBuf++) = r & 0xff; + } +} + /* ** Allocate nByte bytes of memory. */ @@ -12964,6 +14728,7 @@ static void *sqlite3MemMalloc(int nByte){ } mem.pLast = pHdr; pHdr->iForeGuard = FOREGUARD; + pHdr->eType = MEMTYPE_HEAP; pHdr->nBacktraceSlots = mem.nBacktrace; pHdr->nTitle = mem.nTitle; if( mem.nBacktrace ){ @@ -12984,7 +14749,8 @@ static void *sqlite3MemMalloc(int nByte){ adjustStats(nByte, +1); pInt = (int*)&pHdr[1]; pInt[nReserve/sizeof(int)] = REARGUARD; - memset(pInt, 0x65, nReserve); + randomFill((char*)pInt, nByte); + memset(((char*)pInt)+nByte, 0x65, nReserve-nByte); p = (void*)pInt; } sqlite3_mutex_leave(mem.mutex); @@ -12998,7 +14764,8 @@ static void sqlite3MemFree(void *pPrior){ struct MemBlockHdr *pHdr; void **pBt; char *z; - assert( sqlite3GlobalConfig.bMemstat || mem.mutex!=0 ); + assert( sqlite3GlobalConfig.bMemstat || sqlite3GlobalConfig.bCoreMutex==0 + || mem.mutex!=0 ); pHdr = sqlite3MemsysGetHeader(pPrior); pBt = (void**)pHdr; pBt -= pHdr->nBacktraceSlots; @@ -13020,8 +14787,8 @@ static void sqlite3MemFree(void *pPrior){ z = (char*)pBt; z -= pHdr->nTitle; adjustStats(pHdr->iSize, -1); - memset(z, 0x2b, sizeof(void*)*pHdr->nBacktraceSlots + sizeof(*pHdr) + - pHdr->iSize + sizeof(int) + pHdr->nTitle); + randomFill(z, sizeof(void*)*pHdr->nBacktraceSlots + sizeof(*pHdr) + + pHdr->iSize + sizeof(int) + pHdr->nTitle); free(z); sqlite3_mutex_leave(mem.mutex); } @@ -13039,12 +14806,13 @@ static void *sqlite3MemRealloc(void *pPrior, int nByte){ struct MemBlockHdr *pOldHdr; void *pNew; assert( mem.disallow==0 ); + assert( (nByte & 7)==0 ); /* EV: R-46199-30249 */ pOldHdr = sqlite3MemsysGetHeader(pPrior); pNew = sqlite3MemMalloc(nByte); if( pNew ){ memcpy(pNew, pPrior, nByteiSize ? nByte : pOldHdr->iSize); if( nByte>pOldHdr->iSize ){ - memset(&((char*)pNew)[pOldHdr->iSize], 0x2b, nByte - pOldHdr->iSize); + randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - pOldHdr->iSize); } sqlite3MemFree(pPrior); } @@ -13069,6 +14837,62 @@ SQLITE_PRIVATE void sqlite3MemSetDefault(void){ sqlite3_config(SQLITE_CONFIG_MALLOC, &defaultMethods); } +/* +** Set the "type" of an allocation. +*/ +SQLITE_PRIVATE void sqlite3MemdebugSetType(void *p, u8 eType){ + if( p && sqlite3GlobalConfig.m.xMalloc==sqlite3MemMalloc ){ + struct MemBlockHdr *pHdr; + pHdr = sqlite3MemsysGetHeader(p); + assert( pHdr->iForeGuard==FOREGUARD ); + pHdr->eType = eType; + } +} + +/* +** Return TRUE if the mask of type in eType matches the type of the +** allocation p. Also return true if p==NULL. +** +** This routine is designed for use within an assert() statement, to +** verify the type of an allocation. For example: +** +** assert( sqlite3MemdebugHasType(p, MEMTYPE_DB) ); +*/ +SQLITE_PRIVATE int sqlite3MemdebugHasType(void *p, u8 eType){ + int rc = 1; + if( p && sqlite3GlobalConfig.m.xMalloc==sqlite3MemMalloc ){ + struct MemBlockHdr *pHdr; + pHdr = sqlite3MemsysGetHeader(p); + assert( pHdr->iForeGuard==FOREGUARD ); /* Allocation is valid */ + if( (pHdr->eType&eType)==0 ){ + rc = 0; + } + } + return rc; +} + +/* +** Return TRUE if the mask of type in eType matches no bits of the type of the +** allocation p. Also return true if p==NULL. +** +** This routine is designed for use within an assert() statement, to +** verify the type of an allocation. For example: +** +** assert( sqlite3MemdebugNoType(p, MEMTYPE_DB) ); +*/ +SQLITE_PRIVATE int sqlite3MemdebugNoType(void *p, u8 eType){ + int rc = 1; + if( p && sqlite3GlobalConfig.m.xMalloc==sqlite3MemMalloc ){ + struct MemBlockHdr *pHdr; + pHdr = sqlite3MemsysGetHeader(p); + assert( pHdr->iForeGuard==FOREGUARD ); /* Allocation is valid */ + if( (pHdr->eType&eType)!=0 ){ + rc = 0; + } + } + return rc; +} + /* ** Set the number of backtrace levels kept for each allocation. ** A value of zero turns off backtracing. The number is always rounded @@ -13191,8 +15015,6 @@ SQLITE_PRIVATE int sqlite3MemdebugMallocCount(){ ** ** This version of the memory allocation subsystem is included ** in the build only if SQLITE_ENABLE_MEMSYS3 is defined. -** -** $Id: mem3.c,v 1.25 2008/11/19 16:52:44 danielk1977 Exp $ */ /* @@ -14127,7 +15949,11 @@ static void *memsys5MallocUnsafe(int nByte){ ** two in order to create a new free block of size iLogsize. */ for(iBin=iLogsize; mem5.aiFreelist[iBin]<0 && iBin<=LOGMAX; iBin++){} - if( iBin>LOGMAX ) return 0; + if( iBin>LOGMAX ){ + testcase( sqlite3GlobalConfig.xLog!=0 ); + sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes", nByte); + return 0; + } i = memsys5UnlinkFirst(iBin); while( iBin>iLogsize ){ int newSize; @@ -14250,7 +16076,7 @@ static void *memsys5Realloc(void *pPrior, int nBytes){ int nOld; void *p; assert( pPrior!=0 ); - assert( (nBytes&(nBytes-1))==0 ); + assert( (nBytes&(nBytes-1))==0 ); /* EV: R-46199-30249 */ assert( nBytes>=0 ); if( nBytes==0 ){ return 0; @@ -14450,9 +16276,6 @@ SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys5(void){ ** This file contains the C functions that implement mutexes. ** ** This file contains code that is common across all mutex implementations. - -** -** $Id: mutex.c,v 1.31 2009/07/16 18:21:18 drh Exp $ */ #if defined(SQLITE_DEBUG) && !defined(SQLITE_MUTEX_OMIT) @@ -14471,23 +16294,26 @@ static SQLITE_WSD int mutexIsInit = 0; */ SQLITE_PRIVATE int sqlite3MutexInit(void){ int rc = SQLITE_OK; - if( sqlite3GlobalConfig.bCoreMutex ){ - if( !sqlite3GlobalConfig.mutex.xMutexAlloc ){ - /* If the xMutexAlloc method has not been set, then the user did not - ** install a mutex implementation via sqlite3_config() prior to - ** sqlite3_initialize() being called. This block copies pointers to - ** the default implementation into the sqlite3GlobalConfig structure. - */ - sqlite3_mutex_methods *pFrom = sqlite3DefaultMutex(); - sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex; + if( !sqlite3GlobalConfig.mutex.xMutexAlloc ){ + /* If the xMutexAlloc method has not been set, then the user did not + ** install a mutex implementation via sqlite3_config() prior to + ** sqlite3_initialize() being called. This block copies pointers to + ** the default implementation into the sqlite3GlobalConfig structure. + */ + sqlite3_mutex_methods const *pFrom; + sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex; - memcpy(pTo, pFrom, offsetof(sqlite3_mutex_methods, xMutexAlloc)); - memcpy(&pTo->xMutexFree, &pFrom->xMutexFree, - sizeof(*pTo) - offsetof(sqlite3_mutex_methods, xMutexFree)); - pTo->xMutexAlloc = pFrom->xMutexAlloc; + if( sqlite3GlobalConfig.bCoreMutex ){ + pFrom = sqlite3DefaultMutex(); + }else{ + pFrom = sqlite3NoopMutex(); } - rc = sqlite3GlobalConfig.mutex.xMutexInit(); + memcpy(pTo, pFrom, offsetof(sqlite3_mutex_methods, xMutexAlloc)); + memcpy(&pTo->xMutexFree, &pFrom->xMutexFree, + sizeof(*pTo) - offsetof(sqlite3_mutex_methods, xMutexFree)); + pTo->xMutexAlloc = pFrom->xMutexAlloc; } + rc = sqlite3GlobalConfig.mutex.xMutexInit(); #ifdef SQLITE_DEBUG GLOBAL(int, mutexIsInit) = 1; @@ -14617,29 +16443,32 @@ SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex *p){ ** If compiled with SQLITE_DEBUG, then additional logic is inserted ** that does error checking on mutexes to make sure they are being ** called correctly. -** -** $Id: mutex_noop.c,v 1.3 2008/12/05 17:17:08 drh Exp $ */ +#ifndef SQLITE_MUTEX_OMIT -#if defined(SQLITE_MUTEX_NOOP) && !defined(SQLITE_DEBUG) +#ifndef SQLITE_DEBUG /* ** Stub routines for all mutex methods. ** ** This routines provide no mutual exclusion or error checking. */ -static int noopMutexHeld(sqlite3_mutex *p){ return 1; } -static int noopMutexNotheld(sqlite3_mutex *p){ return 1; } static int noopMutexInit(void){ return SQLITE_OK; } static int noopMutexEnd(void){ return SQLITE_OK; } -static sqlite3_mutex *noopMutexAlloc(int id){ return (sqlite3_mutex*)8; } -static void noopMutexFree(sqlite3_mutex *p){ return; } -static void noopMutexEnter(sqlite3_mutex *p){ return; } -static int noopMutexTry(sqlite3_mutex *p){ return SQLITE_OK; } -static void noopMutexLeave(sqlite3_mutex *p){ return; } +static sqlite3_mutex *noopMutexAlloc(int id){ + UNUSED_PARAMETER(id); + return (sqlite3_mutex*)8; +} +static void noopMutexFree(sqlite3_mutex *p){ UNUSED_PARAMETER(p); return; } +static void noopMutexEnter(sqlite3_mutex *p){ UNUSED_PARAMETER(p); return; } +static int noopMutexTry(sqlite3_mutex *p){ + UNUSED_PARAMETER(p); + return SQLITE_OK; +} +static void noopMutexLeave(sqlite3_mutex *p){ UNUSED_PARAMETER(p); return; } -SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ - static sqlite3_mutex_methods sMutex = { +SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3NoopMutex(void){ + static const sqlite3_mutex_methods sMutex = { noopMutexInit, noopMutexEnd, noopMutexAlloc, @@ -14648,15 +16477,15 @@ SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ noopMutexTry, noopMutexLeave, - noopMutexHeld, - noopMutexNotheld + 0, + 0, }; return &sMutex; } -#endif /* defined(SQLITE_MUTEX_NOOP) && !defined(SQLITE_DEBUG) */ +#endif /* !SQLITE_DEBUG */ -#if defined(SQLITE_MUTEX_NOOP) && defined(SQLITE_DEBUG) +#ifdef SQLITE_DEBUG /* ** In this implementation, error checking is provided for testing ** and debugging purposes. The mutexes still do not provide any @@ -14666,19 +16495,21 @@ SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ /* ** The mutex object */ -struct sqlite3_mutex { +typedef struct sqlite3_debug_mutex { int id; /* The mutex type */ int cnt; /* Number of entries without a matching leave */ -}; +} sqlite3_debug_mutex; /* ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are ** intended for use inside assert() statements. */ -static int debugMutexHeld(sqlite3_mutex *p){ +static int debugMutexHeld(sqlite3_mutex *pX){ + sqlite3_debug_mutex *p = (sqlite3_debug_mutex*)pX; return p==0 || p->cnt>0; } -static int debugMutexNotheld(sqlite3_mutex *p){ +static int debugMutexNotheld(sqlite3_mutex *pX){ + sqlite3_debug_mutex *p = (sqlite3_debug_mutex*)pX; return p==0 || p->cnt==0; } @@ -14694,8 +16525,8 @@ static int debugMutexEnd(void){ return SQLITE_OK; } ** that means that a mutex could not be allocated. */ static sqlite3_mutex *debugMutexAlloc(int id){ - static sqlite3_mutex aStatic[6]; - sqlite3_mutex *pNew = 0; + static sqlite3_debug_mutex aStatic[6]; + sqlite3_debug_mutex *pNew = 0; switch( id ){ case SQLITE_MUTEX_FAST: case SQLITE_MUTEX_RECURSIVE: { @@ -14714,13 +16545,14 @@ static sqlite3_mutex *debugMutexAlloc(int id){ break; } } - return pNew; + return (sqlite3_mutex*)pNew; } /* ** This routine deallocates a previously allocated mutex. */ -static void debugMutexFree(sqlite3_mutex *p){ +static void debugMutexFree(sqlite3_mutex *pX){ + sqlite3_debug_mutex *p = (sqlite3_debug_mutex*)pX; assert( p->cnt==0 ); assert( p->id==SQLITE_MUTEX_FAST || p->id==SQLITE_MUTEX_RECURSIVE ); sqlite3_free(p); @@ -14737,12 +16569,14 @@ static void debugMutexFree(sqlite3_mutex *p){ ** can enter. If the same thread tries to enter any other kind of mutex ** more than once, the behavior is undefined. */ -static void debugMutexEnter(sqlite3_mutex *p){ - assert( p->id==SQLITE_MUTEX_RECURSIVE || debugMutexNotheld(p) ); +static void debugMutexEnter(sqlite3_mutex *pX){ + sqlite3_debug_mutex *p = (sqlite3_debug_mutex*)pX; + assert( p->id==SQLITE_MUTEX_RECURSIVE || debugMutexNotheld(pX) ); p->cnt++; } -static int debugMutexTry(sqlite3_mutex *p){ - assert( p->id==SQLITE_MUTEX_RECURSIVE || debugMutexNotheld(p) ); +static int debugMutexTry(sqlite3_mutex *pX){ + sqlite3_debug_mutex *p = (sqlite3_debug_mutex*)pX; + assert( p->id==SQLITE_MUTEX_RECURSIVE || debugMutexNotheld(pX) ); p->cnt++; return SQLITE_OK; } @@ -14753,14 +16587,15 @@ static int debugMutexTry(sqlite3_mutex *p){ ** is undefined if the mutex is not currently entered or ** is not currently allocated. SQLite will never do either. */ -static void debugMutexLeave(sqlite3_mutex *p){ - assert( debugMutexHeld(p) ); +static void debugMutexLeave(sqlite3_mutex *pX){ + sqlite3_debug_mutex *p = (sqlite3_debug_mutex*)pX; + assert( debugMutexHeld(pX) ); p->cnt--; - assert( p->id==SQLITE_MUTEX_RECURSIVE || debugMutexNotheld(p) ); + assert( p->id==SQLITE_MUTEX_RECURSIVE || debugMutexNotheld(pX) ); } -SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ - static sqlite3_mutex_methods sMutex = { +SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3NoopMutex(void){ + static const sqlite3_mutex_methods sMutex = { debugMutexInit, debugMutexEnd, debugMutexAlloc, @@ -14775,7 +16610,18 @@ SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ return &sMutex; } -#endif /* defined(SQLITE_MUTEX_NOOP) && defined(SQLITE_DEBUG) */ +#endif /* SQLITE_DEBUG */ + +/* +** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation +** is used regardless of the run-time threadsafety setting. +*/ +#ifdef SQLITE_MUTEX_NOOP +SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ + return sqlite3NoopMutex(); +} +#endif /* SQLITE_MUTEX_NOOP */ +#endif /* SQLITE_MUTEX_OMIT */ /************** End of mutex_noop.c ******************************************/ /************** Begin file mutex_os2.c ***************************************/ @@ -14791,8 +16637,6 @@ SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ ** ************************************************************************* ** This file contains the C functions that implement mutexes for OS/2 -** -** $Id: mutex_os2.c,v 1.11 2008/11/22 19:50:54 pweilbacher Exp $ */ /* @@ -14940,6 +16784,39 @@ static void os2MutexFree(sqlite3_mutex *p){ sqlite3_free( p ); } +#ifdef SQLITE_DEBUG +/* +** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are +** intended for use inside assert() statements. +*/ +static int os2MutexHeld(sqlite3_mutex *p){ + TID tid; + PID pid; + ULONG ulCount; + PTIB ptib; + if( p!=0 ) { + DosQueryMutexSem(p->mutex, &pid, &tid, &ulCount); + } else { + DosGetInfoBlocks(&ptib, NULL); + tid = ptib->tib_ptib2->tib2_ultid; + } + return p==0 || (p->nRef!=0 && p->owner==tid); +} +static int os2MutexNotheld(sqlite3_mutex *p){ + TID tid; + PID pid; + ULONG ulCount; + PTIB ptib; + if( p!= 0 ) { + DosQueryMutexSem(p->mutex, &pid, &tid, &ulCount); + } else { + DosGetInfoBlocks(&ptib, NULL); + tid = ptib->tib_ptib2->tib2_ultid; + } + return p==0 || p->nRef==0 || p->owner!=tid; +} +#endif + /* ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt ** to enter a mutex. If another thread is already within the mutex, @@ -15000,41 +16877,8 @@ static void os2MutexLeave(sqlite3_mutex *p){ DosReleaseMutexSem(p->mutex); } -#ifdef SQLITE_DEBUG -/* -** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are -** intended for use inside assert() statements. -*/ -static int os2MutexHeld(sqlite3_mutex *p){ - TID tid; - PID pid; - ULONG ulCount; - PTIB ptib; - if( p!=0 ) { - DosQueryMutexSem(p->mutex, &pid, &tid, &ulCount); - } else { - DosGetInfoBlocks(&ptib, NULL); - tid = ptib->tib_ptib2->tib2_ultid; - } - return p==0 || (p->nRef!=0 && p->owner==tid); -} -static int os2MutexNotheld(sqlite3_mutex *p){ - TID tid; - PID pid; - ULONG ulCount; - PTIB ptib; - if( p!= 0 ) { - DosQueryMutexSem(p->mutex, &pid, &tid, &ulCount); - } else { - DosGetInfoBlocks(&ptib, NULL); - tid = ptib->tib_ptib2->tib2_ultid; - } - return p==0 || p->nRef==0 || p->owner!=tid; -} -#endif - -SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ - static sqlite3_mutex_methods sMutex = { +SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ + static const sqlite3_mutex_methods sMutex = { os2MutexInit, os2MutexEnd, os2MutexAlloc, @@ -15066,8 +16910,6 @@ SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ ** ************************************************************************* ** This file contains the C functions that implement mutexes for pthreads -** -** $Id: mutex_unix.c,v 1.16 2008/12/08 18:19:18 drh Exp $ */ /* @@ -15081,23 +16923,33 @@ SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ #include +/* +** The sqlite3_mutex.id, sqlite3_mutex.nRef, and sqlite3_mutex.owner fields +** are necessary under two condidtions: (1) Debug builds and (2) using +** home-grown mutexes. Encapsulate these conditions into a single #define. +*/ +#if defined(SQLITE_DEBUG) || defined(SQLITE_HOMEGROWN_RECURSIVE_MUTEX) +# define SQLITE_MUTEX_NREF 1 +#else +# define SQLITE_MUTEX_NREF 0 +#endif /* ** Each recursive mutex is an instance of the following structure. */ struct sqlite3_mutex { pthread_mutex_t mutex; /* Mutex controlling the lock */ +#if SQLITE_MUTEX_NREF int id; /* Mutex type */ - int nRef; /* Number of entrances */ - pthread_t owner; /* Thread that is within this mutex */ -#ifdef SQLITE_DEBUG + volatile int nRef; /* Number of entrances */ + volatile pthread_t owner; /* Thread that is within this mutex */ int trace; /* True to trace changes */ #endif }; -#ifdef SQLITE_DEBUG +#if SQLITE_MUTEX_NREF #define SQLITE3_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0, (pthread_t)0, 0 } #else -#define SQLITE3_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0, (pthread_t)0 } +#define SQLITE3_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER } #endif /* @@ -15199,14 +17051,18 @@ static sqlite3_mutex *pthreadMutexAlloc(int iType){ pthread_mutex_init(&p->mutex, &recursiveAttr); pthread_mutexattr_destroy(&recursiveAttr); #endif +#if SQLITE_MUTEX_NREF p->id = iType; +#endif } break; } case SQLITE_MUTEX_FAST: { p = sqlite3MallocZero( sizeof(*p) ); if( p ){ +#if SQLITE_MUTEX_NREF p->id = iType; +#endif pthread_mutex_init(&p->mutex, 0); } break; @@ -15215,7 +17071,9 @@ static sqlite3_mutex *pthreadMutexAlloc(int iType){ assert( iType-2 >= 0 ); assert( iType-2 < ArraySize(staticMutexes) ); p = &staticMutexes[iType-2]; +#if SQLITE_MUTEX_NREF p->id = iType; +#endif break; } } @@ -15275,9 +17133,12 @@ static void pthreadMutexEnter(sqlite3_mutex *p){ /* Use the built-in recursive mutexes if they are available. */ pthread_mutex_lock(&p->mutex); +#if SQLITE_MUTEX_NREF + assert( p->nRef>0 || p->owner==0 ); p->owner = pthread_self(); p->nRef++; #endif +#endif #ifdef SQLITE_DEBUG if( p->trace ){ @@ -15318,8 +17179,10 @@ static int pthreadMutexTry(sqlite3_mutex *p){ /* Use the built-in recursive mutexes if they are available. */ if( pthread_mutex_trylock(&p->mutex)==0 ){ +#if SQLITE_MUTEX_NREF p->owner = pthread_self(); p->nRef++; +#endif rc = SQLITE_OK; }else{ rc = SQLITE_BUSY; @@ -15342,7 +17205,10 @@ static int pthreadMutexTry(sqlite3_mutex *p){ */ static void pthreadMutexLeave(sqlite3_mutex *p){ assert( pthreadMutexHeld(p) ); +#if SQLITE_MUTEX_NREF p->nRef--; + if( p->nRef==0 ) p->owner = 0; +#endif assert( p->nRef==0 || p->id==SQLITE_MUTEX_RECURSIVE ); #ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX @@ -15360,8 +17226,8 @@ static void pthreadMutexLeave(sqlite3_mutex *p){ #endif } -SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ - static sqlite3_mutex_methods sMutex = { +SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ + static const sqlite3_mutex_methods sMutex = { pthreadMutexInit, pthreadMutexEnd, pthreadMutexAlloc, @@ -15397,8 +17263,6 @@ SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ ** ************************************************************************* ** This file contains the C functions that implement mutexes for win32 -** -** $Id: mutex_w32.c,v 1.18 2009/08/10 03:23:21 shane Exp $ */ /* @@ -15413,9 +17277,18 @@ SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ struct sqlite3_mutex { CRITICAL_SECTION mutex; /* Mutex controlling the lock */ int id; /* Mutex type */ - int nRef; /* Number of enterances */ - DWORD owner; /* Thread holding this mutex */ +#ifdef SQLITE_DEBUG + volatile int nRef; /* Number of enterances */ + volatile DWORD owner; /* Thread holding this mutex */ + int trace; /* True to trace changes */ +#endif }; +#define SQLITE_W32_MUTEX_INITIALIZER { 0 } +#ifdef SQLITE_DEBUG +#define SQLITE3_MUTEX_INITIALIZER { SQLITE_W32_MUTEX_INITIALIZER, 0, 0L, (DWORD)0, 0 } +#else +#define SQLITE3_MUTEX_INITIALIZER { SQLITE_W32_MUTEX_INITIALIZER, 0 } +#endif /* ** Return true (non-zero) if we are running under WinNT, Win2K, WinXP, @@ -15459,8 +17332,12 @@ struct sqlite3_mutex { static int winMutexHeld(sqlite3_mutex *p){ return p->nRef!=0 && p->owner==GetCurrentThreadId(); } +static int winMutexNotheld2(sqlite3_mutex *p, DWORD tid){ + return p->nRef==0 || p->owner!=tid; +} static int winMutexNotheld(sqlite3_mutex *p){ - return p->nRef==0 || p->owner!=GetCurrentThreadId(); + DWORD tid = GetCurrentThreadId(); + return winMutexNotheld2(p, tid); } #endif @@ -15468,7 +17345,14 @@ static int winMutexNotheld(sqlite3_mutex *p){ /* ** Initialize and deinitialize the mutex subsystem. */ -static sqlite3_mutex winMutex_staticMutexes[6]; +static sqlite3_mutex winMutex_staticMutexes[6] = { + SQLITE3_MUTEX_INITIALIZER, + SQLITE3_MUTEX_INITIALIZER, + SQLITE3_MUTEX_INITIALIZER, + SQLITE3_MUTEX_INITIALIZER, + SQLITE3_MUTEX_INITIALIZER, + SQLITE3_MUTEX_INITIALIZER +}; static int winMutex_isInit = 0; /* As winMutexInit() and winMutexEnd() are called as part ** of the sqlite3_initialize and sqlite3_shutdown() @@ -15559,7 +17443,9 @@ static sqlite3_mutex *winMutexAlloc(int iType){ case SQLITE_MUTEX_RECURSIVE: { p = sqlite3MallocZero( sizeof(*p) ); if( p ){ +#ifdef SQLITE_DEBUG p->id = iType; +#endif InitializeCriticalSection(&p->mutex); } break; @@ -15569,7 +17455,9 @@ static sqlite3_mutex *winMutexAlloc(int iType){ assert( iType-2 >= 0 ); assert( iType-2 < ArraySize(winMutex_staticMutexes) ); p = &winMutex_staticMutexes[iType-2]; +#ifdef SQLITE_DEBUG p->id = iType; +#endif break; } } @@ -15584,7 +17472,7 @@ static sqlite3_mutex *winMutexAlloc(int iType){ */ static void winMutexFree(sqlite3_mutex *p){ assert( p ); - assert( p->nRef==0 ); + assert( p->nRef==0 && p->owner==0 ); assert( p->id==SQLITE_MUTEX_FAST || p->id==SQLITE_MUTEX_RECURSIVE ); DeleteCriticalSection(&p->mutex); sqlite3_free(p); @@ -15602,14 +17490,26 @@ static void winMutexFree(sqlite3_mutex *p){ ** more than once, the behavior is undefined. */ static void winMutexEnter(sqlite3_mutex *p){ - assert( p->id==SQLITE_MUTEX_RECURSIVE || winMutexNotheld(p) ); +#ifdef SQLITE_DEBUG + DWORD tid = GetCurrentThreadId(); + assert( p->id==SQLITE_MUTEX_RECURSIVE || winMutexNotheld2(p, tid) ); +#endif EnterCriticalSection(&p->mutex); - p->owner = GetCurrentThreadId(); +#ifdef SQLITE_DEBUG + assert( p->nRef>0 || p->owner==0 ); + p->owner = tid; p->nRef++; + if( p->trace ){ + printf("enter mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef); + } +#endif } static int winMutexTry(sqlite3_mutex *p){ +#ifndef NDEBUG + DWORD tid = GetCurrentThreadId(); +#endif int rc = SQLITE_BUSY; - assert( p->id==SQLITE_MUTEX_RECURSIVE || winMutexNotheld(p) ); + assert( p->id==SQLITE_MUTEX_RECURSIVE || winMutexNotheld2(p, tid) ); /* ** The sqlite3_mutex_try() routine is very rarely used, and when it ** is used it is merely an optimization. So it is OK for it to always @@ -15623,12 +17523,17 @@ static int winMutexTry(sqlite3_mutex *p){ */ #if 0 if( mutexIsNT() && TryEnterCriticalSection(&p->mutex) ){ - p->owner = GetCurrentThreadId(); + p->owner = tid; p->nRef++; rc = SQLITE_OK; } #else UNUSED_PARAMETER(p); +#endif +#ifdef SQLITE_DEBUG + if( rc==SQLITE_OK && p->trace ){ + printf("enter mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef); + } #endif return rc; } @@ -15640,15 +17545,24 @@ static int winMutexTry(sqlite3_mutex *p){ ** is not currently allocated. SQLite will never do either. */ static void winMutexLeave(sqlite3_mutex *p){ +#ifndef NDEBUG + DWORD tid = GetCurrentThreadId(); assert( p->nRef>0 ); - assert( p->owner==GetCurrentThreadId() ); + assert( p->owner==tid ); p->nRef--; + if( p->nRef==0 ) p->owner = 0; assert( p->nRef==0 || p->id==SQLITE_MUTEX_RECURSIVE ); +#endif LeaveCriticalSection(&p->mutex); +#ifdef SQLITE_DEBUG + if( p->trace ){ + printf("leave mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef); + } +#endif } -SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ - static sqlite3_mutex_methods sMutex = { +SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ + static const sqlite3_mutex_methods sMutex = { winMutexInit, winMutexEnd, winMutexAlloc, @@ -15684,10 +17598,68 @@ SQLITE_PRIVATE sqlite3_mutex_methods *sqlite3DefaultMutex(void){ ************************************************************************* ** ** Memory allocation functions used throughout sqlite. -** -** $Id: malloc.c,v 1.66 2009/07/17 11:44:07 drh Exp $ */ +/* +** Attempt to release up to n bytes of non-essential memory currently +** held by SQLite. An example of non-essential memory is memory used to +** cache database pages that are not currently in use. +*/ +SQLITE_API int sqlite3_release_memory(int n){ +#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT + return sqlite3PcacheReleaseMemory(n); +#else + /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine + ** is a no-op returning zero if SQLite is not compiled with + ** SQLITE_ENABLE_MEMORY_MANAGEMENT. */ + UNUSED_PARAMETER(n); + return 0; +#endif +} + +/* +** An instance of the following object records the location of +** each unused scratch buffer. +*/ +typedef struct ScratchFreeslot { + struct ScratchFreeslot *pNext; /* Next unused scratch buffer */ +} ScratchFreeslot; + +/* +** State information local to the memory allocation subsystem. +*/ +static SQLITE_WSD struct Mem0Global { + sqlite3_mutex *mutex; /* Mutex to serialize access */ + + /* + ** The alarm callback and its arguments. The mem0.mutex lock will + ** be held while the callback is running. Recursive calls into + ** the memory subsystem are allowed, but no new callbacks will be + ** issued. + */ + sqlite3_int64 alarmThreshold; + void (*alarmCallback)(void*, sqlite3_int64,int); + void *alarmArg; + + /* + ** Pointers to the end of sqlite3GlobalConfig.pScratch memory + ** (so that a range test can be used to determine if an allocation + ** being freed came from pScratch) and a pointer to the list of + ** unused scratch allocations. + */ + void *pScratchEnd; + ScratchFreeslot *pScratchFree; + u32 nScratchFree; + + /* + ** True if heap is nearly "full" where "full" is defined by the + ** sqlite3_soft_heap_limit() setting. + */ + int nearlyFull; +} mem0 = { 0, 0, 0, 0, 0, 0, 0, 0 }; + +#define mem0 GLOBAL(struct Mem0Global, mem0) + /* ** This routine runs when the memory allocator sees that the ** total memory allocation is about to exceed the soft heap @@ -15702,79 +17674,67 @@ static void softHeapLimitEnforcer( sqlite3_release_memory(allocSize); } +/* +** Change the alarm callback +*/ +static int sqlite3MemoryAlarm( + void(*xCallback)(void *pArg, sqlite3_int64 used,int N), + void *pArg, + sqlite3_int64 iThreshold +){ + int nUsed; + sqlite3_mutex_enter(mem0.mutex); + mem0.alarmCallback = xCallback; + mem0.alarmArg = pArg; + mem0.alarmThreshold = iThreshold; + nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED); + mem0.nearlyFull = (iThreshold>0 && iThreshold<=nUsed); + sqlite3_mutex_leave(mem0.mutex); + return SQLITE_OK; +} + +#ifndef SQLITE_OMIT_DEPRECATED +/* +** Deprecated external interface. Internal/core SQLite code +** should call sqlite3MemoryAlarm. +*/ +SQLITE_API int sqlite3_memory_alarm( + void(*xCallback)(void *pArg, sqlite3_int64 used,int N), + void *pArg, + sqlite3_int64 iThreshold +){ + return sqlite3MemoryAlarm(xCallback, pArg, iThreshold); +} +#endif + /* ** Set the soft heap-size limit for the library. Passing a zero or ** negative value indicates no limit. */ -SQLITE_API void sqlite3_soft_heap_limit(int n){ - sqlite3_uint64 iLimit; - int overage; - if( n<0 ){ - iLimit = 0; - }else{ - iLimit = n; - } +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n){ + sqlite3_int64 priorLimit; + sqlite3_int64 excess; #ifndef SQLITE_OMIT_AUTOINIT sqlite3_initialize(); #endif - if( iLimit>0 ){ - sqlite3MemoryAlarm(softHeapLimitEnforcer, 0, iLimit); + sqlite3_mutex_enter(mem0.mutex); + priorLimit = mem0.alarmThreshold; + sqlite3_mutex_leave(mem0.mutex); + if( n<0 ) return priorLimit; + if( n>0 ){ + sqlite3MemoryAlarm(softHeapLimitEnforcer, 0, n); }else{ sqlite3MemoryAlarm(0, 0, 0); } - overage = (int)(sqlite3_memory_used() - (i64)n); - if( overage>0 ){ - sqlite3_release_memory(overage); - } + excess = sqlite3_memory_used() - n; + if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff)); + return priorLimit; } - -/* -** Attempt to release up to n bytes of non-essential memory currently -** held by SQLite. An example of non-essential memory is memory used to -** cache database pages that are not currently in use. -*/ -SQLITE_API int sqlite3_release_memory(int n){ -#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT - int nRet = 0; - nRet += sqlite3PcacheReleaseMemory(n-nRet); - return nRet; -#else - UNUSED_PARAMETER(n); - return SQLITE_OK; -#endif +SQLITE_API void sqlite3_soft_heap_limit(int n){ + if( n<0 ) n = 0; + sqlite3_soft_heap_limit64(n); } -/* -** State information local to the memory allocation subsystem. -*/ -static SQLITE_WSD struct Mem0Global { - /* Number of free pages for scratch and page-cache memory */ - u32 nScratchFree; - u32 nPageFree; - - sqlite3_mutex *mutex; /* Mutex to serialize access */ - - /* - ** The alarm callback and its arguments. The mem0.mutex lock will - ** be held while the callback is running. Recursive calls into - ** the memory subsystem are allowed, but no new callbacks will be - ** issued. - */ - sqlite3_int64 alarmThreshold; - void (*alarmCallback)(void*, sqlite3_int64,int); - void *alarmArg; - - /* - ** Pointers to the end of sqlite3GlobalConfig.pScratch and - ** sqlite3GlobalConfig.pPage to a block of memory that records - ** which pages are available. - */ - u32 *aScratchFree; - u32 *aPageFree; -} mem0 = { 0, 0, 0, 0, 0, 0, 0, 0 }; - -#define mem0 GLOBAL(struct Mem0Global, mem0) - /* ** Initialize the memory allocation subsystem. */ @@ -15787,36 +17747,45 @@ SQLITE_PRIVATE int sqlite3MallocInit(void){ mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); } if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100 - && sqlite3GlobalConfig.nScratch>=0 ){ - int i; - sqlite3GlobalConfig.szScratch = ROUNDDOWN8(sqlite3GlobalConfig.szScratch-4); - mem0.aScratchFree = (u32*)&((char*)sqlite3GlobalConfig.pScratch) - [sqlite3GlobalConfig.szScratch*sqlite3GlobalConfig.nScratch]; - for(i=0; i0 ){ + int i, n, sz; + ScratchFreeslot *pSlot; + sz = ROUNDDOWN8(sqlite3GlobalConfig.szScratch); + sqlite3GlobalConfig.szScratch = sz; + pSlot = (ScratchFreeslot*)sqlite3GlobalConfig.pScratch; + n = sqlite3GlobalConfig.nScratch; + mem0.pScratchFree = pSlot; + mem0.nScratchFree = n; + for(i=0; ipNext = (ScratchFreeslot*)(sz+(char*)pSlot); + pSlot = pSlot->pNext; + } + pSlot->pNext = 0; + mem0.pScratchEnd = (void*)&pSlot[1]; }else{ + mem0.pScratchEnd = 0; sqlite3GlobalConfig.pScratch = 0; sqlite3GlobalConfig.szScratch = 0; + sqlite3GlobalConfig.nScratch = 0; } - if( sqlite3GlobalConfig.pPage && sqlite3GlobalConfig.szPage>=512 - && sqlite3GlobalConfig.nPage>=1 ){ - int i; - int overhead; - int sz = ROUNDDOWN8(sqlite3GlobalConfig.szPage); - int n = sqlite3GlobalConfig.nPage; - overhead = (4*n + sz - 1)/sz; - sqlite3GlobalConfig.nPage -= overhead; - mem0.aPageFree = (u32*)&((char*)sqlite3GlobalConfig.pPage) - [sqlite3GlobalConfig.szPage*sqlite3GlobalConfig.nPage]; - for(i=0; i= mem0.alarmThreshold ){ + mem0.nearlyFull = 1; sqlite3MallocAlarm(nFull); + }else{ + mem0.nearlyFull = 0; } } p = sqlite3GlobalConfig.m.xMalloc(nFull); +#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT if( p==0 && mem0.alarmCallback ){ sqlite3MallocAlarm(nFull); p = sqlite3GlobalConfig.m.xMalloc(nFull); } +#endif if( p ){ nFull = sqlite3MallocSize(p); sqlite3StatusAdd(SQLITE_STATUS_MEMORY_USED, nFull); + sqlite3StatusAdd(SQLITE_STATUS_MALLOC_COUNT, 1); } *pp = p; return nFull; @@ -15935,7 +17880,9 @@ static int mallocWithAlarm(int n, void **pp){ */ SQLITE_PRIVATE void *sqlite3Malloc(int n){ void *p; - if( n<=0 || n>=0x7fffff00 ){ + if( n<=0 /* IMP: R-65312-04917 */ + || n>=0x7fffff00 + ){ /* A memory allocation of a number of bytes which is near the maximum ** signed integer value might cause an integer overflow inside of the ** xMalloc(). Hence we limit the maximum size to 0x7fffff00, giving @@ -15949,6 +17896,7 @@ SQLITE_PRIVATE void *sqlite3Malloc(int n){ }else{ p = sqlite3GlobalConfig.m.xMalloc(n); } + assert( EIGHT_BYTE_ALIGNMENT(p) ); /* IMP: R-04675-44850 */ return p; } @@ -15987,88 +17935,79 @@ SQLITE_PRIVATE void *sqlite3ScratchMalloc(int n){ void *p; assert( n>0 ); + sqlite3_mutex_enter(mem0.mutex); + if( mem0.nScratchFree && sqlite3GlobalConfig.szScratch>=n ){ + p = mem0.pScratchFree; + mem0.pScratchFree = mem0.pScratchFree->pNext; + mem0.nScratchFree--; + sqlite3StatusAdd(SQLITE_STATUS_SCRATCH_USED, 1); + sqlite3StatusSet(SQLITE_STATUS_SCRATCH_SIZE, n); + sqlite3_mutex_leave(mem0.mutex); + }else{ + if( sqlite3GlobalConfig.bMemstat ){ + sqlite3StatusSet(SQLITE_STATUS_SCRATCH_SIZE, n); + n = mallocWithAlarm(n, &p); + if( p ) sqlite3StatusAdd(SQLITE_STATUS_SCRATCH_OVERFLOW, n); + sqlite3_mutex_leave(mem0.mutex); + }else{ + sqlite3_mutex_leave(mem0.mutex); + p = sqlite3GlobalConfig.m.xMalloc(n); + } + sqlite3MemdebugSetType(p, MEMTYPE_SCRATCH); + } + assert( sqlite3_mutex_notheld(mem0.mutex) ); + + #if SQLITE_THREADSAFE==0 && !defined(NDEBUG) - /* Verify that no more than one scratch allocation per thread - ** is outstanding at one time. (This is only checked in the + /* Verify that no more than two scratch allocations per thread + ** are outstanding at one time. (This is only checked in the ** single-threaded case since checking in the multi-threaded case ** would be much more complicated.) */ - assert( scratchAllocOut==0 ); -#endif - - if( sqlite3GlobalConfig.szScratch=1 && scratchAllocOut<=2 ); + scratchAllocOut--; #endif - if( sqlite3GlobalConfig.pScratch==0 - || p=(void*)mem0.aScratchFree ){ + if( p>=sqlite3GlobalConfig.pScratch && ppNext = mem0.pScratchFree; + mem0.pScratchFree = pSlot; + mem0.nScratchFree++; + assert( mem0.nScratchFree<=sqlite3GlobalConfig.nScratch ); + sqlite3StatusAdd(SQLITE_STATUS_SCRATCH_USED, -1); + sqlite3_mutex_leave(mem0.mutex); + }else{ + /* Release memory back to the heap */ + assert( sqlite3MemdebugHasType(p, MEMTYPE_SCRATCH) ); + assert( sqlite3MemdebugNoType(p, ~MEMTYPE_SCRATCH) ); + sqlite3MemdebugSetType(p, MEMTYPE_HEAP); if( sqlite3GlobalConfig.bMemstat ){ int iSize = sqlite3MallocSize(p); sqlite3_mutex_enter(mem0.mutex); sqlite3StatusAdd(SQLITE_STATUS_SCRATCH_OVERFLOW, -iSize); sqlite3StatusAdd(SQLITE_STATUS_MEMORY_USED, -iSize); + sqlite3StatusAdd(SQLITE_STATUS_MALLOC_COUNT, -1); sqlite3GlobalConfig.m.xFree(p); sqlite3_mutex_leave(mem0.mutex); }else{ sqlite3GlobalConfig.m.xFree(p); } - }else{ - int i; - i = (int)((u8*)p - (u8*)sqlite3GlobalConfig.pScratch); - i /= sqlite3GlobalConfig.szScratch; - assert( i>=0 && i=db->lookaside.pStart && plookaside.pEnd; + return p && p>=db->lookaside.pStart && plookaside.pEnd; } #else #define isLookaside(A,B) 0 @@ -16089,13 +18028,18 @@ static int isLookaside(sqlite3 *db, void *p){ ** sqlite3Malloc() or sqlite3_malloc(). */ SQLITE_PRIVATE int sqlite3MallocSize(void *p){ + assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) ); + assert( sqlite3MemdebugNoType(p, MEMTYPE_DB) ); return sqlite3GlobalConfig.m.xSize(p); } SQLITE_PRIVATE int sqlite3DbMallocSize(sqlite3 *db, void *p){ assert( db==0 || sqlite3_mutex_held(db->mutex) ); - if( isLookaside(db, p) ){ + if( db && isLookaside(db, p) ){ return db->lookaside.sz; }else{ + assert( sqlite3MemdebugHasType(p, MEMTYPE_DB) ); + assert( sqlite3MemdebugHasType(p, MEMTYPE_LOOKASIDE|MEMTYPE_HEAP) ); + assert( db!=0 || sqlite3MemdebugNoType(p, MEMTYPE_LOOKASIDE) ); return sqlite3GlobalConfig.m.xSize(p); } } @@ -16104,10 +18048,13 @@ SQLITE_PRIVATE int sqlite3DbMallocSize(sqlite3 *db, void *p){ ** Free memory previously obtained from sqlite3Malloc(). */ SQLITE_API void sqlite3_free(void *p){ - if( p==0 ) return; + if( p==0 ) return; /* IMP: R-49053-54554 */ + assert( sqlite3MemdebugNoType(p, MEMTYPE_DB) ); + assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) ); if( sqlite3GlobalConfig.bMemstat ){ sqlite3_mutex_enter(mem0.mutex); sqlite3StatusAdd(SQLITE_STATUS_MEMORY_USED, -sqlite3MallocSize(p)); + sqlite3StatusAdd(SQLITE_STATUS_MALLOC_COUNT, -1); sqlite3GlobalConfig.m.xFree(p); sqlite3_mutex_leave(mem0.mutex); }else{ @@ -16121,14 +18068,24 @@ SQLITE_API void sqlite3_free(void *p){ */ SQLITE_PRIVATE void sqlite3DbFree(sqlite3 *db, void *p){ assert( db==0 || sqlite3_mutex_held(db->mutex) ); - if( isLookaside(db, p) ){ - LookasideSlot *pBuf = (LookasideSlot*)p; - pBuf->pNext = db->lookaside.pFree; - db->lookaside.pFree = pBuf; - db->lookaside.nOut--; - }else{ - sqlite3_free(p); + if( db ){ + if( db->pnBytesFreed ){ + *db->pnBytesFreed += sqlite3DbMallocSize(db, p); + return; + } + if( isLookaside(db, p) ){ + LookasideSlot *pBuf = (LookasideSlot*)p; + pBuf->pNext = db->lookaside.pFree; + db->lookaside.pFree = pBuf; + db->lookaside.nOut--; + return; + } } + assert( sqlite3MemdebugHasType(p, MEMTYPE_DB) ); + assert( sqlite3MemdebugHasType(p, MEMTYPE_LOOKASIDE|MEMTYPE_HEAP) ); + assert( db!=0 || sqlite3MemdebugNoType(p, MEMTYPE_LOOKASIDE) ); + sqlite3MemdebugSetType(p, MEMTYPE_HEAP); + sqlite3_free(p); } /* @@ -16138,10 +18095,10 @@ SQLITE_PRIVATE void *sqlite3Realloc(void *pOld, int nBytes){ int nOld, nNew; void *pNew; if( pOld==0 ){ - return sqlite3Malloc(nBytes); + return sqlite3Malloc(nBytes); /* IMP: R-28354-25769 */ } if( nBytes<=0 ){ - sqlite3_free(pOld); + sqlite3_free(pOld); /* IMP: R-31593-10574 */ return 0; } if( nBytes>=0x7fffff00 ){ @@ -16149,6 +18106,9 @@ SQLITE_PRIVATE void *sqlite3Realloc(void *pOld, int nBytes){ return 0; } nOld = sqlite3MallocSize(pOld); + /* IMPLEMENTATION-OF: R-46199-30249 SQLite guarantees that the second + ** argument to xRealloc is always a value returned by a prior call to + ** xRoundup. */ nNew = sqlite3GlobalConfig.m.xRoundup(nBytes); if( nOld==nNew ){ pNew = pOld; @@ -16159,6 +18119,8 @@ SQLITE_PRIVATE void *sqlite3Realloc(void *pOld, int nBytes){ mem0.alarmThreshold ){ sqlite3MallocAlarm(nNew-nOld); } + assert( sqlite3MemdebugHasType(pOld, MEMTYPE_HEAP) ); + assert( sqlite3MemdebugNoType(pOld, ~MEMTYPE_HEAP) ); pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew); if( pNew==0 && mem0.alarmCallback ){ sqlite3MallocAlarm(nBytes); @@ -16172,6 +18134,7 @@ SQLITE_PRIVATE void *sqlite3Realloc(void *pOld, int nBytes){ }else{ pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew); } + assert( EIGHT_BYTE_ALIGNMENT(pNew) ); /* IMP: R-04675-44850 */ return pNew; } @@ -16231,6 +18194,7 @@ SQLITE_PRIVATE void *sqlite3DbMallocZero(sqlite3 *db, int n){ SQLITE_PRIVATE void *sqlite3DbMallocRaw(sqlite3 *db, int n){ void *p; assert( db==0 || sqlite3_mutex_held(db->mutex) ); + assert( db==0 || db->pnBytesFreed==0 ); #ifndef SQLITE_OMIT_LOOKASIDE if( db ){ LookasideSlot *pBuf; @@ -16256,6 +18220,8 @@ SQLITE_PRIVATE void *sqlite3DbMallocRaw(sqlite3 *db, int n){ if( !p && db ){ db->mallocFailed = 1; } + sqlite3MemdebugSetType(p, MEMTYPE_DB | + ((db && db->lookaside.bEnabled) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP)); return p; } @@ -16281,10 +18247,16 @@ SQLITE_PRIVATE void *sqlite3DbRealloc(sqlite3 *db, void *p, int n){ sqlite3DbFree(db, p); } }else{ + assert( sqlite3MemdebugHasType(p, MEMTYPE_DB) ); + assert( sqlite3MemdebugHasType(p, MEMTYPE_LOOKASIDE|MEMTYPE_HEAP) ); + sqlite3MemdebugSetType(p, MEMTYPE_HEAP); pNew = sqlite3_realloc(p, n); if( !pNew ){ + sqlite3MemdebugSetType(p, MEMTYPE_DB|MEMTYPE_HEAP); db->mallocFailed = 1; } + sqlite3MemdebugSetType(pNew, MEMTYPE_DB | + (db->lookaside.bEnabled ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP)); } } return pNew; @@ -16391,8 +18363,6 @@ SQLITE_PRIVATE int sqlite3ApiExit(sqlite3* db, int rc){ ** an historical reference. Most of the "enhancements" have been backed ** out so that the functionality is now the same as standard printf(). ** -** $Id: printf.c,v 1.104 2009/06/03 01:24:54 drh Exp $ -** ************************************************************************** ** ** The following modules is an enhanced replacement for the "printf" subroutines @@ -16847,7 +18817,9 @@ SQLITE_PRIVATE void sqlite3VXPrintf( case etEXP: case etGENERIC: realvalue = va_arg(ap,double); -#ifndef SQLITE_OMIT_FLOATING_POINT +#ifdef SQLITE_OMIT_FLOATING_POINT + length = 0; +#else if( precision<0 ) precision = 6; /* Set default precision */ if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10; if( realvalue<0.0 ){ @@ -16860,7 +18832,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf( } if( xtype==etGENERIC && precision>0 ) precision--; #if 0 - /* Rounding works like BSD when the constant 0.4999 is used. Weird! */ + /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */ for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1); #else /* It makes more sense to use 0.5 */ @@ -16993,7 +18965,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf( while( nPad-- ) bufpt[i++] = '0'; length = width; } -#endif +#endif /* !defined(SQLITE_OMIT_FLOATING_POINT) */ break; case etSIZE: *(va_arg(ap,int*)) = pAccum->nChar; @@ -17032,14 +19004,15 @@ SQLITE_PRIVATE void sqlite3VXPrintf( case etSQLESCAPE: case etSQLESCAPE2: case etSQLESCAPE3: { - int i, j, n, isnull; + int i, j, k, n, isnull; int needQuote; char ch; char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */ char *escarg = va_arg(ap,char*); isnull = escarg==0; if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); - for(i=n=0; (ch=escarg[i])!=0; i++){ + k = precision; + for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){ if( ch==q ) n++; } needQuote = !isnull && xtype==etSQLESCAPE2; @@ -17055,15 +19028,17 @@ SQLITE_PRIVATE void sqlite3VXPrintf( } j = 0; if( needQuote ) bufpt[j++] = q; - for(i=0; (ch=escarg[i])!=0; i++){ - bufpt[j++] = ch; + k = i; + for(i=0; i=0 && precision=0 && precisionnAlloc = (int)szNew; } - zNew = sqlite3DbMallocRaw(p->db, p->nAlloc ); + if( p->useMalloc==1 ){ + zNew = sqlite3DbMallocRaw(p->db, p->nAlloc ); + }else{ + zNew = sqlite3_malloc(p->nAlloc); + } if( zNew ){ memcpy(zNew, p->zText, p->nChar); sqlite3StrAccumReset(p); @@ -17179,7 +19158,11 @@ SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum *p){ if( p->zText ){ p->zText[p->nChar] = 0; if( p->useMalloc && p->zText==p->zBase ){ - p->zText = sqlite3DbMallocRaw(p->db, p->nChar+1 ); + if( p->useMalloc==1 ){ + p->zText = sqlite3DbMallocRaw(p->db, p->nChar+1 ); + }else{ + p->zText = sqlite3_malloc(p->nChar+1); + } if( p->zText ){ memcpy(p->zText, p->zBase, p->nChar+1); }else{ @@ -17195,7 +19178,11 @@ SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum *p){ */ SQLITE_PRIVATE void sqlite3StrAccumReset(StrAccum *p){ if( p->zText!=p->zBase ){ - sqlite3DbFree(p->db, p->zText); + if( p->useMalloc==1 ){ + sqlite3DbFree(p->db, p->zText); + }else{ + sqlite3_free(p->zText); + } } p->zText = 0; } @@ -17277,6 +19264,7 @@ SQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){ if( sqlite3_initialize() ) return 0; #endif sqlite3StrAccumInit(&acc, zBase, sizeof(zBase), SQLITE_MAX_LENGTH); + acc.useMalloc = 2; sqlite3VXPrintf(&acc, 0, zFormat, ap); z = sqlite3StrAccumFinish(&acc); return z; @@ -17321,6 +19309,38 @@ SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){ return z; } +/* +** This is the routine that actually formats the sqlite3_log() message. +** We house it in a separate routine from sqlite3_log() to avoid using +** stack space on small-stack systems when logging is disabled. +** +** sqlite3_log() must render into a static buffer. It cannot dynamically +** allocate memory because it might be called while the memory allocator +** mutex is held. +*/ +static void renderLogMsg(int iErrCode, const char *zFormat, va_list ap){ + StrAccum acc; /* String accumulator */ + char zMsg[SQLITE_PRINT_BUF_SIZE*3]; /* Complete log message */ + + sqlite3StrAccumInit(&acc, zMsg, sizeof(zMsg), 0); + acc.useMalloc = 0; + sqlite3VXPrintf(&acc, 0, zFormat, ap); + sqlite3GlobalConfig.xLog(sqlite3GlobalConfig.pLogArg, iErrCode, + sqlite3StrAccumFinish(&acc)); +} + +/* +** Format and write a message to the log if logging is enabled. +*/ +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){ + va_list ap; /* Vararg list */ + if( sqlite3GlobalConfig.xLog ){ + va_start(ap, zFormat); + renderLogMsg(iErrCode, zFormat, ap); + va_end(ap); + } +} + #if defined(SQLITE_DEBUG) /* ** A version of printf() that understands %lld. Used for debugging. @@ -17342,6 +19362,18 @@ SQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){ } #endif +#ifndef SQLITE_OMIT_TRACE +/* +** variable-argument wrapper around sqlite3VXPrintf(). +*/ +SQLITE_PRIVATE void sqlite3XPrintf(StrAccum *p, const char *zFormat, ...){ + va_list ap; + va_start(ap,zFormat); + sqlite3VXPrintf(p, 1, zFormat, ap); + va_end(ap); +} +#endif + /************** End of printf.c **********************************************/ /************** Begin file random.c ******************************************/ /* @@ -17360,8 +19392,6 @@ SQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){ ** ** Random numbers are used by some of the database backends in order ** to generate random integer keys for tables or random filenames. -** -** $Id: random.c,v 1.29 2008/12/10 19:26:24 drh Exp $ */ @@ -17507,8 +19537,6 @@ SQLITE_PRIVATE void sqlite3PrngResetState(void){ ** This file contains routines used to translate between UTF-8, ** UTF-16, UTF-16BE, and UTF-16LE. ** -** $Id: utf.c,v 1.73 2009/04/01 18:40:32 drh Exp $ -** ** Notes on UTF-8: ** ** Byte-0 Byte-1 Byte-2 Byte-3 Value @@ -17530,427 +19558,6 @@ SQLITE_PRIVATE void sqlite3PrngResetState(void){ ** 0xfe 0xff big-endian utf-16 follows ** */ -/************** Include vdbeInt.h in the middle of utf.c *********************/ -/************** Begin file vdbeInt.h *****************************************/ -/* -** 2003 September 6 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This is the header file for information that is private to the -** VDBE. This information used to all be at the top of the single -** source code file "vdbe.c". When that file became too big (over -** 6000 lines long) it was split up into several smaller files and -** this header information was factored out. -** -** $Id: vdbeInt.h,v 1.174 2009/06/23 14:15:04 drh Exp $ -*/ -#ifndef _VDBEINT_H_ -#define _VDBEINT_H_ - -/* -** SQL is translated into a sequence of instructions to be -** executed by a virtual machine. Each instruction is an instance -** of the following structure. -*/ -typedef struct VdbeOp Op; - -/* -** Boolean values -*/ -typedef unsigned char Bool; - -/* -** A cursor is a pointer into a single BTree within a database file. -** The cursor can seek to a BTree entry with a particular key, or -** loop over all entries of the Btree. You can also insert new BTree -** entries or retrieve the key or data from the entry that the cursor -** is currently pointing to. -** -** Every cursor that the virtual machine has open is represented by an -** instance of the following structure. -** -** If the VdbeCursor.isTriggerRow flag is set it means that this cursor is -** really a single row that represents the NEW or OLD pseudo-table of -** a row trigger. The data for the row is stored in VdbeCursor.pData and -** the rowid is in VdbeCursor.iKey. -*/ -struct VdbeCursor { - BtCursor *pCursor; /* The cursor structure of the backend */ - int iDb; /* Index of cursor database in db->aDb[] (or -1) */ - i64 lastRowid; /* Last rowid from a Next or NextIdx operation */ - Bool zeroed; /* True if zeroed out and ready for reuse */ - Bool rowidIsValid; /* True if lastRowid is valid */ - Bool atFirst; /* True if pointing to first entry */ - Bool useRandomRowid; /* Generate new record numbers semi-randomly */ - Bool nullRow; /* True if pointing to a row with no data */ - Bool deferredMoveto; /* A call to sqlite3BtreeMoveto() is needed */ - Bool isTable; /* True if a table requiring integer keys */ - Bool isIndex; /* True if an index containing keys only - no data */ - i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */ - Btree *pBt; /* Separate file holding temporary table */ - int pseudoTableReg; /* Register holding pseudotable content. */ - KeyInfo *pKeyInfo; /* Info about index keys needed by index cursors */ - int nField; /* Number of fields in the header */ - i64 seqCount; /* Sequence counter */ - sqlite3_vtab_cursor *pVtabCursor; /* The cursor for a virtual table */ - const sqlite3_module *pModule; /* Module for cursor pVtabCursor */ - - /* Result of last sqlite3BtreeMoveto() done by an OP_NotExists or - ** OP_IsUnique opcode on this cursor. */ - int seekResult; - - /* Cached information about the header for the data record that the - ** cursor is currently pointing to. Only valid if cacheStatus matches - ** Vdbe.cacheCtr. Vdbe.cacheCtr will never take on the value of - ** CACHE_STALE and so setting cacheStatus=CACHE_STALE guarantees that - ** the cache is out of date. - ** - ** aRow might point to (ephemeral) data for the current row, or it might - ** be NULL. - */ - u32 cacheStatus; /* Cache is valid if this matches Vdbe.cacheCtr */ - int payloadSize; /* Total number of bytes in the record */ - u32 *aType; /* Type values for all entries in the record */ - u32 *aOffset; /* Cached offsets to the start of each columns data */ - u8 *aRow; /* Data for the current row, if all on one page */ -}; -typedef struct VdbeCursor VdbeCursor; - -/* -** When a sub-program is executed (OP_Program), a structure of this type -** is allocated to store the current value of the program counter, as -** well as the current memory cell array and various other frame specific -** values stored in the Vdbe struct. When the sub-program is finished, -** these values are copied back to the Vdbe from the VdbeFrame structure, -** restoring the state of the VM to as it was before the sub-program -** began executing. -** -** Frames are stored in a linked list headed at Vdbe.pParent. Vdbe.pParent -** is the parent of the current frame, or zero if the current frame -** is the main Vdbe program. -*/ -typedef struct VdbeFrame VdbeFrame; -struct VdbeFrame { - Vdbe *v; /* VM this frame belongs to */ - int pc; /* Program Counter */ - Op *aOp; /* Program instructions */ - int nOp; /* Size of aOp array */ - Mem *aMem; /* Array of memory cells */ - int nMem; /* Number of entries in aMem */ - VdbeCursor **apCsr; /* Element of Vdbe cursors */ - u16 nCursor; /* Number of entries in apCsr */ - void *token; /* Copy of SubProgram.token */ - int nChildMem; /* Number of memory cells for child frame */ - int nChildCsr; /* Number of cursors for child frame */ - i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */ - int nChange; /* Statement changes (Vdbe.nChanges) */ - VdbeFrame *pParent; /* Parent of this frame */ -}; - -#define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))]) - -/* -** A value for VdbeCursor.cacheValid that means the cache is always invalid. -*/ -#define CACHE_STALE 0 - -/* -** Internally, the vdbe manipulates nearly all SQL values as Mem -** structures. Each Mem struct may cache multiple representations (string, -** integer etc.) of the same value. A value (and therefore Mem structure) -** has the following properties: -** -** Each value has a manifest type. The manifest type of the value stored -** in a Mem struct is returned by the MemType(Mem*) macro. The type is -** one of SQLITE_NULL, SQLITE_INTEGER, SQLITE_REAL, SQLITE_TEXT or -** SQLITE_BLOB. -*/ -struct Mem { - union { - i64 i; /* Integer value. */ - int nZero; /* Used when bit MEM_Zero is set in flags */ - FuncDef *pDef; /* Used only when flags==MEM_Agg */ - RowSet *pRowSet; /* Used only when flags==MEM_RowSet */ - VdbeFrame *pFrame; /* Used when flags==MEM_Frame */ - } u; - double r; /* Real value */ - sqlite3 *db; /* The associated database connection */ - char *z; /* String or BLOB value */ - int n; /* Number of characters in string value, excluding '\0' */ - u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */ - u8 type; /* One of SQLITE_NULL, SQLITE_TEXT, SQLITE_INTEGER, etc */ - u8 enc; /* SQLITE_UTF8, SQLITE_UTF16BE, SQLITE_UTF16LE */ - void (*xDel)(void *); /* If not null, call this function to delete Mem.z */ - char *zMalloc; /* Dynamic buffer allocated by sqlite3_malloc() */ -}; - -/* One or more of the following flags are set to indicate the validOK -** representations of the value stored in the Mem struct. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** No other flags may be set in this case. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. -** -** Multiple of these values can appear in Mem.flags. But only one -** at a time can appear in Mem.type. -*/ -#define MEM_Null 0x0001 /* Value is NULL */ -#define MEM_Str 0x0002 /* Value is a string */ -#define MEM_Int 0x0004 /* Value is an integer */ -#define MEM_Real 0x0008 /* Value is a real number */ -#define MEM_Blob 0x0010 /* Value is a BLOB */ -#define MEM_RowSet 0x0020 /* Value is a RowSet object */ -#define MEM_Frame 0x0040 /* Value is a VdbeFrame object */ -#define MEM_TypeMask 0x00ff /* Mask of type bits */ - -/* Whenever Mem contains a valid string or blob representation, one of -** the following flags must be set to determine the memory management -** policy for Mem.z. The MEM_Term flag tells us whether or not the -** string is \000 or \u0000 terminated -*/ -#define MEM_Term 0x0200 /* String rep is nul terminated */ -#define MEM_Dyn 0x0400 /* Need to call sqliteFree() on Mem.z */ -#define MEM_Static 0x0800 /* Mem.z points to a static string */ -#define MEM_Ephem 0x1000 /* Mem.z points to an ephemeral string */ -#define MEM_Agg 0x2000 /* Mem.z points to an agg function context */ -#define MEM_Zero 0x4000 /* Mem.i contains count of 0s appended to blob */ - -#ifdef SQLITE_OMIT_INCRBLOB - #undef MEM_Zero - #define MEM_Zero 0x0000 -#endif - - -/* -** Clear any existing type flags from a Mem and replace them with f -*/ -#define MemSetTypeFlag(p, f) \ - ((p)->flags = ((p)->flags&~(MEM_TypeMask|MEM_Zero))|f) - - -/* A VdbeFunc is just a FuncDef (defined in sqliteInt.h) that contains -** additional information about auxiliary information bound to arguments -** of the function. This is used to implement the sqlite3_get_auxdata() -** and sqlite3_set_auxdata() APIs. The "auxdata" is some auxiliary data -** that can be associated with a constant argument to a function. This -** allows functions such as "regexp" to compile their constant regular -** expression argument once and reused the compiled code for multiple -** invocations. -*/ -struct VdbeFunc { - FuncDef *pFunc; /* The definition of the function */ - int nAux; /* Number of entries allocated for apAux[] */ - struct AuxData { - void *pAux; /* Aux data for the i-th argument */ - void (*xDelete)(void *); /* Destructor for the aux data */ - } apAux[1]; /* One slot for each function argument */ -}; - -/* -** The "context" argument for a installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. -*/ -struct sqlite3_context { - FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ - VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */ - Mem s; /* The return value is stored here */ - Mem *pMem; /* Memory cell used to store aggregate context */ - int isError; /* Error code returned by the function. */ - CollSeq *pColl; /* Collating sequence */ -}; - -/* -** A Set structure is used for quick testing to see if a value -** is part of a small set. Sets are used to implement code like -** this: -** x.y IN ('hi','hoo','hum') -*/ -typedef struct Set Set; -struct Set { - Hash hash; /* A set is just a hash table */ - HashElem *prev; /* Previously accessed hash elemen */ -}; - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_compile() -** is really a pointer to an instance of this structure. -** -** The Vdbe.inVtabMethod variable is set to non-zero for the duration of -** any virtual table method invocations made by the vdbe program. It is -** set to 2 for xDestroy method calls and 1 for all other methods. This -** variable is used for two purposes: to allow xDestroy methods to execute -** "DROP TABLE" statements and to prevent some nasty side effects of -** malloc failure when SQLite is invoked recursively by a virtual table -** method function. -*/ -struct Vdbe { - sqlite3 *db; /* The database connection that owns this statement */ - Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */ - int nOp; /* Number of instructions in the program */ - int nOpAlloc; /* Number of slots allocated for aOp[] */ - Op *aOp; /* Space to hold the virtual machine's program */ - int nLabel; /* Number of labels used */ - int nLabelAlloc; /* Number of slots allocated in aLabel[] */ - int *aLabel; /* Space to hold the labels */ - Mem **apArg; /* Arguments to currently executing user function */ - Mem *aColName; /* Column names to return */ - Mem *pResultSet; /* Pointer to an array of results */ - u16 nResColumn; /* Number of columns in one row of the result set */ - u16 nCursor; /* Number of slots in apCsr[] */ - VdbeCursor **apCsr; /* One element of this array for each open cursor */ - u8 errorAction; /* Recovery action to do in case of an error */ - u8 okVar; /* True if azVar[] has been initialized */ - ynVar nVar; /* Number of entries in aVar[] */ - Mem *aVar; /* Values for the OP_Variable opcode. */ - char **azVar; /* Name of variables */ - u32 magic; /* Magic number for sanity checking */ - int nMem; /* Number of memory locations currently allocated */ - Mem *aMem; /* The memory locations */ - u32 cacheCtr; /* VdbeCursor row cache generation counter */ - int pc; /* The program counter */ - int rc; /* Value to return */ - char *zErrMsg; /* Error message written here */ - u8 explain; /* True if EXPLAIN present on SQL command */ - u8 changeCntOn; /* True to update the change-counter */ - u8 expired; /* True if the VM needs to be recompiled */ - u8 minWriteFileFormat; /* Minimum file format for writable database files */ - u8 inVtabMethod; /* See comments above */ - u8 usesStmtJournal; /* True if uses a statement journal */ - u8 readOnly; /* True for read-only statements */ - u8 isPrepareV2; /* True if prepared with prepare_v2() */ - int nChange; /* Number of db changes made since last reset */ - int btreeMask; /* Bitmask of db->aDb[] entries referenced */ - i64 startTime; /* Time when query started - used for profiling */ - BtreeMutexArray aMutex; /* An array of Btree used here and needing locks */ - int aCounter[2]; /* Counters used by sqlite3_stmt_status() */ - char *zSql; /* Text of the SQL statement that generated this */ - void *pFree; /* Free this when deleting the vdbe */ - i64 nFkConstraint; /* Number of imm. FK constraints this VM */ - i64 nStmtDefCons; /* Number of def. constraints when stmt started */ - int iStatement; /* Statement number (or 0 if has not opened stmt) */ -#ifdef SQLITE_DEBUG - FILE *trace; /* Write an execution trace here, if not NULL */ -#endif - VdbeFrame *pFrame; /* Parent frame */ - int nFrame; /* Number of frames in pFrame list */ - u32 expmask; /* Binding to these vars invalidates VM */ -}; - -/* -** The following are allowed values for Vdbe.magic -*/ -#define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */ -#define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */ -#define VDBE_MAGIC_HALT 0x519c2973 /* VDBE has completed execution */ -#define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */ - -/* -** Function prototypes -*/ -SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *, VdbeCursor*); -void sqliteVdbePopStack(Vdbe*,int); -SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor*); -#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE) -SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE*, int, Op*); -#endif -SQLITE_PRIVATE u32 sqlite3VdbeSerialTypeLen(u32); -SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem*, int); -SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int); -SQLITE_PRIVATE u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*); -SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc*, int); - -int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *); -SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(VdbeCursor*,UnpackedRecord*,int*); -SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor *, i64 *); -SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); -SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*); -SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*); -SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*); -SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int); -SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*); -SQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem*, const Mem*); -SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem*, const Mem*, int); -SQLITE_PRIVATE void sqlite3VdbeMemMove(Mem*, Mem*); -SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem*); -SQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*)); -SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem*, i64); -SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem*, double); -SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem*); -SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem*,int); -SQLITE_PRIVATE void sqlite3VdbeMemSetRowSet(Mem*); -SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem*); -SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem*, int); -SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem*); -SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem*); -SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem*); -SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem*); -SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem*); -SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem*); -SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*); -SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p); -SQLITE_PRIVATE void sqlite3VdbeMemReleaseExternal(Mem *p); -SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem*, FuncDef*); -SQLITE_PRIVATE const char *sqlite3OpcodeName(int); -SQLITE_PRIVATE int sqlite3VdbeOpcodeHasProperty(int, int); -SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve); -SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int); -SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame*); -SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *); -SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem); - -#ifndef SQLITE_OMIT_FOREIGN_KEY -SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *, int); -#else -# define sqlite3VdbeCheckFk(p,i) 0 -#endif - -#ifndef SQLITE_OMIT_SHARED_CACHE -SQLITE_PRIVATE void sqlite3VdbeMutexArrayEnter(Vdbe *p); -#else -# define sqlite3VdbeMutexArrayEnter(p) -#endif - -SQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem*, u8); -#ifdef SQLITE_DEBUG -SQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe*); -SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf); -#endif -SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem); - -#ifndef SQLITE_OMIT_INCRBLOB -SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *); -#else - #define sqlite3VdbeMemExpandBlob(x) SQLITE_OK -#endif - -#endif /* !defined(_VDBEINT_H_) */ - -/************** End of vdbeInt.h *********************************************/ -/************** Continuing where we left off in utf.c ************************/ #ifndef SQLITE_AMALGAMATION /* @@ -18352,11 +19959,11 @@ SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char *zIn){ ** ** NULL is returned if there is an allocation error. */ -SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte){ +SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){ Mem m; memset(&m, 0, sizeof(m)); m.db = db; - sqlite3VdbeMemSetStr(&m, z, nByte, SQLITE_UTF16NATIVE, SQLITE_STATIC); + sqlite3VdbeMemSetStr(&m, z, nByte, enc, SQLITE_STATIC); sqlite3VdbeChangeEncoding(&m, SQLITE_UTF8); if( db->mallocFailed ){ sqlite3VdbeMemRelease(&m); @@ -18364,7 +19971,9 @@ SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte){ } assert( (m.flags & MEM_Term)!=0 || db->mallocFailed ); assert( (m.flags & MEM_Str)!=0 || db->mallocFailed ); - return (m.flags & MEM_Dyn)!=0 ? m.z : sqlite3DbStrDup(db, m.z); + assert( (m.flags & MEM_Dyn)!=0 || db->mallocFailed ); + assert( m.z || db->mallocFailed ); + return m.z; } /* @@ -18505,6 +20114,7 @@ SQLITE_PRIVATE void sqlite3Coverage(int x){ } #endif +#ifndef SQLITE_OMIT_FLOATING_POINT /* ** Return true if the floating point value is Not a Number (NaN). ** @@ -18549,6 +20159,7 @@ SQLITE_PRIVATE int sqlite3IsNaN(double x){ testcase( rc ); return rc; } +#endif /* SQLITE_OMIT_FLOATING_POINT */ /* ** Compute a string length that is limited to what can be stored in @@ -18620,23 +20231,20 @@ SQLITE_PRIVATE void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ** (sqlite3_step() etc.). */ SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){ + char *zMsg; va_list ap; sqlite3 *db = pParse->db; - pParse->nErr++; - sqlite3DbFree(db, pParse->zErrMsg); va_start(ap, zFormat); - pParse->zErrMsg = sqlite3VMPrintf(db, zFormat, ap); + zMsg = sqlite3VMPrintf(db, zFormat, ap); va_end(ap); - pParse->rc = SQLITE_ERROR; -} - -/* -** Clear the error message in pParse, if any -*/ -SQLITE_PRIVATE void sqlite3ErrorClear(Parse *pParse){ - sqlite3DbFree(pParse->db, pParse->zErrMsg); - pParse->zErrMsg = 0; - pParse->nErr = 0; + if( db->suppressErr ){ + sqlite3DbFree(db, zMsg); + }else{ + pParse->nErr++; + sqlite3DbFree(db, pParse->zErrMsg); + pParse->zErrMsg = zMsg; + pParse->rc = SQLITE_ERROR; + } } /* @@ -18690,6 +20298,12 @@ SQLITE_PRIVATE int sqlite3Dequote(char *z){ /* ** Some systems have stricmp(). Others have strcasecmp(). Because ** there is no consistency, we will define our own. +** +** IMPLEMENTATION-OF: R-20522-24639 The sqlite3_strnicmp() API allows +** applications and extensions to compare the contents of two buffers +** containing UTF-8 strings in a case-independent fashion, using the same +** definition of case independence that SQLite uses internally when +** comparing identifiers. */ SQLITE_PRIVATE int sqlite3StrICmp(const char *zLeft, const char *zRight){ register unsigned char *a, *b; @@ -18707,119 +20321,111 @@ SQLITE_API int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){ } /* -** Return TRUE if z is a pure numeric string. Return FALSE and leave -** *realnum unchanged if the string contains any character which is not -** part of a number. +** The string z[] is an text representation of a real number. +** Convert this string to a double and write it into *pResult. ** -** If the string is pure numeric, set *realnum to TRUE if the string -** contains the '.' character or an "E+000" style exponentiation suffix. -** Otherwise set *realnum to FALSE. Note that just becaue *realnum is -** false does not mean that the number can be successfully converted into -** an integer - it might be too big. +** The string z[] is length bytes in length (bytes, not characters) and +** uses the encoding enc. The string is not necessarily zero-terminated. ** -** An empty string is considered non-numeric. +** Return TRUE if the result is a valid real number (or integer) and FALSE +** if the string is empty or contains extraneous text. Valid numbers +** are in one of these formats: +** +** [+-]digits[E[+-]digits] +** [+-]digits.[digits][E[+-]digits] +** [+-].digits[E[+-]digits] +** +** Leading and trailing whitespace is ignored for the purpose of determining +** validity. +** +** If some prefix of the input string is a valid number, this routine +** returns FALSE but it still converts the prefix and writes the result +** into *pResult. */ -SQLITE_PRIVATE int sqlite3IsNumber(const char *z, int *realnum, u8 enc){ - int incr = (enc==SQLITE_UTF8?1:2); - if( enc==SQLITE_UTF16BE ) z++; - if( *z=='-' || *z=='+' ) z += incr; - if( !sqlite3Isdigit(*z) ){ - return 0; - } - z += incr; - *realnum = 0; - while( sqlite3Isdigit(*z) ){ z += incr; } - if( *z=='.' ){ - z += incr; - if( !sqlite3Isdigit(*z) ) return 0; - while( sqlite3Isdigit(*z) ){ z += incr; } - *realnum = 1; - } - if( *z=='e' || *z=='E' ){ - z += incr; - if( *z=='+' || *z=='-' ) z += incr; - if( !sqlite3Isdigit(*z) ) return 0; - while( sqlite3Isdigit(*z) ){ z += incr; } - *realnum = 1; - } - return *z==0; -} - -/* -** The string z[] is an ASCII representation of a real number. -** Convert this string to a double. -** -** This routine assumes that z[] really is a valid number. If it -** is not, the result is undefined. -** -** This routine is used instead of the library atof() function because -** the library atof() might want to use "," as the decimal point instead -** of "." depending on how locale is set. But that would cause problems -** for SQL. So this routine always uses "." regardless of locale. -*/ -SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult){ +SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){ #ifndef SQLITE_OMIT_FLOATING_POINT - const char *zBegin = z; + int incr = (enc==SQLITE_UTF8?1:2); + const char *zEnd = z + length; /* sign * significand * (10 ^ (esign * exponent)) */ - int sign = 1; /* sign of significand */ - i64 s = 0; /* significand */ - int d = 0; /* adjust exponent for shifting decimal point */ - int esign = 1; /* sign of exponent */ - int e = 0; /* exponent */ + int sign = 1; /* sign of significand */ + i64 s = 0; /* significand */ + int d = 0; /* adjust exponent for shifting decimal point */ + int esign = 1; /* sign of exponent */ + int e = 0; /* exponent */ + int eValid = 1; /* True exponent is either not used or is well-formed */ double result; int nDigits = 0; + *pResult = 0.0; /* Default return value, in case of an error */ + + if( enc==SQLITE_UTF16BE ) z++; + /* skip leading spaces */ - while( sqlite3Isspace(*z) ) z++; + while( z=zEnd ) return 0; + /* get sign of significand */ if( *z=='-' ){ sign = -1; - z++; + z+=incr; }else if( *z=='+' ){ - z++; + z+=incr; } + /* skip leading zeroes */ - while( z[0]=='0' ) z++, nDigits++; + while( z=zEnd ) goto do_atof_calc; /* if decimal point is present */ if( *z=='.' ){ - z++; + z+=incr; /* copy digits from after decimal to significand ** (decrease exponent by d to shift decimal right) */ - while( sqlite3Isdigit(*z) && s<((LARGEST_INT64-9)/10) ){ + while( z=zEnd ) goto do_atof_calc; /* if exponent is present */ if( *z=='e' || *z=='E' ){ - z++; + z+=incr; + eValid = 0; + if( z>=zEnd ) goto do_atof_calc; /* get sign of exponent */ if( *z=='-' ){ esign = -1; - z++; + z+=incr; }else if( *z=='+' ){ - z++; + z+=incr; } /* copy digits to exponent */ - while( sqlite3Isdigit(*z) ){ + while( z=zEnd && nDigits>0 && eValid; #else - return sqlite3Atoi64(z, pResult); + return !sqlite3Atoi64(z, pResult, length, enc); #endif /* SQLITE_OMIT_FLOATING_POINT */ } @@ -18889,108 +20495,89 @@ SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult){ ** Compare the 19-character string zNum against the text representation ** value 2^63: 9223372036854775808. Return negative, zero, or positive ** if zNum is less than, equal to, or greater than the string. +** Note that zNum must contain exactly 19 characters. ** ** Unlike memcmp() this routine is guaranteed to return the difference ** in the values of the last digit if the only difference is in the ** last digit. So, for example, ** -** compare2pow63("9223372036854775800") +** compare2pow63("9223372036854775800", 1) ** ** will return -8. */ -static int compare2pow63(const char *zNum){ - int c; - c = memcmp(zNum,"922337203685477580",18)*10; +static int compare2pow63(const char *zNum, int incr){ + int c = 0; + int i; + /* 012345678901234567 */ + const char *pow63 = "922337203685477580"; + for(i=0; c==0 && i<18; i++){ + c = (zNum[i*incr]-pow63[i])*10; + } if( c==0 ){ - c = zNum[18] - '8'; + c = zNum[18*incr] - '8'; + testcase( c==(-1) ); + testcase( c==0 ); + testcase( c==(+1) ); } return c; } /* -** Return TRUE if zNum is a 64-bit signed integer and write -** the value of the integer into *pNum. If zNum is not an integer -** or is an integer that is too large to be expressed with 64 bits, -** then return false. +** Convert zNum to a 64-bit signed integer and write +** the value of the integer into *pNum. +** If zNum is exactly 9223372036854665808, return 2. +** This is a special case as the context will determine +** if it is too big (used as a negative). +** If zNum is not an integer or is an integer that +** is too large to be expressed with 64 bits, +** then return 1. Otherwise return 0. ** -** When this routine was originally written it dealt with only -** 32-bit numbers. At that time, it was much faster than the -** atoi() library routine in RedHat 7.2. +** length is the number of bytes in the string (bytes, not characters). +** The string is not necessarily zero-terminated. The encoding is +** given by enc. */ -SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum){ +SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum, int length, u8 enc){ + int incr = (enc==SQLITE_UTF8?1:2); i64 v = 0; - int neg; - int i, c; + int neg = 0; /* assume positive */ + int i; + int c = 0; const char *zStart; - while( sqlite3Isspace(*zNum) ) zNum++; + const char *zEnd = zNum + length; + if( enc==SQLITE_UTF16BE ) zNum++; + while( zNum=zEnd ) goto do_atoi_calc; if( *zNum=='-' ){ neg = 1; - zNum++; + zNum+=incr; }else if( *zNum=='+' ){ - neg = 0; - zNum++; - }else{ - neg = 0; + zNum+=incr; } +do_atoi_calc: zStart = zNum; - while( zNum[0]=='0' ){ zNum++; } /* Skip over leading zeros. Ticket #2454 */ - for(i=0; (c=zNum[i])>='0' && c<='9'; i++){ + while( zNum='0' && c<='9'; i+=incr){ v = v*10 + c - '0'; } *pNum = neg ? -v : v; - if( c!=0 || (i==0 && zStart==zNum) || i>19 ){ + testcase( i==18 ); + testcase( i==19 ); + testcase( i==20 ); + if( (c!=0 && &zNum[i]19*incr ){ /* zNum is empty or contains non-numeric text or is longer - ** than 19 digits (thus guaranting that it is too large) */ - return 0; - }else if( i<19 ){ - /* Less than 19 digits, so we know that it fits in 64 bits */ + ** than 19 digits (thus guaranteeing that it is too large) */ return 1; + }else if( i<19*incr ){ + /* Less than 19 digits, so we know that it fits in 64 bits */ + return 0; }else{ /* 19-digit numbers must be no larger than 9223372036854775807 if positive ** or 9223372036854775808 if negative. Note that 9223372036854665808 - ** is 2^63. */ - return compare2pow63(zNum)='0' && zNum[0]<='9' ); /* zNum is an unsigned number */ - - if( negFlag ) neg = 1-neg; - while( *zNum=='0' ){ - zNum++; /* Skip leading zeros. Ticket #2454 */ - } - for(i=0; zNum[i]; i++){ assert( zNum[i]>='0' && zNum[i]<='9' ); } - if( i<19 ){ - /* Guaranteed to fit if less than 19 digits */ - return 1; - }else if( i>19 ){ - /* Guaranteed to be too big if greater than 19 digits */ - return 0; - }else{ - /* Compare against 2^63. */ - return compare2pow63(zNum) 2147483648 */ + testcase( i==10 ); if( i>10 ){ return 0; } + testcase( v-neg==2147483647 ); if( v-neg>2147483647 ){ return 0; } @@ -19112,6 +20701,19 @@ SQLITE_PRIVATE int sqlite3PutVarint32(unsigned char *p, u32 v){ return sqlite3PutVarint(p, v); } +/* +** Bitmasks used by sqlite3GetVarint(). These precomputed constants +** are defined here rather than simply putting the constant expressions +** inline in order to work around bugs in the RVT compiler. +** +** SLOT_2_0 A mask for (0x7f<<14) | 0x7f +** +** SLOT_4_2_0 A mask for (0x7f<<28) | SLOT_2_0 +*/ +#define SLOT_2_0 0x001fc07f +#define SLOT_4_2_0 0xf01fc07f + + /* ** Read a 64-bit variable-length integer from memory starting at p[0]. ** Return the number of bytes read. The value is stored in *v. @@ -19139,13 +20741,17 @@ SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ return 2; } + /* Verify that constants are precomputed correctly */ + assert( SLOT_2_0 == ((0x7f<<14) | (0x7f)) ); + assert( SLOT_4_2_0 == ((0xfU<<28) | (0x7f<<14) | (0x7f)) ); + p++; a = a<<14; a |= *p; /* a: p0<<14 | p2 (unmasked) */ if (!(a&0x80)) { - a &= (0x7f<<14)|(0x7f); + a &= SLOT_2_0; b &= 0x7f; b = b<<7; a |= b; @@ -19154,14 +20760,14 @@ SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ } /* CSE1 from below */ - a &= (0x7f<<14)|(0x7f); + a &= SLOT_2_0; p++; b = b<<14; b |= *p; /* b: p1<<14 | p3 (unmasked) */ if (!(b&0x80)) { - b &= (0x7f<<14)|(0x7f); + b &= SLOT_2_0; /* moved CSE1 up */ /* a &= (0x7f<<14)|(0x7f); */ a = a<<7; @@ -19175,7 +20781,7 @@ SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ /* 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ /* moved CSE1 up */ /* a &= (0x7f<<14)|(0x7f); */ - b &= (0x7f<<14)|(0x7f); + b &= SLOT_2_0; s = a; /* s: p0<<14 | p2 (masked) */ @@ -19208,7 +20814,7 @@ SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ { /* we can skip this cause it was (effectively) done above in calc'ing s */ /* b &= (0x7f<<28)|(0x7f<<14)|(0x7f); */ - a &= (0x7f<<14)|(0x7f); + a &= SLOT_2_0; a = a<<7; a |= b; s = s>>18; @@ -19222,8 +20828,8 @@ SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ /* a: p2<<28 | p4<<14 | p6 (unmasked) */ if (!(a&0x80)) { - a &= (0x1f<<28)|(0x7f<<14)|(0x7f); - b &= (0x7f<<14)|(0x7f); + a &= SLOT_4_2_0; + b &= SLOT_2_0; b = b<<7; a |= b; s = s>>11; @@ -19232,14 +20838,14 @@ SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ } /* CSE2 from below */ - a &= (0x7f<<14)|(0x7f); + a &= SLOT_2_0; p++; b = b<<14; b |= *p; /* b: p3<<28 | p5<<14 | p7 (unmasked) */ if (!(b&0x80)) { - b &= (0x1f<<28)|(0x7f<<14)|(0x7f); + b &= SLOT_4_2_0; /* moved CSE2 up */ /* a &= (0x7f<<14)|(0x7f); */ a = a<<7; @@ -19256,7 +20862,7 @@ SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ /* moved CSE2 up */ /* a &= (0x7f<<29)|(0x7f<<15)|(0xff); */ - b &= (0x7f<<14)|(0x7f); + b &= SLOT_2_0; b = b<<8; a |= b; @@ -19376,9 +20982,9 @@ SQLITE_PRIVATE u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){ /* a: p0<<28 | p2<<14 | p4 (unmasked) */ if (!(a&0x80)) { - /* Walues between 268435456 and 34359738367 */ - a &= (0x1f<<28)|(0x7f<<14)|(0x7f); - b &= (0x1f<<28)|(0x7f<<14)|(0x7f); + /* Values between 268435456 and 34359738367 */ + a &= SLOT_4_2_0; + b &= SLOT_4_2_0; b = b<<7; *v = a | b; return 5; @@ -19471,64 +21077,17 @@ SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3 *db, const char *z, int n){ } #endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC */ - /* -** Change the sqlite.magic from SQLITE_MAGIC_OPEN to SQLITE_MAGIC_BUSY. -** Return an error (non-zero) if the magic was not SQLITE_MAGIC_OPEN -** when this routine is called. -** -** This routine is called when entering an SQLite API. The SQLITE_MAGIC_OPEN -** value indicates that the database connection passed into the API is -** open and is not being used by another thread. By changing the value -** to SQLITE_MAGIC_BUSY we indicate that the connection is in use. -** sqlite3SafetyOff() below will change the value back to SQLITE_MAGIC_OPEN -** when the API exits. -** -** This routine is a attempt to detect if two threads use the -** same sqlite* pointer at the same time. There is a race -** condition so it is possible that the error is not detected. -** But usually the problem will be seen. The result will be an -** error which can be used to debug the application that is -** using SQLite incorrectly. -** -** Ticket #202: If db->magic is not a valid open value, take care not -** to modify the db structure at all. It could be that db is a stale -** pointer. In other words, it could be that there has been a prior -** call to sqlite3_close(db) and db has been deallocated. And we do -** not want to write into deallocated memory. +** Log an error that is an API call on a connection pointer that should +** not have been used. The "type" of connection pointer is given as the +** argument. The zType is a word like "NULL" or "closed" or "invalid". */ -#ifdef SQLITE_DEBUG -SQLITE_PRIVATE int sqlite3SafetyOn(sqlite3 *db){ - if( db->magic==SQLITE_MAGIC_OPEN ){ - db->magic = SQLITE_MAGIC_BUSY; - assert( sqlite3_mutex_held(db->mutex) ); - return 0; - }else if( db->magic==SQLITE_MAGIC_BUSY ){ - db->magic = SQLITE_MAGIC_ERROR; - db->u1.isInterrupted = 1; - } - return 1; +static void logBadConnection(const char *zType){ + sqlite3_log(SQLITE_MISUSE, + "API call with %s database connection pointer", + zType + ); } -#endif - -/* -** Change the magic from SQLITE_MAGIC_BUSY to SQLITE_MAGIC_OPEN. -** Return an error (non-zero) if the magic was not SQLITE_MAGIC_BUSY -** when this routine is called. -*/ -#ifdef SQLITE_DEBUG -SQLITE_PRIVATE int sqlite3SafetyOff(sqlite3 *db){ - if( db->magic==SQLITE_MAGIC_BUSY ){ - db->magic = SQLITE_MAGIC_OPEN; - assert( sqlite3_mutex_held(db->mutex) ); - return 0; - }else{ - db->magic = SQLITE_MAGIC_ERROR; - db->u1.isInterrupted = 1; - return 1; - } -} -#endif /* ** Check to make sure we have a valid db pointer. This test is not @@ -19546,13 +21105,16 @@ SQLITE_PRIVATE int sqlite3SafetyOff(sqlite3 *db){ */ SQLITE_PRIVATE int sqlite3SafetyCheckOk(sqlite3 *db){ u32 magic; - if( db==0 ) return 0; + if( db==0 ){ + logBadConnection("NULL"); + return 0; + } magic = db->magic; - if( magic!=SQLITE_MAGIC_OPEN -#ifdef SQLITE_DEBUG - && magic!=SQLITE_MAGIC_BUSY -#endif - ){ + if( magic!=SQLITE_MAGIC_OPEN ){ + if( sqlite3SafetyCheckSickOrOk(db) ){ + testcase( sqlite3GlobalConfig.xLog!=0 ); + logBadConnection("unopened"); + } return 0; }else{ return 1; @@ -19563,8 +21125,13 @@ SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3 *db){ magic = db->magic; if( magic!=SQLITE_MAGIC_SICK && magic!=SQLITE_MAGIC_OPEN && - magic!=SQLITE_MAGIC_BUSY ) return 0; - return 1; + magic!=SQLITE_MAGIC_BUSY ){ + testcase( sqlite3GlobalConfig.xLog!=0 ); + logBadConnection("invalid"); + return 0; + }else{ + return 1; + } } /************** End of util.c ************************************************/ @@ -19582,8 +21149,6 @@ SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3 *db){ ************************************************************************* ** This is the implementation of generic hash-tables ** used in SQLite. -** -** $Id: hash.c,v 1.38 2009/05/09 23:29:12 drh Exp $ */ /* Turn bulk memory into a hash table object by initializing the @@ -19893,39 +21458,39 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ /* 37 */ "VerifyCookie", /* 38 */ "OpenRead", /* 39 */ "OpenWrite", - /* 40 */ "OpenEphemeral", - /* 41 */ "OpenPseudo", - /* 42 */ "Close", - /* 43 */ "SeekLt", - /* 44 */ "SeekLe", - /* 45 */ "SeekGe", - /* 46 */ "SeekGt", - /* 47 */ "Seek", - /* 48 */ "NotFound", - /* 49 */ "Found", - /* 50 */ "IsUnique", - /* 51 */ "NotExists", - /* 52 */ "Sequence", - /* 53 */ "NewRowid", - /* 54 */ "Insert", - /* 55 */ "InsertInt", - /* 56 */ "Delete", - /* 57 */ "ResetCount", - /* 58 */ "RowKey", - /* 59 */ "RowData", - /* 60 */ "Rowid", - /* 61 */ "NullRow", - /* 62 */ "Last", - /* 63 */ "Sort", - /* 64 */ "Rewind", - /* 65 */ "Prev", - /* 66 */ "Next", - /* 67 */ "IdxInsert", + /* 40 */ "OpenAutoindex", + /* 41 */ "OpenEphemeral", + /* 42 */ "OpenPseudo", + /* 43 */ "Close", + /* 44 */ "SeekLt", + /* 45 */ "SeekLe", + /* 46 */ "SeekGe", + /* 47 */ "SeekGt", + /* 48 */ "Seek", + /* 49 */ "NotFound", + /* 50 */ "Found", + /* 51 */ "IsUnique", + /* 52 */ "NotExists", + /* 53 */ "Sequence", + /* 54 */ "NewRowid", + /* 55 */ "Insert", + /* 56 */ "InsertInt", + /* 57 */ "Delete", + /* 58 */ "ResetCount", + /* 59 */ "RowKey", + /* 60 */ "RowData", + /* 61 */ "Rowid", + /* 62 */ "NullRow", + /* 63 */ "Last", + /* 64 */ "Sort", + /* 65 */ "Rewind", + /* 66 */ "Prev", + /* 67 */ "Next", /* 68 */ "Or", /* 69 */ "And", - /* 70 */ "IdxDelete", - /* 71 */ "IdxRowid", - /* 72 */ "IdxLT", + /* 70 */ "IdxInsert", + /* 71 */ "IdxDelete", + /* 72 */ "IdxRowid", /* 73 */ "IsNull", /* 74 */ "NotNull", /* 75 */ "Ne", @@ -19934,7 +21499,7 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ /* 78 */ "Le", /* 79 */ "Lt", /* 80 */ "Ge", - /* 81 */ "IdxGE", + /* 81 */ "IdxLT", /* 82 */ "BitAnd", /* 83 */ "BitOr", /* 84 */ "ShiftLeft", @@ -19945,52 +21510,52 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ /* 89 */ "Divide", /* 90 */ "Remainder", /* 91 */ "Concat", - /* 92 */ "Destroy", + /* 92 */ "IdxGE", /* 93 */ "BitNot", /* 94 */ "String8", - /* 95 */ "Clear", - /* 96 */ "CreateIndex", - /* 97 */ "CreateTable", - /* 98 */ "ParseSchema", - /* 99 */ "LoadAnalysis", - /* 100 */ "DropTable", - /* 101 */ "DropIndex", - /* 102 */ "DropTrigger", - /* 103 */ "IntegrityCk", - /* 104 */ "RowSetAdd", - /* 105 */ "RowSetRead", - /* 106 */ "RowSetTest", - /* 107 */ "Program", - /* 108 */ "Param", - /* 109 */ "FkCounter", - /* 110 */ "FkIfZero", - /* 111 */ "MemMax", - /* 112 */ "IfPos", - /* 113 */ "IfNeg", - /* 114 */ "IfZero", - /* 115 */ "AggStep", - /* 116 */ "AggFinal", - /* 117 */ "Vacuum", - /* 118 */ "IncrVacuum", - /* 119 */ "Expire", - /* 120 */ "TableLock", - /* 121 */ "VBegin", - /* 122 */ "VCreate", - /* 123 */ "VDestroy", - /* 124 */ "VOpen", - /* 125 */ "VFilter", - /* 126 */ "VColumn", - /* 127 */ "VNext", - /* 128 */ "VRename", - /* 129 */ "VUpdate", + /* 95 */ "Destroy", + /* 96 */ "Clear", + /* 97 */ "CreateIndex", + /* 98 */ "CreateTable", + /* 99 */ "ParseSchema", + /* 100 */ "LoadAnalysis", + /* 101 */ "DropTable", + /* 102 */ "DropIndex", + /* 103 */ "DropTrigger", + /* 104 */ "IntegrityCk", + /* 105 */ "RowSetAdd", + /* 106 */ "RowSetRead", + /* 107 */ "RowSetTest", + /* 108 */ "Program", + /* 109 */ "Param", + /* 110 */ "FkCounter", + /* 111 */ "FkIfZero", + /* 112 */ "MemMax", + /* 113 */ "IfPos", + /* 114 */ "IfNeg", + /* 115 */ "IfZero", + /* 116 */ "AggStep", + /* 117 */ "AggFinal", + /* 118 */ "Checkpoint", + /* 119 */ "JournalMode", + /* 120 */ "Vacuum", + /* 121 */ "IncrVacuum", + /* 122 */ "Expire", + /* 123 */ "TableLock", + /* 124 */ "VBegin", + /* 125 */ "VCreate", + /* 126 */ "VDestroy", + /* 127 */ "VOpen", + /* 128 */ "VFilter", + /* 129 */ "VColumn", /* 130 */ "Real", - /* 131 */ "Pagecount", - /* 132 */ "Trace", - /* 133 */ "Noop", - /* 134 */ "Explain", - /* 135 */ "NotUsed_135", - /* 136 */ "NotUsed_136", - /* 137 */ "NotUsed_137", + /* 131 */ "VNext", + /* 132 */ "VRename", + /* 133 */ "VUpdate", + /* 134 */ "Pagecount", + /* 135 */ "Trace", + /* 136 */ "Noop", + /* 137 */ "Explain", /* 138 */ "NotUsed_138", /* 139 */ "NotUsed_139", /* 140 */ "NotUsed_140", @@ -20019,8 +21584,6 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ ****************************************************************************** ** ** This file contains code that is specific to OS/2. -** -** $Id: os_os2.c,v 1.63 2008/12/10 19:26:24 drh Exp $ */ @@ -20082,8 +21645,6 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ ** ** This file should be #included by the os_*.c files only. It is not a ** general purpose header file. -** -** $Id: os_common.h,v 1.38 2009/02/24 18:40:50 danielk1977 Exp $ */ #ifndef _OS_COMMON_H_ #define _OS_COMMON_H_ @@ -20099,23 +21660,9 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ #ifdef SQLITE_DEBUG SQLITE_PRIVATE int sqlite3OSTrace = 0; -#define OSTRACE1(X) if( sqlite3OSTrace ) sqlite3DebugPrintf(X) -#define OSTRACE2(X,Y) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y) -#define OSTRACE3(X,Y,Z) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y,Z) -#define OSTRACE4(X,Y,Z,A) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y,Z,A) -#define OSTRACE5(X,Y,Z,A,B) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y,Z,A,B) -#define OSTRACE6(X,Y,Z,A,B,C) \ - if(sqlite3OSTrace) sqlite3DebugPrintf(X,Y,Z,A,B,C) -#define OSTRACE7(X,Y,Z,A,B,C,D) \ - if(sqlite3OSTrace) sqlite3DebugPrintf(X,Y,Z,A,B,C,D) +#define OSTRACE(X) if( sqlite3OSTrace ) sqlite3DebugPrintf X #else -#define OSTRACE1(X) -#define OSTRACE2(X,Y) -#define OSTRACE3(X,Y,Z) -#define OSTRACE4(X,Y,Z,A) -#define OSTRACE5(X,Y,Z,A,B) -#define OSTRACE6(X,Y,Z,A,B,C) -#define OSTRACE7(X,Y,Z,A,B,C,D) +#define OSTRACE(X) #endif /* @@ -20144,8 +21691,6 @@ SQLITE_PRIVATE int sqlite3OSTrace = 0; ** ** This file contains inline asm code for retrieving "high-performance" ** counters for x86 class CPUs. -** -** $Id: hwtime.h,v 1.3 2008/08/01 14:33:15 shane Exp $ */ #ifndef _HWTIME_H_ #define _HWTIME_H_ @@ -20313,7 +21858,7 @@ static int os2Close( sqlite3_file *id ){ APIRET rc = NO_ERROR; os2File *pFile; if( id && (pFile = (os2File*)id) != 0 ){ - OSTRACE2( "CLOSE %d\n", pFile->h ); + OSTRACE(( "CLOSE %d\n", pFile->h )); rc = DosClose( pFile->h ); pFile->locktype = NO_LOCK; if( pFile->pathToDel != NULL ){ @@ -20344,7 +21889,7 @@ static int os2Read( os2File *pFile = (os2File*)id; assert( id!=0 ); SimulateIOError( return SQLITE_IOERR_READ ); - OSTRACE3( "READ %d lock=%d\n", pFile->h, pFile->locktype ); + OSTRACE(( "READ %d lock=%d\n", pFile->h, pFile->locktype )); if( DosSetFilePtr(pFile->h, offset, FILE_BEGIN, &fileLocation) != NO_ERROR ){ return SQLITE_IOERR; } @@ -20377,7 +21922,7 @@ static int os2Write( assert( id!=0 ); SimulateIOError( return SQLITE_IOERR_WRITE ); SimulateDiskfullError( return SQLITE_FULL ); - OSTRACE3( "WRITE %d lock=%d\n", pFile->h, pFile->locktype ); + OSTRACE(( "WRITE %d lock=%d\n", pFile->h, pFile->locktype )); if( DosSetFilePtr(pFile->h, offset, FILE_BEGIN, &fileLocation) != NO_ERROR ){ return SQLITE_IOERR; } @@ -20399,7 +21944,7 @@ static int os2Write( static int os2Truncate( sqlite3_file *id, i64 nByte ){ APIRET rc = NO_ERROR; os2File *pFile = (os2File*)id; - OSTRACE3( "TRUNCATE %d %lld\n", pFile->h, nByte ); + OSTRACE(( "TRUNCATE %d %lld\n", pFile->h, nByte )); SimulateIOError( return SQLITE_IOERR_TRUNCATE ); rc = DosSetFileSize( pFile->h, nByte ); return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR_TRUNCATE; @@ -20419,7 +21964,7 @@ SQLITE_API int sqlite3_fullsync_count = 0; */ static int os2Sync( sqlite3_file *id, int flags ){ os2File *pFile = (os2File*)id; - OSTRACE3( "SYNC %d lock=%d\n", pFile->h, pFile->locktype ); + OSTRACE(( "SYNC %d lock=%d\n", pFile->h, pFile->locktype )); #ifdef SQLITE_TEST if( flags & SQLITE_SYNC_FULL){ sqlite3_fullsync_count++; @@ -20469,7 +22014,7 @@ static int getReadLock( os2File *pFile ){ UnlockArea.lOffset = 0L; UnlockArea.lRange = 0L; res = DosSetFileLocks( pFile->h, &UnlockArea, &LockArea, LOCK_TIMEOUT, 1L ); - OSTRACE3( "GETREADLOCK %d res=%d\n", pFile->h, res ); + OSTRACE(( "GETREADLOCK %d res=%d\n", pFile->h, res )); return res; } @@ -20487,7 +22032,7 @@ static int unlockReadLock( os2File *id ){ UnlockArea.lOffset = SHARED_FIRST; UnlockArea.lRange = SHARED_SIZE; res = DosSetFileLocks( id->h, &UnlockArea, &LockArea, LOCK_TIMEOUT, 1L ); - OSTRACE3( "UNLOCK-READLOCK file handle=%d res=%d?\n", id->h, res ); + OSTRACE(( "UNLOCK-READLOCK file handle=%d res=%d?\n", id->h, res )); return res; } @@ -20528,14 +22073,14 @@ static int os2Lock( sqlite3_file *id, int locktype ){ memset(&LockArea, 0, sizeof(LockArea)); memset(&UnlockArea, 0, sizeof(UnlockArea)); assert( pFile!=0 ); - OSTRACE4( "LOCK %d %d was %d\n", pFile->h, locktype, pFile->locktype ); + OSTRACE(( "LOCK %d %d was %d\n", pFile->h, locktype, pFile->locktype )); /* If there is already a lock of this type or more restrictive on the ** os2File, do nothing. Don't use the end_lock: exit path, as ** sqlite3_mutex_enter() hasn't been called yet. */ if( pFile->locktype>=locktype ){ - OSTRACE3( "LOCK %d %d ok (already held)\n", pFile->h, locktype ); + OSTRACE(( "LOCK %d %d ok (already held)\n", pFile->h, locktype )); return SQLITE_OK; } @@ -20562,7 +22107,7 @@ static int os2Lock( sqlite3_file *id, int locktype ){ res = DosSetFileLocks( pFile->h, &UnlockArea, &LockArea, 100L, 0L ); if( res == NO_ERROR ){ gotPendingLock = 1; - OSTRACE3( "LOCK %d pending lock boolean set. res=%d\n", pFile->h, res ); + OSTRACE(( "LOCK %d pending lock boolean set. res=%d\n", pFile->h, res )); } } @@ -20574,7 +22119,7 @@ static int os2Lock( sqlite3_file *id, int locktype ){ if( res == NO_ERROR ){ newLocktype = SHARED_LOCK; } - OSTRACE3( "LOCK %d acquire shared lock. res=%d\n", pFile->h, res ); + OSTRACE(( "LOCK %d acquire shared lock. res=%d\n", pFile->h, res )); } /* Acquire a RESERVED lock @@ -20589,7 +22134,7 @@ static int os2Lock( sqlite3_file *id, int locktype ){ if( res == NO_ERROR ){ newLocktype = RESERVED_LOCK; } - OSTRACE3( "LOCK %d acquire reserved lock. res=%d\n", pFile->h, res ); + OSTRACE(( "LOCK %d acquire reserved lock. res=%d\n", pFile->h, res )); } /* Acquire a PENDING lock @@ -20597,7 +22142,8 @@ static int os2Lock( sqlite3_file *id, int locktype ){ if( locktype==EXCLUSIVE_LOCK && res == NO_ERROR ){ newLocktype = PENDING_LOCK; gotPendingLock = 0; - OSTRACE2( "LOCK %d acquire pending lock. pending lock boolean unset.\n", pFile->h ); + OSTRACE(( "LOCK %d acquire pending lock. pending lock boolean unset.\n", + pFile->h )); } /* Acquire an EXCLUSIVE lock @@ -20605,7 +22151,7 @@ static int os2Lock( sqlite3_file *id, int locktype ){ if( locktype==EXCLUSIVE_LOCK && res == NO_ERROR ){ assert( pFile->locktype>=SHARED_LOCK ); res = unlockReadLock(pFile); - OSTRACE2( "unreadlock = %d\n", res ); + OSTRACE(( "unreadlock = %d\n", res )); LockArea.lOffset = SHARED_FIRST; LockArea.lRange = SHARED_SIZE; UnlockArea.lOffset = 0L; @@ -20614,10 +22160,10 @@ static int os2Lock( sqlite3_file *id, int locktype ){ if( res == NO_ERROR ){ newLocktype = EXCLUSIVE_LOCK; }else{ - OSTRACE2( "OS/2 error-code = %d\n", res ); + OSTRACE(( "OS/2 error-code = %d\n", res )); getReadLock(pFile); } - OSTRACE3( "LOCK %d acquire exclusive lock. res=%d\n", pFile->h, res ); + OSTRACE(( "LOCK %d acquire exclusive lock. res=%d\n", pFile->h, res )); } /* If we are holding a PENDING lock that ought to be released, then @@ -20630,7 +22176,7 @@ static int os2Lock( sqlite3_file *id, int locktype ){ UnlockArea.lOffset = PENDING_BYTE; UnlockArea.lRange = 1L; r = DosSetFileLocks( pFile->h, &UnlockArea, &LockArea, LOCK_TIMEOUT, 0L ); - OSTRACE3( "LOCK %d unlocking pending/is shared. r=%d\n", pFile->h, r ); + OSTRACE(( "LOCK %d unlocking pending/is shared. r=%d\n", pFile->h, r )); } /* Update the state of the lock has held in the file descriptor then @@ -20639,12 +22185,12 @@ static int os2Lock( sqlite3_file *id, int locktype ){ if( res == NO_ERROR ){ rc = SQLITE_OK; }else{ - OSTRACE4( "LOCK FAILED %d trying for %d but got %d\n", pFile->h, - locktype, newLocktype ); + OSTRACE(( "LOCK FAILED %d trying for %d but got %d\n", pFile->h, + locktype, newLocktype )); rc = SQLITE_BUSY; } pFile->locktype = newLocktype; - OSTRACE3( "LOCK %d now %d\n", pFile->h, pFile->locktype ); + OSTRACE(( "LOCK %d now %d\n", pFile->h, pFile->locktype )); return rc; } @@ -20659,7 +22205,7 @@ static int os2CheckReservedLock( sqlite3_file *id, int *pOut ){ assert( pFile!=0 ); if( pFile->locktype>=RESERVED_LOCK ){ r = 1; - OSTRACE3( "TEST WR-LOCK %d %d (local)\n", pFile->h, r ); + OSTRACE(( "TEST WR-LOCK %d %d (local)\n", pFile->h, r )); }else{ FILELOCK LockArea, UnlockArea; @@ -20671,7 +22217,7 @@ static int os2CheckReservedLock( sqlite3_file *id, int *pOut ){ UnlockArea.lOffset = 0L; UnlockArea.lRange = 0L; rc = DosSetFileLocks( pFile->h, &UnlockArea, &LockArea, LOCK_TIMEOUT, 0L ); - OSTRACE3( "TEST WR-LOCK %d lock reserved byte rc=%d\n", pFile->h, rc ); + OSTRACE(( "TEST WR-LOCK %d lock reserved byte rc=%d\n", pFile->h, rc )); if( rc == NO_ERROR ){ APIRET rcu = NO_ERROR; /* return code for unlocking */ LockArea.lOffset = 0L; @@ -20679,10 +22225,10 @@ static int os2CheckReservedLock( sqlite3_file *id, int *pOut ){ UnlockArea.lOffset = RESERVED_BYTE; UnlockArea.lRange = 1L; rcu = DosSetFileLocks( pFile->h, &UnlockArea, &LockArea, LOCK_TIMEOUT, 0L ); - OSTRACE3( "TEST WR-LOCK %d unlock reserved byte r=%d\n", pFile->h, rcu ); + OSTRACE(( "TEST WR-LOCK %d unlock reserved byte r=%d\n", pFile->h, rcu )); } r = !(rc == NO_ERROR); - OSTRACE3( "TEST WR-LOCK %d %d (remote)\n", pFile->h, r ); + OSTRACE(( "TEST WR-LOCK %d %d (remote)\n", pFile->h, r )); } *pOut = r; return SQLITE_OK; @@ -20710,7 +22256,7 @@ static int os2Unlock( sqlite3_file *id, int locktype ){ memset(&UnlockArea, 0, sizeof(UnlockArea)); assert( pFile!=0 ); assert( locktype<=SHARED_LOCK ); - OSTRACE4( "UNLOCK %d to %d was %d\n", pFile->h, locktype, pFile->locktype ); + OSTRACE(( "UNLOCK %d to %d was %d\n", pFile->h, locktype, pFile->locktype )); type = pFile->locktype; if( type>=EXCLUSIVE_LOCK ){ LockArea.lOffset = 0L; @@ -20718,11 +22264,11 @@ static int os2Unlock( sqlite3_file *id, int locktype ){ UnlockArea.lOffset = SHARED_FIRST; UnlockArea.lRange = SHARED_SIZE; res = DosSetFileLocks( pFile->h, &UnlockArea, &LockArea, LOCK_TIMEOUT, 0L ); - OSTRACE3( "UNLOCK %d exclusive lock res=%d\n", pFile->h, res ); + OSTRACE(( "UNLOCK %d exclusive lock res=%d\n", pFile->h, res )); if( locktype==SHARED_LOCK && getReadLock(pFile) != NO_ERROR ){ /* This should never happen. We should always be able to ** reacquire the read lock */ - OSTRACE3( "UNLOCK %d to %d getReadLock() failed\n", pFile->h, locktype ); + OSTRACE(( "UNLOCK %d to %d getReadLock() failed\n", pFile->h, locktype )); rc = SQLITE_IOERR_UNLOCK; } } @@ -20732,11 +22278,12 @@ static int os2Unlock( sqlite3_file *id, int locktype ){ UnlockArea.lOffset = RESERVED_BYTE; UnlockArea.lRange = 1L; res = DosSetFileLocks( pFile->h, &UnlockArea, &LockArea, LOCK_TIMEOUT, 0L ); - OSTRACE3( "UNLOCK %d reserved res=%d\n", pFile->h, res ); + OSTRACE(( "UNLOCK %d reserved res=%d\n", pFile->h, res )); } if( locktype==NO_LOCK && type>=SHARED_LOCK ){ res = unlockReadLock(pFile); - OSTRACE5( "UNLOCK %d is %d want %d res=%d\n", pFile->h, type, locktype, res ); + OSTRACE(( "UNLOCK %d is %d want %d res=%d\n", + pFile->h, type, locktype, res )); } if( type>=PENDING_LOCK ){ LockArea.lOffset = 0L; @@ -20744,10 +22291,10 @@ static int os2Unlock( sqlite3_file *id, int locktype ){ UnlockArea.lOffset = PENDING_BYTE; UnlockArea.lRange = 1L; res = DosSetFileLocks( pFile->h, &UnlockArea, &LockArea, LOCK_TIMEOUT, 0L ); - OSTRACE3( "UNLOCK %d pending res=%d\n", pFile->h, res ); + OSTRACE(( "UNLOCK %d pending res=%d\n", pFile->h, res )); } pFile->locktype = locktype; - OSTRACE3( "UNLOCK %d now %d\n", pFile->h, pFile->locktype ); + OSTRACE(( "UNLOCK %d now %d\n", pFile->h, pFile->locktype )); return rc; } @@ -20758,7 +22305,8 @@ static int os2FileControl(sqlite3_file *id, int op, void *pArg){ switch( op ){ case SQLITE_FCNTL_LOCKSTATE: { *(int*)pArg = ((os2File*)id)->locktype; - OSTRACE3( "FCNTL_LOCKSTATE %d lock=%d\n", ((os2File*)id)->h, ((os2File*)id)->locktype ); + OSTRACE(( "FCNTL_LOCKSTATE %d lock=%d\n", + ((os2File*)id)->h, ((os2File*)id)->locktype )); return SQLITE_OK; } } @@ -20945,7 +22493,7 @@ static int getTempname(int nBuf, char *zBuf ){ zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; } zBuf[j] = 0; - OSTRACE2( "TEMP FILENAME: %s\n", zBuf ); + OSTRACE(( "TEMP FILENAME: %s\n", zBuf )); return SQLITE_OK; } @@ -21008,30 +22556,30 @@ static int os2Open( memset( pFile, 0, sizeof(*pFile) ); - OSTRACE2( "OPEN want %d\n", flags ); + OSTRACE(( "OPEN want %d\n", flags )); if( flags & SQLITE_OPEN_READWRITE ){ ulOpenMode |= OPEN_ACCESS_READWRITE; - OSTRACE1( "OPEN read/write\n" ); + OSTRACE(( "OPEN read/write\n" )); }else{ ulOpenMode |= OPEN_ACCESS_READONLY; - OSTRACE1( "OPEN read only\n" ); + OSTRACE(( "OPEN read only\n" )); } if( flags & SQLITE_OPEN_CREATE ){ ulOpenFlags |= OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW; - OSTRACE1( "OPEN open new/create\n" ); + OSTRACE(( "OPEN open new/create\n" )); }else{ ulOpenFlags |= OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW; - OSTRACE1( "OPEN open existing\n" ); + OSTRACE(( "OPEN open existing\n" )); } if( flags & SQLITE_OPEN_MAIN_DB ){ ulOpenMode |= OPEN_SHARE_DENYNONE; - OSTRACE1( "OPEN share read/write\n" ); + OSTRACE(( "OPEN share read/write\n" )); }else{ ulOpenMode |= OPEN_SHARE_DENYWRITE; - OSTRACE1( "OPEN share read only\n" ); + OSTRACE(( "OPEN share read only\n" )); } if( flags & SQLITE_OPEN_DELETEONCLOSE ){ @@ -21041,10 +22589,10 @@ static int os2Open( #endif os2FullPathname( pVfs, zName, CCHMAXPATH, pathUtf8 ); pFile->pathToDel = convertUtf8PathToCp( pathUtf8 ); - OSTRACE1( "OPEN hidden/delete on close file attributes\n" ); + OSTRACE(( "OPEN hidden/delete on close file attributes\n" )); }else{ pFile->pathToDel = NULL; - OSTRACE1( "OPEN normal file attribute\n" ); + OSTRACE(( "OPEN normal file attribute\n" )); } /* always open in random access mode for possibly better speed */ @@ -21063,13 +22611,14 @@ static int os2Open( (PEAOP2)NULL ); free( zNameCp ); if( rc != NO_ERROR ){ - OSTRACE7( "OPEN Invalid handle rc=%d: zName=%s, ulAction=%#lx, ulAttr=%#lx, ulFlags=%#lx, ulMode=%#lx\n", - rc, zName, ulAction, ulFileAttribute, ulOpenFlags, ulOpenMode ); + OSTRACE(( "OPEN Invalid handle rc=%d: zName=%s, ulAction=%#lx, ulAttr=%#lx, ulFlags=%#lx, ulMode=%#lx\n", + rc, zName, ulAction, ulFileAttribute, ulOpenFlags, ulOpenMode )); if( pFile->pathToDel ) free( pFile->pathToDel ); pFile->pathToDel = NULL; if( flags & SQLITE_OPEN_READWRITE ){ - OSTRACE2( "OPEN %d Invalid handle\n", ((flags | SQLITE_OPEN_READONLY) & ~SQLITE_OPEN_READWRITE) ); + OSTRACE(( "OPEN %d Invalid handle\n", + ((flags | SQLITE_OPEN_READONLY) & ~SQLITE_OPEN_READWRITE) )); return os2Open( pVfs, zName, id, ((flags | SQLITE_OPEN_READONLY) & ~SQLITE_OPEN_READWRITE), pOutFlags ); @@ -21085,7 +22634,7 @@ static int os2Open( pFile->pMethod = &os2IoMethod; pFile->h = h; OpenCounter(+1); - OSTRACE3( "OPEN %d pOutFlags=%d\n", pFile->h, pOutFlags ); + OSTRACE(( "OPEN %d pOutFlags=%d\n", pFile->h, pOutFlags )); return SQLITE_OK; } @@ -21102,7 +22651,7 @@ static int os2Delete( SimulateIOError( return SQLITE_IOERR_DELETE ); rc = DosDelete( (PSZ)zFilenameCp ); free( zFilenameCp ); - OSTRACE2( "DELETE \"%s\"\n", zFilename ); + OSTRACE(( "DELETE \"%s\"\n", zFilename )); return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR_DELETE; } @@ -21123,17 +22672,17 @@ static int os2Access( rc = DosQueryPathInfo( (PSZ)zFilenameCp, FIL_STANDARD, &fsts3ConfigInfo, sizeof(FILESTATUS3) ); free( zFilenameCp ); - OSTRACE4( "ACCESS fsts3ConfigInfo.attrFile=%d flags=%d rc=%d\n", - fsts3ConfigInfo.attrFile, flags, rc ); + OSTRACE(( "ACCESS fsts3ConfigInfo.attrFile=%d flags=%d rc=%d\n", + fsts3ConfigInfo.attrFile, flags, rc )); switch( flags ){ case SQLITE_ACCESS_READ: case SQLITE_ACCESS_EXISTS: rc = (rc == NO_ERROR); - OSTRACE3( "ACCESS %s access of read and exists rc=%d\n", zFilename, rc ); + OSTRACE(( "ACCESS %s access of read and exists rc=%d\n", zFilename, rc)); break; case SQLITE_ACCESS_READWRITE: rc = (rc == NO_ERROR) && ( (fsts3ConfigInfo.attrFile & FILE_READONLY) == 0 ); - OSTRACE3( "ACCESS %s access of read/write rc=%d\n", zFilename, rc ); + OSTRACE(( "ACCESS %s access of read/write rc=%d\n", zFilename, rc )); break; default: assert( !"Invalid flags argument" ); @@ -21343,7 +22892,7 @@ SQLITE_API int sqlite3_os_init(void){ os2Randomness, /* xRandomness */ os2Sleep, /* xSleep */ os2CurrentTime, /* xCurrentTime */ - os2GetLastError /* xGetLastError */ + os2GetLastError, /* xGetLastError */ }; sqlite3_vfs_register(&os2Vfs, 1); initUconvObjects(); @@ -21477,6 +23026,7 @@ SQLITE_API int sqlite3_os_end(void){ #include #include #include +#include #if SQLITE_ENABLE_LOCKING_STYLE # include @@ -21486,10 +23036,18 @@ SQLITE_API int sqlite3_os_end(void){ # else # include # include -# include # endif #endif /* SQLITE_ENABLE_LOCKING_STYLE */ +#if defined(__APPLE__) || (SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS) +# include +#endif + +/* +** Allowed values of unixFile.fsFlags +*/ +#define SQLITE_FSFLAGS_IS_MSDOS 0x1 + /* ** If we are to be thread-safe, include the pthreads header and define ** the SQLITE_UNIX_THREADS macro. @@ -21523,6 +23081,11 @@ SQLITE_API int sqlite3_os_end(void){ */ #define IS_LOCK_ERROR(x) ((x != SQLITE_OK) && (x != SQLITE_BUSY)) +/* Forward references */ +typedef struct unixShm unixShm; /* Connection shared memory */ +typedef struct unixShmNode unixShmNode; /* Shared memory instance */ +typedef struct unixInodeInfo unixInodeInfo; /* An i-node */ +typedef struct UnixUnusedFd UnixUnusedFd; /* An unused file descriptor */ /* ** Sometimes, after a file handle is closed by SQLite, the file descriptor @@ -21530,7 +23093,6 @@ SQLITE_API int sqlite3_os_end(void){ ** structure are used to store the file descriptor while waiting for an ** opportunity to either close or reuse it. */ -typedef struct UnixUnusedFd UnixUnusedFd; struct UnixUnusedFd { int fd; /* File descriptor to close */ int flags; /* Flags this file descriptor was opened with */ @@ -21544,24 +23106,26 @@ struct UnixUnusedFd { typedef struct unixFile unixFile; struct unixFile { sqlite3_io_methods const *pMethod; /* Always the first entry */ - struct unixOpenCnt *pOpen; /* Info about all open fd's on this inode */ - struct unixLockInfo *pLock; /* Info about locks on this inode */ - int h; /* The file descriptor */ - int dirfd; /* File descriptor for the directory */ - unsigned char locktype; /* The type of lock held on this fd */ - int lastErrno; /* The unix errno from the last I/O error */ - void *lockingContext; /* Locking style specific state */ - UnixUnusedFd *pUnused; /* Pre-allocated UnixUnusedFd */ - int fileFlags; /* Miscellanous flags */ + unixInodeInfo *pInode; /* Info about locks on this inode */ + int h; /* The file descriptor */ + int dirfd; /* File descriptor for the directory */ + unsigned char eFileLock; /* The type of lock held on this fd */ + int lastErrno; /* The unix errno from last I/O error */ + void *lockingContext; /* Locking style specific state */ + UnixUnusedFd *pUnused; /* Pre-allocated UnixUnusedFd */ + int fileFlags; /* Miscellanous flags */ + const char *zPath; /* Name of the file */ + unixShm *pShm; /* Shared memory segment information */ + int szChunk; /* Configured by FCNTL_CHUNK_SIZE */ #if SQLITE_ENABLE_LOCKING_STYLE - int openFlags; /* The flags specified at open() */ + int openFlags; /* The flags specified at open() */ #endif -#if SQLITE_THREADSAFE && defined(__linux__) - pthread_t tid; /* The thread that "owns" this unixFile */ +#if SQLITE_ENABLE_LOCKING_STYLE || defined(__APPLE__) + unsigned fsFlags; /* cached details from statfs() */ #endif #if OS_VXWORKS - int isDelete; /* Delete on close if true */ - struct vxworksFileId *pId; /* Unique file ID */ + int isDelete; /* Delete on close if true */ + struct vxworksFileId *pId; /* Unique file ID */ #endif #ifndef NDEBUG /* The next group of variables are used to track whether or not the @@ -21611,8 +23175,6 @@ struct unixFile { ** ** This file should be #included by the os_*.c files only. It is not a ** general purpose header file. -** -** $Id: os_common.h,v 1.38 2009/02/24 18:40:50 danielk1977 Exp $ */ #ifndef _OS_COMMON_H_ #define _OS_COMMON_H_ @@ -21628,23 +23190,9 @@ struct unixFile { #ifdef SQLITE_DEBUG SQLITE_PRIVATE int sqlite3OSTrace = 0; -#define OSTRACE1(X) if( sqlite3OSTrace ) sqlite3DebugPrintf(X) -#define OSTRACE2(X,Y) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y) -#define OSTRACE3(X,Y,Z) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y,Z) -#define OSTRACE4(X,Y,Z,A) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y,Z,A) -#define OSTRACE5(X,Y,Z,A,B) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y,Z,A,B) -#define OSTRACE6(X,Y,Z,A,B,C) \ - if(sqlite3OSTrace) sqlite3DebugPrintf(X,Y,Z,A,B,C) -#define OSTRACE7(X,Y,Z,A,B,C,D) \ - if(sqlite3OSTrace) sqlite3DebugPrintf(X,Y,Z,A,B,C,D) +#define OSTRACE(X) if( sqlite3OSTrace ) sqlite3DebugPrintf X #else -#define OSTRACE1(X) -#define OSTRACE2(X,Y) -#define OSTRACE3(X,Y,Z) -#define OSTRACE4(X,Y,Z,A) -#define OSTRACE5(X,Y,Z,A,B) -#define OSTRACE6(X,Y,Z,A,B,C) -#define OSTRACE7(X,Y,Z,A,B,C,D) +#define OSTRACE(X) #endif /* @@ -21673,8 +23221,6 @@ SQLITE_PRIVATE int sqlite3OSTrace = 0; ** ** This file contains inline asm code for retrieving "high-performance" ** counters for x86 class CPUs. -** -** $Id: hwtime.h,v 1.3 2008/08/01 14:33:15 shane Exp $ */ #ifndef _HWTIME_H_ #define _HWTIME_H_ @@ -21856,7 +23402,7 @@ SQLITE_API int sqlite3_open_file_count = 0; /* ** Helper functions to obtain and relinquish the global mutex. The -** global mutex is used to protect the unixOpenCnt, unixLockInfo and +** global mutex is used to protect the unixInodeInfo and ** vxworksFileId objects used by this file, all of which may be ** shared by multiple threads. ** @@ -21887,8 +23433,8 @@ static int unixMutexHeld(void) { ** binaries. This returns the string represetation of the supplied ** integer lock-type. */ -static const char *locktypeName(int locktype){ - switch( locktype ){ +static const char *azFileLock(int eFileLock){ + switch( eFileLock ){ case NO_LOCK: return "NONE"; case SHARED_LOCK: return "SHARED"; case RESERVED_LOCK: return "RESERVED"; @@ -22225,13 +23771,12 @@ static void vxworksReleaseFileId(struct vxworksFileId *pId){ ** ** If you close a file descriptor that points to a file that has locks, ** all locks on that file that are owned by the current process are -** released. To work around this problem, each unixFile structure contains -** a pointer to an unixOpenCnt structure. There is one unixOpenCnt structure -** per open inode, which means that multiple unixFile can point to a single -** unixOpenCnt. When an attempt is made to close an unixFile, if there are +** released. To work around this problem, each unixInodeInfo object +** maintains a count of the number of pending locks on tha inode. +** When an attempt is made to close an unixFile, if there are ** other unixFile open on the same inode that are holding locks, the call ** to close() the file descriptor is deferred until all of the locks clear. -** The unixOpenCnt structure keeps a list of file descriptors that need to +** The unixInodeInfo structure keeps a list of file descriptors that need to ** be closed and that list is walked (and cleared) when the last lock ** clears. ** @@ -22246,46 +23791,19 @@ static void vxworksReleaseFileId(struct vxworksFileId *pId){ ** in thread B. But there is no way to know at compile-time which ** threading library is being used. So there is no way to know at ** compile-time whether or not thread A can override locks on thread B. -** We have to do a run-time check to discover the behavior of the +** One has to do a run-time check to discover the behavior of the ** current process. ** -** On systems where thread A is unable to modify locks created by -** thread B, we have to keep track of which thread created each -** lock. Hence there is an extra field in the key to the unixLockInfo -** structure to record this information. And on those systems it -** is illegal to begin a transaction in one thread and finish it -** in another. For this latter restriction, there is no work-around. -** It is a limitation of LinuxThreads. +** SQLite used to support LinuxThreads. But support for LinuxThreads +** was dropped beginning with version 3.7.0. SQLite will still work with +** LinuxThreads provided that (1) there is no more than one connection +** per database file in the same process and (2) database connections +** do not move across threads. */ -/* -** Set or check the unixFile.tid field. This field is set when an unixFile -** is first opened. All subsequent uses of the unixFile verify that the -** same thread is operating on the unixFile. Some operating systems do -** not allow locks to be overridden by other threads and that restriction -** means that sqlite3* database handles cannot be moved from one thread -** to another while locks are held. -** -** Version 3.3.1 (2006-01-15): unixFile can be moved from one thread to -** another as long as we are running on a system that supports threads -** overriding each others locks (which is now the most common behavior) -** or if no locks are held. But the unixFile.pLock field needs to be -** recomputed because its key includes the thread-id. See the -** transferOwnership() function below for additional information -*/ -#if SQLITE_THREADSAFE && defined(__linux__) -# define SET_THREADID(X) (X)->tid = pthread_self() -# define CHECK_THREADID(X) (threadsOverrideEachOthersLocks==0 && \ - !pthread_equal((X)->tid, pthread_self())) -#else -# define SET_THREADID(X) -# define CHECK_THREADID(X) 0 -#endif - /* ** An instance of the following structure serves as the key used -** to locate a particular unixOpenCnt structure given its inode. This -** is the same as the unixLockKey except that the thread ID is omitted. +** to locate a particular unixInodeInfo object. */ struct unixFileId { dev_t dev; /* Device number */ @@ -22296,23 +23814,6 @@ struct unixFileId { #endif }; -/* -** An instance of the following structure serves as the key used -** to locate a particular unixLockInfo structure given its inode. -** -** If threads cannot override each others locks (LinuxThreads), then we -** set the unixLockKey.tid field to the thread ID. If threads can override -** each others locks (Posix and NPTL) then tid is always set to zero. -** tid is omitted if we compile without threading support or on an OS -** other than linux. -*/ -struct unixLockKey { - struct unixFileId fid; /* Unique identifier for the file */ -#if SQLITE_THREADSAFE && defined(__linux__) - pthread_t tid; /* Thread ID of lock owner. Zero if not using LinuxThreads */ -#endif -}; - /* ** An instance of the following structure is allocated for each open ** inode. Or, on LinuxThreads, there is one of these structures for @@ -22322,227 +23823,109 @@ struct unixLockKey { ** structure contains a pointer to an instance of this object and this ** object keeps a count of the number of unixFile pointing to it. */ -struct unixLockInfo { - struct unixLockKey lockKey; /* The lookup key */ - int cnt; /* Number of SHARED locks held */ - int locktype; /* One of SHARED_LOCK, RESERVED_LOCK etc. */ +struct unixInodeInfo { + struct unixFileId fileId; /* The lookup key */ + int nShared; /* Number of SHARED locks held */ + int eFileLock; /* One of SHARED_LOCK, RESERVED_LOCK etc. */ int nRef; /* Number of pointers to this structure */ - struct unixLockInfo *pNext; /* List of all unixLockInfo objects */ - struct unixLockInfo *pPrev; /* .... doubly linked */ -}; - -/* -** An instance of the following structure is allocated for each open -** inode. This structure keeps track of the number of locks on that -** inode. If a close is attempted against an inode that is holding -** locks, the close is deferred until all locks clear by adding the -** file descriptor to be closed to the pending list. -** -** TODO: Consider changing this so that there is only a single file -** descriptor for each open file, even when it is opened multiple times. -** The close() system call would only occur when the last database -** using the file closes. -*/ -struct unixOpenCnt { - struct unixFileId fileId; /* The lookup key */ - int nRef; /* Number of pointers to this structure */ - int nLock; /* Number of outstanding locks */ - UnixUnusedFd *pUnused; /* Unused file descriptors to close */ + unixShmNode *pShmNode; /* Shared memory associated with this inode */ + int nLock; /* Number of outstanding file locks */ + UnixUnusedFd *pUnused; /* Unused file descriptors to close */ + unixInodeInfo *pNext; /* List of all unixInodeInfo objects */ + unixInodeInfo *pPrev; /* .... doubly linked */ +#if defined(SQLITE_ENABLE_LOCKING_STYLE) + unsigned long long sharedByte; /* for AFP simulated shared lock */ +#endif #if OS_VXWORKS - sem_t *pSem; /* Named POSIX semaphore */ - char aSemName[MAX_PATHNAME+2]; /* Name of that semaphore */ + sem_t *pSem; /* Named POSIX semaphore */ + char aSemName[MAX_PATHNAME+2]; /* Name of that semaphore */ #endif - struct unixOpenCnt *pNext, *pPrev; /* List of all unixOpenCnt objects */ }; /* -** Lists of all unixLockInfo and unixOpenCnt objects. These used to be hash -** tables. But the number of objects is rarely more than a dozen and -** never exceeds a few thousand. And lookup is not on a critical -** path so a simple linked list will suffice. +** A lists of all unixInodeInfo objects. */ -static struct unixLockInfo *lockList = 0; -static struct unixOpenCnt *openList = 0; +static unixInodeInfo *inodeList = 0; /* -** This variable remembers whether or not threads can override each others -** locks. +** Close all file descriptors accumuated in the unixInodeInfo->pUnused list. +** If all such file descriptors are closed without error, the list is +** cleared and SQLITE_OK returned. ** -** 0: No. Threads cannot override each others locks. (LinuxThreads) -** 1: Yes. Threads can override each others locks. (Posix & NLPT) -** -1: We don't know yet. -** -** On some systems, we know at compile-time if threads can override each -** others locks. On those systems, the SQLITE_THREAD_OVERRIDE_LOCK macro -** will be set appropriately. On other systems, we have to check at -** runtime. On these latter systems, SQLTIE_THREAD_OVERRIDE_LOCK is -** undefined. -** -** This variable normally has file scope only. But during testing, we make -** it a global so that the test code can change its value in order to verify -** that the right stuff happens in either case. -*/ -#if SQLITE_THREADSAFE && defined(__linux__) -# ifndef SQLITE_THREAD_OVERRIDE_LOCK -# define SQLITE_THREAD_OVERRIDE_LOCK -1 -# endif -# ifdef SQLITE_TEST -int threadsOverrideEachOthersLocks = SQLITE_THREAD_OVERRIDE_LOCK; -# else -static int threadsOverrideEachOthersLocks = SQLITE_THREAD_OVERRIDE_LOCK; -# endif -#endif - -/* -** This structure holds information passed into individual test -** threads by the testThreadLockingBehavior() routine. -*/ -struct threadTestData { - int fd; /* File to be locked */ - struct flock lock; /* The locking operation */ - int result; /* Result of the locking operation */ -}; - -#if SQLITE_THREADSAFE && defined(__linux__) -/* -** This function is used as the main routine for a thread launched by -** testThreadLockingBehavior(). It tests whether the shared-lock obtained -** by the main thread in testThreadLockingBehavior() conflicts with a -** hypothetical write-lock obtained by this thread on the same file. -** -** The write-lock is not actually acquired, as this is not possible if -** the file is open in read-only mode (see ticket #3472). +** Otherwise, if an error occurs, then successfully closed file descriptor +** entries are removed from the list, and SQLITE_IOERR_CLOSE returned. +** not deleted and SQLITE_IOERR_CLOSE returned. */ -static void *threadLockingTest(void *pArg){ - struct threadTestData *pData = (struct threadTestData*)pArg; - pData->result = fcntl(pData->fd, F_GETLK, &pData->lock); - return pArg; -} -#endif /* SQLITE_THREADSAFE && defined(__linux__) */ - - -#if SQLITE_THREADSAFE && defined(__linux__) -/* -** This procedure attempts to determine whether or not threads -** can override each others locks then sets the -** threadsOverrideEachOthersLocks variable appropriately. -*/ -static void testThreadLockingBehavior(int fd_orig){ - int fd; - int rc; - struct threadTestData d; - struct flock l; - pthread_t t; - - fd = dup(fd_orig); - if( fd<0 ) return; - memset(&l, 0, sizeof(l)); - l.l_type = F_RDLCK; - l.l_len = 1; - l.l_start = 0; - l.l_whence = SEEK_SET; - rc = fcntl(fd_orig, F_SETLK, &l); - if( rc!=0 ) return; - memset(&d, 0, sizeof(d)); - d.fd = fd; - d.lock = l; - d.lock.l_type = F_WRLCK; - if( pthread_create(&t, 0, threadLockingTest, &d)==0 ){ - pthread_join(t, 0); +static int closePendingFds(unixFile *pFile){ + int rc = SQLITE_OK; + unixInodeInfo *pInode = pFile->pInode; + UnixUnusedFd *pError = 0; + UnixUnusedFd *p; + UnixUnusedFd *pNext; + for(p=pInode->pUnused; p; p=pNext){ + pNext = p->pNext; + if( close(p->fd) ){ + pFile->lastErrno = errno; + rc = SQLITE_IOERR_CLOSE; + p->pNext = pError; + pError = p; + }else{ + sqlite3_free(p); + } } - close(fd); - if( d.result!=0 ) return; - threadsOverrideEachOthersLocks = (d.lock.l_type==F_UNLCK); + pInode->pUnused = pError; + return rc; } -#endif /* SQLITE_THREADSAFE && defined(__linux__) */ /* -** Release a unixLockInfo structure previously allocated by findLockInfo(). +** Release a unixInodeInfo structure previously allocated by findInodeInfo(). ** ** The mutex entered using the unixEnterMutex() function must be held ** when this function is called. */ -static void releaseLockInfo(struct unixLockInfo *pLock){ +static void releaseInodeInfo(unixFile *pFile){ + unixInodeInfo *pInode = pFile->pInode; assert( unixMutexHeld() ); - if( pLock ){ - pLock->nRef--; - if( pLock->nRef==0 ){ - if( pLock->pPrev ){ - assert( pLock->pPrev->pNext==pLock ); - pLock->pPrev->pNext = pLock->pNext; + if( pInode ){ + pInode->nRef--; + if( pInode->nRef==0 ){ + assert( pInode->pShmNode==0 ); + closePendingFds(pFile); + if( pInode->pPrev ){ + assert( pInode->pPrev->pNext==pInode ); + pInode->pPrev->pNext = pInode->pNext; }else{ - assert( lockList==pLock ); - lockList = pLock->pNext; + assert( inodeList==pInode ); + inodeList = pInode->pNext; } - if( pLock->pNext ){ - assert( pLock->pNext->pPrev==pLock ); - pLock->pNext->pPrev = pLock->pPrev; + if( pInode->pNext ){ + assert( pInode->pNext->pPrev==pInode ); + pInode->pNext->pPrev = pInode->pPrev; } - sqlite3_free(pLock); + sqlite3_free(pInode); } } } /* -** Release a unixOpenCnt structure previously allocated by findLockInfo(). -** -** The mutex entered using the unixEnterMutex() function must be held -** when this function is called. -*/ -static void releaseOpenCnt(struct unixOpenCnt *pOpen){ - assert( unixMutexHeld() ); - if( pOpen ){ - pOpen->nRef--; - if( pOpen->nRef==0 ){ - if( pOpen->pPrev ){ - assert( pOpen->pPrev->pNext==pOpen ); - pOpen->pPrev->pNext = pOpen->pNext; - }else{ - assert( openList==pOpen ); - openList = pOpen->pNext; - } - if( pOpen->pNext ){ - assert( pOpen->pNext->pPrev==pOpen ); - pOpen->pNext->pPrev = pOpen->pPrev; - } -#if SQLITE_THREADSAFE && defined(__linux__) - assert( !pOpen->pUnused || threadsOverrideEachOthersLocks==0 ); -#endif - - /* If pOpen->pUnused is not null, then memory and file-descriptors - ** are leaked. - ** - ** This will only happen if, under Linuxthreads, the user has opened - ** a transaction in one thread, then attempts to close the database - ** handle from another thread (without first unlocking the db file). - ** This is a misuse. */ - sqlite3_free(pOpen); - } - } -} - -/* -** Given a file descriptor, locate unixLockInfo and unixOpenCnt structures that -** describes that file descriptor. Create new ones if necessary. The -** return values might be uninitialized if an error occurs. +** Given a file descriptor, locate the unixInodeInfo object that +** describes that file descriptor. Create a new one if necessary. The +** return value might be uninitialized if an error occurs. ** ** The mutex entered using the unixEnterMutex() function must be held ** when this function is called. ** ** Return an appropriate error code. */ -static int findLockInfo( +static int findInodeInfo( unixFile *pFile, /* Unix file with file desc used in the key */ - struct unixLockInfo **ppLock, /* Return the unixLockInfo structure here */ - struct unixOpenCnt **ppOpen /* Return the unixOpenCnt structure here */ + unixInodeInfo **ppInode /* Return the unixInodeInfo object here */ ){ int rc; /* System call return code */ int fd; /* The file descriptor for pFile */ - struct unixLockKey lockKey; /* Lookup key for the unixLockInfo structure */ - struct unixFileId fileId; /* Lookup key for the unixOpenCnt struct */ + struct unixFileId fileId; /* Lookup key for the unixInodeInfo */ struct stat statbuf; /* Low-level file information */ - struct unixLockInfo *pLock = 0;/* Candidate unixLockInfo object */ - struct unixOpenCnt *pOpen; /* Candidate unixOpenCnt object */ + unixInodeInfo *pInode = 0; /* Candidate unixInodeInfo object */ assert( unixMutexHeld() ); @@ -22570,9 +23953,10 @@ static int findLockInfo( ** is a race condition such that another thread has already populated ** the first page of the database, no damage is done. */ - if( statbuf.st_size==0 ){ + if( statbuf.st_size==0 && (pFile->fsFlags & SQLITE_FSFLAGS_IS_MSDOS)!=0 ){ rc = write(fd, "S", 1); if( rc!=1 ){ + pFile->lastErrno = errno; return SQLITE_IOERR; } rc = fstat(fd, &statbuf); @@ -22583,120 +23967,36 @@ static int findLockInfo( } #endif - memset(&lockKey, 0, sizeof(lockKey)); - lockKey.fid.dev = statbuf.st_dev; + memset(&fileId, 0, sizeof(fileId)); + fileId.dev = statbuf.st_dev; #if OS_VXWORKS - lockKey.fid.pId = pFile->pId; + fileId.pId = pFile->pId; #else - lockKey.fid.ino = statbuf.st_ino; + fileId.ino = statbuf.st_ino; #endif -#if SQLITE_THREADSAFE && defined(__linux__) - if( threadsOverrideEachOthersLocks<0 ){ - testThreadLockingBehavior(fd); + pInode = inodeList; + while( pInode && memcmp(&fileId, &pInode->fileId, sizeof(fileId)) ){ + pInode = pInode->pNext; } - lockKey.tid = threadsOverrideEachOthersLocks ? 0 : pthread_self(); -#endif - fileId = lockKey.fid; - if( ppLock!=0 ){ - pLock = lockList; - while( pLock && memcmp(&lockKey, &pLock->lockKey, sizeof(lockKey)) ){ - pLock = pLock->pNext; + if( pInode==0 ){ + pInode = sqlite3_malloc( sizeof(*pInode) ); + if( pInode==0 ){ + return SQLITE_NOMEM; } - if( pLock==0 ){ - pLock = sqlite3_malloc( sizeof(*pLock) ); - if( pLock==0 ){ - rc = SQLITE_NOMEM; - goto exit_findlockinfo; - } - memcpy(&pLock->lockKey,&lockKey,sizeof(lockKey)); - pLock->nRef = 1; - pLock->cnt = 0; - pLock->locktype = 0; - pLock->pNext = lockList; - pLock->pPrev = 0; - if( lockList ) lockList->pPrev = pLock; - lockList = pLock; - }else{ - pLock->nRef++; - } - *ppLock = pLock; + memset(pInode, 0, sizeof(*pInode)); + memcpy(&pInode->fileId, &fileId, sizeof(fileId)); + pInode->nRef = 1; + pInode->pNext = inodeList; + pInode->pPrev = 0; + if( inodeList ) inodeList->pPrev = pInode; + inodeList = pInode; + }else{ + pInode->nRef++; } - if( ppOpen!=0 ){ - pOpen = openList; - while( pOpen && memcmp(&fileId, &pOpen->fileId, sizeof(fileId)) ){ - pOpen = pOpen->pNext; - } - if( pOpen==0 ){ - pOpen = sqlite3_malloc( sizeof(*pOpen) ); - if( pOpen==0 ){ - releaseLockInfo(pLock); - rc = SQLITE_NOMEM; - goto exit_findlockinfo; - } - memset(pOpen, 0, sizeof(*pOpen)); - pOpen->fileId = fileId; - pOpen->nRef = 1; - pOpen->pNext = openList; - if( openList ) openList->pPrev = pOpen; - openList = pOpen; - }else{ - pOpen->nRef++; - } - *ppOpen = pOpen; - } - -exit_findlockinfo: - return rc; + *ppInode = pInode; + return SQLITE_OK; } -/* -** If we are currently in a different thread than the thread that the -** unixFile argument belongs to, then transfer ownership of the unixFile -** over to the current thread. -** -** A unixFile is only owned by a thread on systems that use LinuxThreads. -** -** Ownership transfer is only allowed if the unixFile is currently unlocked. -** If the unixFile is locked and an ownership is wrong, then return -** SQLITE_MISUSE. SQLITE_OK is returned if everything works. -*/ -#if SQLITE_THREADSAFE && defined(__linux__) -static int transferOwnership(unixFile *pFile){ - int rc; - pthread_t hSelf; - if( threadsOverrideEachOthersLocks ){ - /* Ownership transfers not needed on this system */ - return SQLITE_OK; - } - hSelf = pthread_self(); - if( pthread_equal(pFile->tid, hSelf) ){ - /* We are still in the same thread */ - OSTRACE1("No-transfer, same thread\n"); - return SQLITE_OK; - } - if( pFile->locktype!=NO_LOCK ){ - /* We cannot change ownership while we are holding a lock! */ - return SQLITE_MISUSE; - } - OSTRACE4("Transfer ownership of %d from %d to %d\n", - pFile->h, pFile->tid, hSelf); - pFile->tid = hSelf; - if (pFile->pLock != NULL) { - releaseLockInfo(pFile->pLock); - rc = findLockInfo(pFile, &pFile->pLock, 0); - OSTRACE5("LOCK %d is now %s(%s,%d)\n", pFile->h, - locktypeName(pFile->locktype), - locktypeName(pFile->pLock->locktype), pFile->pLock->cnt); - return rc; - } else { - return SQLITE_OK; - } -} -#else /* if not SQLITE_THREADSAFE */ - /* On single-threaded builds, ownership transfer is a no-op */ -# define transferOwnership(X) SQLITE_OK -#endif /* SQLITE_THREADSAFE */ - /* ** This routine checks if there is a RESERVED lock held on the specified @@ -22712,10 +24012,10 @@ static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){ SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); assert( pFile ); - unixEnterMutex(); /* Because pFile->pLock is shared across threads */ + unixEnterMutex(); /* Because pFile->pInode is shared across threads */ /* Check if a thread in this process holds such a lock */ - if( pFile->pLock->locktype>SHARED_LOCK ){ + if( pFile->pInode->eFileLock>SHARED_LOCK ){ reserved = 1; } @@ -22739,70 +24039,14 @@ static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){ #endif unixLeaveMutex(); - OSTRACE4("TEST WR-LOCK %d %d %d\n", pFile->h, rc, reserved); + OSTRACE(("TEST WR-LOCK %d %d %d (unix)\n", pFile->h, rc, reserved)); *pResOut = reserved; return rc; } /* -** Perform a file locking operation on a range of bytes in a file. -** The "op" parameter should be one of F_RDLCK, F_WRLCK, or F_UNLCK. -** Return 0 on success or -1 for failure. On failure, write the error -** code into *pErrcode. -** -** If the SQLITE_WHOLE_FILE_LOCKING bit is clear, then only lock -** the range of bytes on the locking page between SHARED_FIRST and -** SHARED_SIZE. If SQLITE_WHOLE_FILE_LOCKING is set, then lock all -** bytes from 0 up to but not including PENDING_BYTE, and all bytes -** that follow SHARED_FIRST. -** -** In other words, of SQLITE_WHOLE_FILE_LOCKING if false (the historical -** default case) then only lock a small range of bytes from SHARED_FIRST -** through SHARED_FIRST+SHARED_SIZE-1. But if SQLITE_WHOLE_FILE_LOCKING is -** true then lock every byte in the file except for PENDING_BYTE and -** RESERVED_BYTE. -** -** SQLITE_WHOLE_FILE_LOCKING=true overlaps SQLITE_WHOLE_FILE_LOCKING=false -** and so the locking schemes are compatible. One type of lock will -** effectively exclude the other type. The reason for using the -** SQLITE_WHOLE_FILE_LOCKING=true is that by indicating the full range -** of bytes to be read or written, we give hints to NFS to help it -** maintain cache coherency. On the other hand, whole file locking -** is slower, so we don't want to use it except for NFS. -*/ -static int rangeLock(unixFile *pFile, int op, int *pErrcode){ - struct flock lock; - int rc; - lock.l_type = op; - lock.l_start = SHARED_FIRST; - lock.l_whence = SEEK_SET; - if( (pFile->fileFlags & SQLITE_WHOLE_FILE_LOCKING)==0 ){ - lock.l_len = SHARED_SIZE; - rc = fcntl(pFile->h, F_SETLK, &lock); - *pErrcode = errno; - }else{ - lock.l_len = 0; - rc = fcntl(pFile->h, F_SETLK, &lock); - *pErrcode = errno; - if( NEVER(op==F_UNLCK) || rc!=(-1) ){ - lock.l_start = 0; - lock.l_len = PENDING_BYTE; - rc = fcntl(pFile->h, F_SETLK, &lock); - if( ALWAYS(op!=F_UNLCK) && rc==(-1) ){ - *pErrcode = errno; - lock.l_type = F_UNLCK; - lock.l_start = SHARED_FIRST; - lock.l_len = 0; - fcntl(pFile->h, F_SETLK, &lock); - } - } - } - return rc; -} - -/* -** Lock the file with the lock specified by parameter locktype - one +** Lock the file with the lock specified by parameter eFileLock - one ** of the following: ** ** (1) SHARED_LOCK @@ -22825,7 +24069,7 @@ static int rangeLock(unixFile *pFile, int op, int *pErrcode){ ** This routine will only increase a lock. Use the sqlite3OsUnlock() ** routine to lower a locking level. */ -static int unixLock(sqlite3_file *id, int locktype){ +static int unixLock(sqlite3_file *id, int eFileLock){ /* The following describes the implementation of the various locks and ** lock transitions in terms of the POSIX advisory shared and exclusive ** lock primitives (called read-locks and write-locks below, to avoid @@ -22866,23 +24110,23 @@ static int unixLock(sqlite3_file *id, int locktype){ */ int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; - struct unixLockInfo *pLock = pFile->pLock; + unixInodeInfo *pInode = pFile->pInode; struct flock lock; int s = 0; - int tErrno; + int tErrno = 0; assert( pFile ); - OSTRACE7("LOCK %d %s was %s(%s,%d) pid=%d\n", pFile->h, - locktypeName(locktype), locktypeName(pFile->locktype), - locktypeName(pLock->locktype), pLock->cnt , getpid()); + OSTRACE(("LOCK %d %s was %s(%s,%d) pid=%d (unix)\n", pFile->h, + azFileLock(eFileLock), azFileLock(pFile->eFileLock), + azFileLock(pInode->eFileLock), pInode->nShared , getpid())); /* If there is already a lock of this type or more restrictive on the ** unixFile, do nothing. Don't use the end_lock: exit path, as ** unixEnterMutex() hasn't been called yet. */ - if( pFile->locktype>=locktype ){ - OSTRACE3("LOCK %d %s ok (already held)\n", pFile->h, - locktypeName(locktype)); + if( pFile->eFileLock>=eFileLock ){ + OSTRACE(("LOCK %d %s ok (already held) (unix)\n", pFile->h, + azFileLock(eFileLock))); return SQLITE_OK; } @@ -22891,28 +24135,20 @@ static int unixLock(sqlite3_file *id, int locktype){ ** (2) SQLite never explicitly requests a pendig lock. ** (3) A shared lock is always held when a reserve lock is requested. */ - assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK ); - assert( locktype!=PENDING_LOCK ); - assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK ); + assert( pFile->eFileLock!=NO_LOCK || eFileLock==SHARED_LOCK ); + assert( eFileLock!=PENDING_LOCK ); + assert( eFileLock!=RESERVED_LOCK || pFile->eFileLock==SHARED_LOCK ); - /* This mutex is needed because pFile->pLock is shared across threads + /* This mutex is needed because pFile->pInode is shared across threads */ unixEnterMutex(); - - /* Make sure the current thread owns the pFile. - */ - rc = transferOwnership(pFile); - if( rc!=SQLITE_OK ){ - unixLeaveMutex(); - return rc; - } - pLock = pFile->pLock; + pInode = pFile->pInode; /* If some thread using this PID has a lock via a different unixFile* ** handle that precludes the requested lock, return BUSY. */ - if( (pFile->locktype!=pLock->locktype && - (pLock->locktype>=PENDING_LOCK || locktype>SHARED_LOCK)) + if( (pFile->eFileLock!=pInode->eFileLock && + (pInode->eFileLock>=PENDING_LOCK || eFileLock>SHARED_LOCK)) ){ rc = SQLITE_BUSY; goto end_lock; @@ -22922,14 +24158,14 @@ static int unixLock(sqlite3_file *id, int locktype){ ** has a SHARED or RESERVED lock, then increment reference counts and ** return SQLITE_OK. */ - if( locktype==SHARED_LOCK && - (pLock->locktype==SHARED_LOCK || pLock->locktype==RESERVED_LOCK) ){ - assert( locktype==SHARED_LOCK ); - assert( pFile->locktype==0 ); - assert( pLock->cnt>0 ); - pFile->locktype = SHARED_LOCK; - pLock->cnt++; - pFile->pOpen->nLock++; + if( eFileLock==SHARED_LOCK && + (pInode->eFileLock==SHARED_LOCK || pInode->eFileLock==RESERVED_LOCK) ){ + assert( eFileLock==SHARED_LOCK ); + assert( pFile->eFileLock==0 ); + assert( pInode->nShared>0 ); + pFile->eFileLock = SHARED_LOCK; + pInode->nShared++; + pInode->nLock++; goto end_lock; } @@ -22940,10 +24176,10 @@ static int unixLock(sqlite3_file *id, int locktype){ */ lock.l_len = 1L; lock.l_whence = SEEK_SET; - if( locktype==SHARED_LOCK - || (locktype==EXCLUSIVE_LOCK && pFile->locktypeeFileLockh, F_SETLK, &lock); if( s==(-1) ){ @@ -22960,13 +24196,16 @@ static int unixLock(sqlite3_file *id, int locktype){ /* If control gets to this point, then actually go ahead and make ** operating system calls for the specified lock. */ - if( locktype==SHARED_LOCK ){ - assert( pLock->cnt==0 ); - assert( pLock->locktype==0 ); + if( eFileLock==SHARED_LOCK ){ + assert( pInode->nShared==0 ); + assert( pInode->eFileLock==0 ); /* Now get the read-lock */ - s = rangeLock(pFile, F_RDLCK, &tErrno); - + lock.l_start = SHARED_FIRST; + lock.l_len = SHARED_SIZE; + if( (s = fcntl(pFile->h, F_SETLK, &lock))==(-1) ){ + tErrno = errno; + } /* Drop the temporary PENDING lock */ lock.l_start = PENDING_BYTE; lock.l_len = 1L; @@ -22988,11 +24227,11 @@ static int unixLock(sqlite3_file *id, int locktype){ pFile->lastErrno = tErrno; } }else{ - pFile->locktype = SHARED_LOCK; - pFile->pOpen->nLock++; - pLock->cnt = 1; + pFile->eFileLock = SHARED_LOCK; + pInode->nLock++; + pInode->nShared = 1; } - }else if( locktype==EXCLUSIVE_LOCK && pLock->cnt>1 ){ + }else if( eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1 ){ /* We are trying for an exclusive lock but another thread in this ** same process is still holding a shared lock. */ rc = SQLITE_BUSY; @@ -23001,21 +24240,22 @@ static int unixLock(sqlite3_file *id, int locktype){ ** assumed that there is a SHARED or greater lock on the file ** already. */ - assert( 0!=pFile->locktype ); + assert( 0!=pFile->eFileLock ); lock.l_type = F_WRLCK; - switch( locktype ){ + switch( eFileLock ){ case RESERVED_LOCK: lock.l_start = RESERVED_BYTE; - s = fcntl(pFile->h, F_SETLK, &lock); - tErrno = errno; break; case EXCLUSIVE_LOCK: - s = rangeLock(pFile, F_WRLCK, &tErrno); + lock.l_start = SHARED_FIRST; + lock.l_len = SHARED_SIZE; break; default: assert(0); } + s = fcntl(pFile->h, F_SETLK, &lock); if( s==(-1) ){ + tErrno = errno; rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK); if( IS_LOCK_ERROR(rc) ){ pFile->lastErrno = tErrno; @@ -23031,8 +24271,8 @@ static int unixLock(sqlite3_file *id, int locktype){ ** write operation (not a hot journal rollback). */ if( rc==SQLITE_OK - && pFile->locktype<=SHARED_LOCK - && locktype==RESERVED_LOCK + && pFile->eFileLock<=SHARED_LOCK + && eFileLock==RESERVED_LOCK ){ pFile->transCntrChng = 0; pFile->dbUpdate = 0; @@ -23042,47 +24282,17 @@ static int unixLock(sqlite3_file *id, int locktype){ if( rc==SQLITE_OK ){ - pFile->locktype = locktype; - pLock->locktype = locktype; - }else if( locktype==EXCLUSIVE_LOCK ){ - pFile->locktype = PENDING_LOCK; - pLock->locktype = PENDING_LOCK; + pFile->eFileLock = eFileLock; + pInode->eFileLock = eFileLock; + }else if( eFileLock==EXCLUSIVE_LOCK ){ + pFile->eFileLock = PENDING_LOCK; + pInode->eFileLock = PENDING_LOCK; } end_lock: unixLeaveMutex(); - OSTRACE4("LOCK %d %s %s\n", pFile->h, locktypeName(locktype), - rc==SQLITE_OK ? "ok" : "failed"); - return rc; -} - -/* -** Close all file descriptors accumuated in the unixOpenCnt->pUnused list. -** If all such file descriptors are closed without error, the list is -** cleared and SQLITE_OK returned. -** -** Otherwise, if an error occurs, then successfully closed file descriptor -** entries are removed from the list, and SQLITE_IOERR_CLOSE returned. -** not deleted and SQLITE_IOERR_CLOSE returned. -*/ -static int closePendingFds(unixFile *pFile){ - int rc = SQLITE_OK; - struct unixOpenCnt *pOpen = pFile->pOpen; - UnixUnusedFd *pError = 0; - UnixUnusedFd *p; - UnixUnusedFd *pNext; - for(p=pOpen->pUnused; p; p=pNext){ - pNext = p->pNext; - if( close(p->fd) ){ - pFile->lastErrno = errno; - rc = SQLITE_IOERR_CLOSE; - p->pNext = pError; - pError = p; - }else{ - sqlite3_free(p); - } - } - pOpen->pUnused = pError; + OSTRACE(("LOCK %d %s %s (unix)\n", pFile->h, azFileLock(eFileLock), + rc==SQLITE_OK ? "ok" : "failed")); return rc; } @@ -23091,46 +24301,50 @@ static int closePendingFds(unixFile *pFile){ ** pUnused list. */ static void setPendingFd(unixFile *pFile){ - struct unixOpenCnt *pOpen = pFile->pOpen; + unixInodeInfo *pInode = pFile->pInode; UnixUnusedFd *p = pFile->pUnused; - p->pNext = pOpen->pUnused; - pOpen->pUnused = p; + p->pNext = pInode->pUnused; + pInode->pUnused = p; pFile->h = -1; pFile->pUnused = 0; } /* -** Lower the locking level on file descriptor pFile to locktype. locktype +** Lower the locking level on file descriptor pFile to eFileLock. eFileLock ** must be either NO_LOCK or SHARED_LOCK. ** ** If the locking level of the file descriptor is already at or below ** the requested locking level, this routine is a no-op. +** +** If handleNFSUnlock is true, then on downgrading an EXCLUSIVE_LOCK to SHARED +** the byte range is divided into 2 parts and the first part is unlocked then +** set to a read lock, then the other part is simply unlocked. This works +** around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to +** remove the write lock on a region when a read lock is set. */ -static int unixUnlock(sqlite3_file *id, int locktype){ - unixFile *pFile = (unixFile*)id; /* The open file */ - struct unixLockInfo *pLock; /* Structure describing current lock state */ - struct flock lock; /* Information passed into fcntl() */ - int rc = SQLITE_OK; /* Return code from this interface */ - int h; /* The underlying file descriptor */ +static int _posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){ + unixFile *pFile = (unixFile*)id; + unixInodeInfo *pInode; + struct flock lock; + int rc = SQLITE_OK; + int h; int tErrno; /* Error code from system call errors */ assert( pFile ); - OSTRACE7("UNLOCK %d %d was %d(%d,%d) pid=%d\n", pFile->h, locktype, - pFile->locktype, pFile->pLock->locktype, pFile->pLock->cnt, getpid()); + OSTRACE(("UNLOCK %d %d was %d(%d,%d) pid=%d (unix)\n", pFile->h, eFileLock, + pFile->eFileLock, pFile->pInode->eFileLock, pFile->pInode->nShared, + getpid())); - assert( locktype<=SHARED_LOCK ); - if( pFile->locktype<=locktype ){ + assert( eFileLock<=SHARED_LOCK ); + if( pFile->eFileLock<=eFileLock ){ return SQLITE_OK; } - if( CHECK_THREADID(pFile) ){ - return SQLITE_MISUSE; - } unixEnterMutex(); h = pFile->h; - pLock = pFile->pLock; - assert( pLock->cnt!=0 ); - if( pFile->locktype>SHARED_LOCK ){ - assert( pLock->locktype==pFile->locktype ); + pInode = pFile->pInode; + assert( pInode->nShared!=0 ); + if( pFile->eFileLock>SHARED_LOCK ){ + assert( pInode->eFileLock==pFile->eFileLock ); SimulateIOErrorBenign(1); SimulateIOError( h=(-1) ) SimulateIOErrorBenign(0); @@ -23144,20 +24358,76 @@ static int unixUnlock(sqlite3_file *id, int locktype){ ** the file has changed and hence might not know to flush their ** cache. The use of a stale cache can lead to database corruption. */ +#if 0 assert( pFile->inNormalWrite==0 || pFile->dbUpdate==0 || pFile->transCntrChng==1 ); +#endif pFile->inNormalWrite = 0; #endif - - if( locktype==SHARED_LOCK ){ - if( rangeLock(pFile, F_RDLCK, &tErrno)==(-1) ){ - rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK); - if( IS_LOCK_ERROR(rc) ){ - pFile->lastErrno = tErrno; + /* downgrading to a shared lock on NFS involves clearing the write lock + ** before establishing the readlock - to avoid a race condition we downgrade + ** the lock in 2 blocks, so that part of the range will be covered by a + ** write lock until the rest is covered by a read lock: + ** 1: [WWWWW] + ** 2: [....W] + ** 3: [RRRRW] + ** 4: [RRRR.] + */ + if( eFileLock==SHARED_LOCK ){ + if( handleNFSUnlock ){ + off_t divSize = SHARED_SIZE - 1; + + lock.l_type = F_UNLCK; + lock.l_whence = SEEK_SET; + lock.l_start = SHARED_FIRST; + lock.l_len = divSize; + if( fcntl(h, F_SETLK, &lock)==(-1) ){ + tErrno = errno; + rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); + if( IS_LOCK_ERROR(rc) ){ + pFile->lastErrno = tErrno; + } + goto end_unlock; + } + lock.l_type = F_RDLCK; + lock.l_whence = SEEK_SET; + lock.l_start = SHARED_FIRST; + lock.l_len = divSize; + if( fcntl(h, F_SETLK, &lock)==(-1) ){ + tErrno = errno; + rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK); + if( IS_LOCK_ERROR(rc) ){ + pFile->lastErrno = tErrno; + } + goto end_unlock; + } + lock.l_type = F_UNLCK; + lock.l_whence = SEEK_SET; + lock.l_start = SHARED_FIRST+divSize; + lock.l_len = SHARED_SIZE-divSize; + if( fcntl(h, F_SETLK, &lock)==(-1) ){ + tErrno = errno; + rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); + if( IS_LOCK_ERROR(rc) ){ + pFile->lastErrno = tErrno; + } + goto end_unlock; + } + }else{ + lock.l_type = F_RDLCK; + lock.l_whence = SEEK_SET; + lock.l_start = SHARED_FIRST; + lock.l_len = SHARED_SIZE; + if( fcntl(h, F_SETLK, &lock)==(-1) ){ + tErrno = errno; + rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK); + if( IS_LOCK_ERROR(rc) ){ + pFile->lastErrno = tErrno; + } + goto end_unlock; } - goto end_unlock; } } lock.l_type = F_UNLCK; @@ -23165,7 +24435,7 @@ static int unixUnlock(sqlite3_file *id, int locktype){ lock.l_start = PENDING_BYTE; lock.l_len = 2L; assert( PENDING_BYTE+1==RESERVED_BYTE ); if( fcntl(h, F_SETLK, &lock)!=(-1) ){ - pLock->locktype = SHARED_LOCK; + pInode->eFileLock = SHARED_LOCK; }else{ tErrno = errno; rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); @@ -23175,15 +24445,13 @@ static int unixUnlock(sqlite3_file *id, int locktype){ goto end_unlock; } } - if( locktype==NO_LOCK ){ - struct unixOpenCnt *pOpen; - + if( eFileLock==NO_LOCK ){ /* Decrement the shared lock counter. Release the lock using an ** OS call only when all threads in this same process have released ** the lock. */ - pLock->cnt--; - if( pLock->cnt==0 ){ + pInode->nShared--; + if( pInode->nShared==0 ){ lock.l_type = F_UNLCK; lock.l_whence = SEEK_SET; lock.l_start = lock.l_len = 0L; @@ -23191,15 +24459,15 @@ static int unixUnlock(sqlite3_file *id, int locktype){ SimulateIOError( h=(-1) ) SimulateIOErrorBenign(0); if( fcntl(h, F_SETLK, &lock)!=(-1) ){ - pLock->locktype = NO_LOCK; + pInode->eFileLock = NO_LOCK; }else{ tErrno = errno; rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); if( IS_LOCK_ERROR(rc) ){ pFile->lastErrno = tErrno; } - pLock->locktype = NO_LOCK; - pFile->locktype = NO_LOCK; + pInode->eFileLock = NO_LOCK; + pFile->eFileLock = NO_LOCK; } } @@ -23207,10 +24475,9 @@ static int unixUnlock(sqlite3_file *id, int locktype){ ** count reaches zero, close any other file descriptors whose close ** was deferred because of outstanding locks. */ - pOpen = pFile->pOpen; - pOpen->nLock--; - assert( pOpen->nLock>=0 ); - if( pOpen->nLock==0 ){ + pInode->nLock--; + assert( pInode->nLock>=0 ); + if( pInode->nLock==0 ){ int rc2 = closePendingFds(pFile); if( rc==SQLITE_OK ){ rc = rc2; @@ -23220,10 +24487,21 @@ static int unixUnlock(sqlite3_file *id, int locktype){ end_unlock: unixLeaveMutex(); - if( rc==SQLITE_OK ) pFile->locktype = locktype; + if( rc==SQLITE_OK ) pFile->eFileLock = eFileLock; return rc; } +/* +** Lower the locking level on file descriptor pFile to eFileLock. eFileLock +** must be either NO_LOCK or SHARED_LOCK. +** +** If the locking level of the file descriptor is already at or below +** the requested locking level, this routine is a no-op. +*/ +static int unixUnlock(sqlite3_file *id, int eFileLock){ + return _posixUnlock(id, eFileLock, 0); +} + /* ** This function performs the parts of the "close file" operation ** common to all locking schemes. It closes the directory and file @@ -23262,7 +24540,7 @@ static int closeUnixFile(sqlite3_file *id){ pFile->pId = 0; } #endif - OSTRACE2("CLOSE %-3d\n", pFile->h); + OSTRACE(("CLOSE %-3d\n", pFile->h)); OpenCounter(-1); sqlite3_free(pFile->pUnused); memset(pFile, 0, sizeof(unixFile)); @@ -23279,16 +24557,15 @@ static int unixClose(sqlite3_file *id){ unixFile *pFile = (unixFile *)id; unixUnlock(id, NO_LOCK); unixEnterMutex(); - if( pFile->pOpen && pFile->pOpen->nLock ){ + if( pFile->pInode && pFile->pInode->nLock ){ /* If there are outstanding locks, do not actually close the file just ** yet because that would clear those locks. Instead, add the file - ** descriptor to pOpen->pUnused list. It will be automatically closed + ** descriptor to pInode->pUnused list. It will be automatically closed ** when the last lock is cleared. */ setPendingFd(pFile); } - releaseLockInfo(pFile->pLock); - releaseOpenCnt(pFile->pOpen); + releaseInodeInfo(pFile); rc = closeUnixFile(id); unixLeaveMutex(); } @@ -23387,7 +24664,7 @@ static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) { assert( pFile ); /* Check if a thread in this process holds such a lock */ - if( pFile->locktype>SHARED_LOCK ){ + if( pFile->eFileLock>SHARED_LOCK ){ /* Either this connection or some other connection in the same process ** holds a lock on the file. No need to check further. */ reserved = 1; @@ -23396,13 +24673,13 @@ static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) { const char *zLockFile = (const char*)pFile->lockingContext; reserved = access(zLockFile, 0)==0; } - OSTRACE4("TEST WR-LOCK %d %d %d\n", pFile->h, rc, reserved); + OSTRACE(("TEST WR-LOCK %d %d %d (dotlock)\n", pFile->h, rc, reserved)); *pResOut = reserved; return rc; } /* -** Lock the file with the lock specified by parameter locktype - one +** Lock the file with the lock specified by parameter eFileLock - one ** of the following: ** ** (1) SHARED_LOCK @@ -23428,7 +24705,7 @@ static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) { ** With dotfile locking, we really only support state (4): EXCLUSIVE. ** But we track the other locking levels internally. */ -static int dotlockLock(sqlite3_file *id, int locktype) { +static int dotlockLock(sqlite3_file *id, int eFileLock) { unixFile *pFile = (unixFile*)id; int fd; char *zLockFile = (char *)pFile->lockingContext; @@ -23438,8 +24715,8 @@ static int dotlockLock(sqlite3_file *id, int locktype) { /* If we have any lock, then the lock file already exists. All we have ** to do is adjust our internal record of the lock level. */ - if( pFile->locktype > NO_LOCK ){ - pFile->locktype = locktype; + if( pFile->eFileLock > NO_LOCK ){ + pFile->eFileLock = eFileLock; #if !OS_VXWORKS /* Always update the timestamp on the old file */ utimes(zLockFile, NULL); @@ -23468,12 +24745,12 @@ static int dotlockLock(sqlite3_file *id, int locktype) { } /* got it, set the type and return ok */ - pFile->locktype = locktype; + pFile->eFileLock = eFileLock; return rc; } /* -** Lower the locking level on file descriptor pFile to locktype. locktype +** Lower the locking level on file descriptor pFile to eFileLock. eFileLock ** must be either NO_LOCK or SHARED_LOCK. ** ** If the locking level of the file descriptor is already at or below @@ -23481,30 +24758,30 @@ static int dotlockLock(sqlite3_file *id, int locktype) { ** ** When the locking level reaches NO_LOCK, delete the lock file. */ -static int dotlockUnlock(sqlite3_file *id, int locktype) { +static int dotlockUnlock(sqlite3_file *id, int eFileLock) { unixFile *pFile = (unixFile*)id; char *zLockFile = (char *)pFile->lockingContext; assert( pFile ); - OSTRACE5("UNLOCK %d %d was %d pid=%d\n", pFile->h, locktype, - pFile->locktype, getpid()); - assert( locktype<=SHARED_LOCK ); + OSTRACE(("UNLOCK %d %d was %d pid=%d (dotlock)\n", pFile->h, eFileLock, + pFile->eFileLock, getpid())); + assert( eFileLock<=SHARED_LOCK ); /* no-op if possible */ - if( pFile->locktype==locktype ){ + if( pFile->eFileLock==eFileLock ){ return SQLITE_OK; } /* To downgrade to shared, simply update our internal notion of the ** lock state. No need to mess with the file on disk. */ - if( locktype==SHARED_LOCK ){ - pFile->locktype = SHARED_LOCK; + if( eFileLock==SHARED_LOCK ){ + pFile->eFileLock = SHARED_LOCK; return SQLITE_OK; } /* To fully unlock the database, delete the lock file */ - assert( locktype==NO_LOCK ); + assert( eFileLock==NO_LOCK ); if( unlink(zLockFile) ){ int rc = 0; int tErrno = errno; @@ -23516,7 +24793,7 @@ static int dotlockUnlock(sqlite3_file *id, int locktype) { } return rc; } - pFile->locktype = NO_LOCK; + pFile->eFileLock = NO_LOCK; return SQLITE_OK; } @@ -23569,7 +24846,7 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ assert( pFile ); /* Check if a thread in this process holds such a lock */ - if( pFile->locktype>SHARED_LOCK ){ + if( pFile->eFileLock>SHARED_LOCK ){ reserved = 1; } @@ -23600,7 +24877,7 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ } } } - OSTRACE4("TEST WR-LOCK %d %d %d\n", pFile->h, rc, reserved); + OSTRACE(("TEST WR-LOCK %d %d %d (flock)\n", pFile->h, rc, reserved)); #ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS if( (rc & SQLITE_IOERR) == SQLITE_IOERR ){ @@ -23613,7 +24890,7 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ } /* -** Lock the file with the lock specified by parameter locktype - one +** Lock the file with the lock specified by parameter eFileLock - one ** of the following: ** ** (1) SHARED_LOCK @@ -23641,7 +24918,7 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ ** This routine will only increase a lock. Use the sqlite3OsUnlock() ** routine to lower a locking level. */ -static int flockLock(sqlite3_file *id, int locktype) { +static int flockLock(sqlite3_file *id, int eFileLock) { int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; @@ -23649,8 +24926,8 @@ static int flockLock(sqlite3_file *id, int locktype) { /* if we already have a lock, it is exclusive. ** Just adjust level and punt on outta here. */ - if (pFile->locktype > NO_LOCK) { - pFile->locktype = locktype; + if (pFile->eFileLock > NO_LOCK) { + pFile->eFileLock = eFileLock; return SQLITE_OK; } @@ -23665,10 +24942,10 @@ static int flockLock(sqlite3_file *id, int locktype) { } } else { /* got it, set the type and return ok */ - pFile->locktype = locktype; + pFile->eFileLock = eFileLock; } - OSTRACE4("LOCK %d %s %s\n", pFile->h, locktypeName(locktype), - rc==SQLITE_OK ? "ok" : "failed"); + OSTRACE(("LOCK %d %s %s (flock)\n", pFile->h, azFileLock(eFileLock), + rc==SQLITE_OK ? "ok" : "failed")); #ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS if( (rc & SQLITE_IOERR) == SQLITE_IOERR ){ rc = SQLITE_BUSY; @@ -23679,28 +24956,28 @@ static int flockLock(sqlite3_file *id, int locktype) { /* -** Lower the locking level on file descriptor pFile to locktype. locktype +** Lower the locking level on file descriptor pFile to eFileLock. eFileLock ** must be either NO_LOCK or SHARED_LOCK. ** ** If the locking level of the file descriptor is already at or below ** the requested locking level, this routine is a no-op. */ -static int flockUnlock(sqlite3_file *id, int locktype) { +static int flockUnlock(sqlite3_file *id, int eFileLock) { unixFile *pFile = (unixFile*)id; assert( pFile ); - OSTRACE5("UNLOCK %d %d was %d pid=%d\n", pFile->h, locktype, - pFile->locktype, getpid()); - assert( locktype<=SHARED_LOCK ); + OSTRACE(("UNLOCK %d %d was %d pid=%d (flock)\n", pFile->h, eFileLock, + pFile->eFileLock, getpid())); + assert( eFileLock<=SHARED_LOCK ); /* no-op if possible */ - if( pFile->locktype==locktype ){ + if( pFile->eFileLock==eFileLock ){ return SQLITE_OK; } /* shared can just be set because we always have an exclusive */ - if (locktype==SHARED_LOCK) { - pFile->locktype = locktype; + if (eFileLock==SHARED_LOCK) { + pFile->eFileLock = eFileLock; return SQLITE_OK; } @@ -23720,7 +24997,7 @@ static int flockUnlock(sqlite3_file *id, int locktype) { return r; } else { - pFile->locktype = NO_LOCK; + pFile->eFileLock = NO_LOCK; return SQLITE_OK; } } @@ -23768,13 +25045,13 @@ static int semCheckReservedLock(sqlite3_file *id, int *pResOut) { assert( pFile ); /* Check if a thread in this process holds such a lock */ - if( pFile->locktype>SHARED_LOCK ){ + if( pFile->eFileLock>SHARED_LOCK ){ reserved = 1; } /* Otherwise see if some other process holds it. */ if( !reserved ){ - sem_t *pSem = pFile->pOpen->pSem; + sem_t *pSem = pFile->pInode->pSem; struct stat statBuf; if( sem_trywait(pSem)==-1 ){ @@ -23784,21 +25061,21 @@ static int semCheckReservedLock(sqlite3_file *id, int *pResOut) { pFile->lastErrno = tErrno; } else { /* someone else has the lock when we are in NO_LOCK */ - reserved = (pFile->locktype < SHARED_LOCK); + reserved = (pFile->eFileLock < SHARED_LOCK); } }else{ /* we could have it if we want it */ sem_post(pSem); } } - OSTRACE4("TEST WR-LOCK %d %d %d\n", pFile->h, rc, reserved); + OSTRACE(("TEST WR-LOCK %d %d %d (sem)\n", pFile->h, rc, reserved)); *pResOut = reserved; return rc; } /* -** Lock the file with the lock specified by parameter locktype - one +** Lock the file with the lock specified by parameter eFileLock - one ** of the following: ** ** (1) SHARED_LOCK @@ -23826,16 +25103,16 @@ static int semCheckReservedLock(sqlite3_file *id, int *pResOut) { ** This routine will only increase a lock. Use the sqlite3OsUnlock() ** routine to lower a locking level. */ -static int semLock(sqlite3_file *id, int locktype) { +static int semLock(sqlite3_file *id, int eFileLock) { unixFile *pFile = (unixFile*)id; int fd; - sem_t *pSem = pFile->pOpen->pSem; + sem_t *pSem = pFile->pInode->pSem; int rc = SQLITE_OK; /* if we already have a lock, it is exclusive. ** Just adjust level and punt on outta here. */ - if (pFile->locktype > NO_LOCK) { - pFile->locktype = locktype; + if (pFile->eFileLock > NO_LOCK) { + pFile->eFileLock = eFileLock; rc = SQLITE_OK; goto sem_end_lock; } @@ -23847,37 +25124,37 @@ static int semLock(sqlite3_file *id, int locktype) { } /* got it, set the type and return ok */ - pFile->locktype = locktype; + pFile->eFileLock = eFileLock; sem_end_lock: return rc; } /* -** Lower the locking level on file descriptor pFile to locktype. locktype +** Lower the locking level on file descriptor pFile to eFileLock. eFileLock ** must be either NO_LOCK or SHARED_LOCK. ** ** If the locking level of the file descriptor is already at or below ** the requested locking level, this routine is a no-op. */ -static int semUnlock(sqlite3_file *id, int locktype) { +static int semUnlock(sqlite3_file *id, int eFileLock) { unixFile *pFile = (unixFile*)id; - sem_t *pSem = pFile->pOpen->pSem; + sem_t *pSem = pFile->pInode->pSem; assert( pFile ); assert( pSem ); - OSTRACE5("UNLOCK %d %d was %d pid=%d\n", pFile->h, locktype, - pFile->locktype, getpid()); - assert( locktype<=SHARED_LOCK ); + OSTRACE(("UNLOCK %d %d was %d pid=%d (sem)\n", pFile->h, eFileLock, + pFile->eFileLock, getpid())); + assert( eFileLock<=SHARED_LOCK ); /* no-op if possible */ - if( pFile->locktype==locktype ){ + if( pFile->eFileLock==eFileLock ){ return SQLITE_OK; } /* shared can just be set because we always have an exclusive */ - if (locktype==SHARED_LOCK) { - pFile->locktype = locktype; + if (eFileLock==SHARED_LOCK) { + pFile->eFileLock = eFileLock; return SQLITE_OK; } @@ -23890,7 +25167,7 @@ static int semUnlock(sqlite3_file *id, int locktype) { } return rc; } - pFile->locktype = NO_LOCK; + pFile->eFileLock = NO_LOCK; return SQLITE_OK; } @@ -23903,8 +25180,7 @@ static int semClose(sqlite3_file *id) { semUnlock(id, NO_LOCK); assert( pFile ); unixEnterMutex(); - releaseLockInfo(pFile->pLock); - releaseOpenCnt(pFile->pOpen); + releaseInodeInfo(pFile); unixLeaveMutex(); closeUnixFile(id); } @@ -23935,7 +25211,7 @@ static int semClose(sqlite3_file *id) { */ typedef struct afpLockingContext afpLockingContext; struct afpLockingContext { - unsigned long long sharedByte; + int reserved; const char *dbPath; /* Name of the open file */ }; @@ -23973,15 +25249,15 @@ static int afpSetLock( pb.length = length; pb.fd = pFile->h; - OSTRACE6("AFPSETLOCK [%s] for %d%s in range %llx:%llx\n", + OSTRACE(("AFPSETLOCK [%s] for %d%s in range %llx:%llx\n", (setLockFlag?"ON":"OFF"), pFile->h, (pb.fd==-1?"[testval-1]":""), - offset, length); + offset, length)); err = fsctl(path, afpfsByteRangeLock2FSCTL, &pb, 0); if ( err==-1 ) { int rc; int tErrno = errno; - OSTRACE4("AFPSETLOCK failed to fsctl() '%s' %d %s\n", - path, tErrno, strerror(tErrno)); + OSTRACE(("AFPSETLOCK failed to fsctl() '%s' %d %s\n", + path, tErrno, strerror(tErrno))); #ifdef SQLITE_IGNORE_AFP_LOCK_ERRORS rc = SQLITE_BUSY; #else @@ -24012,9 +25288,14 @@ static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ assert( pFile ); afpLockingContext *context = (afpLockingContext *) pFile->lockingContext; + if( context->reserved ){ + *pResOut = 1; + return SQLITE_OK; + } + unixEnterMutex(); /* Because pFile->pInode is shared across threads */ /* Check if a thread in this process holds such a lock */ - if( pFile->locktype>SHARED_LOCK ){ + if( pFile->pInode->eFileLock>SHARED_LOCK ){ reserved = 1; } @@ -24036,14 +25317,15 @@ static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ } } - OSTRACE4("TEST WR-LOCK %d %d %d\n", pFile->h, rc, reserved); + unixLeaveMutex(); + OSTRACE(("TEST WR-LOCK %d %d %d (afp)\n", pFile->h, rc, reserved)); *pResOut = reserved; return rc; } /* -** Lock the file with the lock specified by parameter locktype - one +** Lock the file with the lock specified by parameter eFileLock - one ** of the following: ** ** (1) SHARED_LOCK @@ -24066,49 +25348,72 @@ static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ ** This routine will only increase a lock. Use the sqlite3OsUnlock() ** routine to lower a locking level. */ -static int afpLock(sqlite3_file *id, int locktype){ +static int afpLock(sqlite3_file *id, int eFileLock){ int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; + unixInodeInfo *pInode = pFile->pInode; afpLockingContext *context = (afpLockingContext *) pFile->lockingContext; assert( pFile ); - OSTRACE5("LOCK %d %s was %s pid=%d\n", pFile->h, - locktypeName(locktype), locktypeName(pFile->locktype), getpid()); + OSTRACE(("LOCK %d %s was %s(%s,%d) pid=%d (afp)\n", pFile->h, + azFileLock(eFileLock), azFileLock(pFile->eFileLock), + azFileLock(pInode->eFileLock), pInode->nShared , getpid())); /* If there is already a lock of this type or more restrictive on the ** unixFile, do nothing. Don't use the afp_end_lock: exit path, as ** unixEnterMutex() hasn't been called yet. */ - if( pFile->locktype>=locktype ){ - OSTRACE3("LOCK %d %s ok (already held)\n", pFile->h, - locktypeName(locktype)); + if( pFile->eFileLock>=eFileLock ){ + OSTRACE(("LOCK %d %s ok (already held) (afp)\n", pFile->h, + azFileLock(eFileLock))); return SQLITE_OK; } /* Make sure the locking sequence is correct + ** (1) We never move from unlocked to anything higher than shared lock. + ** (2) SQLite never explicitly requests a pendig lock. + ** (3) A shared lock is always held when a reserve lock is requested. */ - assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK ); - assert( locktype!=PENDING_LOCK ); - assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK ); + assert( pFile->eFileLock!=NO_LOCK || eFileLock==SHARED_LOCK ); + assert( eFileLock!=PENDING_LOCK ); + assert( eFileLock!=RESERVED_LOCK || pFile->eFileLock==SHARED_LOCK ); - /* This mutex is needed because pFile->pLock is shared across threads + /* This mutex is needed because pFile->pInode is shared across threads */ unixEnterMutex(); + pInode = pFile->pInode; - /* Make sure the current thread owns the pFile. + /* If some thread using this PID has a lock via a different unixFile* + ** handle that precludes the requested lock, return BUSY. */ - rc = transferOwnership(pFile); - if( rc!=SQLITE_OK ){ - unixLeaveMutex(); - return rc; + if( (pFile->eFileLock!=pInode->eFileLock && + (pInode->eFileLock>=PENDING_LOCK || eFileLock>SHARED_LOCK)) + ){ + rc = SQLITE_BUSY; + goto afp_end_lock; + } + + /* If a SHARED lock is requested, and some thread using this PID already + ** has a SHARED or RESERVED lock, then increment reference counts and + ** return SQLITE_OK. + */ + if( eFileLock==SHARED_LOCK && + (pInode->eFileLock==SHARED_LOCK || pInode->eFileLock==RESERVED_LOCK) ){ + assert( eFileLock==SHARED_LOCK ); + assert( pFile->eFileLock==0 ); + assert( pInode->nShared>0 ); + pFile->eFileLock = SHARED_LOCK; + pInode->nShared++; + pInode->nLock++; + goto afp_end_lock; } /* A PENDING lock is needed before acquiring a SHARED lock and before ** acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will ** be released. */ - if( locktype==SHARED_LOCK - || (locktype==EXCLUSIVE_LOCK && pFile->locktypeeFileLockdbPath, pFile, PENDING_BYTE, 1, 1); @@ -24121,16 +25426,20 @@ static int afpLock(sqlite3_file *id, int locktype){ /* If control gets to this point, then actually go ahead and make ** operating system calls for the specified lock. */ - if( locktype==SHARED_LOCK ){ - int lk, lrc1, lrc2; - int lrc1Errno = 0; + if( eFileLock==SHARED_LOCK ){ + int lrc1, lrc2, lrc1Errno; + long lk, mask; + assert( pInode->nShared==0 ); + assert( pInode->eFileLock==0 ); + + mask = (sizeof(long)==8) ? LARGEST_INT64 : 0x7fffffff; /* Now get the read-lock SHARED_LOCK */ /* note that the quality of the randomness doesn't matter that much */ lk = random(); - context->sharedByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1); + pInode->sharedByte = (lk & mask)%(SHARED_SIZE - 1); lrc1 = afpSetLock(context->dbPath, pFile, - SHARED_FIRST+context->sharedByte, 1, 1); + SHARED_FIRST+pInode->sharedByte, 1, 1); if( IS_LOCK_ERROR(lrc1) ){ lrc1Errno = pFile->lastErrno; } @@ -24147,34 +25456,42 @@ static int afpLock(sqlite3_file *id, int locktype){ } else if( lrc1 != SQLITE_OK ) { rc = lrc1; } else { - pFile->locktype = SHARED_LOCK; - pFile->pOpen->nLock++; + pFile->eFileLock = SHARED_LOCK; + pInode->nLock++; + pInode->nShared = 1; } + }else if( eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1 ){ + /* We are trying for an exclusive lock but another thread in this + ** same process is still holding a shared lock. */ + rc = SQLITE_BUSY; }else{ /* The request was for a RESERVED or EXCLUSIVE lock. It is ** assumed that there is a SHARED or greater lock on the file ** already. */ int failed = 0; - assert( 0!=pFile->locktype ); - if (locktype >= RESERVED_LOCK && pFile->locktype < RESERVED_LOCK) { + assert( 0!=pFile->eFileLock ); + if (eFileLock >= RESERVED_LOCK && pFile->eFileLock < RESERVED_LOCK) { /* Acquire a RESERVED lock */ failed = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1,1); + if( !failed ){ + context->reserved = 1; + } } - if (!failed && locktype == EXCLUSIVE_LOCK) { + if (!failed && eFileLock == EXCLUSIVE_LOCK) { /* Acquire an EXCLUSIVE lock */ /* Remove the shared lock before trying the range. we'll need to ** reestablish the shared lock if we can't get the afpUnlock */ if( !(failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST + - context->sharedByte, 1, 0)) ){ + pInode->sharedByte, 1, 0)) ){ int failed2 = SQLITE_OK; /* now attemmpt to get the exclusive lock range */ failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST, SHARED_SIZE, 1); if( failed && (failed2 = afpSetLock(context->dbPath, pFile, - SHARED_FIRST + context->sharedByte, 1, 1)) ){ + SHARED_FIRST + pInode->sharedByte, 1, 1)) ){ /* Can't reestablish the shared lock. Sqlite can't deal, this is ** a critical I/O error */ @@ -24192,78 +25509,124 @@ static int afpLock(sqlite3_file *id, int locktype){ } if( rc==SQLITE_OK ){ - pFile->locktype = locktype; - }else if( locktype==EXCLUSIVE_LOCK ){ - pFile->locktype = PENDING_LOCK; + pFile->eFileLock = eFileLock; + pInode->eFileLock = eFileLock; + }else if( eFileLock==EXCLUSIVE_LOCK ){ + pFile->eFileLock = PENDING_LOCK; + pInode->eFileLock = PENDING_LOCK; } afp_end_lock: unixLeaveMutex(); - OSTRACE4("LOCK %d %s %s\n", pFile->h, locktypeName(locktype), - rc==SQLITE_OK ? "ok" : "failed"); + OSTRACE(("LOCK %d %s %s (afp)\n", pFile->h, azFileLock(eFileLock), + rc==SQLITE_OK ? "ok" : "failed")); return rc; } /* -** Lower the locking level on file descriptor pFile to locktype. locktype +** Lower the locking level on file descriptor pFile to eFileLock. eFileLock ** must be either NO_LOCK or SHARED_LOCK. ** ** If the locking level of the file descriptor is already at or below ** the requested locking level, this routine is a no-op. */ -static int afpUnlock(sqlite3_file *id, int locktype) { +static int afpUnlock(sqlite3_file *id, int eFileLock) { int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; - afpLockingContext *pCtx = (afpLockingContext *) pFile->lockingContext; + unixInodeInfo *pInode; + afpLockingContext *context = (afpLockingContext *) pFile->lockingContext; + int skipShared = 0; +#ifdef SQLITE_TEST + int h = pFile->h; +#endif assert( pFile ); - OSTRACE5("UNLOCK %d %d was %d pid=%d\n", pFile->h, locktype, - pFile->locktype, getpid()); + OSTRACE(("UNLOCK %d %d was %d(%d,%d) pid=%d (afp)\n", pFile->h, eFileLock, + pFile->eFileLock, pFile->pInode->eFileLock, pFile->pInode->nShared, + getpid())); - assert( locktype<=SHARED_LOCK ); - if( pFile->locktype<=locktype ){ + assert( eFileLock<=SHARED_LOCK ); + if( pFile->eFileLock<=eFileLock ){ return SQLITE_OK; } - if( CHECK_THREADID(pFile) ){ - return SQLITE_MISUSE; - } unixEnterMutex(); - if( pFile->locktype>SHARED_LOCK ){ + pInode = pFile->pInode; + assert( pInode->nShared!=0 ); + if( pFile->eFileLock>SHARED_LOCK ){ + assert( pInode->eFileLock==pFile->eFileLock ); + SimulateIOErrorBenign(1); + SimulateIOError( h=(-1) ) + SimulateIOErrorBenign(0); - if( pFile->locktype==EXCLUSIVE_LOCK ){ - rc = afpSetLock(pCtx->dbPath, pFile, SHARED_FIRST, SHARED_SIZE, 0); - if( rc==SQLITE_OK && locktype==SHARED_LOCK ){ +#ifndef NDEBUG + /* When reducing a lock such that other processes can start + ** reading the database file again, make sure that the + ** transaction counter was updated if any part of the database + ** file changed. If the transaction counter is not updated, + ** other connections to the same file might not realize that + ** the file has changed and hence might not know to flush their + ** cache. The use of a stale cache can lead to database corruption. + */ + assert( pFile->inNormalWrite==0 + || pFile->dbUpdate==0 + || pFile->transCntrChng==1 ); + pFile->inNormalWrite = 0; +#endif + + if( pFile->eFileLock==EXCLUSIVE_LOCK ){ + rc = afpSetLock(context->dbPath, pFile, SHARED_FIRST, SHARED_SIZE, 0); + if( rc==SQLITE_OK && (eFileLock==SHARED_LOCK || pInode->nShared>1) ){ /* only re-establish the shared lock if necessary */ - int sharedLockByte = SHARED_FIRST+pCtx->sharedByte; - rc = afpSetLock(pCtx->dbPath, pFile, sharedLockByte, 1, 1); + int sharedLockByte = SHARED_FIRST+pInode->sharedByte; + rc = afpSetLock(context->dbPath, pFile, sharedLockByte, 1, 1); + } else { + skipShared = 1; } } - if( rc==SQLITE_OK && pFile->locktype>=PENDING_LOCK ){ - rc = afpSetLock(pCtx->dbPath, pFile, PENDING_BYTE, 1, 0); + if( rc==SQLITE_OK && pFile->eFileLock>=PENDING_LOCK ){ + rc = afpSetLock(context->dbPath, pFile, PENDING_BYTE, 1, 0); } - if( rc==SQLITE_OK && pFile->locktype>=RESERVED_LOCK ){ - rc = afpSetLock(pCtx->dbPath, pFile, RESERVED_BYTE, 1, 0); + if( rc==SQLITE_OK && pFile->eFileLock>=RESERVED_LOCK && context->reserved ){ + rc = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1, 0); + if( !rc ){ + context->reserved = 0; + } + } + if( rc==SQLITE_OK && (eFileLock==SHARED_LOCK || pInode->nShared>1)){ + pInode->eFileLock = SHARED_LOCK; } - }else if( locktype==NO_LOCK ){ - /* clear the shared lock */ - int sharedLockByte = SHARED_FIRST+pCtx->sharedByte; - rc = afpSetLock(pCtx->dbPath, pFile, sharedLockByte, 1, 0); } + if( rc==SQLITE_OK && eFileLock==NO_LOCK ){ - if( rc==SQLITE_OK ){ - if( locktype==NO_LOCK ){ - struct unixOpenCnt *pOpen = pFile->pOpen; - pOpen->nLock--; - assert( pOpen->nLock>=0 ); - if( pOpen->nLock==0 ){ + /* Decrement the shared lock counter. Release the lock using an + ** OS call only when all threads in this same process have released + ** the lock. + */ + unsigned long long sharedLockByte = SHARED_FIRST+pInode->sharedByte; + pInode->nShared--; + if( pInode->nShared==0 ){ + SimulateIOErrorBenign(1); + SimulateIOError( h=(-1) ) + SimulateIOErrorBenign(0); + if( !skipShared ){ + rc = afpSetLock(context->dbPath, pFile, sharedLockByte, 1, 0); + } + if( !rc ){ + pInode->eFileLock = NO_LOCK; + pFile->eFileLock = NO_LOCK; + } + } + if( rc==SQLITE_OK ){ + pInode->nLock--; + assert( pInode->nLock>=0 ); + if( pInode->nLock==0 ){ rc = closePendingFds(pFile); } } } + unixLeaveMutex(); - if( rc==SQLITE_OK ){ - pFile->locktype = locktype; - } + if( rc==SQLITE_OK ) pFile->eFileLock = eFileLock; return rc; } @@ -24271,24 +25634,25 @@ static int afpUnlock(sqlite3_file *id, int locktype) { ** Close a file & cleanup AFP specific locking context */ static int afpClose(sqlite3_file *id) { + int rc = SQLITE_OK; if( id ){ unixFile *pFile = (unixFile*)id; afpUnlock(id, NO_LOCK); unixEnterMutex(); - if( pFile->pOpen && pFile->pOpen->nLock ){ + if( pFile->pInode && pFile->pInode->nLock ){ /* If there are outstanding locks, do not actually close the file just ** yet because that would clear those locks. Instead, add the file - ** descriptor to pOpen->aPending. It will be automatically closed when + ** descriptor to pInode->aPending. It will be automatically closed when ** the last lock is cleared. */ setPendingFd(pFile); } - releaseOpenCnt(pFile->pOpen); + releaseInodeInfo(pFile); sqlite3_free(pFile->lockingContext); - closeUnixFile(id); + rc = closeUnixFile(id); unixLeaveMutex(); } - return SQLITE_OK; + return rc; } #endif /* defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE */ @@ -24301,6 +25665,29 @@ static int afpClose(sqlite3_file *id) { ********************* End of the AFP lock implementation ********************** ******************************************************************************/ +/****************************************************************************** +*************************** Begin NFS Locking ********************************/ + +#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE +/* + ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock + ** must be either NO_LOCK or SHARED_LOCK. + ** + ** If the locking level of the file descriptor is already at or below + ** the requested locking level, this routine is a no-op. + */ +static int nfsUnlock(sqlite3_file *id, int eFileLock){ + return _posixUnlock(id, eFileLock, 1); +} + +#endif /* defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE */ +/* +** The code above is the NFS lock implementation. The code is specific +** to MacOSX and does not work on other unix platforms. No alternative +** is available. +** +********************* End of the NFS lock implementation ********************** +******************************************************************************/ /****************************************************************************** **************** Non-locking sqlite3_file methods ***************************** @@ -24327,7 +25714,9 @@ static int afpClose(sqlite3_file *id) { */ static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){ int got; +#if (!defined(USE_PREAD) && !defined(USE_PREAD64)) i64 newOffset; +#endif TIMER_START; #if defined(USE_PREAD) got = pread(id->h, pBuf, cnt, offset); @@ -24352,7 +25741,7 @@ static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){ if( got<0 ){ ((unixFile*)id)->lastErrno = errno; } - OSTRACE5("READ %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED); + OSTRACE(("READ %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED)); return got; } @@ -24373,10 +25762,12 @@ static int unixRead( /* If this is a database file (not a journal, master-journal or temp ** file), the bytes in the locking range should never be read or written. */ +#if 0 assert( pFile->pUnused==0 || offset>=PENDING_BYTE+512 || offset+amt<=PENDING_BYTE ); +#endif got = seekAndRead(pFile, offset, pBuf, amt); if( got==amt ){ @@ -24401,7 +25792,9 @@ static int unixRead( */ static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){ int got; +#if (!defined(USE_PREAD) && !defined(USE_PREAD64)) i64 newOffset; +#endif TIMER_START; #if defined(USE_PREAD) got = pwrite(id->h, pBuf, cnt, offset); @@ -24424,7 +25817,7 @@ static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){ ((unixFile*)id)->lastErrno = errno; } - OSTRACE5("WRITE %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED); + OSTRACE(("WRITE %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED)); return got; } @@ -24446,10 +25839,12 @@ static int unixWrite( /* If this is a database file (not a journal, master-journal or temp ** file), the bytes in the locking range should never be read or written. */ +#if 0 assert( pFile->pUnused==0 || offset>=PENDING_BYTE+512 || offset+amt<=PENDING_BYTE ); +#endif #ifndef NDEBUG /* If we are doing a normal write to a database file (as opposed to @@ -24480,6 +25875,7 @@ static int unixWrite( } SimulateIOError(( wrote=(-1), amt=1 )); SimulateDiskfullError(( wrote=0, amt=1 )); + if( amt>0 ){ if( wrote<0 ){ /* lastErrno set by seekAndWrite */ @@ -24489,6 +25885,7 @@ static int unixWrite( return SQLITE_FULL; } } + return SQLITE_OK; } @@ -24595,6 +25992,11 @@ static int full_fsync(int fd, int fullSync, int dataOnly){ */ if( rc ) rc = fsync(fd); +#elif defined(__APPLE__) + /* fdatasync() on HFS+ doesn't yet flush the file size if it changed correctly + ** so currently we default to the macro that redefines fdatasync to fsync + */ + rc = fsync(fd); #else rc = fdatasync(fd); #if OS_VXWORKS @@ -24643,7 +26045,7 @@ static int unixSync(sqlite3_file *id, int flags){ SimulateDiskfullError( return SQLITE_FULL ); assert( pFile ); - OSTRACE2("SYNC %-3d\n", pFile->h); + OSTRACE(("SYNC %-3d\n", pFile->h)); rc = full_fsync(pFile->h, isFullsync, isDataOnly); SimulateIOError( rc=1 ); if( rc ){ @@ -24652,8 +26054,8 @@ static int unixSync(sqlite3_file *id, int flags){ } if( pFile->dirfd>=0 ){ int err; - OSTRACE4("DIRSYNC %-3d (have_fullfsync=%d fullsync=%d)\n", pFile->dirfd, - HAVE_FULLFSYNC, isFullsync); + OSTRACE(("DIRSYNC %-3d (have_fullfsync=%d fullsync=%d)\n", pFile->dirfd, + HAVE_FULLFSYNC, isFullsync)); #ifndef SQLITE_DISABLE_DIRSYNC /* The directory sync is only attempted if full_fsync is ** turned off or unavailable. If a full_fsync occurred above, @@ -24685,14 +26087,38 @@ static int unixSync(sqlite3_file *id, int flags){ ** Truncate an open file to a specified size */ static int unixTruncate(sqlite3_file *id, i64 nByte){ + unixFile *pFile = (unixFile *)id; int rc; - assert( id ); + assert( pFile ); SimulateIOError( return SQLITE_IOERR_TRUNCATE ); - rc = ftruncate(((unixFile*)id)->h, (off_t)nByte); + + /* If the user has configured a chunk-size for this file, truncate the + ** file so that it consists of an integer number of chunks (i.e. the + ** actual file size after the operation may be larger than the requested + ** size). + */ + if( pFile->szChunk ){ + nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk; + } + + rc = ftruncate(pFile->h, (off_t)nByte); if( rc ){ - ((unixFile*)id)->lastErrno = errno; + pFile->lastErrno = errno; return SQLITE_IOERR_TRUNCATE; }else{ +#ifndef NDEBUG + /* If we are doing a normal write to a database file (as opposed to + ** doing a hot-journal rollback or a write to some file other than a + ** normal database file) and we truncate the file to zero length, + ** that effectively updates the change counter. This might happen + ** when restoring a database using the backup API from a zero-length + ** source. + */ + if( pFile->inNormalWrite && nByte==0 ){ + pFile->transCntrChng = 1; + } +#endif + return SQLITE_OK; } } @@ -24712,7 +26138,7 @@ static int unixFileSize(sqlite3_file *id, i64 *pSize){ } *pSize = buf.st_size; - /* When opening a zero-size database, the findLockInfo() procedure + /* When opening a zero-size database, the findInodeInfo() procedure ** writes a single byte into that file in order to work around a bug ** in the OS-X msdos filesystem. In order to avoid problems with upper ** layers, we need to report this file size as zero even though it is @@ -24732,6 +26158,54 @@ static int unixFileSize(sqlite3_file *id, i64 *pSize){ static int proxyFileControl(sqlite3_file*,int,void*); #endif +/* +** This function is called to handle the SQLITE_FCNTL_SIZE_HINT +** file-control operation. +** +** If the user has configured a chunk-size for this file, it could be +** that the file needs to be extended at this point. Otherwise, the +** SQLITE_FCNTL_SIZE_HINT operation is a no-op for Unix. +*/ +static int fcntlSizeHint(unixFile *pFile, i64 nByte){ + if( pFile->szChunk ){ + i64 nSize; /* Required file size */ + struct stat buf; /* Used to hold return values of fstat() */ + + if( fstat(pFile->h, &buf) ) return SQLITE_IOERR_FSTAT; + + nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk; + if( nSize>(i64)buf.st_size ){ +#if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE + if( posix_fallocate(pFile->h, buf.st_size, nSize-buf.st_size) ){ + return SQLITE_IOERR_WRITE; + } +#else + /* If the OS does not have posix_fallocate(), fake it. First use + ** ftruncate() to set the file size, then write a single byte to + ** the last byte in each block within the extended region. This + ** is the same technique used by glibc to implement posix_fallocate() + ** on systems that do not have a real fallocate() system call. + */ + int nBlk = buf.st_blksize; /* File-system block size */ + i64 iWrite; /* Next offset to write to */ + int nWrite; /* Return value from seekAndWrite() */ + + if( ftruncate(pFile->h, nSize) ){ + pFile->lastErrno = errno; + return SQLITE_IOERR_TRUNCATE; + } + iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1; + do { + nWrite = seekAndWrite(pFile, iWrite, "", 1); + iWrite += nBlk; + } while( nWrite==1 && iWritelocktype; + *(int*)pArg = ((unixFile*)id)->eFileLock; return SQLITE_OK; } case SQLITE_LAST_ERRNO: { *(int*)pArg = ((unixFile*)id)->lastErrno; return SQLITE_OK; } + case SQLITE_FCNTL_CHUNK_SIZE: { + ((unixFile*)id)->szChunk = *(int *)pArg; + return SQLITE_OK; + } + case SQLITE_FCNTL_SIZE_HINT: { + return fcntlSizeHint((unixFile *)id, *(i64 *)pArg); + } #ifndef NDEBUG /* The pager calls this method to signal that it has done ** a rollback and that the database is therefore unchanged and @@ -24790,6 +26271,609 @@ static int unixDeviceCharacteristics(sqlite3_file *NotUsed){ return 0; } +#ifndef SQLITE_OMIT_WAL + + +/* +** Object used to represent an shared memory buffer. +** +** When multiple threads all reference the same wal-index, each thread +** has its own unixShm object, but they all point to a single instance +** of this unixShmNode object. In other words, each wal-index is opened +** only once per process. +** +** Each unixShmNode object is connected to a single unixInodeInfo object. +** We could coalesce this object into unixInodeInfo, but that would mean +** every open file that does not use shared memory (in other words, most +** open files) would have to carry around this extra information. So +** the unixInodeInfo object contains a pointer to this unixShmNode object +** and the unixShmNode object is created only when needed. +** +** unixMutexHeld() must be true when creating or destroying +** this object or while reading or writing the following fields: +** +** nRef +** +** The following fields are read-only after the object is created: +** +** fid +** zFilename +** +** Either unixShmNode.mutex must be held or unixShmNode.nRef==0 and +** unixMutexHeld() is true when reading or writing any other field +** in this structure. +*/ +struct unixShmNode { + unixInodeInfo *pInode; /* unixInodeInfo that owns this SHM node */ + sqlite3_mutex *mutex; /* Mutex to access this object */ + char *zFilename; /* Name of the mmapped file */ + int h; /* Open file descriptor */ + int szRegion; /* Size of shared-memory regions */ + int nRegion; /* Size of array apRegion */ + char **apRegion; /* Array of mapped shared-memory regions */ + int nRef; /* Number of unixShm objects pointing to this */ + unixShm *pFirst; /* All unixShm objects pointing to this */ +#ifdef SQLITE_DEBUG + u8 exclMask; /* Mask of exclusive locks held */ + u8 sharedMask; /* Mask of shared locks held */ + u8 nextShmId; /* Next available unixShm.id value */ +#endif +}; + +/* +** Structure used internally by this VFS to record the state of an +** open shared memory connection. +** +** The following fields are initialized when this object is created and +** are read-only thereafter: +** +** unixShm.pFile +** unixShm.id +** +** All other fields are read/write. The unixShm.pFile->mutex must be held +** while accessing any read/write fields. +*/ +struct unixShm { + unixShmNode *pShmNode; /* The underlying unixShmNode object */ + unixShm *pNext; /* Next unixShm with the same unixShmNode */ + u8 hasMutex; /* True if holding the unixShmNode mutex */ + u16 sharedMask; /* Mask of shared locks held */ + u16 exclMask; /* Mask of exclusive locks held */ +#ifdef SQLITE_DEBUG + u8 id; /* Id of this connection within its unixShmNode */ +#endif +}; + +/* +** Constants used for locking +*/ +#define UNIX_SHM_BASE ((22+SQLITE_SHM_NLOCK)*4) /* first lock byte */ +#define UNIX_SHM_DMS (UNIX_SHM_BASE+SQLITE_SHM_NLOCK) /* deadman switch */ + +/* +** Apply posix advisory locks for all bytes from ofst through ofst+n-1. +** +** Locks block if the mask is exactly UNIX_SHM_C and are non-blocking +** otherwise. +*/ +static int unixShmSystemLock( + unixShmNode *pShmNode, /* Apply locks to this open shared-memory segment */ + int lockType, /* F_UNLCK, F_RDLCK, or F_WRLCK */ + int ofst, /* First byte of the locking range */ + int n /* Number of bytes to lock */ +){ + struct flock f; /* The posix advisory locking structure */ + int rc = SQLITE_OK; /* Result code form fcntl() */ + + /* Access to the unixShmNode object is serialized by the caller */ + assert( sqlite3_mutex_held(pShmNode->mutex) || pShmNode->nRef==0 ); + + /* Shared locks never span more than one byte */ + assert( n==1 || lockType!=F_RDLCK ); + + /* Locks are within range */ + assert( n>=1 && nh, F_SETLK, &f); + rc = (rc!=(-1)) ? SQLITE_OK : SQLITE_BUSY; + + /* Update the global lock state and do debug tracing */ +#ifdef SQLITE_DEBUG + { u16 mask; + OSTRACE(("SHM-LOCK ")); + mask = (1<<(ofst+n)) - (1<exclMask &= ~mask; + pShmNode->sharedMask &= ~mask; + }else if( lockType==F_RDLCK ){ + OSTRACE(("read-lock %d ok", ofst)); + pShmNode->exclMask &= ~mask; + pShmNode->sharedMask |= mask; + }else{ + assert( lockType==F_WRLCK ); + OSTRACE(("write-lock %d ok", ofst)); + pShmNode->exclMask |= mask; + pShmNode->sharedMask &= ~mask; + } + }else{ + if( lockType==F_UNLCK ){ + OSTRACE(("unlock %d failed", ofst)); + }else if( lockType==F_RDLCK ){ + OSTRACE(("read-lock failed")); + }else{ + assert( lockType==F_WRLCK ); + OSTRACE(("write-lock %d failed", ofst)); + } + } + OSTRACE((" - afterwards %03x,%03x\n", + pShmNode->sharedMask, pShmNode->exclMask)); + } +#endif + + return rc; +} + + +/* +** Purge the unixShmNodeList list of all entries with unixShmNode.nRef==0. +** +** This is not a VFS shared-memory method; it is a utility function called +** by VFS shared-memory methods. +*/ +static void unixShmPurge(unixFile *pFd){ + unixShmNode *p = pFd->pInode->pShmNode; + assert( unixMutexHeld() ); + if( p && p->nRef==0 ){ + int i; + assert( p->pInode==pFd->pInode ); + if( p->mutex ) sqlite3_mutex_free(p->mutex); + for(i=0; inRegion; i++){ + munmap(p->apRegion[i], p->szRegion); + } + sqlite3_free(p->apRegion); + if( p->h>=0 ) close(p->h); + p->pInode->pShmNode = 0; + sqlite3_free(p); + } +} + +/* +** Open a shared-memory area associated with open database file pDbFd. +** This particular implementation uses mmapped files. +** +** The file used to implement shared-memory is in the same directory +** as the open database file and has the same name as the open database +** file with the "-shm" suffix added. For example, if the database file +** is "/home/user1/config.db" then the file that is created and mmapped +** for shared memory will be called "/home/user1/config.db-shm". +** +** Another approach to is to use files in /dev/shm or /dev/tmp or an +** some other tmpfs mount. But if a file in a different directory +** from the database file is used, then differing access permissions +** or a chroot() might cause two different processes on the same +** database to end up using different files for shared memory - +** meaning that their memory would not really be shared - resulting +** in database corruption. Nevertheless, this tmpfs file usage +** can be enabled at compile-time using -DSQLITE_SHM_DIRECTORY="/dev/shm" +** or the equivalent. The use of the SQLITE_SHM_DIRECTORY compile-time +** option results in an incompatible build of SQLite; builds of SQLite +** that with differing SQLITE_SHM_DIRECTORY settings attempt to use the +** same database file at the same time, database corruption will likely +** result. The SQLITE_SHM_DIRECTORY compile-time option is considered +** "unsupported" and may go away in a future SQLite release. +** +** When opening a new shared-memory file, if no other instances of that +** file are currently open, in this process or in other processes, then +** the file must be truncated to zero length or have its header cleared. +*/ +static int unixOpenSharedMemory(unixFile *pDbFd){ + struct unixShm *p = 0; /* The connection to be opened */ + struct unixShmNode *pShmNode; /* The underlying mmapped file */ + int rc; /* Result code */ + unixInodeInfo *pInode; /* The inode of fd */ + char *zShmFilename; /* Name of the file used for SHM */ + int nShmFilename; /* Size of the SHM filename in bytes */ + + /* Allocate space for the new unixShm object. */ + p = sqlite3_malloc( sizeof(*p) ); + if( p==0 ) return SQLITE_NOMEM; + memset(p, 0, sizeof(*p)); + assert( pDbFd->pShm==0 ); + + /* Check to see if a unixShmNode object already exists. Reuse an existing + ** one if present. Create a new one if necessary. + */ + unixEnterMutex(); + pInode = pDbFd->pInode; + pShmNode = pInode->pShmNode; + if( pShmNode==0 ){ + struct stat sStat; /* fstat() info for database file */ + + /* Call fstat() to figure out the permissions on the database file. If + ** a new *-shm file is created, an attempt will be made to create it + ** with the same permissions. The actual permissions the file is created + ** with are subject to the current umask setting. + */ + if( fstat(pDbFd->h, &sStat) ){ + rc = SQLITE_IOERR_FSTAT; + goto shm_open_err; + } + +#ifdef SQLITE_SHM_DIRECTORY + nShmFilename = sizeof(SQLITE_SHM_DIRECTORY) + 30; +#else + nShmFilename = 5 + (int)strlen(pDbFd->zPath); +#endif + pShmNode = sqlite3_malloc( sizeof(*pShmNode) + nShmFilename ); + if( pShmNode==0 ){ + rc = SQLITE_NOMEM; + goto shm_open_err; + } + memset(pShmNode, 0, sizeof(*pShmNode)); + zShmFilename = pShmNode->zFilename = (char*)&pShmNode[1]; +#ifdef SQLITE_SHM_DIRECTORY + sqlite3_snprintf(nShmFilename, zShmFilename, + SQLITE_SHM_DIRECTORY "/sqlite-shm-%x-%x", + (u32)sStat.st_ino, (u32)sStat.st_dev); +#else + sqlite3_snprintf(nShmFilename, zShmFilename, "%s-shm", pDbFd->zPath); +#endif + pShmNode->h = -1; + pDbFd->pInode->pShmNode = pShmNode; + pShmNode->pInode = pDbFd->pInode; + pShmNode->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST); + if( pShmNode->mutex==0 ){ + rc = SQLITE_NOMEM; + goto shm_open_err; + } + + pShmNode->h = open(zShmFilename, O_RDWR|O_CREAT, (sStat.st_mode & 0777)); + if( pShmNode->h<0 ){ + rc = SQLITE_CANTOPEN_BKPT; + goto shm_open_err; + } + + /* Check to see if another process is holding the dead-man switch. + ** If not, truncate the file to zero length. + */ + rc = SQLITE_OK; + if( unixShmSystemLock(pShmNode, F_WRLCK, UNIX_SHM_DMS, 1)==SQLITE_OK ){ + if( ftruncate(pShmNode->h, 0) ){ + rc = SQLITE_IOERR_SHMOPEN; + } + } + if( rc==SQLITE_OK ){ + rc = unixShmSystemLock(pShmNode, F_RDLCK, UNIX_SHM_DMS, 1); + } + if( rc ) goto shm_open_err; + } + + /* Make the new connection a child of the unixShmNode */ + p->pShmNode = pShmNode; +#ifdef SQLITE_DEBUG + p->id = pShmNode->nextShmId++; +#endif + pShmNode->nRef++; + pDbFd->pShm = p; + unixLeaveMutex(); + + /* The reference count on pShmNode has already been incremented under + ** the cover of the unixEnterMutex() mutex and the pointer from the + ** new (struct unixShm) object to the pShmNode has been set. All that is + ** left to do is to link the new object into the linked list starting + ** at pShmNode->pFirst. This must be done while holding the pShmNode->mutex + ** mutex. + */ + sqlite3_mutex_enter(pShmNode->mutex); + p->pNext = pShmNode->pFirst; + pShmNode->pFirst = p; + sqlite3_mutex_leave(pShmNode->mutex); + return SQLITE_OK; + + /* Jump here on any error */ +shm_open_err: + unixShmPurge(pDbFd); /* This call frees pShmNode if required */ + sqlite3_free(p); + unixLeaveMutex(); + return rc; +} + +/* +** This function is called to obtain a pointer to region iRegion of the +** shared-memory associated with the database file fd. Shared-memory regions +** are numbered starting from zero. Each shared-memory region is szRegion +** bytes in size. +** +** If an error occurs, an error code is returned and *pp is set to NULL. +** +** Otherwise, if the bExtend parameter is 0 and the requested shared-memory +** region has not been allocated (by any client, including one running in a +** separate process), then *pp is set to NULL and SQLITE_OK returned. If +** bExtend is non-zero and the requested shared-memory region has not yet +** been allocated, it is allocated by this function. +** +** If the shared-memory region has already been allocated or is allocated by +** this call as described above, then it is mapped into this processes +** address space (if it is not already), *pp is set to point to the mapped +** memory and SQLITE_OK returned. +*/ +static int unixShmMap( + sqlite3_file *fd, /* Handle open on database file */ + int iRegion, /* Region to retrieve */ + int szRegion, /* Size of regions */ + int bExtend, /* True to extend file if necessary */ + void volatile **pp /* OUT: Mapped memory */ +){ + unixFile *pDbFd = (unixFile*)fd; + unixShm *p; + unixShmNode *pShmNode; + int rc = SQLITE_OK; + + /* If the shared-memory file has not yet been opened, open it now. */ + if( pDbFd->pShm==0 ){ + rc = unixOpenSharedMemory(pDbFd); + if( rc!=SQLITE_OK ) return rc; + } + + p = pDbFd->pShm; + pShmNode = p->pShmNode; + sqlite3_mutex_enter(pShmNode->mutex); + assert( szRegion==pShmNode->szRegion || pShmNode->nRegion==0 ); + + if( pShmNode->nRegion<=iRegion ){ + char **apNew; /* New apRegion[] array */ + int nByte = (iRegion+1)*szRegion; /* Minimum required file size */ + struct stat sStat; /* Used by fstat() */ + + pShmNode->szRegion = szRegion; + + /* The requested region is not mapped into this processes address space. + ** Check to see if it has been allocated (i.e. if the wal-index file is + ** large enough to contain the requested region). + */ + if( fstat(pShmNode->h, &sStat) ){ + rc = SQLITE_IOERR_SHMSIZE; + goto shmpage_out; + } + + if( sStat.st_sizeh, nByte) ){ + rc = SQLITE_IOERR_SHMSIZE; + goto shmpage_out; + } + } + + /* Map the requested memory region into this processes address space. */ + apNew = (char **)sqlite3_realloc( + pShmNode->apRegion, (iRegion+1)*sizeof(char *) + ); + if( !apNew ){ + rc = SQLITE_IOERR_NOMEM; + goto shmpage_out; + } + pShmNode->apRegion = apNew; + while(pShmNode->nRegion<=iRegion){ + void *pMem = mmap(0, szRegion, PROT_READ|PROT_WRITE, + MAP_SHARED, pShmNode->h, pShmNode->nRegion*szRegion + ); + if( pMem==MAP_FAILED ){ + rc = SQLITE_IOERR; + goto shmpage_out; + } + pShmNode->apRegion[pShmNode->nRegion] = pMem; + pShmNode->nRegion++; + } + } + +shmpage_out: + if( pShmNode->nRegion>iRegion ){ + *pp = pShmNode->apRegion[iRegion]; + }else{ + *pp = 0; + } + sqlite3_mutex_leave(pShmNode->mutex); + return rc; +} + +/* +** Change the lock state for a shared-memory segment. +** +** Note that the relationship between SHAREd and EXCLUSIVE locks is a little +** different here than in posix. In xShmLock(), one can go from unlocked +** to shared and back or from unlocked to exclusive and back. But one may +** not go from shared to exclusive or from exclusive to shared. +*/ +static int unixShmLock( + sqlite3_file *fd, /* Database file holding the shared memory */ + int ofst, /* First lock to acquire or release */ + int n, /* Number of locks to acquire or release */ + int flags /* What to do with the lock */ +){ + unixFile *pDbFd = (unixFile*)fd; /* Connection holding shared memory */ + unixShm *p = pDbFd->pShm; /* The shared memory being locked */ + unixShm *pX; /* For looping over all siblings */ + unixShmNode *pShmNode = p->pShmNode; /* The underlying file iNode */ + int rc = SQLITE_OK; /* Result code */ + u16 mask; /* Mask of locks to take or release */ + + assert( pShmNode==pDbFd->pInode->pShmNode ); + assert( pShmNode->pInode==pDbFd->pInode ); + assert( ofst>=0 && ofst+n<=SQLITE_SHM_NLOCK ); + assert( n>=1 ); + assert( flags==(SQLITE_SHM_LOCK | SQLITE_SHM_SHARED) + || flags==(SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE) + || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED) + || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE) ); + assert( n==1 || (flags & SQLITE_SHM_EXCLUSIVE)!=0 ); + + mask = (1<<(ofst+n)) - (1<1 || mask==(1<mutex); + if( flags & SQLITE_SHM_UNLOCK ){ + u16 allMask = 0; /* Mask of locks held by siblings */ + + /* See if any siblings hold this same lock */ + for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ + if( pX==p ) continue; + assert( (pX->exclMask & (p->exclMask|p->sharedMask))==0 ); + allMask |= pX->sharedMask; + } + + /* Unlock the system-level locks */ + if( (mask & allMask)==0 ){ + rc = unixShmSystemLock(pShmNode, F_UNLCK, ofst+UNIX_SHM_BASE, n); + }else{ + rc = SQLITE_OK; + } + + /* Undo the local locks */ + if( rc==SQLITE_OK ){ + p->exclMask &= ~mask; + p->sharedMask &= ~mask; + } + }else if( flags & SQLITE_SHM_SHARED ){ + u16 allShared = 0; /* Union of locks held by connections other than "p" */ + + /* Find out which shared locks are already held by sibling connections. + ** If any sibling already holds an exclusive lock, go ahead and return + ** SQLITE_BUSY. + */ + for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ + if( (pX->exclMask & mask)!=0 ){ + rc = SQLITE_BUSY; + break; + } + allShared |= pX->sharedMask; + } + + /* Get shared locks at the system level, if necessary */ + if( rc==SQLITE_OK ){ + if( (allShared & mask)==0 ){ + rc = unixShmSystemLock(pShmNode, F_RDLCK, ofst+UNIX_SHM_BASE, n); + }else{ + rc = SQLITE_OK; + } + } + + /* Get the local shared locks */ + if( rc==SQLITE_OK ){ + p->sharedMask |= mask; + } + }else{ + /* Make sure no sibling connections hold locks that will block this + ** lock. If any do, return SQLITE_BUSY right away. + */ + for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ + if( (pX->exclMask & mask)!=0 || (pX->sharedMask & mask)!=0 ){ + rc = SQLITE_BUSY; + break; + } + } + + /* Get the exclusive locks at the system level. Then if successful + ** also mark the local connection as being locked. + */ + if( rc==SQLITE_OK ){ + rc = unixShmSystemLock(pShmNode, F_WRLCK, ofst+UNIX_SHM_BASE, n); + if( rc==SQLITE_OK ){ + assert( (p->sharedMask & mask)==0 ); + p->exclMask |= mask; + } + } + } + sqlite3_mutex_leave(pShmNode->mutex); + OSTRACE(("SHM-LOCK shmid-%d, pid-%d got %03x,%03x\n", + p->id, getpid(), p->sharedMask, p->exclMask)); + return rc; +} + +/* +** Implement a memory barrier or memory fence on shared memory. +** +** All loads and stores begun before the barrier must complete before +** any load or store begun after the barrier. +*/ +static void unixShmBarrier( + sqlite3_file *fd /* Database file holding the shared memory */ +){ + UNUSED_PARAMETER(fd); + unixEnterMutex(); + unixLeaveMutex(); +} + +/* +** Close a connection to shared-memory. Delete the underlying +** storage if deleteFlag is true. +** +** If there is no shared memory associated with the connection then this +** routine is a harmless no-op. +*/ +static int unixShmUnmap( + sqlite3_file *fd, /* The underlying database file */ + int deleteFlag /* Delete shared-memory if true */ +){ + unixShm *p; /* The connection to be closed */ + unixShmNode *pShmNode; /* The underlying shared-memory file */ + unixShm **pp; /* For looping over sibling connections */ + unixFile *pDbFd; /* The underlying database file */ + + pDbFd = (unixFile*)fd; + p = pDbFd->pShm; + if( p==0 ) return SQLITE_OK; + pShmNode = p->pShmNode; + + assert( pShmNode==pDbFd->pInode->pShmNode ); + assert( pShmNode->pInode==pDbFd->pInode ); + + /* Remove connection p from the set of connections associated + ** with pShmNode */ + sqlite3_mutex_enter(pShmNode->mutex); + for(pp=&pShmNode->pFirst; (*pp)!=p; pp = &(*pp)->pNext){} + *pp = p->pNext; + + /* Free the connection p */ + sqlite3_free(p); + pDbFd->pShm = 0; + sqlite3_mutex_leave(pShmNode->mutex); + + /* If pShmNode->nRef has reached 0, then close the underlying + ** shared-memory file, too */ + unixEnterMutex(); + assert( pShmNode->nRef>0 ); + pShmNode->nRef--; + if( pShmNode->nRef==0 ){ + if( deleteFlag ) unlink(pShmNode->zFilename); + unixShmPurge(pDbFd); + } + unixLeaveMutex(); + + return SQLITE_OK; +} + + +#else +# define unixShmMap 0 +# define unixShmLock 0 +# define unixShmBarrier 0 +# define unixShmUnmap 0 +#endif /* #ifndef SQLITE_OMIT_WAL */ + /* ** Here ends the implementation of all sqlite3_file methods. ** @@ -24830,9 +26914,9 @@ static int unixDeviceCharacteristics(sqlite3_file *NotUsed){ ** * An I/O method finder function called FINDER that returns a pointer ** to the METHOD object in the previous bullet. */ -#define IOMETHODS(FINDER, METHOD, CLOSE, LOCK, UNLOCK, CKLOCK) \ +#define IOMETHODS(FINDER, METHOD, VERSION, CLOSE, LOCK, UNLOCK, CKLOCK) \ static const sqlite3_io_methods METHOD = { \ - 1, /* iVersion */ \ + VERSION, /* iVersion */ \ CLOSE, /* xClose */ \ unixRead, /* xRead */ \ unixWrite, /* xWrite */ \ @@ -24844,7 +26928,11 @@ static const sqlite3_io_methods METHOD = { \ CKLOCK, /* xCheckReservedLock */ \ unixFileControl, /* xFileControl */ \ unixSectorSize, /* xSectorSize */ \ - unixDeviceCharacteristics /* xDeviceCapabilities */ \ + unixDeviceCharacteristics, /* xDeviceCapabilities */ \ + unixShmMap, /* xShmMap */ \ + unixShmLock, /* xShmLock */ \ + unixShmBarrier, /* xShmBarrier */ \ + unixShmUnmap /* xShmUnmap */ \ }; \ static const sqlite3_io_methods *FINDER##Impl(const char *z, unixFile *p){ \ UNUSED_PARAMETER(z); UNUSED_PARAMETER(p); \ @@ -24861,6 +26949,7 @@ static const sqlite3_io_methods *(*const FINDER)(const char*,unixFile *p) \ IOMETHODS( posixIoFinder, /* Finder function name */ posixIoMethods, /* sqlite3_io_methods object name */ + 2, /* shared memory is enabled */ unixClose, /* xClose method */ unixLock, /* xLock method */ unixUnlock, /* xUnlock method */ @@ -24869,6 +26958,7 @@ IOMETHODS( IOMETHODS( nolockIoFinder, /* Finder function name */ nolockIoMethods, /* sqlite3_io_methods object name */ + 1, /* shared memory is disabled */ nolockClose, /* xClose method */ nolockLock, /* xLock method */ nolockUnlock, /* xUnlock method */ @@ -24877,6 +26967,7 @@ IOMETHODS( IOMETHODS( dotlockIoFinder, /* Finder function name */ dotlockIoMethods, /* sqlite3_io_methods object name */ + 1, /* shared memory is disabled */ dotlockClose, /* xClose method */ dotlockLock, /* xLock method */ dotlockUnlock, /* xUnlock method */ @@ -24887,6 +26978,7 @@ IOMETHODS( IOMETHODS( flockIoFinder, /* Finder function name */ flockIoMethods, /* sqlite3_io_methods object name */ + 1, /* shared memory is disabled */ flockClose, /* xClose method */ flockLock, /* xLock method */ flockUnlock, /* xUnlock method */ @@ -24898,6 +26990,7 @@ IOMETHODS( IOMETHODS( semIoFinder, /* Finder function name */ semIoMethods, /* sqlite3_io_methods object name */ + 1, /* shared memory is disabled */ semClose, /* xClose method */ semLock, /* xLock method */ semUnlock, /* xUnlock method */ @@ -24909,6 +27002,7 @@ IOMETHODS( IOMETHODS( afpIoFinder, /* Finder function name */ afpIoMethods, /* sqlite3_io_methods object name */ + 1, /* shared memory is disabled */ afpClose, /* xClose method */ afpLock, /* xLock method */ afpUnlock, /* xUnlock method */ @@ -24916,23 +27010,6 @@ IOMETHODS( ) #endif -/* -** The "Whole File Locking" finder returns the same set of methods as -** the posix locking finder. But it also sets the SQLITE_WHOLE_FILE_LOCKING -** flag to force the posix advisory locks to cover the whole file instead -** of just a small span of bytes near the 1GiB boundary. Whole File Locking -** is useful on NFS-mounted files since it helps NFS to maintain cache -** coherency. But it is a detriment to other filesystems since it runs -** slower. -*/ -static const sqlite3_io_methods *posixWflIoFinderImpl(const char*z, unixFile*p){ - UNUSED_PARAMETER(z); - p->fileFlags = SQLITE_WHOLE_FILE_LOCKING; - return &posixIoMethods; -} -static const sqlite3_io_methods - *(*const posixWflIoFinder)(const char*,unixFile *p) = posixWflIoFinderImpl; - /* ** The proxy locking method is a "super-method" in the sense that it ** opens secondary file descriptors for the conch and lock files and @@ -24950,6 +27027,7 @@ static int proxyCheckReservedLock(sqlite3_file*, int*); IOMETHODS( proxyIoFinder, /* Finder function name */ proxyIoMethods, /* sqlite3_io_methods object name */ + 1, /* shared memory is disabled */ proxyClose, /* xClose method */ proxyLock, /* xLock method */ proxyUnlock, /* xUnlock method */ @@ -24957,6 +27035,18 @@ IOMETHODS( ) #endif +/* nfs lockd on OSX 10.3+ doesn't clear write locks when a read lock is set */ +#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE +IOMETHODS( + nfsIoFinder, /* Finder function name */ + nfsIoMethods, /* sqlite3_io_methods object name */ + 1, /* shared memory is disabled */ + unixClose, /* xClose method */ + unixLock, /* xLock method */ + nfsUnlock, /* xUnlock method */ + unixCheckReservedLock /* xCheckReservedLock method */ +) +#endif #if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE /* @@ -24977,11 +27067,7 @@ static const sqlite3_io_methods *autolockIoFinderImpl( { "hfs", &posixIoMethods }, { "ufs", &posixIoMethods }, { "afpfs", &afpIoMethods }, -#ifdef SQLITE_ENABLE_AFP_LOCKING_SMB { "smbfs", &afpIoMethods }, -#else - { "smbfs", &flockIoMethods }, -#endif { "webdav", &nolockIoMethods }, { 0, 0 } }; @@ -25014,8 +27100,11 @@ static const sqlite3_io_methods *autolockIoFinderImpl( lockInfo.l_whence = SEEK_SET; lockInfo.l_type = F_RDLCK; if( fcntl(pNew->h, F_GETLK, &lockInfo)!=-1 ) { - pNew->fileFlags = SQLITE_WHOLE_FILE_LOCKING; - return &posixIoMethods; + if( strcmp(fsInfo.f_fstypename, "nfs")==0 ){ + return &nfsIoMethods; + } else { + return &posixIoMethods; + } }else{ return &dotlockIoMethods; } @@ -25092,19 +27181,29 @@ static int fillInUnixFile( unixFile *pNew = (unixFile *)pId; int rc = SQLITE_OK; - assert( pNew->pLock==NULL ); - assert( pNew->pOpen==NULL ); + assert( pNew->pInode==NULL ); /* Parameter isDelete is only used on vxworks. Express this explicitly ** here to prevent compiler warnings about unused parameters. */ UNUSED_PARAMETER(isDelete); - OSTRACE3("OPEN %-3d %s\n", h, zFilename); + /* Usually the path zFilename should not be a relative pathname. The + ** exception is when opening the proxy "conch" file in builds that + ** include the special Apple locking styles. + */ +#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE + assert( zFilename==0 || zFilename[0]=='/' + || pVfs->pAppData==(void*)&autolockIoFinder ); +#else + assert( zFilename==0 || zFilename[0]=='/' ); +#endif + + OSTRACE(("OPEN %-3d %s\n", h, zFilename)); pNew->h = h; pNew->dirfd = dirfd; - SET_THREADID(pNew); pNew->fileFlags = 0; + pNew->zPath = zFilename; #if OS_VXWORKS pNew->pId = vxworksFindFileId(zFilename); @@ -25126,12 +27225,16 @@ static int fillInUnixFile( #endif } - if( pLockingStyle == &posixIoMethods ){ + if( pLockingStyle == &posixIoMethods +#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE + || pLockingStyle == &nfsIoMethods +#endif + ){ unixEnterMutex(); - rc = findLockInfo(pNew, &pNew->pLock, &pNew->pOpen); + rc = findInodeInfo(pNew, &pNew->pInode); if( rc!=SQLITE_OK ){ - /* If an error occured in findLockInfo(), close the file descriptor - ** immediately, before releasing the mutex. findLockInfo() may fail + /* If an error occured in findInodeInfo(), close the file descriptor + ** immediately, before releasing the mutex. findInodeInfo() may fail ** in two scenarios: ** ** (a) A call to fstat() failed. @@ -25140,7 +27243,7 @@ static int fillInUnixFile( ** Scenario (b) may only occur if the process is holding no other ** file descriptors open on the same file. If there were other file ** descriptors on this file, then no malloc would be required by - ** findLockInfo(). If this is the case, it is quite safe to close + ** findInodeInfo(). If this is the case, it is quite safe to close ** handle h - as it is guaranteed that no posix locks will be released ** by doing so. ** @@ -25168,9 +27271,15 @@ static int fillInUnixFile( ** according to requirement F11141. So we do not need to make a ** copy of the filename. */ pCtx->dbPath = zFilename; + pCtx->reserved = 0; srandomdev(); unixEnterMutex(); - rc = findLockInfo(pNew, NULL, &pNew->pOpen); + rc = findInodeInfo(pNew, &pNew->pInode); + if( rc!=SQLITE_OK ){ + sqlite3_free(pNew->lockingContext); + close(h); + h = -1; + } unixLeaveMutex(); } } @@ -25198,18 +27307,18 @@ static int fillInUnixFile( ** included in the semLockingContext */ unixEnterMutex(); - rc = findLockInfo(pNew, &pNew->pLock, &pNew->pOpen); - if( (rc==SQLITE_OK) && (pNew->pOpen->pSem==NULL) ){ - char *zSemName = pNew->pOpen->aSemName; + rc = findInodeInfo(pNew, &pNew->pInode); + if( (rc==SQLITE_OK) && (pNew->pInode->pSem==NULL) ){ + char *zSemName = pNew->pInode->aSemName; int n; sqlite3_snprintf(MAX_PATHNAME, zSemName, "/%s.sem", pNew->pId->zCanonicalName); for( n=1; zSemName[n]; n++ ) if( zSemName[n]=='/' ) zSemName[n] = '_'; - pNew->pOpen->pSem = sem_open(zSemName, O_CREAT, 0666, 1); - if( pNew->pOpen->pSem == SEM_FAILED ){ + pNew->pInode->pSem = sem_open(zSemName, O_CREAT, 0666, 1); + if( pNew->pInode->pSem == SEM_FAILED ){ rc = SQLITE_NOMEM; - pNew->pOpen->aSemName[0] = '\0'; + pNew->pInode->aSemName[0] = '\0'; } } unixLeaveMutex(); @@ -25219,6 +27328,8 @@ static int fillInUnixFile( pNew->lastErrno = 0; #if OS_VXWORKS if( rc!=SQLITE_OK ){ + if( h>=0 ) close(h); + h = -1; unlink(zFilename); isDelete = 0; } @@ -25258,11 +27369,40 @@ static int openDirectory(const char *zFilename, int *pFd){ #ifdef FD_CLOEXEC fcntl(fd, F_SETFD, fcntl(fd, F_GETFD, 0) | FD_CLOEXEC); #endif - OSTRACE3("OPENDIR %-3d %s\n", fd, zDirname); + OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname)); } } *pFd = fd; - return (fd>=0?SQLITE_OK:SQLITE_CANTOPEN); + return (fd>=0?SQLITE_OK:SQLITE_CANTOPEN_BKPT); +} + +/* +** Return the name of a directory in which to put temporary files. +** If no suitable temporary file directory can be found, return NULL. +*/ +static const char *unixTempFileDir(void){ + static const char *azDirs[] = { + 0, + 0, + "/var/tmp", + "/usr/tmp", + "/tmp", + 0 /* List terminator */ + }; + unsigned int i; + struct stat buf; + const char *zDir = 0; + + azDirs[0] = sqlite3_temp_directory; + if( !azDirs[1] ) azDirs[1] = getenv("TMPDIR"); + for(i=0; imxPathname bytes. */ -static int getTempname(int nBuf, char *zBuf){ - static const char *azDirs[] = { - 0, - 0, - "/var/tmp", - "/usr/tmp", - "/tmp", - ".", - }; +static int unixGetTempname(int nBuf, char *zBuf){ static const unsigned char zChars[] = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789"; unsigned int i, j; - struct stat buf; - const char *zDir = "."; + const char *zDir; /* It's odd to simulate an io-error here, but really this is just ** using the io-error infrastructure to test that SQLite handles this @@ -25293,19 +27424,8 @@ static int getTempname(int nBuf, char *zBuf){ */ SimulateIOError( return SQLITE_IOERR ); - azDirs[0] = sqlite3_temp_directory; - if (NULL == azDirs[1]) { - azDirs[1] = getenv("TMPDIR"); - } - - for(i=0; ifileId, sizeof(id)); pO=pO->pNext); - if( pO ){ + pInode = inodeList; + while( pInode && (pInode->fileId.dev!=sStat.st_dev + || pInode->fileId.ino!=sStat.st_ino) ){ + pInode = pInode->pNext; + } + if( pInode ){ UnixUnusedFd **pp; - for(pp=&pO->pUnused; *pp && (*pp)->flags!=flags; pp=&((*pp)->pNext)); + for(pp=&pInode->pUnused; *pp && (*pp)->flags!=flags; pp=&((*pp)->pNext)); pUnused = *pp; if( pUnused ){ *pp = pUnused->pNext; @@ -25392,6 +27513,51 @@ static UnixUnusedFd *findReusableFd(const char *zPath, int flags){ return pUnused; } +/* +** This function is called by unixOpen() to determine the unix permissions +** to create new files with. If no error occurs, then SQLITE_OK is returned +** and a value suitable for passing as the third argument to open(2) is +** written to *pMode. If an IO error occurs, an SQLite error code is +** returned and the value of *pMode is not modified. +** +** If the file being opened is a temporary file, it is always created with +** the octal permissions 0600 (read/writable by owner only). If the file +** is a database or master journal file, it is created with the permissions +** mask SQLITE_DEFAULT_FILE_PERMISSIONS. +** +** Finally, if the file being opened is a WAL or regular journal file, then +** this function queries the file-system for the permissions on the +** corresponding database file and sets *pMode to this value. Whenever +** possible, WAL and journal files are created using the same permissions +** as the associated database file. +*/ +static int findCreateFileMode( + const char *zPath, /* Path of file (possibly) being created */ + int flags, /* Flags passed as 4th argument to xOpen() */ + mode_t *pMode /* OUT: Permissions to open file with */ +){ + int rc = SQLITE_OK; /* Return Code */ + if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){ + char zDb[MAX_PATHNAME+1]; /* Database file path */ + int nDb; /* Number of valid bytes in zDb */ + struct stat sStat; /* Output of stat() on database file */ + + nDb = sqlite3Strlen30(zPath) - ((flags & SQLITE_OPEN_WAL) ? 4 : 8); + memcpy(zDb, zPath, nDb); + zDb[nDb] = '\0'; + if( 0==stat(zDb, &sStat) ){ + *pMode = sStat.st_mode & 0777; + }else{ + rc = SQLITE_IOERR_FSTAT; + } + }else if( flags & SQLITE_OPEN_DELETEONCLOSE ){ + *pMode = 0600; + }else{ + *pMode = SQLITE_DEFAULT_FILE_PERMISSIONS; + } + return rc; +} + /* ** Open the file zPath. ** @@ -25434,14 +27600,19 @@ static int unixOpen( int isCreate = (flags & SQLITE_OPEN_CREATE); int isReadonly = (flags & SQLITE_OPEN_READONLY); int isReadWrite = (flags & SQLITE_OPEN_READWRITE); +#if SQLITE_ENABLE_LOCKING_STYLE + int isAutoProxy = (flags & SQLITE_OPEN_AUTOPROXY); +#endif /* If creating a master or main-file journal, this function will open ** a file-descriptor on the directory too. The first time unixSync() ** is called the directory file descriptor will be fsync()ed and close()d. */ - int isOpenDirectory = (isCreate && - (eType==SQLITE_OPEN_MASTER_JOURNAL || eType==SQLITE_OPEN_MAIN_JOURNAL) - ); + int isOpenDirectory = (isCreate && ( + eType==SQLITE_OPEN_MASTER_JOURNAL + || eType==SQLITE_OPEN_MAIN_JOURNAL + || eType==SQLITE_OPEN_WAL + )); /* If argument zPath is a NULL pointer, this function is required to open ** a temporary file. Use this buffer to store the file name in. @@ -25461,17 +27632,18 @@ static int unixOpen( assert(isExclusive==0 || isCreate); assert(isDelete==0 || isCreate); - /* The main DB, main journal, and master journal are never automatically - ** deleted. Nor are they ever temporary files. */ + /* The main DB, main journal, WAL file and master journal are never + ** automatically deleted. Nor are they ever temporary files. */ assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_DB ); assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_JOURNAL ); assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MASTER_JOURNAL ); + assert( (!isDelete && zName) || eType!=SQLITE_OPEN_WAL ); /* Assert that the upper layer has set one of the "file-type" flags. */ assert( eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL || eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL - || eType==SQLITE_OPEN_TRANSIENT_DB + || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL ); memset(p, 0, sizeof(unixFile)); @@ -25491,7 +27663,7 @@ static int unixOpen( }else if( !zName ){ /* If zName is NULL, the upper layer is requesting a temp file. */ assert(isDelete && !isOpenDirectory); - rc = getTempname(MAX_PATHNAME+1, zTmpname); + rc = unixGetTempname(MAX_PATHNAME+1, zTmpname); if( rc!=SQLITE_OK ){ return rc; } @@ -25509,9 +27681,15 @@ static int unixOpen( openFlags |= (O_LARGEFILE|O_BINARY); if( fd<0 ){ - mode_t openMode = (isDelete?0600:SQLITE_DEFAULT_FILE_PERMISSIONS); + mode_t openMode; /* Permissions to create file with */ + rc = findCreateFileMode(zName, flags, &openMode); + if( rc!=SQLITE_OK ){ + assert( !p->pUnused ); + assert( eType==SQLITE_OPEN_WAL || eType==SQLITE_OPEN_MAIN_JOURNAL ); + return rc; + } fd = open(zName, openFlags, openMode); - OSTRACE4("OPENX %-3d %s 0%o\n", fd, zName, openFlags); + OSTRACE(("OPENX %-3d %s 0%o\n", fd, zName, openFlags)); if( fd<0 && errno!=EISDIR && isReadWrite && !isExclusive ){ /* Failed to open the file for read/write access. Try read-only. */ flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE); @@ -25521,7 +27699,7 @@ static int unixOpen( fd = open(zName, openFlags, openMode); } if( fd<0 ){ - rc = SQLITE_CANTOPEN; + rc = SQLITE_CANTOPEN_BKPT; goto open_finished; } } @@ -25567,8 +27745,25 @@ static int unixOpen( noLock = eType!=SQLITE_OPEN_MAIN_DB; + +#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE + struct statfs fsInfo; + if( fstatfs(fd, &fsInfo) == -1 ){ + ((unixFile*)pFile)->lastErrno = errno; + if( dirfd>=0 ) close(dirfd); /* silently leak if fail, in error */ + close(fd); /* silently leak if fail, in error */ + return SQLITE_IOERR_ACCESS; + } + if (0 == strncmp("msdos", fsInfo.f_fstypename, 5)) { + ((unixFile*)pFile)->fsFlags |= SQLITE_FSFLAGS_IS_MSDOS; + } +#endif + +#if SQLITE_ENABLE_LOCKING_STYLE #if SQLITE_PREFER_PROXY_LOCKING - if( zPath!=NULL && !noLock && pVfs->xOpen ){ + isAutoProxy = 1; +#endif + if( isAutoProxy && (zPath!=NULL) && (!noLock) && pVfs->xOpen ){ char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); int useProxy = 0; @@ -25600,6 +27795,14 @@ static int unixOpen( rc = fillInUnixFile(pVfs, fd, dirfd, pFile, zPath, noLock, isDelete); if( rc==SQLITE_OK ){ rc = proxyTransformUnixFile((unixFile*)pFile, ":auto:"); + if( rc!=SQLITE_OK ){ + /* Use unixClose to clean up the resources added in fillInUnixFile + ** and clear all the structure's references. Specifically, + ** pFile->pMethods will be NULL so sqlite3OsClose will be a no-op + */ + unixClose(pFile); + return rc; + } } goto open_finished; } @@ -25627,7 +27830,9 @@ static int unixDelete( int rc = SQLITE_OK; UNUSED_PARAMETER(NotUsed); SimulateIOError(return SQLITE_IOERR_DELETE); - unlink(zPath); + if( unlink(zPath)==(-1) && errno!=ENOENT ){ + return SQLITE_IOERR_DELETE; + } #ifndef SQLITE_DISABLE_DIRSYNC if( dirSync ){ int fd; @@ -25684,6 +27889,12 @@ static int unixAccess( assert(!"Invalid flags argument"); } *pResOut = (access(zPath, amode)==0); + if( flags==SQLITE_ACCESS_EXISTS && *pResOut ){ + struct stat buf; + if( 0==stat(zPath, &buf) && buf.st_size==0 ){ + *pResOut = 0; + } + } return SQLITE_OK; } @@ -25720,7 +27931,7 @@ static int unixFullPathname( }else{ int nCwd; if( getcwd(zOut, nOut-1)==0 ){ - return SQLITE_CANTOPEN; + return SQLITE_CANTOPEN_BKPT; } nCwd = (int)strlen(zOut); sqlite3_snprintf(nOut-nCwd, &zOut[nCwd], "/%s", zPath); @@ -25871,36 +28082,50 @@ static int unixSleep(sqlite3_vfs *NotUsed, int microseconds){ SQLITE_API int sqlite3_current_time = 0; /* Fake system time in seconds since 1970. */ #endif +/* +** Find the current time (in Universal Coordinated Time). Write into *piNow +** the current time and date as a Julian Day number times 86_400_000. In +** other words, write into *piNow the number of milliseconds since the Julian +** epoch of noon in Greenwich on November 24, 4714 B.C according to the +** proleptic Gregorian calendar. +** +** On success, return 0. Return 1 if the time and date cannot be found. +*/ +static int unixCurrentTimeInt64(sqlite3_vfs *NotUsed, sqlite3_int64 *piNow){ + static const sqlite3_int64 unixEpoch = 24405875*(sqlite3_int64)8640000; +#if defined(NO_GETTOD) + time_t t; + time(&t); + *piNow = ((sqlite3_int64)i)*1000 + unixEpoch; +#elif OS_VXWORKS + struct timespec sNow; + clock_gettime(CLOCK_REALTIME, &sNow); + *piNow = unixEpoch + 1000*(sqlite3_int64)sNow.tv_sec + sNow.tv_nsec/1000000; +#else + struct timeval sNow; + gettimeofday(&sNow, 0); + *piNow = unixEpoch + 1000*(sqlite3_int64)sNow.tv_sec + sNow.tv_usec/1000; +#endif + +#ifdef SQLITE_TEST + if( sqlite3_current_time ){ + *piNow = 1000*(sqlite3_int64)sqlite3_current_time + unixEpoch; + } +#endif + UNUSED_PARAMETER(NotUsed); + return 0; +} + /* ** Find the current time (in Universal Coordinated Time). Write the ** current time and date as a Julian Day number into *prNow and ** return 0. Return 1 if the time and date cannot be found. */ static int unixCurrentTime(sqlite3_vfs *NotUsed, double *prNow){ -#if defined(SQLITE_OMIT_FLOATING_POINT) - time_t t; - time(&t); - *prNow = (((sqlite3_int64)t)/8640 + 24405875)/10; -#elif defined(NO_GETTOD) - time_t t; - time(&t); - *prNow = t/86400.0 + 2440587.5; -#elif OS_VXWORKS - struct timespec sNow; - clock_gettime(CLOCK_REALTIME, &sNow); - *prNow = 2440587.5 + sNow.tv_sec/86400.0 + sNow.tv_nsec/86400000000000.0; -#else - struct timeval sNow; - gettimeofday(&sNow, 0); - *prNow = 2440587.5 + sNow.tv_sec/86400.0 + sNow.tv_usec/86400000000.0; -#endif - -#ifdef SQLITE_TEST - if( sqlite3_current_time ){ - *prNow = sqlite3_current_time/86400.0 + 2440587.5; - } -#endif + sqlite3_int64 i; UNUSED_PARAMETER(NotUsed); + unixCurrentTimeInt64(0, &i); + *prNow = i/86400000.0; return 0; } @@ -25918,6 +28143,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ return 0; } + /* ************************ End of sqlite3_vfs methods *************************** ******************************************************************************/ @@ -26027,11 +28253,6 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** of the database file for multiple readers and writers on the same ** host (the conch ensures that they all use the same local lock file). ** -** There is a third file - the host ID file - used as a persistent record -** of a unique identifier for the host, a 128-byte unique host id file -** in the path defined by the HOSTIDPATH macro (default value is -** /Library/Caches/.com.apple.sqliteConchHostId). -** ** Requesting the lock proxy does not immediately take the conch, it is ** only taken when the first request to lock database file is made. ** This matches the semantics of the traditional locking behavior, where @@ -26057,10 +28278,6 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** Enables the logging of error messages during host id file ** retrieval and creation ** -** HOSTIDPATH -** -** Overrides the default host ID file path location -** ** LOCKPROXYDIR ** ** Overrides the default directory used for lock proxy files that @@ -26085,11 +28302,6 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ */ #if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE -#ifdef SQLITE_TEST -/* simulate multiple hosts by creating unique hostid file paths */ -SQLITE_API int sqlite3_hostid_num = 0; -#endif - /* ** The proxyLockingContext has the path and file structures for the remote ** and local proxy files in it @@ -26101,134 +28313,16 @@ struct proxyLockingContext { unixFile *lockProxy; /* Open proxy lock file */ char *lockProxyPath; /* Name of the proxy lock file */ char *dbPath; /* Name of the open file */ - int conchHeld; /* True if the conch is currently held */ + int conchHeld; /* 1 if the conch is held, -1 if lockless */ void *oldLockingContext; /* Original lockingcontext to restore on close */ sqlite3_io_methods const *pOldMethod; /* Original I/O methods for close */ }; -/* HOSTIDLEN and CONCHLEN both include space for the string -** terminating nul +/* +** The proxy lock file path for the database at dbPath is written into lPath, +** which must point to valid, writable memory large enough for a maxLen length +** file path. */ -#define HOSTIDLEN 128 -#define CONCHLEN (MAXPATHLEN+HOSTIDLEN+1) -#ifndef HOSTIDPATH -# define HOSTIDPATH "/Library/Caches/.com.apple.sqliteConchHostId" -#endif - -/* basically a copy of unixRandomness with different -** test behavior built in */ -static int proxyGenerateHostID(char *pHostID){ - int pid, fd, len; - unsigned char *key = (unsigned char *)pHostID; - - memset(key, 0, HOSTIDLEN); - len = 0; - fd = open("/dev/urandom", O_RDONLY); - if( fd>=0 ){ - len = read(fd, key, HOSTIDLEN); - close(fd); /* silently leak the fd if it fails */ - } - if( len < HOSTIDLEN ){ - time_t t; - time(&t); - memcpy(key, &t, sizeof(t)); - pid = getpid(); - memcpy(&key[sizeof(t)], &pid, sizeof(pid)); - } - -#ifdef MAKE_PRETTY_HOSTID - { - int i; - /* filter the bytes into printable ascii characters and NUL terminate */ - key[(HOSTIDLEN-1)] = 0x00; - for( i=0; i<(HOSTIDLEN-1); i++ ){ - unsigned char pa = key[i]&0x7F; - if( pa<0x20 ){ - key[i] = (key[i]&0x80 == 0x80) ? pa+0x40 : pa+0x20; - }else if( pa==0x7F ){ - key[i] = (key[i]&0x80 == 0x80) ? pa=0x20 : pa+0x7E; - } - } - } -#endif - return SQLITE_OK; -} - -/* writes the host id path to path, path should be an pre-allocated buffer -** with enough space for a path -*/ -static void proxyGetHostIDPath(char *path, size_t len){ - strlcpy(path, HOSTIDPATH, len); -#ifdef SQLITE_TEST - if( sqlite3_hostid_num>0 ){ - char suffix[2] = "1"; - suffix[0] = suffix[0] + sqlite3_hostid_num; - strlcat(path, suffix, len); - } -#endif - OSTRACE3("GETHOSTIDPATH %s pid=%d\n", path, getpid()); -} - -/* get the host ID from a sqlite hostid file stored in the -** user-specific tmp directory, create the ID if it's not there already -*/ -static int proxyGetHostID(char *pHostID, int *pError){ - int fd; - char path[MAXPATHLEN]; - size_t len; - int rc=SQLITE_OK; - - proxyGetHostIDPath(path, MAXPATHLEN); - /* try to create the host ID file, if it already exists read the contents */ - fd = open(path, O_CREAT|O_WRONLY|O_EXCL, 0644); - if( fd<0 ){ - int err=errno; - - if( err!=EEXIST ){ -#ifdef SQLITE_PROXY_DEBUG /* set the sqlite error message instead */ - fprintf(stderr, "sqlite error creating host ID file %s: %s\n", - path, strerror(err)); -#endif - return SQLITE_PERM; - } - /* couldn't create the file, read it instead */ - fd = open(path, O_RDONLY|O_EXCL); - if( fd<0 ){ -#ifdef SQLITE_PROXY_DEBUG /* set the sqlite error message instead */ - int err = errno; - fprintf(stderr, "sqlite error opening host ID file %s: %s\n", - path, strerror(err)); -#endif - return SQLITE_PERM; - } - len = pread(fd, pHostID, HOSTIDLEN, 0); - if( len<0 ){ - *pError = errno; - rc = SQLITE_IOERR_READ; - }else if( len 0) ){ + /* only mkdir if leaf dir != "." or "/" or ".." */ + if( i-start>2 || (i-start==1 && buf[start] != '.' && buf[start] != '/') + || (i-start==2 && buf[start] != '.' && buf[start+1] != '.') ){ + buf[i]='\0'; + if( mkdir(buf, SQLITE_DEFAULT_PROXYDIR_PERMISSIONS) ){ + int err=errno; + if( err!=EEXIST ) { + OSTRACE(("CREATELOCKPATH FAILED creating %s, " + "'%s' proxy lock path=%s pid=%d\n", + buf, strerror(err), lockPath, getpid())); + return err; + } + } + } + start=i+1; + } + buf[i] = lockPath[i]; + } + OSTRACE(("CREATELOCKPATH proxy lock path=%s pid=%d\n", lockPath, getpid())); + return 0; +} + /* ** Create a new VFS file descriptor (stored in memory obtained from ** sqlite3_malloc) and open the file named "path" in the file descriptor. @@ -26282,48 +28404,270 @@ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){ ** The caller is responsible not only for closing the file descriptor ** but also for freeing the memory associated with the file descriptor. */ -static int proxyCreateUnixFile(const char *path, unixFile **ppFile) { +static int proxyCreateUnixFile( + const char *path, /* path for the new unixFile */ + unixFile **ppFile, /* unixFile created and returned by ref */ + int islockfile /* if non zero missing dirs will be created */ +) { + int fd = -1; + int dirfd = -1; unixFile *pNew; - int flags = SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE; int rc = SQLITE_OK; + int openFlags = O_RDWR | O_CREAT; sqlite3_vfs dummyVfs; + int terrno = 0; + UnixUnusedFd *pUnused = NULL; - pNew = (unixFile *)sqlite3_malloc(sizeof(unixFile)); - if( !pNew ){ - return SQLITE_NOMEM; + /* 1. first try to open/create the file + ** 2. if that fails, and this is a lock file (not-conch), try creating + ** the parent directories and then try again. + ** 3. if that fails, try to open the file read-only + ** otherwise return BUSY (if lock file) or CANTOPEN for the conch file + */ + pUnused = findReusableFd(path, openFlags); + if( pUnused ){ + fd = pUnused->fd; + }else{ + pUnused = sqlite3_malloc(sizeof(*pUnused)); + if( !pUnused ){ + return SQLITE_NOMEM; + } + } + if( fd<0 ){ + fd = open(path, openFlags, SQLITE_DEFAULT_FILE_PERMISSIONS); + terrno = errno; + if( fd<0 && errno==ENOENT && islockfile ){ + if( proxyCreateLockPath(path) == SQLITE_OK ){ + fd = open(path, openFlags, SQLITE_DEFAULT_FILE_PERMISSIONS); + } + } + } + if( fd<0 ){ + openFlags = O_RDONLY; + fd = open(path, openFlags, SQLITE_DEFAULT_FILE_PERMISSIONS); + terrno = errno; + } + if( fd<0 ){ + if( islockfile ){ + return SQLITE_BUSY; + } + switch (terrno) { + case EACCES: + return SQLITE_PERM; + case EIO: + return SQLITE_IOERR_LOCK; /* even though it is the conch */ + default: + return SQLITE_CANTOPEN_BKPT; + } + } + + pNew = (unixFile *)sqlite3_malloc(sizeof(*pNew)); + if( pNew==NULL ){ + rc = SQLITE_NOMEM; + goto end_create_proxy; } memset(pNew, 0, sizeof(unixFile)); - - /* Call unixOpen() to open the proxy file. The flags passed to unixOpen() - ** suggest that the file being opened is a "main database". This is - ** necessary as other file types do not necessarily support locking. It - ** is better to use unixOpen() instead of opening the file directly with - ** open(), as unixOpen() sets up the various mechanisms required to - ** make sure a call to close() does not cause the system to discard - ** POSIX locks prematurely. - ** - ** It is important that the xOpen member of the VFS object passed to - ** unixOpen() is NULL. This tells unixOpen() may try to open a proxy-file - ** for the proxy-file (creating a potential infinite loop). - */ + pNew->openFlags = openFlags; dummyVfs.pAppData = (void*)&autolockIoFinder; - dummyVfs.xOpen = 0; - rc = unixOpen(&dummyVfs, path, (sqlite3_file *)pNew, flags, &flags); - if( rc==SQLITE_OK && (flags&SQLITE_OPEN_READONLY) ){ - pNew->pMethod->xClose((sqlite3_file *)pNew); - rc = SQLITE_CANTOPEN; + pUnused->fd = fd; + pUnused->flags = openFlags; + pNew->pUnused = pUnused; + + rc = fillInUnixFile(&dummyVfs, fd, dirfd, (sqlite3_file*)pNew, path, 0, 0); + if( rc==SQLITE_OK ){ + *ppFile = pNew; + return SQLITE_OK; } - - if( rc!=SQLITE_OK ){ - sqlite3_free(pNew); - pNew = 0; - } - - *ppFile = pNew; +end_create_proxy: + close(fd); /* silently leak fd if error, we're already in error */ + sqlite3_free(pNew); + sqlite3_free(pUnused); return rc; } -/* takes the conch by taking a shared lock and read the contents conch, if +#ifdef SQLITE_TEST +/* simulate multiple hosts by creating unique hostid file paths */ +SQLITE_API int sqlite3_hostid_num = 0; +#endif + +#define PROXY_HOSTIDLEN 16 /* conch file host id length */ + +/* Not always defined in the headers as it ought to be */ +extern int gethostuuid(uuid_t id, const struct timespec *wait); + +/* get the host ID via gethostuuid(), pHostID must point to PROXY_HOSTIDLEN +** bytes of writable memory. +*/ +static int proxyGetHostID(unsigned char *pHostID, int *pError){ + struct timespec timeout = {1, 0}; /* 1 sec timeout */ + + assert(PROXY_HOSTIDLEN == sizeof(uuid_t)); + memset(pHostID, 0, PROXY_HOSTIDLEN); +#if defined(__MAX_OS_X_VERSION_MIN_REQUIRED)\ + && __MAC_OS_X_VERSION_MIN_REQUIRED<1050 + if( gethostuuid(pHostID, &timeout) ){ + int err = errno; + if( pError ){ + *pError = err; + } + return SQLITE_IOERR; + } +#endif +#ifdef SQLITE_TEST + /* simulate multiple hosts by creating unique hostid file paths */ + if( sqlite3_hostid_num != 0){ + pHostID[0] = (char)(pHostID[0] + (char)(sqlite3_hostid_num & 0xFF)); + } +#endif + + return SQLITE_OK; +} + +/* The conch file contains the header, host id and lock file path + */ +#define PROXY_CONCHVERSION 2 /* 1-byte header, 16-byte host id, path */ +#define PROXY_HEADERLEN 1 /* conch file header length */ +#define PROXY_PATHINDEX (PROXY_HEADERLEN+PROXY_HOSTIDLEN) +#define PROXY_MAXCONCHLEN (PROXY_HEADERLEN+PROXY_HOSTIDLEN+MAXPATHLEN) + +/* +** Takes an open conch file, copies the contents to a new path and then moves +** it back. The newly created file's file descriptor is assigned to the +** conch file structure and finally the original conch file descriptor is +** closed. Returns zero if successful. +*/ +static int proxyBreakConchLock(unixFile *pFile, uuid_t myHostID){ + proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; + unixFile *conchFile = pCtx->conchFile; + char tPath[MAXPATHLEN]; + char buf[PROXY_MAXCONCHLEN]; + char *cPath = pCtx->conchFilePath; + size_t readLen = 0; + size_t pathLen = 0; + char errmsg[64] = ""; + int fd = -1; + int rc = -1; + UNUSED_PARAMETER(myHostID); + + /* create a new path by replace the trailing '-conch' with '-break' */ + pathLen = strlcpy(tPath, cPath, MAXPATHLEN); + if( pathLen>MAXPATHLEN || pathLen<6 || + (strlcpy(&tPath[pathLen-5], "break", 6) != 5) ){ + sprintf(errmsg, "path error (len %d)", (int)pathLen); + goto end_breaklock; + } + /* read the conch content */ + readLen = pread(conchFile->h, buf, PROXY_MAXCONCHLEN, 0); + if( readLenh); + conchFile->h = fd; + conchFile->openFlags = O_RDWR | O_CREAT; + +end_breaklock: + if( rc ){ + if( fd>=0 ){ + unlink(tPath); + close(fd); + } + fprintf(stderr, "failed to break stale lock on %s, %s\n", cPath, errmsg); + } + return rc; +} + +/* Take the requested lock on the conch file and break a stale lock if the +** host id matches. +*/ +static int proxyConchLock(unixFile *pFile, uuid_t myHostID, int lockType){ + proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; + unixFile *conchFile = pCtx->conchFile; + int rc = SQLITE_OK; + int nTries = 0; + struct timespec conchModTime; + + do { + rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, lockType); + nTries ++; + if( rc==SQLITE_BUSY ){ + /* If the lock failed (busy): + * 1st try: get the mod time of the conch, wait 0.5s and try again. + * 2nd try: fail if the mod time changed or host id is different, wait + * 10 sec and try again + * 3rd try: break the lock unless the mod time has changed. + */ + struct stat buf; + if( fstat(conchFile->h, &buf) ){ + pFile->lastErrno = errno; + return SQLITE_IOERR_LOCK; + } + + if( nTries==1 ){ + conchModTime = buf.st_mtimespec; + usleep(500000); /* wait 0.5 sec and try the lock again*/ + continue; + } + + assert( nTries>1 ); + if( conchModTime.tv_sec != buf.st_mtimespec.tv_sec || + conchModTime.tv_nsec != buf.st_mtimespec.tv_nsec ){ + return SQLITE_BUSY; + } + + if( nTries==2 ){ + char tBuf[PROXY_MAXCONCHLEN]; + int len = pread(conchFile->h, tBuf, PROXY_MAXCONCHLEN, 0); + if( len<0 ){ + pFile->lastErrno = errno; + return SQLITE_IOERR_LOCK; + } + if( len>PROXY_PATHINDEX && tBuf[0]==(char)PROXY_CONCHVERSION){ + /* don't break the lock if the host id doesn't match */ + if( 0!=memcmp(&tBuf[PROXY_HEADERLEN], myHostID, PROXY_HOSTIDLEN) ){ + return SQLITE_BUSY; + } + }else{ + /* don't break the lock on short read or a version mismatch */ + return SQLITE_BUSY; + } + usleep(10000000); /* wait 10 sec and try the lock again */ + continue; + } + + assert( nTries==3 ); + if( 0==proxyBreakConchLock(pFile, myHostID) ){ + rc = SQLITE_OK; + if( lockType==EXCLUSIVE_LOCK ){ + rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, SHARED_LOCK); + } + if( !rc ){ + rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, lockType); + } + } + } + } while( rc==SQLITE_BUSY && nTries<3 ); + + return rc; +} + +/* Takes the conch by taking a shared lock and read the contents conch, if ** lockPath is non-NULL, the host ID and lock file path must match. A NULL ** lockPath means that the lockPath in the conch file will be used if the ** host IDs match, or a new lock path will be generated automatically @@ -26332,149 +28676,221 @@ static int proxyCreateUnixFile(const char *path, unixFile **ppFile) { static int proxyTakeConch(unixFile *pFile){ proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; - if( pCtx->conchHeld>0 ){ + if( pCtx->conchHeld!=0 ){ return SQLITE_OK; }else{ unixFile *conchFile = pCtx->conchFile; - char testValue[CONCHLEN]; - char conchValue[CONCHLEN]; + uuid_t myHostID; + int pError = 0; + char readBuf[PROXY_MAXCONCHLEN]; char lockPath[MAXPATHLEN]; - char *tLockPath = NULL; + char *tempLockPath = NULL; int rc = SQLITE_OK; - int readRc = SQLITE_OK; - int syncPerms = 0; + int createConch = 0; + int hostIdMatch = 0; + int readLen = 0; + int tryOldLockPath = 0; + int forceNewLockPath = 0; + + OSTRACE(("TAKECONCH %d for %s pid=%d\n", conchFile->h, + (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), getpid())); - OSTRACE4("TAKECONCH %d for %s pid=%d\n", conchFile->h, - (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), getpid()); - - rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, SHARED_LOCK); - if( rc==SQLITE_OK ){ - int pError = 0; - memset(testValue, 0, CONCHLEN); /* conch is fixed size */ - rc = proxyGetHostID(testValue, &pError); - if( (rc&0xff)==SQLITE_IOERR ){ - pFile->lastErrno = pError; - } - if( pCtx->lockProxyPath ){ - strlcpy(&testValue[HOSTIDLEN], pCtx->lockProxyPath, MAXPATHLEN); - } + rc = proxyGetHostID(myHostID, &pError); + if( (rc&0xff)==SQLITE_IOERR ){ + pFile->lastErrno = pError; + goto end_takeconch; } + rc = proxyConchLock(pFile, myHostID, SHARED_LOCK); if( rc!=SQLITE_OK ){ goto end_takeconch; } - - readRc = unixRead((sqlite3_file *)conchFile, conchValue, CONCHLEN, 0); - if( readRc!=SQLITE_IOERR_SHORT_READ ){ - if( readRc!=SQLITE_OK ){ - if( (rc&0xff)==SQLITE_IOERR ){ - pFile->lastErrno = conchFile->lastErrno; + /* read the existing conch file */ + readLen = seekAndRead((unixFile*)conchFile, 0, readBuf, PROXY_MAXCONCHLEN); + if( readLen<0 ){ + /* I/O error: lastErrno set by seekAndRead */ + pFile->lastErrno = conchFile->lastErrno; + rc = SQLITE_IOERR_READ; + goto end_takeconch; + }else if( readLen<=(PROXY_HEADERLEN+PROXY_HOSTIDLEN) || + readBuf[0]!=(char)PROXY_CONCHVERSION ){ + /* a short read or version format mismatch means we need to create a new + ** conch file. + */ + createConch = 1; + } + /* if the host id matches and the lock path already exists in the conch + ** we'll try to use the path there, if we can't open that path, we'll + ** retry with a new auto-generated path + */ + do { /* in case we need to try again for an :auto: named lock file */ + + if( !createConch && !forceNewLockPath ){ + hostIdMatch = !memcmp(&readBuf[PROXY_HEADERLEN], myHostID, + PROXY_HOSTIDLEN); + /* if the conch has data compare the contents */ + if( !pCtx->lockProxyPath ){ + /* for auto-named local lock file, just check the host ID and we'll + ** use the local lock file path that's already in there + */ + if( hostIdMatch ){ + size_t pathLen = (readLen - PROXY_PATHINDEX); + + if( pathLen>=MAXPATHLEN ){ + pathLen=MAXPATHLEN-1; + } + memcpy(lockPath, &readBuf[PROXY_PATHINDEX], pathLen); + lockPath[pathLen] = 0; + tempLockPath = lockPath; + tryOldLockPath = 1; + /* create a copy of the lock path if the conch is taken */ + goto end_takeconch; + } + }else if( hostIdMatch + && !strncmp(pCtx->lockProxyPath, &readBuf[PROXY_PATHINDEX], + readLen-PROXY_PATHINDEX) + ){ + /* conch host and lock path match */ + goto end_takeconch; } - rc = readRc; + } + + /* if the conch isn't writable and doesn't match, we can't take it */ + if( (conchFile->openFlags&O_RDWR) == 0 ){ + rc = SQLITE_BUSY; goto end_takeconch; } - /* if the conch has data compare the contents */ + + /* either the conch didn't match or we need to create a new one */ if( !pCtx->lockProxyPath ){ - /* for auto-named local lock file, just check the host ID and we'll - ** use the local lock file path that's already in there */ - if( !memcmp(testValue, conchValue, HOSTIDLEN) ){ - tLockPath = (char *)&conchValue[HOSTIDLEN]; - goto end_takeconch; - } - }else{ - /* we've got the conch if conchValue matches our path and host ID */ - if( !memcmp(testValue, conchValue, CONCHLEN) ){ - goto end_takeconch; - } + proxyGetLockPath(pCtx->dbPath, lockPath, MAXPATHLEN); + tempLockPath = lockPath; + /* create a copy of the lock path _only_ if the conch is taken */ } - }else{ - /* a short read means we're "creating" the conch (even though it could - ** have been user-intervention), if we acquire the exclusive lock, - ** we'll try to match the current on-disk permissions of the database + + /* update conch with host and path (this will fail if other process + ** has a shared lock already), if the host id matches, use the big + ** stick. */ - syncPerms = 1; - } - - /* either conch was emtpy or didn't match */ - if( !pCtx->lockProxyPath ){ - proxyGetLockPath(pCtx->dbPath, lockPath, MAXPATHLEN); - tLockPath = lockPath; - strlcpy(&testValue[HOSTIDLEN], lockPath, MAXPATHLEN); - } - - /* update conch with host and path (this will fail if other process - ** has a shared lock already) */ - rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, EXCLUSIVE_LOCK); - if( rc==SQLITE_OK ){ - rc = unixWrite((sqlite3_file *)conchFile, testValue, CONCHLEN, 0); - if( rc==SQLITE_OK && syncPerms ){ - struct stat buf; - int err = fstat(pFile->h, &buf); - if( err==0 ){ - /* try to match the database file permissions, ignore failure */ -#ifndef SQLITE_PROXY_DEBUG - fchmod(conchFile->h, buf.st_mode); -#else - if( fchmod(conchFile->h, buf.st_mode)!=0 ){ - int code = errno; - fprintf(stderr, "fchmod %o FAILED with %d %s\n", - buf.st_mode, code, strerror(code)); - } else { - fprintf(stderr, "fchmod %o SUCCEDED\n",buf.st_mode); - } - }else{ - int code = errno; - fprintf(stderr, "STAT FAILED[%d] with %d %s\n", - err, code, strerror(code)); -#endif + futimes(conchFile->h, NULL); + if( hostIdMatch && !createConch ){ + if( conchFile->pInode && conchFile->pInode->nShared>1 ){ + /* We are trying for an exclusive lock but another thread in this + ** same process is still holding a shared lock. */ + rc = SQLITE_BUSY; + } else { + rc = proxyConchLock(pFile, myHostID, EXCLUSIVE_LOCK); } - } - } - conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, SHARED_LOCK); - -end_takeconch: - OSTRACE2("TRANSPROXY: CLOSE %d\n", pFile->h); - if( rc==SQLITE_OK && pFile->openFlags ){ - if( pFile->h>=0 ){ -#ifdef STRICT_CLOSE_ERROR - if( close(pFile->h) ){ - pFile->lastErrno = errno; - return SQLITE_IOERR_CLOSE; - } -#else - close(pFile->h); /* silently leak fd if fail */ -#endif - } - pFile->h = -1; - int fd = open(pCtx->dbPath, pFile->openFlags, - SQLITE_DEFAULT_FILE_PERMISSIONS); - OSTRACE2("TRANSPROXY: OPEN %d\n", fd); - if( fd>=0 ){ - pFile->h = fd; }else{ - rc=SQLITE_CANTOPEN; /* SQLITE_BUSY? proxyTakeConch called - during locking */ + rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, EXCLUSIVE_LOCK); } - } - if( rc==SQLITE_OK && !pCtx->lockProxy ){ - char *path = tLockPath ? tLockPath : pCtx->lockProxyPath; - /* ACS: Need to make a copy of path sometimes */ - rc = proxyCreateUnixFile(path, &pCtx->lockProxy); - } - if( rc==SQLITE_OK ){ - pCtx->conchHeld = 1; - - if( tLockPath ){ - pCtx->lockProxyPath = sqlite3DbStrDup(0, tLockPath); - if( pCtx->lockProxy->pMethod == &afpIoMethods ){ - ((afpLockingContext *)pCtx->lockProxy->lockingContext)->dbPath = - pCtx->lockProxyPath; + if( rc==SQLITE_OK ){ + char writeBuffer[PROXY_MAXCONCHLEN]; + int writeSize = 0; + + writeBuffer[0] = (char)PROXY_CONCHVERSION; + memcpy(&writeBuffer[PROXY_HEADERLEN], myHostID, PROXY_HOSTIDLEN); + if( pCtx->lockProxyPath!=NULL ){ + strlcpy(&writeBuffer[PROXY_PATHINDEX], pCtx->lockProxyPath, MAXPATHLEN); + }else{ + strlcpy(&writeBuffer[PROXY_PATHINDEX], tempLockPath, MAXPATHLEN); + } + writeSize = PROXY_PATHINDEX + strlen(&writeBuffer[PROXY_PATHINDEX]); + ftruncate(conchFile->h, writeSize); + rc = unixWrite((sqlite3_file *)conchFile, writeBuffer, writeSize, 0); + fsync(conchFile->h); + /* If we created a new conch file (not just updated the contents of a + ** valid conch file), try to match the permissions of the database + */ + if( rc==SQLITE_OK && createConch ){ + struct stat buf; + int err = fstat(pFile->h, &buf); + if( err==0 ){ + mode_t cmode = buf.st_mode&(S_IRUSR|S_IWUSR | S_IRGRP|S_IWGRP | + S_IROTH|S_IWOTH); + /* try to match the database file R/W permissions, ignore failure */ +#ifndef SQLITE_PROXY_DEBUG + fchmod(conchFile->h, cmode); +#else + if( fchmod(conchFile->h, cmode)!=0 ){ + int code = errno; + fprintf(stderr, "fchmod %o FAILED with %d %s\n", + cmode, code, strerror(code)); + } else { + fprintf(stderr, "fchmod %o SUCCEDED\n",cmode); + } + }else{ + int code = errno; + fprintf(stderr, "STAT FAILED[%d] with %d %s\n", + err, code, strerror(code)); +#endif + } } } - } else { - conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK); - } - OSTRACE3("TAKECONCH %d %s\n", conchFile->h, rc==SQLITE_OK?"ok":"failed"); - return rc; + conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, SHARED_LOCK); + + end_takeconch: + OSTRACE(("TRANSPROXY: CLOSE %d\n", pFile->h)); + if( rc==SQLITE_OK && pFile->openFlags ){ + if( pFile->h>=0 ){ +#ifdef STRICT_CLOSE_ERROR + if( close(pFile->h) ){ + pFile->lastErrno = errno; + return SQLITE_IOERR_CLOSE; + } +#else + close(pFile->h); /* silently leak fd if fail */ +#endif + } + pFile->h = -1; + int fd = open(pCtx->dbPath, pFile->openFlags, + SQLITE_DEFAULT_FILE_PERMISSIONS); + OSTRACE(("TRANSPROXY: OPEN %d\n", fd)); + if( fd>=0 ){ + pFile->h = fd; + }else{ + rc=SQLITE_CANTOPEN_BKPT; /* SQLITE_BUSY? proxyTakeConch called + during locking */ + } + } + if( rc==SQLITE_OK && !pCtx->lockProxy ){ + char *path = tempLockPath ? tempLockPath : pCtx->lockProxyPath; + rc = proxyCreateUnixFile(path, &pCtx->lockProxy, 1); + if( rc!=SQLITE_OK && rc!=SQLITE_NOMEM && tryOldLockPath ){ + /* we couldn't create the proxy lock file with the old lock file path + ** so try again via auto-naming + */ + forceNewLockPath = 1; + tryOldLockPath = 0; + continue; /* go back to the do {} while start point, try again */ + } + } + if( rc==SQLITE_OK ){ + /* Need to make a copy of path if we extracted the value + ** from the conch file or the path was allocated on the stack + */ + if( tempLockPath ){ + pCtx->lockProxyPath = sqlite3DbStrDup(0, tempLockPath); + if( !pCtx->lockProxyPath ){ + rc = SQLITE_NOMEM; + } + } + } + if( rc==SQLITE_OK ){ + pCtx->conchHeld = 1; + + if( pCtx->lockProxy->pMethod == &afpIoMethods ){ + afpLockingContext *afpCtx; + afpCtx = (afpLockingContext *)pCtx->lockProxy->lockingContext; + afpCtx->dbPath = pCtx->lockProxyPath; + } + } else { + conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK); + } + OSTRACE(("TAKECONCH %d %s\n", conchFile->h, + rc==SQLITE_OK?"ok":"failed")); + return rc; + } while (1); /* in case we need to retry the :auto: lock file - + ** we should never get here except via the 'continue' call. */ } } @@ -26482,19 +28898,21 @@ end_takeconch: ** If pFile holds a lock on a conch file, then release that lock. */ static int proxyReleaseConch(unixFile *pFile){ - int rc; /* Subroutine return code */ + int rc = SQLITE_OK; /* Subroutine return code */ proxyLockingContext *pCtx; /* The locking context for the proxy lock */ unixFile *conchFile; /* Name of the conch file */ pCtx = (proxyLockingContext *)pFile->lockingContext; conchFile = pCtx->conchFile; - OSTRACE4("RELEASECONCH %d for %s pid=%d\n", conchFile->h, + OSTRACE(("RELEASECONCH %d for %s pid=%d\n", conchFile->h, (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), - getpid()); + getpid())); + if( pCtx->conchHeld>0 ){ + rc = conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK); + } pCtx->conchHeld = 0; - rc = conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK); - OSTRACE3("RELEASECONCH %d %s\n", conchFile->h, - (rc==SQLITE_OK ? "ok" : "failed")); + OSTRACE(("RELEASECONCH %d %s\n", conchFile->h, + (rc==SQLITE_OK ? "ok" : "failed"))); return rc; } @@ -26551,7 +28969,7 @@ static int switchLockProxyPath(unixFile *pFile, const char *path) { char *oldPath = pCtx->lockProxyPath; int rc = SQLITE_OK; - if( pFile->locktype!=NO_LOCK ){ + if( pFile->eFileLock!=NO_LOCK ){ return SQLITE_BUSY; } @@ -26588,8 +29006,8 @@ static int proxyGetDbPathForUnixFile(unixFile *pFile, char *dbPath){ /* afp style keeps a reference to the db path in the filePath field ** of the struct */ assert( (int)strlen((char*)pFile->lockingContext)<=MAXPATHLEN ); - strcpy(dbPath, ((afpLockingContext *)pFile->lockingContext)->dbPath); - }else + strlcpy(dbPath, ((afpLockingContext *)pFile->lockingContext)->dbPath, MAXPATHLEN); + } else #endif if( pFile->pMethod == &dotlockIoMethods ){ /* dot lock style uses the locking context to store the dot lock @@ -26599,7 +29017,7 @@ static int proxyGetDbPathForUnixFile(unixFile *pFile, char *dbPath){ }else{ /* all other styles use the locking context to store the db file path */ assert( strlen((char*)pFile->lockingContext)<=MAXPATHLEN ); - strcpy(dbPath, (char *)pFile->lockingContext); + strlcpy(dbPath, (char *)pFile->lockingContext, MAXPATHLEN); } return SQLITE_OK; } @@ -26618,7 +29036,7 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { char *lockPath=NULL; int rc = SQLITE_OK; - if( pFile->locktype!=NO_LOCK ){ + if( pFile->eFileLock!=NO_LOCK ){ return SQLITE_BUSY; } proxyGetDbPathForUnixFile(pFile, dbPath); @@ -26628,8 +29046,8 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { lockPath=(char *)path; } - OSTRACE4("TRANSPROXY %d for %s pid=%d\n", pFile->h, - (lockPath ? lockPath : ":auto:"), getpid()); + OSTRACE(("TRANSPROXY %d for %s pid=%d\n", pFile->h, + (lockPath ? lockPath : ":auto:"), getpid())); pCtx = sqlite3_malloc( sizeof(*pCtx) ); if( pCtx==0 ){ @@ -26639,32 +29057,58 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { rc = proxyCreateConchPathname(dbPath, &pCtx->conchFilePath); if( rc==SQLITE_OK ){ - rc = proxyCreateUnixFile(pCtx->conchFilePath, &pCtx->conchFile); + rc = proxyCreateUnixFile(pCtx->conchFilePath, &pCtx->conchFile, 0); + if( rc==SQLITE_CANTOPEN && ((pFile->openFlags&O_RDWR) == 0) ){ + /* if (a) the open flags are not O_RDWR, (b) the conch isn't there, and + ** (c) the file system is read-only, then enable no-locking access. + ** Ugh, since O_RDONLY==0x0000 we test for !O_RDWR since unixOpen asserts + ** that openFlags will have only one of O_RDONLY or O_RDWR. + */ + struct statfs fsInfo; + struct stat conchInfo; + int goLockless = 0; + + if( stat(pCtx->conchFilePath, &conchInfo) == -1 ) { + int err = errno; + if( (err==ENOENT) && (statfs(dbPath, &fsInfo) != -1) ){ + goLockless = (fsInfo.f_flags&MNT_RDONLY) == MNT_RDONLY; + } + } + if( goLockless ){ + pCtx->conchHeld = -1; /* read only FS/ lockless */ + rc = SQLITE_OK; + } + } } if( rc==SQLITE_OK && lockPath ){ pCtx->lockProxyPath = sqlite3DbStrDup(0, lockPath); } + if( rc==SQLITE_OK ){ + pCtx->dbPath = sqlite3DbStrDup(0, dbPath); + if( pCtx->dbPath==NULL ){ + rc = SQLITE_NOMEM; + } + } if( rc==SQLITE_OK ){ /* all memory is allocated, proxys are created and assigned, ** switch the locking context and pMethod then return. */ - pCtx->dbPath = sqlite3DbStrDup(0, dbPath); pCtx->oldLockingContext = pFile->lockingContext; pFile->lockingContext = pCtx; pCtx->pOldMethod = pFile->pMethod; pFile->pMethod = &proxyIoMethods; }else{ if( pCtx->conchFile ){ - rc = pCtx->conchFile->pMethod->xClose((sqlite3_file *)pCtx->conchFile); - if( rc ) return rc; + pCtx->conchFile->pMethod->xClose((sqlite3_file *)pCtx->conchFile); sqlite3_free(pCtx->conchFile); } + sqlite3DbFree(0, pCtx->lockProxyPath); sqlite3_free(pCtx->conchFilePath); sqlite3_free(pCtx); } - OSTRACE3("TRANSPROXY %d %s\n", pFile->h, - (rc==SQLITE_OK ? "ok" : "failed")); + OSTRACE(("TRANSPROXY %d %s\n", pFile->h, + (rc==SQLITE_OK ? "ok" : "failed"))); return rc; } @@ -26748,14 +29192,18 @@ static int proxyCheckReservedLock(sqlite3_file *id, int *pResOut) { int rc = proxyTakeConch(pFile); if( rc==SQLITE_OK ){ proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; - unixFile *proxy = pCtx->lockProxy; - return proxy->pMethod->xCheckReservedLock((sqlite3_file*)proxy, pResOut); + if( pCtx->conchHeld>0 ){ + unixFile *proxy = pCtx->lockProxy; + return proxy->pMethod->xCheckReservedLock((sqlite3_file*)proxy, pResOut); + }else{ /* conchHeld < 0 is lockless */ + pResOut=0; + } } return rc; } /* -** Lock the file with the lock specified by parameter locktype - one +** Lock the file with the lock specified by parameter eFileLock - one ** of the following: ** ** (1) SHARED_LOCK @@ -26778,34 +29226,42 @@ static int proxyCheckReservedLock(sqlite3_file *id, int *pResOut) { ** This routine will only increase a lock. Use the sqlite3OsUnlock() ** routine to lower a locking level. */ -static int proxyLock(sqlite3_file *id, int locktype) { +static int proxyLock(sqlite3_file *id, int eFileLock) { unixFile *pFile = (unixFile*)id; int rc = proxyTakeConch(pFile); if( rc==SQLITE_OK ){ proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; - unixFile *proxy = pCtx->lockProxy; - rc = proxy->pMethod->xLock((sqlite3_file*)proxy, locktype); - pFile->locktype = proxy->locktype; + if( pCtx->conchHeld>0 ){ + unixFile *proxy = pCtx->lockProxy; + rc = proxy->pMethod->xLock((sqlite3_file*)proxy, eFileLock); + pFile->eFileLock = proxy->eFileLock; + }else{ + /* conchHeld < 0 is lockless */ + } } return rc; } /* -** Lower the locking level on file descriptor pFile to locktype. locktype +** Lower the locking level on file descriptor pFile to eFileLock. eFileLock ** must be either NO_LOCK or SHARED_LOCK. ** ** If the locking level of the file descriptor is already at or below ** the requested locking level, this routine is a no-op. */ -static int proxyUnlock(sqlite3_file *id, int locktype) { +static int proxyUnlock(sqlite3_file *id, int eFileLock) { unixFile *pFile = (unixFile*)id; int rc = proxyTakeConch(pFile); if( rc==SQLITE_OK ){ proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; - unixFile *proxy = pCtx->lockProxy; - rc = proxy->pMethod->xUnlock((sqlite3_file*)proxy, locktype); - pFile->locktype = proxy->locktype; + if( pCtx->conchHeld>0 ){ + unixFile *proxy = pCtx->lockProxy; + rc = proxy->pMethod->xUnlock((sqlite3_file*)proxy, eFileLock); + pFile->eFileLock = proxy->eFileLock; + }else{ + /* conchHeld < 0 is lockless */ + } } return rc; } @@ -26838,9 +29294,9 @@ static int proxyClose(sqlite3_file *id) { if( rc ) return rc; sqlite3_free(conchFile); } - sqlite3_free(pCtx->lockProxyPath); + sqlite3DbFree(0, pCtx->lockProxyPath); sqlite3_free(pCtx->conchFilePath); - sqlite3_free(pCtx->dbPath); + sqlite3DbFree(0, pCtx->dbPath); /* restore the original locking context and pMethod then close it */ pFile->lockingContext = pCtx->oldLockingContext; pFile->pMethod = pCtx->pOldMethod; @@ -26897,7 +29353,7 @@ SQLITE_API int sqlite3_os_init(void){ ** that filesystem time. */ #define UNIXVFS(VFSNAME, FINDER) { \ - 1, /* iVersion */ \ + 2, /* iVersion */ \ sizeof(unixFile), /* szOsFile */ \ MAX_PATHNAME, /* mxPathname */ \ 0, /* pNext */ \ @@ -26914,7 +29370,8 @@ SQLITE_API int sqlite3_os_init(void){ unixRandomness, /* xRandomness */ \ unixSleep, /* xSleep */ \ unixCurrentTime, /* xCurrentTime */ \ - unixGetLastError /* xGetLastError */ \ + unixGetLastError, /* xGetLastError */ \ + unixCurrentTimeInt64, /* xCurrentTimeInt64 */ \ } /* @@ -26932,7 +29389,6 @@ SQLITE_API int sqlite3_os_init(void){ #endif UNIXVFS("unix-none", nolockIoFinder ), UNIXVFS("unix-dotfile", dotlockIoFinder ), - UNIXVFS("unix-wfl", posixWflIoFinder ), #if OS_VXWORKS UNIXVFS("unix-namedsem", semIoFinder ), #endif @@ -26944,6 +29400,7 @@ SQLITE_API int sqlite3_os_init(void){ #endif #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) UNIXVFS("unix-afp", afpIoFinder ), + UNIXVFS("unix-nfs", nfsIoFinder ), UNIXVFS("unix-proxy", proxyIoFinder ), #endif }; @@ -27050,8 +29507,6 @@ SQLITE_API int sqlite3_os_end(void){ ** ** This file should be #included by the os_*.c files only. It is not a ** general purpose header file. -** -** $Id: os_common.h,v 1.38 2009/02/24 18:40:50 danielk1977 Exp $ */ #ifndef _OS_COMMON_H_ #define _OS_COMMON_H_ @@ -27067,23 +29522,9 @@ SQLITE_API int sqlite3_os_end(void){ #ifdef SQLITE_DEBUG SQLITE_PRIVATE int sqlite3OSTrace = 0; -#define OSTRACE1(X) if( sqlite3OSTrace ) sqlite3DebugPrintf(X) -#define OSTRACE2(X,Y) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y) -#define OSTRACE3(X,Y,Z) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y,Z) -#define OSTRACE4(X,Y,Z,A) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y,Z,A) -#define OSTRACE5(X,Y,Z,A,B) if( sqlite3OSTrace ) sqlite3DebugPrintf(X,Y,Z,A,B) -#define OSTRACE6(X,Y,Z,A,B,C) \ - if(sqlite3OSTrace) sqlite3DebugPrintf(X,Y,Z,A,B,C) -#define OSTRACE7(X,Y,Z,A,B,C,D) \ - if(sqlite3OSTrace) sqlite3DebugPrintf(X,Y,Z,A,B,C,D) +#define OSTRACE(X) if( sqlite3OSTrace ) sqlite3DebugPrintf X #else -#define OSTRACE1(X) -#define OSTRACE2(X,Y) -#define OSTRACE3(X,Y,Z) -#define OSTRACE4(X,Y,Z,A) -#define OSTRACE5(X,Y,Z,A,B) -#define OSTRACE6(X,Y,Z,A,B,C) -#define OSTRACE7(X,Y,Z,A,B,C,D) +#define OSTRACE(X) #endif /* @@ -27112,8 +29553,6 @@ SQLITE_PRIVATE int sqlite3OSTrace = 0; ** ** This file contains inline asm code for retrieving "high-performance" ** counters for x86 class CPUs. -** -** $Id: hwtime.h,v 1.3 2008/08/01 14:33:15 shane Exp $ */ #ifndef _HWTIME_H_ #define _HWTIME_H_ @@ -27271,6 +29710,10 @@ SQLITE_API int sqlite3_open_file_count = 0; # define FormatMessageW(a,b,c,d,e,f,g) 0 #endif +/* Forward references */ +typedef struct winShm winShm; /* A connection to shared-memory */ +typedef struct winShmNode winShmNode; /* A region of shared-memory */ + /* ** WinCE lacks native support for file locking so we have to fake it ** with some code of our own. @@ -27290,12 +29733,16 @@ typedef struct winceLock { */ typedef struct winFile winFile; struct winFile { - const sqlite3_io_methods *pMethod;/* Must be first */ + const sqlite3_io_methods *pMethod; /*** Must be first ***/ + sqlite3_vfs *pVfs; /* The VFS used to open this file */ HANDLE h; /* Handle for accessing the file */ unsigned char locktype; /* Type of lock currently held on this file */ short sharedLockByte; /* Randomly chosen byte used as a shared lock */ DWORD lastErrno; /* The Windows errno from the last I/O error */ DWORD sectorSize; /* Sector size of the device file is on */ + winShm *pShm; /* Instance of shared memory on this file */ + const char *zPath; /* Full pathname of this file */ + int szChunk; /* Chunk size configured by FCNTL_CHUNK_SIZE */ #if SQLITE_OS_WINCE WCHAR *zDeleteOnClose; /* Name of file to delete when closing */ HANDLE hMutex; /* Mutex used to control access to shared lock */ @@ -27807,6 +30254,42 @@ static BOOL winceLockFileEx( ** by the sqlite3_io_methods object. ******************************************************************************/ +/* +** Some microsoft compilers lack this definition. +*/ +#ifndef INVALID_SET_FILE_POINTER +# define INVALID_SET_FILE_POINTER ((DWORD)-1) +#endif + +/* +** Move the current position of the file handle passed as the first +** argument to offset iOffset within the file. If successful, return 0. +** Otherwise, set pFile->lastErrno and return non-zero. +*/ +static int seekWinFile(winFile *pFile, sqlite3_int64 iOffset){ + LONG upperBits; /* Most sig. 32 bits of new offset */ + LONG lowerBits; /* Least sig. 32 bits of new offset */ + DWORD dwRet; /* Value returned by SetFilePointer() */ + + upperBits = (LONG)((iOffset>>32) & 0x7fffffff); + lowerBits = (LONG)(iOffset & 0xffffffff); + + /* API oddity: If successful, SetFilePointer() returns a dword + ** containing the lower 32-bits of the new file-offset. Or, if it fails, + ** it returns INVALID_SET_FILE_POINTER. However according to MSDN, + ** INVALID_SET_FILE_POINTER may also be a valid new offset. So to determine + ** whether an error has actually occured, it is also necessary to call + ** GetLastError(). + */ + dwRet = SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN); + if( (dwRet==INVALID_SET_FILE_POINTER && GetLastError()!=NO_ERROR) ){ + pFile->lastErrno = GetLastError(); + return 1; + } + + return 0; +} + /* ** Close a file. ** @@ -27823,9 +30306,11 @@ static int winClose(sqlite3_file *id){ winFile *pFile = (winFile*)id; assert( id!=0 ); - OSTRACE2("CLOSE %d\n", pFile->h); + assert( pFile->pShm==0 ); + OSTRACE(("CLOSE %d\n", pFile->h)); do{ rc = CloseHandle(pFile->h); + /* SimulateIOError( rc=0; cnt=MX_CLOSE_ATTEMPT; ); */ }while( rc==0 && ++cnt < MX_CLOSE_ATTEMPT && (Sleep(100), 1) ); #if SQLITE_OS_WINCE #define WINCE_DELETION_ATTEMPTS 3 @@ -27842,17 +30327,11 @@ static int winClose(sqlite3_file *id){ free(pFile->zDeleteOnClose); } #endif + OSTRACE(("CLOSE %d %s\n", pFile->h, rc ? "ok" : "failed")); OpenCounter(-1); return rc ? SQLITE_OK : SQLITE_IOERR; } -/* -** Some microsoft compilers lack this definition. -*/ -#ifndef INVALID_SET_FILE_POINTER -# define INVALID_SET_FILE_POINTER ((DWORD)-1) -#endif - /* ** Read data from a file into a buffer. Return SQLITE_OK if all ** bytes were read successfully and SQLITE_IOERR if anything goes @@ -27864,32 +30343,27 @@ static int winRead( int amt, /* Number of bytes to read */ sqlite3_int64 offset /* Begin reading at this offset */ ){ - LONG upperBits = (LONG)((offset>>32) & 0x7fffffff); - LONG lowerBits = (LONG)(offset & 0xffffffff); - DWORD rc; - winFile *pFile = (winFile*)id; - DWORD error; - DWORD got; + winFile *pFile = (winFile*)id; /* file handle */ + DWORD nRead; /* Number of bytes actually read from file */ assert( id!=0 ); SimulateIOError(return SQLITE_IOERR_READ); - OSTRACE3("READ %d lock=%d\n", pFile->h, pFile->locktype); - rc = SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN); - if( rc==INVALID_SET_FILE_POINTER && (error=GetLastError())!=NO_ERROR ){ - pFile->lastErrno = error; + OSTRACE(("READ %d lock=%d\n", pFile->h, pFile->locktype)); + + if( seekWinFile(pFile, offset) ){ return SQLITE_FULL; } - if( !ReadFile(pFile->h, pBuf, amt, &got, 0) ){ + if( !ReadFile(pFile->h, pBuf, amt, &nRead, 0) ){ pFile->lastErrno = GetLastError(); return SQLITE_IOERR_READ; } - if( got==(DWORD)amt ){ - return SQLITE_OK; - }else{ + if( nRead<(DWORD)amt ){ /* Unread parts of the buffer must be zero-filled */ - memset(&((char*)pBuf)[got], 0, amt-got); + memset(&((char*)pBuf)[nRead], 0, amt-nRead); return SQLITE_IOERR_SHORT_READ; } + + return SQLITE_OK; } /* @@ -27897,39 +30371,42 @@ static int winRead( ** or some other error code on failure. */ static int winWrite( - sqlite3_file *id, /* File to write into */ - const void *pBuf, /* The bytes to be written */ - int amt, /* Number of bytes to write */ - sqlite3_int64 offset /* Offset into the file to begin writing at */ + sqlite3_file *id, /* File to write into */ + const void *pBuf, /* The bytes to be written */ + int amt, /* Number of bytes to write */ + sqlite3_int64 offset /* Offset into the file to begin writing at */ ){ - LONG upperBits = (LONG)((offset>>32) & 0x7fffffff); - LONG lowerBits = (LONG)(offset & 0xffffffff); - DWORD rc; - winFile *pFile = (winFile*)id; - DWORD error; - DWORD wrote = 0; + int rc; /* True if error has occured, else false */ + winFile *pFile = (winFile*)id; /* File handle */ - assert( id!=0 ); + assert( amt>0 ); + assert( pFile ); SimulateIOError(return SQLITE_IOERR_WRITE); SimulateDiskfullError(return SQLITE_FULL); - OSTRACE3("WRITE %d lock=%d\n", pFile->h, pFile->locktype); - rc = SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN); - if( rc==INVALID_SET_FILE_POINTER && (error=GetLastError())!=NO_ERROR ){ - pFile->lastErrno = error; - return SQLITE_FULL; + + OSTRACE(("WRITE %d lock=%d\n", pFile->h, pFile->locktype)); + + rc = seekWinFile(pFile, offset); + if( rc==0 ){ + u8 *aRem = (u8 *)pBuf; /* Data yet to be written */ + int nRem = amt; /* Number of bytes yet to be written */ + DWORD nWrite; /* Bytes written by each WriteFile() call */ + + while( nRem>0 && WriteFile(pFile->h, aRem, nRem, &nWrite, 0) && nWrite>0 ){ + aRem += nWrite; + nRem -= nWrite; + } + if( nRem>0 ){ + pFile->lastErrno = GetLastError(); + rc = 1; + } } - assert( amt>0 ); - while( - amt>0 - && (rc = WriteFile(pFile->h, pBuf, amt, &wrote, 0))!=0 - && wrote>0 - ){ - amt -= wrote; - pBuf = &((char*)pBuf)[wrote]; - } - if( !rc || amt>(int)wrote ){ - pFile->lastErrno = GetLastError(); - return SQLITE_FULL; + + if( rc ){ + if( pFile->lastErrno==ERROR_HANDLE_DISK_FULL ){ + return SQLITE_FULL; + } + return SQLITE_IOERR_WRITE; } return SQLITE_OK; } @@ -27938,26 +30415,33 @@ static int winWrite( ** Truncate an open file to a specified size */ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){ - LONG upperBits = (LONG)((nByte>>32) & 0x7fffffff); - LONG lowerBits = (LONG)(nByte & 0xffffffff); - DWORD rc; - winFile *pFile = (winFile*)id; - DWORD error; + winFile *pFile = (winFile*)id; /* File handle object */ + int rc = SQLITE_OK; /* Return code for this function */ - assert( id!=0 ); - OSTRACE3("TRUNCATE %d %lld\n", pFile->h, nByte); + assert( pFile ); + + OSTRACE(("TRUNCATE %d %lld\n", pFile->h, nByte)); SimulateIOError(return SQLITE_IOERR_TRUNCATE); - rc = SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN); - if( rc==INVALID_SET_FILE_POINTER && (error=GetLastError())!=NO_ERROR ){ - pFile->lastErrno = error; - return SQLITE_IOERR_TRUNCATE; + + /* If the user has configured a chunk-size for this file, truncate the + ** file so that it consists of an integer number of chunks (i.e. the + ** actual file size after the operation may be larger than the requested + ** size). + */ + if( pFile->szChunk ){ + nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk; } - /* SetEndOfFile will fail if nByte is negative */ - if( !SetEndOfFile(pFile->h) ){ + + /* SetEndOfFile() returns non-zero when successful, or zero when it fails. */ + if( seekWinFile(pFile, nByte) ){ + rc = SQLITE_IOERR_TRUNCATE; + }else if( 0==SetEndOfFile(pFile->h) ){ pFile->lastErrno = GetLastError(); - return SQLITE_IOERR_TRUNCATE; + rc = SQLITE_IOERR_TRUNCATE; } - return SQLITE_OK; + + OSTRACE(("TRUNCATE %d %lld %s\n", pFile->h, nByte, rc ? "failed" : "ok")); + return rc; } #ifdef SQLITE_TEST @@ -27973,14 +30457,20 @@ SQLITE_API int sqlite3_fullsync_count = 0; ** Make sure all writes to a particular file are committed to disk. */ static int winSync(sqlite3_file *id, int flags){ -#ifndef SQLITE_NO_SYNC +#if !defined(NDEBUG) || !defined(SQLITE_NO_SYNC) || defined(SQLITE_DEBUG) winFile *pFile = (winFile*)id; - - assert( id!=0 ); - OSTRACE3("SYNC %d lock=%d\n", pFile->h, pFile->locktype); #else UNUSED_PARAMETER(id); #endif + + assert( pFile ); + /* Check that one of SQLITE_SYNC_NORMAL or FULL was passed */ + assert((flags&0x0F)==SQLITE_SYNC_NORMAL + || (flags&0x0F)==SQLITE_SYNC_FULL + ); + + OSTRACE(("SYNC %d lock=%d\n", pFile->h, pFile->locktype)); + #ifndef SQLITE_TEST UNUSED_PARAMETER(flags); #else @@ -27989,11 +30479,18 @@ static int winSync(sqlite3_file *id, int flags){ } sqlite3_sync_count++; #endif + + /* Unix cannot, but some systems may return SQLITE_FULL from here. This + ** line is to test that doing so does not cause any problems. + */ + SimulateDiskfullError( return SQLITE_FULL ); + SimulateIOError( return SQLITE_IOERR; ); + /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a ** no-op */ #ifdef SQLITE_NO_SYNC - return SQLITE_OK; + return SQLITE_OK; #else if( FlushFileBuffers(pFile->h) ){ return SQLITE_OK; @@ -28118,8 +30615,8 @@ static int winLock(sqlite3_file *id, int locktype){ DWORD error = NO_ERROR; assert( id!=0 ); - OSTRACE5("LOCK %d %d was %d(%d)\n", - pFile->h, locktype, pFile->locktype, pFile->sharedLockByte); + OSTRACE(("LOCK %d %d was %d(%d)\n", + pFile->h, locktype, pFile->locktype, pFile->sharedLockByte)); /* If there is already a lock of this type or more restrictive on the ** OsFile, do nothing. Don't use the end_lock: exit path, as @@ -28149,7 +30646,7 @@ static int winLock(sqlite3_file *id, int locktype){ /* Try 3 times to get the pending lock. The pending lock might be ** held by another reader process who will release it momentarily. */ - OSTRACE2("could not get a PENDING lock. cnt=%d\n", cnt); + OSTRACE(("could not get a PENDING lock. cnt=%d\n", cnt)); Sleep(1); } gotPendingLock = res; @@ -28194,13 +30691,13 @@ static int winLock(sqlite3_file *id, int locktype){ if( locktype==EXCLUSIVE_LOCK && res ){ assert( pFile->locktype>=SHARED_LOCK ); res = unlockReadLock(pFile); - OSTRACE2("unreadlock = %d\n", res); + OSTRACE(("unreadlock = %d\n", res)); res = LockFile(pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0); if( res ){ newLocktype = EXCLUSIVE_LOCK; }else{ error = GetLastError(); - OSTRACE2("error-code = %d\n", error); + OSTRACE(("error-code = %d\n", error)); getReadLock(pFile); } } @@ -28218,8 +30715,8 @@ static int winLock(sqlite3_file *id, int locktype){ if( res ){ rc = SQLITE_OK; }else{ - OSTRACE4("LOCK FAILED %d trying for %d but got %d\n", pFile->h, - locktype, newLocktype); + OSTRACE(("LOCK FAILED %d trying for %d but got %d\n", pFile->h, + locktype, newLocktype)); pFile->lastErrno = error; rc = SQLITE_BUSY; } @@ -28236,17 +30733,19 @@ static int winCheckReservedLock(sqlite3_file *id, int *pResOut){ int rc; winFile *pFile = (winFile*)id; + SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); + assert( id!=0 ); if( pFile->locktype>=RESERVED_LOCK ){ rc = 1; - OSTRACE3("TEST WR-LOCK %d %d (local)\n", pFile->h, rc); + OSTRACE(("TEST WR-LOCK %d %d (local)\n", pFile->h, rc)); }else{ rc = LockFile(pFile->h, RESERVED_BYTE, 0, 1, 0); if( rc ){ UnlockFile(pFile->h, RESERVED_BYTE, 0, 1, 0); } rc = !rc; - OSTRACE3("TEST WR-LOCK %d %d (remote)\n", pFile->h, rc); + OSTRACE(("TEST WR-LOCK %d %d (remote)\n", pFile->h, rc)); } *pResOut = rc; return SQLITE_OK; @@ -28269,8 +30768,8 @@ static int winUnlock(sqlite3_file *id, int locktype){ int rc = SQLITE_OK; assert( pFile!=0 ); assert( locktype<=SHARED_LOCK ); - OSTRACE5("UNLOCK %d to %d was %d(%d)\n", pFile->h, locktype, - pFile->locktype, pFile->sharedLockByte); + OSTRACE(("UNLOCK %d to %d was %d(%d)\n", pFile->h, locktype, + pFile->locktype, pFile->sharedLockByte)); type = pFile->locktype; if( type>=EXCLUSIVE_LOCK ){ UnlockFile(pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0); @@ -28306,6 +30805,17 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){ *(int*)pArg = (int)((winFile*)id)->lastErrno; return SQLITE_OK; } + case SQLITE_FCNTL_CHUNK_SIZE: { + ((winFile*)id)->szChunk = *(int *)pArg; + return SQLITE_OK; + } + case SQLITE_FCNTL_SIZE_HINT: { + sqlite3_int64 sz = *(sqlite3_int64*)pArg; + SimulateIOErrorBenign(1); + winTruncate(id, sz); + SimulateIOErrorBenign(0); + return SQLITE_OK; + } } return SQLITE_ERROR; } @@ -28330,34 +30840,673 @@ static int winSectorSize(sqlite3_file *id){ */ static int winDeviceCharacteristics(sqlite3_file *id){ UNUSED_PARAMETER(id); - return 0; + return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN; } +#ifndef SQLITE_OMIT_WAL + +/* +** Windows will only let you create file view mappings +** on allocation size granularity boundaries. +** During sqlite3_os_init() we do a GetSystemInfo() +** to get the granularity size. +*/ +SYSTEM_INFO winSysInfo; + +/* +** Helper functions to obtain and relinquish the global mutex. The +** global mutex is used to protect the winLockInfo objects used by +** this file, all of which may be shared by multiple threads. +** +** Function winShmMutexHeld() is used to assert() that the global mutex +** is held when required. This function is only used as part of assert() +** statements. e.g. +** +** winShmEnterMutex() +** assert( winShmMutexHeld() ); +** winShmLeaveMutex() +*/ +static void winShmEnterMutex(void){ + sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER)); +} +static void winShmLeaveMutex(void){ + sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER)); +} +#ifdef SQLITE_DEBUG +static int winShmMutexHeld(void) { + return sqlite3_mutex_held(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER)); +} +#endif + +/* +** Object used to represent a single file opened and mmapped to provide +** shared memory. When multiple threads all reference the same +** log-summary, each thread has its own winFile object, but they all +** point to a single instance of this object. In other words, each +** log-summary is opened only once per process. +** +** winShmMutexHeld() must be true when creating or destroying +** this object or while reading or writing the following fields: +** +** nRef +** pNext +** +** The following fields are read-only after the object is created: +** +** fid +** zFilename +** +** Either winShmNode.mutex must be held or winShmNode.nRef==0 and +** winShmMutexHeld() is true when reading or writing any other field +** in this structure. +** +*/ +struct winShmNode { + sqlite3_mutex *mutex; /* Mutex to access this object */ + char *zFilename; /* Name of the file */ + winFile hFile; /* File handle from winOpen */ + + int szRegion; /* Size of shared-memory regions */ + int nRegion; /* Size of array apRegion */ + struct ShmRegion { + HANDLE hMap; /* File handle from CreateFileMapping */ + void *pMap; + } *aRegion; + DWORD lastErrno; /* The Windows errno from the last I/O error */ + + int nRef; /* Number of winShm objects pointing to this */ + winShm *pFirst; /* All winShm objects pointing to this */ + winShmNode *pNext; /* Next in list of all winShmNode objects */ +#ifdef SQLITE_DEBUG + u8 nextShmId; /* Next available winShm.id value */ +#endif +}; + +/* +** A global array of all winShmNode objects. +** +** The winShmMutexHeld() must be true while reading or writing this list. +*/ +static winShmNode *winShmNodeList = 0; + +/* +** Structure used internally by this VFS to record the state of an +** open shared memory connection. +** +** The following fields are initialized when this object is created and +** are read-only thereafter: +** +** winShm.pShmNode +** winShm.id +** +** All other fields are read/write. The winShm.pShmNode->mutex must be held +** while accessing any read/write fields. +*/ +struct winShm { + winShmNode *pShmNode; /* The underlying winShmNode object */ + winShm *pNext; /* Next winShm with the same winShmNode */ + u8 hasMutex; /* True if holding the winShmNode mutex */ + u16 sharedMask; /* Mask of shared locks held */ + u16 exclMask; /* Mask of exclusive locks held */ +#ifdef SQLITE_DEBUG + u8 id; /* Id of this connection with its winShmNode */ +#endif +}; + +/* +** Constants used for locking +*/ +#define WIN_SHM_BASE ((22+SQLITE_SHM_NLOCK)*4) /* first lock byte */ +#define WIN_SHM_DMS (WIN_SHM_BASE+SQLITE_SHM_NLOCK) /* deadman switch */ + +/* +** Apply advisory locks for all n bytes beginning at ofst. +*/ +#define _SHM_UNLCK 1 +#define _SHM_RDLCK 2 +#define _SHM_WRLCK 3 +static int winShmSystemLock( + winShmNode *pFile, /* Apply locks to this open shared-memory segment */ + int lockType, /* _SHM_UNLCK, _SHM_RDLCK, or _SHM_WRLCK */ + int ofst, /* Offset to first byte to be locked/unlocked */ + int nByte /* Number of bytes to lock or unlock */ +){ + OVERLAPPED ovlp; + DWORD dwFlags; + int rc = 0; /* Result code form Lock/UnlockFileEx() */ + + /* Access to the winShmNode object is serialized by the caller */ + assert( sqlite3_mutex_held(pFile->mutex) || pFile->nRef==0 ); + + /* Initialize the locking parameters */ + dwFlags = LOCKFILE_FAIL_IMMEDIATELY; + if( lockType == _SHM_WRLCK ) dwFlags |= LOCKFILE_EXCLUSIVE_LOCK; + + memset(&ovlp, 0, sizeof(OVERLAPPED)); + ovlp.Offset = ofst; + + /* Release/Acquire the system-level lock */ + if( lockType==_SHM_UNLCK ){ + rc = UnlockFileEx(pFile->hFile.h, 0, nByte, 0, &ovlp); + }else{ + rc = LockFileEx(pFile->hFile.h, dwFlags, 0, nByte, 0, &ovlp); + } + + if( rc!= 0 ){ + rc = SQLITE_OK; + }else{ + pFile->lastErrno = GetLastError(); + rc = SQLITE_BUSY; + } + + OSTRACE(("SHM-LOCK %d %s %s 0x%08lx\n", + pFile->hFile.h, + rc==SQLITE_OK ? "ok" : "failed", + lockType==_SHM_UNLCK ? "UnlockFileEx" : "LockFileEx", + pFile->lastErrno)); + + return rc; +} + +/* Forward references to VFS methods */ +static int winOpen(sqlite3_vfs*,const char*,sqlite3_file*,int,int*); +static int winDelete(sqlite3_vfs *,const char*,int); + +/* +** Purge the winShmNodeList list of all entries with winShmNode.nRef==0. +** +** This is not a VFS shared-memory method; it is a utility function called +** by VFS shared-memory methods. +*/ +static void winShmPurge(sqlite3_vfs *pVfs, int deleteFlag){ + winShmNode **pp; + winShmNode *p; + BOOL bRc; + assert( winShmMutexHeld() ); + pp = &winShmNodeList; + while( (p = *pp)!=0 ){ + if( p->nRef==0 ){ + int i; + if( p->mutex ) sqlite3_mutex_free(p->mutex); + for(i=0; inRegion; i++){ + bRc = UnmapViewOfFile(p->aRegion[i].pMap); + OSTRACE(("SHM-PURGE pid-%d unmap region=%d %s\n", + (int)GetCurrentProcessId(), i, + bRc ? "ok" : "failed")); + bRc = CloseHandle(p->aRegion[i].hMap); + OSTRACE(("SHM-PURGE pid-%d close region=%d %s\n", + (int)GetCurrentProcessId(), i, + bRc ? "ok" : "failed")); + } + if( p->hFile.h != INVALID_HANDLE_VALUE ){ + SimulateIOErrorBenign(1); + winClose((sqlite3_file *)&p->hFile); + SimulateIOErrorBenign(0); + } + if( deleteFlag ){ + SimulateIOErrorBenign(1); + winDelete(pVfs, p->zFilename, 0); + SimulateIOErrorBenign(0); + } + *pp = p->pNext; + sqlite3_free(p->aRegion); + sqlite3_free(p); + }else{ + pp = &p->pNext; + } + } +} + +/* +** Open the shared-memory area associated with database file pDbFd. +** +** When opening a new shared-memory file, if no other instances of that +** file are currently open, in this process or in other processes, then +** the file must be truncated to zero length or have its header cleared. +*/ +static int winOpenSharedMemory(winFile *pDbFd){ + struct winShm *p; /* The connection to be opened */ + struct winShmNode *pShmNode = 0; /* The underlying mmapped file */ + int rc; /* Result code */ + struct winShmNode *pNew; /* Newly allocated winShmNode */ + int nName; /* Size of zName in bytes */ + + assert( pDbFd->pShm==0 ); /* Not previously opened */ + + /* Allocate space for the new sqlite3_shm object. Also speculatively + ** allocate space for a new winShmNode and filename. + */ + p = sqlite3_malloc( sizeof(*p) ); + if( p==0 ) return SQLITE_NOMEM; + memset(p, 0, sizeof(*p)); + nName = sqlite3Strlen30(pDbFd->zPath); + pNew = sqlite3_malloc( sizeof(*pShmNode) + nName + 15 ); + if( pNew==0 ){ + sqlite3_free(p); + return SQLITE_NOMEM; + } + memset(pNew, 0, sizeof(*pNew)); + pNew->zFilename = (char*)&pNew[1]; + sqlite3_snprintf(nName+15, pNew->zFilename, "%s-shm", pDbFd->zPath); + + /* Look to see if there is an existing winShmNode that can be used. + ** If no matching winShmNode currently exists, create a new one. + */ + winShmEnterMutex(); + for(pShmNode = winShmNodeList; pShmNode; pShmNode=pShmNode->pNext){ + /* TBD need to come up with better match here. Perhaps + ** use FILE_ID_BOTH_DIR_INFO Structure. + */ + if( sqlite3StrICmp(pShmNode->zFilename, pNew->zFilename)==0 ) break; + } + if( pShmNode ){ + sqlite3_free(pNew); + }else{ + pShmNode = pNew; + pNew = 0; + ((winFile*)(&pShmNode->hFile))->h = INVALID_HANDLE_VALUE; + pShmNode->pNext = winShmNodeList; + winShmNodeList = pShmNode; + + pShmNode->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST); + if( pShmNode->mutex==0 ){ + rc = SQLITE_NOMEM; + goto shm_open_err; + } + + rc = winOpen(pDbFd->pVfs, + pShmNode->zFilename, /* Name of the file (UTF-8) */ + (sqlite3_file*)&pShmNode->hFile, /* File handle here */ + SQLITE_OPEN_WAL | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, /* Mode flags */ + 0); + if( SQLITE_OK!=rc ){ + rc = SQLITE_CANTOPEN_BKPT; + goto shm_open_err; + } + + /* Check to see if another process is holding the dead-man switch. + ** If not, truncate the file to zero length. + */ + if( winShmSystemLock(pShmNode, _SHM_WRLCK, WIN_SHM_DMS, 1)==SQLITE_OK ){ + rc = winTruncate((sqlite3_file *)&pShmNode->hFile, 0); + if( rc!=SQLITE_OK ){ + rc = SQLITE_IOERR_SHMOPEN; + } + } + if( rc==SQLITE_OK ){ + winShmSystemLock(pShmNode, _SHM_UNLCK, WIN_SHM_DMS, 1); + rc = winShmSystemLock(pShmNode, _SHM_RDLCK, WIN_SHM_DMS, 1); + } + if( rc ) goto shm_open_err; + } + + /* Make the new connection a child of the winShmNode */ + p->pShmNode = pShmNode; +#ifdef SQLITE_DEBUG + p->id = pShmNode->nextShmId++; +#endif + pShmNode->nRef++; + pDbFd->pShm = p; + winShmLeaveMutex(); + + /* The reference count on pShmNode has already been incremented under + ** the cover of the winShmEnterMutex() mutex and the pointer from the + ** new (struct winShm) object to the pShmNode has been set. All that is + ** left to do is to link the new object into the linked list starting + ** at pShmNode->pFirst. This must be done while holding the pShmNode->mutex + ** mutex. + */ + sqlite3_mutex_enter(pShmNode->mutex); + p->pNext = pShmNode->pFirst; + pShmNode->pFirst = p; + sqlite3_mutex_leave(pShmNode->mutex); + return SQLITE_OK; + + /* Jump here on any error */ +shm_open_err: + winShmSystemLock(pShmNode, _SHM_UNLCK, WIN_SHM_DMS, 1); + winShmPurge(pDbFd->pVfs, 0); /* This call frees pShmNode if required */ + sqlite3_free(p); + sqlite3_free(pNew); + winShmLeaveMutex(); + return rc; +} + +/* +** Close a connection to shared-memory. Delete the underlying +** storage if deleteFlag is true. +*/ +static int winShmUnmap( + sqlite3_file *fd, /* Database holding shared memory */ + int deleteFlag /* Delete after closing if true */ +){ + winFile *pDbFd; /* Database holding shared-memory */ + winShm *p; /* The connection to be closed */ + winShmNode *pShmNode; /* The underlying shared-memory file */ + winShm **pp; /* For looping over sibling connections */ + + pDbFd = (winFile*)fd; + p = pDbFd->pShm; + if( p==0 ) return SQLITE_OK; + pShmNode = p->pShmNode; + + /* Remove connection p from the set of connections associated + ** with pShmNode */ + sqlite3_mutex_enter(pShmNode->mutex); + for(pp=&pShmNode->pFirst; (*pp)!=p; pp = &(*pp)->pNext){} + *pp = p->pNext; + + /* Free the connection p */ + sqlite3_free(p); + pDbFd->pShm = 0; + sqlite3_mutex_leave(pShmNode->mutex); + + /* If pShmNode->nRef has reached 0, then close the underlying + ** shared-memory file, too */ + winShmEnterMutex(); + assert( pShmNode->nRef>0 ); + pShmNode->nRef--; + if( pShmNode->nRef==0 ){ + winShmPurge(pDbFd->pVfs, deleteFlag); + } + winShmLeaveMutex(); + + return SQLITE_OK; +} + +/* +** Change the lock state for a shared-memory segment. +*/ +static int winShmLock( + sqlite3_file *fd, /* Database file holding the shared memory */ + int ofst, /* First lock to acquire or release */ + int n, /* Number of locks to acquire or release */ + int flags /* What to do with the lock */ +){ + winFile *pDbFd = (winFile*)fd; /* Connection holding shared memory */ + winShm *p = pDbFd->pShm; /* The shared memory being locked */ + winShm *pX; /* For looping over all siblings */ + winShmNode *pShmNode = p->pShmNode; + int rc = SQLITE_OK; /* Result code */ + u16 mask; /* Mask of locks to take or release */ + + assert( ofst>=0 && ofst+n<=SQLITE_SHM_NLOCK ); + assert( n>=1 ); + assert( flags==(SQLITE_SHM_LOCK | SQLITE_SHM_SHARED) + || flags==(SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE) + || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED) + || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE) ); + assert( n==1 || (flags & SQLITE_SHM_EXCLUSIVE)!=0 ); + + mask = (u16)((1U<<(ofst+n)) - (1U<1 || mask==(1<mutex); + if( flags & SQLITE_SHM_UNLOCK ){ + u16 allMask = 0; /* Mask of locks held by siblings */ + + /* See if any siblings hold this same lock */ + for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ + if( pX==p ) continue; + assert( (pX->exclMask & (p->exclMask|p->sharedMask))==0 ); + allMask |= pX->sharedMask; + } + + /* Unlock the system-level locks */ + if( (mask & allMask)==0 ){ + rc = winShmSystemLock(pShmNode, _SHM_UNLCK, ofst+WIN_SHM_BASE, n); + }else{ + rc = SQLITE_OK; + } + + /* Undo the local locks */ + if( rc==SQLITE_OK ){ + p->exclMask &= ~mask; + p->sharedMask &= ~mask; + } + }else if( flags & SQLITE_SHM_SHARED ){ + u16 allShared = 0; /* Union of locks held by connections other than "p" */ + + /* Find out which shared locks are already held by sibling connections. + ** If any sibling already holds an exclusive lock, go ahead and return + ** SQLITE_BUSY. + */ + for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ + if( (pX->exclMask & mask)!=0 ){ + rc = SQLITE_BUSY; + break; + } + allShared |= pX->sharedMask; + } + + /* Get shared locks at the system level, if necessary */ + if( rc==SQLITE_OK ){ + if( (allShared & mask)==0 ){ + rc = winShmSystemLock(pShmNode, _SHM_RDLCK, ofst+WIN_SHM_BASE, n); + }else{ + rc = SQLITE_OK; + } + } + + /* Get the local shared locks */ + if( rc==SQLITE_OK ){ + p->sharedMask |= mask; + } + }else{ + /* Make sure no sibling connections hold locks that will block this + ** lock. If any do, return SQLITE_BUSY right away. + */ + for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ + if( (pX->exclMask & mask)!=0 || (pX->sharedMask & mask)!=0 ){ + rc = SQLITE_BUSY; + break; + } + } + + /* Get the exclusive locks at the system level. Then if successful + ** also mark the local connection as being locked. + */ + if( rc==SQLITE_OK ){ + rc = winShmSystemLock(pShmNode, _SHM_WRLCK, ofst+WIN_SHM_BASE, n); + if( rc==SQLITE_OK ){ + assert( (p->sharedMask & mask)==0 ); + p->exclMask |= mask; + } + } + } + sqlite3_mutex_leave(pShmNode->mutex); + OSTRACE(("SHM-LOCK shmid-%d, pid-%d got %03x,%03x %s\n", + p->id, (int)GetCurrentProcessId(), p->sharedMask, p->exclMask, + rc ? "failed" : "ok")); + return rc; +} + +/* +** Implement a memory barrier or memory fence on shared memory. +** +** All loads and stores begun before the barrier must complete before +** any load or store begun after the barrier. +*/ +static void winShmBarrier( + sqlite3_file *fd /* Database holding the shared memory */ +){ + UNUSED_PARAMETER(fd); + /* MemoryBarrier(); // does not work -- do not know why not */ + winShmEnterMutex(); + winShmLeaveMutex(); +} + +/* +** This function is called to obtain a pointer to region iRegion of the +** shared-memory associated with the database file fd. Shared-memory regions +** are numbered starting from zero. Each shared-memory region is szRegion +** bytes in size. +** +** If an error occurs, an error code is returned and *pp is set to NULL. +** +** Otherwise, if the isWrite parameter is 0 and the requested shared-memory +** region has not been allocated (by any client, including one running in a +** separate process), then *pp is set to NULL and SQLITE_OK returned. If +** isWrite is non-zero and the requested shared-memory region has not yet +** been allocated, it is allocated by this function. +** +** If the shared-memory region has already been allocated or is allocated by +** this call as described above, then it is mapped into this processes +** address space (if it is not already), *pp is set to point to the mapped +** memory and SQLITE_OK returned. +*/ +static int winShmMap( + sqlite3_file *fd, /* Handle open on database file */ + int iRegion, /* Region to retrieve */ + int szRegion, /* Size of regions */ + int isWrite, /* True to extend file if necessary */ + void volatile **pp /* OUT: Mapped memory */ +){ + winFile *pDbFd = (winFile*)fd; + winShm *p = pDbFd->pShm; + winShmNode *pShmNode; + int rc = SQLITE_OK; + + if( !p ){ + rc = winOpenSharedMemory(pDbFd); + if( rc!=SQLITE_OK ) return rc; + p = pDbFd->pShm; + } + pShmNode = p->pShmNode; + + sqlite3_mutex_enter(pShmNode->mutex); + assert( szRegion==pShmNode->szRegion || pShmNode->nRegion==0 ); + + if( pShmNode->nRegion<=iRegion ){ + struct ShmRegion *apNew; /* New aRegion[] array */ + int nByte = (iRegion+1)*szRegion; /* Minimum required file size */ + sqlite3_int64 sz; /* Current size of wal-index file */ + + pShmNode->szRegion = szRegion; + + /* The requested region is not mapped into this processes address space. + ** Check to see if it has been allocated (i.e. if the wal-index file is + ** large enough to contain the requested region). + */ + rc = winFileSize((sqlite3_file *)&pShmNode->hFile, &sz); + if( rc!=SQLITE_OK ){ + rc = SQLITE_IOERR_SHMSIZE; + goto shmpage_out; + } + + if( szhFile, nByte); + if( rc!=SQLITE_OK ){ + rc = SQLITE_IOERR_SHMSIZE; + goto shmpage_out; + } + } + + /* Map the requested memory region into this processes address space. */ + apNew = (struct ShmRegion *)sqlite3_realloc( + pShmNode->aRegion, (iRegion+1)*sizeof(apNew[0]) + ); + if( !apNew ){ + rc = SQLITE_IOERR_NOMEM; + goto shmpage_out; + } + pShmNode->aRegion = apNew; + + while( pShmNode->nRegion<=iRegion ){ + HANDLE hMap; /* file-mapping handle */ + void *pMap = 0; /* Mapped memory region */ + + hMap = CreateFileMapping(pShmNode->hFile.h, + NULL, PAGE_READWRITE, 0, nByte, NULL + ); + OSTRACE(("SHM-MAP pid-%d create region=%d nbyte=%d %s\n", + (int)GetCurrentProcessId(), pShmNode->nRegion, nByte, + hMap ? "ok" : "failed")); + if( hMap ){ + int iOffset = pShmNode->nRegion*szRegion; + int iOffsetShift = iOffset % winSysInfo.dwAllocationGranularity; + pMap = MapViewOfFile(hMap, FILE_MAP_WRITE | FILE_MAP_READ, + 0, iOffset - iOffsetShift, szRegion + iOffsetShift + ); + OSTRACE(("SHM-MAP pid-%d map region=%d offset=%d size=%d %s\n", + (int)GetCurrentProcessId(), pShmNode->nRegion, iOffset, szRegion, + pMap ? "ok" : "failed")); + } + if( !pMap ){ + pShmNode->lastErrno = GetLastError(); + rc = SQLITE_IOERR; + if( hMap ) CloseHandle(hMap); + goto shmpage_out; + } + + pShmNode->aRegion[pShmNode->nRegion].pMap = pMap; + pShmNode->aRegion[pShmNode->nRegion].hMap = hMap; + pShmNode->nRegion++; + } + } + +shmpage_out: + if( pShmNode->nRegion>iRegion ){ + int iOffset = iRegion*szRegion; + int iOffsetShift = iOffset % winSysInfo.dwAllocationGranularity; + char *p = (char *)pShmNode->aRegion[iRegion].pMap; + *pp = (void *)&p[iOffsetShift]; + }else{ + *pp = 0; + } + sqlite3_mutex_leave(pShmNode->mutex); + return rc; +} + +#else +# define winShmMap 0 +# define winShmLock 0 +# define winShmBarrier 0 +# define winShmUnmap 0 +#endif /* #ifndef SQLITE_OMIT_WAL */ + +/* +** Here ends the implementation of all sqlite3_file methods. +** +********************** End sqlite3_file Methods ******************************* +******************************************************************************/ + /* ** This vector defines all the methods that can operate on an ** sqlite3_file for win32. */ static const sqlite3_io_methods winIoMethod = { - 1, /* iVersion */ - winClose, - winRead, - winWrite, - winTruncate, - winSync, - winFileSize, - winLock, - winUnlock, - winCheckReservedLock, - winFileControl, - winSectorSize, - winDeviceCharacteristics + 2, /* iVersion */ + winClose, /* xClose */ + winRead, /* xRead */ + winWrite, /* xWrite */ + winTruncate, /* xTruncate */ + winSync, /* xSync */ + winFileSize, /* xFileSize */ + winLock, /* xLock */ + winUnlock, /* xUnlock */ + winCheckReservedLock, /* xCheckReservedLock */ + winFileControl, /* xFileControl */ + winSectorSize, /* xSectorSize */ + winDeviceCharacteristics, /* xDeviceCharacteristics */ + winShmMap, /* xShmMap */ + winShmLock, /* xShmLock */ + winShmBarrier, /* xShmBarrier */ + winShmUnmap /* xShmUnmap */ }; -/*************************************************************************** -** Here ends the I/O methods that form the sqlite3_io_methods object. +/**************************************************************************** +**************************** sqlite3_vfs methods **************************** ** -** The next block of code implements the VFS methods. -****************************************************************************/ +** This division contains the implementation of methods on the +** sqlite3_vfs object. +*/ /* ** Convert a UTF-8 filename into whatever form the underlying @@ -28391,6 +31540,13 @@ static int getTempname(int nBuf, char *zBuf){ "0123456789"; size_t i, j; char zTempPath[MAX_PATH+1]; + + /* It's odd to simulate an io-error here, but really this is just + ** using the io-error infrastructure to test that SQLite handles this + ** function failing. + */ + SimulateIOError( return SQLITE_IOERR ); + if( sqlite3_temp_directory ){ sqlite3_snprintf(MAX_PATH-30, zTempPath, "%s", sqlite3_temp_directory); }else if( isNT() ){ @@ -28422,17 +31578,27 @@ static int getTempname(int nBuf, char *zBuf){ } #endif } + + /* Check that the output buffer is large enough for the temporary file + ** name. If it is not, return SQLITE_ERROR. + */ + if( (sqlite3Strlen30(zTempPath) + sqlite3Strlen30(SQLITE_TEMP_FILE_PREFIX) + 17) >= nBuf ){ + return SQLITE_ERROR; + } + for(i=sqlite3Strlen30(zTempPath); i>0 && zTempPath[i-1]=='\\'; i--){} zTempPath[i] = 0; - sqlite3_snprintf(nBuf-30, zBuf, + + sqlite3_snprintf(nBuf-17, zBuf, "%s\\"SQLITE_TEMP_FILE_PREFIX, zTempPath); j = sqlite3Strlen30(zBuf); - sqlite3_randomness(20, &zBuf[j]); - for(i=0; i<20; i++, j++){ + sqlite3_randomness(15, &zBuf[j]); + for(i=0; i<15; i++, j++){ zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; } zBuf[j] = 0; - OSTRACE2("TEMP FILENAME: %s\n", zBuf); + + OSTRACE(("TEMP FILENAME: %s\n", zBuf)); return SQLITE_OK; } @@ -28517,18 +31683,72 @@ static int winOpen( int isTemp = 0; #endif winFile *pFile = (winFile*)id; - void *zConverted; /* Filename in OS encoding */ - const char *zUtf8Name = zName; /* Filename in UTF-8 encoding */ - char zTmpname[MAX_PATH+1]; /* Buffer used to create temp filename */ + void *zConverted; /* Filename in OS encoding */ + const char *zUtf8Name = zName; /* Filename in UTF-8 encoding */ + + /* If argument zPath is a NULL pointer, this function is required to open + ** a temporary file. Use this buffer to store the file name in. + */ + char zTmpname[MAX_PATH+1]; /* Buffer used to create temp filename */ + + int rc = SQLITE_OK; /* Function Return Code */ +#if !defined(NDEBUG) || SQLITE_OS_WINCE + int eType = flags&0xFFFFFF00; /* Type of file to open */ +#endif + + int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE); + int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE); + int isCreate = (flags & SQLITE_OPEN_CREATE); +#ifndef NDEBUG + int isReadonly = (flags & SQLITE_OPEN_READONLY); +#endif + int isReadWrite = (flags & SQLITE_OPEN_READWRITE); + +#ifndef NDEBUG + int isOpenJournal = (isCreate && ( + eType==SQLITE_OPEN_MASTER_JOURNAL + || eType==SQLITE_OPEN_MAIN_JOURNAL + || eType==SQLITE_OPEN_WAL + )); +#endif + + /* Check the following statements are true: + ** + ** (a) Exactly one of the READWRITE and READONLY flags must be set, and + ** (b) if CREATE is set, then READWRITE must also be set, and + ** (c) if EXCLUSIVE is set, then CREATE must also be set. + ** (d) if DELETEONCLOSE is set, then CREATE must also be set. + */ + assert((isReadonly==0 || isReadWrite==0) && (isReadWrite || isReadonly)); + assert(isCreate==0 || isReadWrite); + assert(isExclusive==0 || isCreate); + assert(isDelete==0 || isCreate); + + /* The main DB, main journal, WAL file and master journal are never + ** automatically deleted. Nor are they ever temporary files. */ + assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_DB ); + assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_JOURNAL ); + assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MASTER_JOURNAL ); + assert( (!isDelete && zName) || eType!=SQLITE_OPEN_WAL ); + + /* Assert that the upper layer has set one of the "file-type" flags. */ + assert( eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB + || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL + || eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL + || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL + ); assert( id!=0 ); UNUSED_PARAMETER(pVfs); + pFile->h = INVALID_HANDLE_VALUE; + /* If the second argument to this function is NULL, generate a ** temporary file name to use */ if( !zUtf8Name ){ - int rc = getTempname(MAX_PATH+1, zTmpname); + assert(isDelete && !isOpenJournal); + rc = getTempname(MAX_PATH+1, zTmpname); if( rc!=SQLITE_OK ){ return rc; } @@ -28541,29 +31761,31 @@ static int winOpen( return SQLITE_NOMEM; } - if( flags & SQLITE_OPEN_READWRITE ){ + if( isReadWrite ){ dwDesiredAccess = GENERIC_READ | GENERIC_WRITE; }else{ dwDesiredAccess = GENERIC_READ; } + /* SQLITE_OPEN_EXCLUSIVE is used to make sure that a new file is ** created. SQLite doesn't use it to indicate "exclusive access" ** as it is usually understood. */ - assert(!(flags & SQLITE_OPEN_EXCLUSIVE) || (flags & SQLITE_OPEN_CREATE)); - if( flags & SQLITE_OPEN_EXCLUSIVE ){ + if( isExclusive ){ /* Creates a new file, only if it does not already exist. */ /* If the file exists, it fails. */ dwCreationDisposition = CREATE_NEW; - }else if( flags & SQLITE_OPEN_CREATE ){ + }else if( isCreate ){ /* Open existing file, or create if it doesn't exist */ dwCreationDisposition = OPEN_ALWAYS; }else{ /* Opens a file, only if it exists. */ dwCreationDisposition = OPEN_EXISTING; } + dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; - if( flags & SQLITE_OPEN_DELETEONCLOSE ){ + + if( isDelete ){ #if SQLITE_OS_WINCE dwFlagsAndAttributes = FILE_ATTRIBUTE_HIDDEN; isTemp = 1; @@ -28580,6 +31802,7 @@ static int winOpen( #if SQLITE_OS_WINCE dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS; #endif + if( isNT() ){ h = CreateFileW((WCHAR*)zConverted, dwDesiredAccess, @@ -28605,35 +31828,46 @@ static int winOpen( ); #endif } + + OSTRACE(("OPEN %d %s 0x%lx %s\n", + h, zName, dwDesiredAccess, + h==INVALID_HANDLE_VALUE ? "failed" : "ok")); + if( h==INVALID_HANDLE_VALUE ){ + pFile->lastErrno = GetLastError(); free(zConverted); - if( flags & SQLITE_OPEN_READWRITE ){ + if( isReadWrite ){ return winOpen(pVfs, zName, id, - ((flags|SQLITE_OPEN_READONLY)&~SQLITE_OPEN_READWRITE), pOutFlags); + ((flags|SQLITE_OPEN_READONLY)&~(SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE)), pOutFlags); }else{ - return SQLITE_CANTOPEN; + return SQLITE_CANTOPEN_BKPT; } } + if( pOutFlags ){ - if( flags & SQLITE_OPEN_READWRITE ){ + if( isReadWrite ){ *pOutFlags = SQLITE_OPEN_READWRITE; }else{ *pOutFlags = SQLITE_OPEN_READONLY; } } + memset(pFile, 0, sizeof(*pFile)); pFile->pMethod = &winIoMethod; pFile->h = h; pFile->lastErrno = NO_ERROR; + pFile->pVfs = pVfs; + pFile->pShm = 0; + pFile->zPath = zName; pFile->sectorSize = getSectorSize(pVfs, zUtf8Name); + #if SQLITE_OS_WINCE - if( (flags & (SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB)) == - (SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB) + if( isReadWrite && eType==SQLITE_OPEN_MAIN_DB && !winceCreateLock(zName, pFile) ){ CloseHandle(h); free(zConverted); - return SQLITE_CANTOPEN; + return SQLITE_CANTOPEN_BKPT; } if( isTemp ){ pFile->zDeleteOnClose = zConverted; @@ -28642,8 +31876,9 @@ static int winOpen( { free(zConverted); } + OpenCounter(+1); - return SQLITE_OK; + return rc; } /* @@ -28667,13 +31902,15 @@ static int winDelete( int cnt = 0; DWORD rc; DWORD error = 0; - void *zConverted = convertUtf8Filename(zFilename); + void *zConverted; UNUSED_PARAMETER(pVfs); UNUSED_PARAMETER(syncDir); + + SimulateIOError(return SQLITE_IOERR_DELETE); + zConverted = convertUtf8Filename(zFilename); if( zConverted==0 ){ return SQLITE_NOMEM; } - SimulateIOError(return SQLITE_IOERR_DELETE); if( isNT() ){ do{ DeleteFileW(zConverted); @@ -28696,7 +31933,10 @@ static int winDelete( #endif } free(zConverted); - OSTRACE2("DELETE \"%s\"\n", zFilename); + OSTRACE(("DELETE \"%s\" %s\n", zFilename, + ( (rc==INVALID_FILE_ATTRIBUTES) && (error==ERROR_FILE_NOT_FOUND)) ? + "ok" : "failed" )); + return ( (rc == INVALID_FILE_ATTRIBUTES) && (error == ERROR_FILE_NOT_FOUND)) ? SQLITE_OK : SQLITE_IOERR_DELETE; } @@ -28712,13 +31952,38 @@ static int winAccess( ){ DWORD attr; int rc = 0; - void *zConverted = convertUtf8Filename(zFilename); + void *zConverted; UNUSED_PARAMETER(pVfs); + + SimulateIOError( return SQLITE_IOERR_ACCESS; ); + zConverted = convertUtf8Filename(zFilename); if( zConverted==0 ){ return SQLITE_NOMEM; } if( isNT() ){ - attr = GetFileAttributesW((WCHAR*)zConverted); + WIN32_FILE_ATTRIBUTE_DATA sAttrData; + memset(&sAttrData, 0, sizeof(sAttrData)); + if( GetFileAttributesExW((WCHAR*)zConverted, + GetFileExInfoStandard, + &sAttrData) ){ + /* For an SQLITE_ACCESS_EXISTS query, treat a zero-length file + ** as if it does not exist. + */ + if( flags==SQLITE_ACCESS_EXISTS + && sAttrData.nFileSizeHigh==0 + && sAttrData.nFileSizeLow==0 ){ + attr = INVALID_FILE_ATTRIBUTES; + }else{ + attr = sAttrData.dwFileAttributes; + } + }else{ + if( GetLastError()!=ERROR_FILE_NOT_FOUND ){ + free(zConverted); + return SQLITE_IOERR_ACCESS; + }else{ + attr = INVALID_FILE_ATTRIBUTES; + } + } /* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. ** Since the ASCII version of these Windows API do not exist for WINCE, ** it's important to not reference them for WINCE builds. @@ -28758,12 +32023,14 @@ static int winFullPathname( ){ #if defined(__CYGWIN__) + SimulateIOError( return SQLITE_ERROR ); UNUSED_PARAMETER(nFull); cygwin_conv_to_full_win32_path(zRelative, zFull); return SQLITE_OK; #endif #if SQLITE_OS_WINCE + SimulateIOError( return SQLITE_ERROR ); UNUSED_PARAMETER(nFull); /* WinCE has no concept of a relative pathname, or so I am told. */ sqlite3_snprintf(pVfs->mxPathname, zFull, "%s", zRelative); @@ -28774,6 +32041,13 @@ static int winFullPathname( int nByte; void *zConverted; char *zOut; + + /* It's odd to simulate an io-error here, but really this is just + ** using the io-error infrastructure to test that SQLite handles this + ** function failing. This function could fail if, for example, the + ** current working directory has been unlinked. + */ + SimulateIOError( return SQLITE_ERROR ); UNUSED_PARAMETER(nFull); zConverted = convertUtf8Filename(zRelative); if( isNT() ){ @@ -28841,7 +32115,9 @@ static int getSectorSize( ** to get the drive letter to look up the sector ** size. */ + SimulateIOErrorBenign(1); rc = winFullPathname(pVfs, zRelative, MAX_PATH, zFullpath); + SimulateIOErrorBenign(0); if( rc == SQLITE_OK ) { void *zConverted = convertUtf8Filename(zFullpath); @@ -28989,34 +32265,32 @@ static int winSleep(sqlite3_vfs *pVfs, int microsec){ } /* -** The following variable, if set to a non-zero value, becomes the result -** returned from sqlite3OsCurrentTime(). This is used for testing. +** The following variable, if set to a non-zero value, is interpreted as +** the number of seconds since 1970 and is used to set the result of +** sqlite3OsCurrentTime() during testing. */ #ifdef SQLITE_TEST -SQLITE_API int sqlite3_current_time = 0; +SQLITE_API int sqlite3_current_time = 0; /* Fake system time in seconds since 1970. */ #endif /* -** Find the current time (in Universal Coordinated Time). Write the -** current time and date as a Julian Day number into *prNow and -** return 0. Return 1 if the time and date cannot be found. +** Find the current time (in Universal Coordinated Time). Write into *piNow +** the current time and date as a Julian Day number times 86_400_000. In +** other words, write into *piNow the number of milliseconds since the Julian +** epoch of noon in Greenwich on November 24, 4714 B.C according to the +** proleptic Gregorian calendar. +** +** On success, return 0. Return 1 if the time and date cannot be found. */ -int winCurrentTime(sqlite3_vfs *pVfs, double *prNow){ - FILETIME ft; +static int winCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *piNow){ /* FILETIME structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (= JD 2305813.5). */ - sqlite3_int64 timeW; /* Whole days */ - sqlite3_int64 timeF; /* Fractional Days */ - - /* Number of 100-nanosecond intervals in a single day */ - static const sqlite3_int64 ntuPerDay = - 10000000*(sqlite3_int64)86400; - - /* Number of 100-nanosecond intervals in half of a day */ - static const sqlite3_int64 ntuPerHalfDay = - 10000000*(sqlite3_int64)43200; - + FILETIME ft; + static const sqlite3_int64 winFiletimeEpoch = 23058135*(sqlite3_int64)8640000; +#ifdef SQLITE_TEST + static const sqlite3_int64 unixEpoch = 24405875*(sqlite3_int64)8640000; +#endif /* 2^32 - to avoid use of LL and warnings in gcc */ static const sqlite3_int64 max32BitValue = (sqlite3_int64)2000000000 + (sqlite3_int64)2000000000 + (sqlite3_int64)294967296; @@ -29031,23 +32305,35 @@ int winCurrentTime(sqlite3_vfs *pVfs, double *prNow){ #else GetSystemTimeAsFileTime( &ft ); #endif - UNUSED_PARAMETER(pVfs); - timeW = (((sqlite3_int64)ft.dwHighDateTime)*max32BitValue) + (sqlite3_int64)ft.dwLowDateTime; - timeF = timeW % ntuPerDay; /* fractional days (100-nanoseconds) */ - timeW = timeW / ntuPerDay; /* whole days */ - timeW = timeW + 2305813; /* add whole days (from 2305813.5) */ - timeF = timeF + ntuPerHalfDay; /* add half a day (from 2305813.5) */ - timeW = timeW + (timeF/ntuPerDay); /* add whole day if half day made one */ - timeF = timeF % ntuPerDay; /* compute new fractional days */ - *prNow = (double)timeW + ((double)timeF / (double)ntuPerDay); + + *piNow = winFiletimeEpoch + + ((((sqlite3_int64)ft.dwHighDateTime)*max32BitValue) + + (sqlite3_int64)ft.dwLowDateTime)/(sqlite3_int64)10000; + #ifdef SQLITE_TEST if( sqlite3_current_time ){ - *prNow = ((double)sqlite3_current_time + (double)43200) / (double)86400 + (double)2440587; + *piNow = 1000*(sqlite3_int64)sqlite3_current_time + unixEpoch; } #endif + UNUSED_PARAMETER(pVfs); return 0; } +/* +** Find the current time (in Universal Coordinated Time). Write the +** current time and date as a Julian Day number into *prNow and +** return 0. Return 1 if the time and date cannot be found. +*/ +int winCurrentTime(sqlite3_vfs *pVfs, double *prNow){ + int rc; + sqlite3_int64 i; + rc = winCurrentTimeInt64(pVfs, &i); + if( !rc ){ + *prNow = i/86400000.0; + } + return rc; +} + /* ** The idea is that this function works like a combination of ** GetLastError() and FormatMessage() on windows (or errno and @@ -29083,32 +32369,41 @@ static int winGetLastError(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ return getLastErrorMsg(nBuf, zBuf); } + + /* ** Initialize and deinitialize the operating system interface. */ SQLITE_API int sqlite3_os_init(void){ static sqlite3_vfs winVfs = { - 1, /* iVersion */ - sizeof(winFile), /* szOsFile */ - MAX_PATH, /* mxPathname */ - 0, /* pNext */ - "win32", /* zName */ - 0, /* pAppData */ - - winOpen, /* xOpen */ - winDelete, /* xDelete */ - winAccess, /* xAccess */ - winFullPathname, /* xFullPathname */ - winDlOpen, /* xDlOpen */ - winDlError, /* xDlError */ - winDlSym, /* xDlSym */ - winDlClose, /* xDlClose */ - winRandomness, /* xRandomness */ - winSleep, /* xSleep */ - winCurrentTime, /* xCurrentTime */ - winGetLastError /* xGetLastError */ + 2, /* iVersion */ + sizeof(winFile), /* szOsFile */ + MAX_PATH, /* mxPathname */ + 0, /* pNext */ + "win32", /* zName */ + 0, /* pAppData */ + winOpen, /* xOpen */ + winDelete, /* xDelete */ + winAccess, /* xAccess */ + winFullPathname, /* xFullPathname */ + winDlOpen, /* xDlOpen */ + winDlError, /* xDlError */ + winDlSym, /* xDlSym */ + winDlClose, /* xDlClose */ + winRandomness, /* xRandomness */ + winSleep, /* xSleep */ + winCurrentTime, /* xCurrentTime */ + winGetLastError, /* xGetLastError */ + winCurrentTimeInt64, /* xCurrentTimeInt64 */ }; +#ifndef SQLITE_OMIT_WAL + /* get memory map allocation granularity */ + memset(&winSysInfo, 0, sizeof(SYSTEM_INFO)); + GetSystemInfo(&winSysInfo); + assert(winSysInfo.dwAllocationGranularity > 0); +#endif + sqlite3_vfs_register(&winVfs, 1); return SQLITE_OK; } @@ -29135,7 +32430,7 @@ SQLITE_API int sqlite3_os_end(void){ ** bitmap. Bits are numbered starting with 1. ** ** A bitmap is used to record which pages of a database file have been -** journalled during a transaction, or which pages have the "don't-write" +** journalled during a transaction, or which pages have the "dont-write" ** property. Usually only a few pages are meet either condition. ** So the bitmap is usually sparse and has low cardinality. ** But sometimes (for example when during a DROP of a large table) most @@ -29155,12 +32450,10 @@ SQLITE_API int sqlite3_os_end(void){ ** Bitvec object is the number of pages in the database file at the ** start of a transaction, and is thus usually less than a few thousand, ** but can be as large as 2 billion for a really big database. -** -** @(#) $Id: bitvec.c,v 1.17 2009/07/25 17:33:26 drh Exp $ */ /* Size of the Bitvec structure in bytes. */ -#define BITVEC_SZ (sizeof(void*)*128) /* 512 on 32bit. 1024 on 64bit */ +#define BITVEC_SZ 512 /* Round the union size down to the nearest pointer boundary, since that's how ** it will be aligned within the Bitvec struct. */ @@ -29544,8 +32837,6 @@ bitvec_end: ** ************************************************************************* ** This file implements that page cache. -** -** @(#) $Id: pcache.c,v 1.47 2009/07/25 11:46:49 danielk1977 Exp $ */ /* @@ -29677,12 +32968,16 @@ static void pcacheUnpin(PgHdr *p){ */ SQLITE_PRIVATE int sqlite3PcacheInitialize(void){ if( sqlite3GlobalConfig.pcache.xInit==0 ){ + /* IMPLEMENTATION-OF: R-26801-64137 If the xInit() method is NULL, then the + ** built-in default page cache is used instead of the application defined + ** page cache. */ sqlite3PCacheSetDefault(); } return sqlite3GlobalConfig.pcache.xInit(sqlite3GlobalConfig.pcache.pArg); } SQLITE_PRIVATE void sqlite3PcacheShutdown(void){ if( sqlite3GlobalConfig.pcache.xShutdown ){ + /* IMPLEMENTATION-OF: R-26000-56589 The xShutdown() method may be NULL. */ sqlite3GlobalConfig.pcache.xShutdown(sqlite3GlobalConfig.pcache.pArg); } } @@ -29724,6 +33019,7 @@ SQLITE_PRIVATE void sqlite3PcacheSetPageSize(PCache *pCache, int szPage){ if( pCache->pCache ){ sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache); pCache->pCache = 0; + pCache->pPage1 = 0; } pCache->szPage = szPage; } @@ -29777,6 +33073,7 @@ SQLITE_PRIVATE int sqlite3PcacheFetch( pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); pPg=pPg->pDirtyPrev ); + pCache->pSynced = pPg; if( !pPg ){ for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pDirtyPrev); } @@ -29793,15 +33090,17 @@ SQLITE_PRIVATE int sqlite3PcacheFetch( if( pPage ){ if( !pPage->pData ){ - memset(pPage, 0, sizeof(PgHdr) + pCache->szExtra); - pPage->pExtra = (void*)&pPage[1]; - pPage->pData = (void *)&((char *)pPage)[sizeof(PgHdr) + pCache->szExtra]; + memset(pPage, 0, sizeof(PgHdr)); + pPage->pData = (void *)&pPage[1]; + pPage->pExtra = (void*)&((char *)pPage->pData)[pCache->szPage]; + memset(pPage->pExtra, 0, pCache->szExtra); pPage->pCache = pCache; pPage->pgno = pgno; } assert( pPage->pCache==pCache ); assert( pPage->pgno==pgno ); - assert( pPage->pExtra==(void *)&pPage[1] ); + assert( pPage->pData==(void *)&pPage[1] ); + assert( pPage->pExtra==(void *)&((char *)&pPage[1])[pCache->szPage] ); if( 0==pPage->nRef ){ pCache->nRef++; @@ -29940,7 +33239,12 @@ SQLITE_PRIVATE void sqlite3PcacheTruncate(PCache *pCache, Pgno pgno){ PgHdr *pNext; for(p=pCache->pDirty; p; p=pNext){ pNext = p->pDirtyNext; - if( p->pgno>pgno ){ + /* This routine never gets call with a positive pgno except right + ** after sqlite3PcacheCleanAll(). So if there are dirty pages, + ** it must be that pgno==0. + */ + assert( p->pgno>0 ); + if( ALWAYS(p->pgno>pgno) ){ assert( p->flags&PGHDR_DIRTY ); sqlite3PcacheMakeClean(p); } @@ -30127,8 +33431,6 @@ SQLITE_PRIVATE void sqlite3PcacheIterateDirty(PCache *pCache, void (*xIter)(PgHd ** of the SQLITE_CONFIG_PAGECACHE and sqlite3_release_memory() features. ** If the default page cache implementation is overriden, then neither of ** these two features are available. -** -** @(#) $Id: pcache1.c,v 1.19 2009/07/17 11:44:07 drh Exp $ */ @@ -30136,8 +33438,13 @@ typedef struct PCache1 PCache1; typedef struct PgHdr1 PgHdr1; typedef struct PgFreeslot PgFreeslot; -/* Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles +/* Each page cache is an instance of the following object. Every +** open database file (including each in-memory database and each +** temporary or transient database) has a single page cache which +** is an instance of this object. +** +** Pointers to structures of this type are cast and returned as +** opaque sqlite3_pcache* handles. */ struct PCache1 { /* Cache configuration parameters. Page size (szPage) and the purgeable @@ -30197,6 +33504,9 @@ static SQLITE_WSD struct PCacheGlobal { /* Variables related to SQLITE_CONFIG_PAGECACHE settings. */ int szSlot; /* Size of each free slot */ + int nSlot; /* The number of pcache slots */ + int nFreeSlot; /* Number of unused pcache slots */ + int nReserve; /* Try to keep nFreeSlot above this */ void *pStart, *pEnd; /* Bounds of pagecache malloc range */ PgFreeslot *pFree; /* Free page blocks */ int isInit; /* True if initialized */ @@ -30244,6 +33554,8 @@ SQLITE_PRIVATE void sqlite3PCacheBufferSetup(void *pBuf, int sz, int n){ PgFreeslot *p; sz = ROUNDDOWN8(sz); pcache1.szSlot = sz; + pcache1.nSlot = pcache1.nFreeSlot = n; + pcache1.nReserve = n>90 ? 10 : (n/10 + 1); pcache1.pStart = pBuf; pcache1.pFree = 0; while( n-- ){ @@ -30265,11 +33577,13 @@ SQLITE_PRIVATE void sqlite3PCacheBufferSetup(void *pBuf, int sz, int n){ static void *pcache1Alloc(int nByte){ void *p; assert( sqlite3_mutex_held(pcache1.mutex) ); + sqlite3StatusSet(SQLITE_STATUS_PAGECACHE_SIZE, nByte); if( nByte<=pcache1.szSlot && pcache1.pFree ){ assert( pcache1.isInit ); p = (PgHdr1 *)pcache1.pFree; pcache1.pFree = pcache1.pFree->pNext; - sqlite3StatusSet(SQLITE_STATUS_PAGECACHE_SIZE, nByte); + pcache1.nFreeSlot--; + assert( pcache1.nFreeSlot>=0 ); sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_USED, 1); }else{ @@ -30286,6 +33600,7 @@ static void *pcache1Alloc(int nByte){ int sz = sqlite3MallocSize(p); sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, sz); } + sqlite3MemdebugSetType(p, MEMTYPE_PCACHE); } return p; } @@ -30302,13 +33617,37 @@ static void pcache1Free(void *p){ pSlot = (PgFreeslot*)p; pSlot->pNext = pcache1.pFree; pcache1.pFree = pSlot; + pcache1.nFreeSlot++; + assert( pcache1.nFreeSlot<=pcache1.nSlot ); }else{ - int iSize = sqlite3MallocSize(p); + int iSize; + assert( sqlite3MemdebugHasType(p, MEMTYPE_PCACHE) ); + sqlite3MemdebugSetType(p, MEMTYPE_HEAP); + iSize = sqlite3MallocSize(p); sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -iSize); sqlite3_free(p); } } +#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT +/* +** Return the size of a pcache allocation +*/ +static int pcache1MemSize(void *p){ + assert( sqlite3_mutex_held(pcache1.mutex) ); + if( p>=pcache1.pStart && pszPage<=pcache1.szSlot ){ + return pcache1.nFreeSlot=(pcache1.nMaxPage+pCache->nMin-pcache1.nMinPage) || nPinned>=(pCache->nMax * 9 / 10) + || pcache1UnderMemoryPressure(pCache) )){ goto fetch_out; } @@ -30666,7 +34037,9 @@ static void *pcache1Fetch(sqlite3_pcache *p, unsigned int iKey, int createFlag){ /* Step 4. Try to recycle a page buffer if appropriate. */ if( pCache->bPurgeable && pcache1.pLruTail && ( - (pCache->nPage+1>=pCache->nMax) || pcache1.nCurrentPage>=pcache1.nMaxPage + (pCache->nPage+1>=pCache->nMax) + || pcache1.nCurrentPage>=pcache1.nMaxPage + || pcache1UnderMemoryPressure(pCache) )){ pPage = pcache1.pLruTail; pcache1RemoveFromHash(pPage); @@ -30778,15 +34151,7 @@ static void pcache1Rekey( pPage->iKey = iNew; pPage->pNext = pCache->apHash[h]; pCache->apHash[h] = pPage; - - /* The xRekey() interface is only used to move pages earlier in the - ** database file (in order to move all free pages to the end of the - ** file where they can be truncated off.) Hence, it is not possible - ** for the new page number to be greater than the largest previously - ** fetched page. But we retain the following test in case xRekey() - ** begins to be used in different ways in the future. - */ - if( NEVER(iNew>pCache->iMaxKey) ){ + if( iNew>pCache->iMaxKey ){ pCache->iMaxKey = iNew; } @@ -30817,6 +34182,7 @@ static void pcache1Truncate(sqlite3_pcache *p, unsigned int iLimit){ */ static void pcache1Destroy(sqlite3_pcache *p){ PCache1 *pCache = (PCache1 *)p; + assert( pCache->bPurgeable || (pCache->nMax==0 && pCache->nMin==0) ); pcache1EnterMutex(); pcache1TruncateUnsafe(pCache, 0); pcache1.nMaxPage -= pCache->nMax; @@ -30833,7 +34199,7 @@ static void pcache1Destroy(sqlite3_pcache *p){ ** already provided an alternative. */ SQLITE_PRIVATE void sqlite3PCacheSetDefault(void){ - static sqlite3_pcache_methods defaultMethods = { + static const sqlite3_pcache_methods defaultMethods = { 0, /* pArg */ pcache1Init, /* xInit */ pcache1Shutdown, /* xShutdown */ @@ -30864,8 +34230,8 @@ SQLITE_PRIVATE int sqlite3PcacheReleaseMemory(int nReq){ if( pcache1.pStart==0 ){ PgHdr1 *p; pcache1EnterMutex(); - while( (nReq<0 || nFree READER-------+ | +** | | | +** | V | +** |<-------WRITER_LOCKED------> ERROR +** | | ^ +** | V | +** |<------WRITER_CACHEMOD-------->| +** | | | +** | V | +** |<-------WRITER_DBMOD---------->| +** | | | +** | V | +** +<------WRITER_FINISHED-------->+ ** -** PAGER_SHARED The page cache is reading the database. -** Writing is not permitted. There can be -** multiple readers accessing the same database -** file at the same time. ** -** PAGER_RESERVED This process has reserved the database for writing -** but has not yet made any changes. Only one process -** at a time can reserve the database. The original -** database file has not been modified so other -** processes may still be reading the on-disk -** database file. +** List of state transitions and the C [function] that performs each: +** +** OPEN -> READER [sqlite3PagerSharedLock] +** READER -> OPEN [pager_unlock] ** -** PAGER_EXCLUSIVE The page cache is writing the database. -** Access is exclusive. No other processes or -** threads can be reading or writing while one -** process is writing. +** READER -> WRITER_LOCKED [sqlite3PagerBegin] +** WRITER_LOCKED -> WRITER_CACHEMOD [pager_open_journal] +** WRITER_CACHEMOD -> WRITER_DBMOD [syncJournal] +** WRITER_DBMOD -> WRITER_FINISHED [sqlite3PagerCommitPhaseOne] +** WRITER_*** -> READER [pager_end_transaction] ** -** PAGER_SYNCED The pager moves to this state from PAGER_EXCLUSIVE -** after all dirty pages have been written to the -** database file and the file has been synced to -** disk. All that remains to do is to remove or -** truncate the journal file and the transaction -** will be committed. +** WRITER_*** -> ERROR [pager_error] +** ERROR -> OPEN [pager_unlock] +** ** -** The page cache comes up in PAGER_UNLOCK. The first time a -** sqlite3PagerGet() occurs, the state transitions to PAGER_SHARED. -** After all pages have been released using sqlite_page_unref(), -** the state transitions back to PAGER_UNLOCK. The first time -** that sqlite3PagerWrite() is called, the state transitions to -** PAGER_RESERVED. (Note that sqlite3PagerWrite() can only be -** called on an outstanding page which means that the pager must -** be in PAGER_SHARED before it transitions to PAGER_RESERVED.) -** PAGER_RESERVED means that there is an open rollback journal. -** The transition to PAGER_EXCLUSIVE occurs before any changes -** are made to the database file, though writes to the rollback -** journal occurs with just PAGER_RESERVED. After an sqlite3PagerRollback() -** or sqlite3PagerCommitPhaseTwo(), the state can go back to PAGER_SHARED, -** or it can stay at PAGER_EXCLUSIVE if we are in exclusive access mode. +** OPEN: +** +** The pager starts up in this state. Nothing is guaranteed in this +** state - the file may or may not be locked and the database size is +** unknown. The database may not be read or written. +** +** * No read or write transaction is active. +** * Any lock, or no lock at all, may be held on the database file. +** * The dbSize, dbOrigSize and dbFileSize variables may not be trusted. +** +** READER: +** +** In this state all the requirements for reading the database in +** rollback (non-WAL) mode are met. Unless the pager is (or recently +** was) in exclusive-locking mode, a user-level read transaction is +** open. The database size is known in this state. +** +** A connection running with locking_mode=normal enters this state when +** it opens a read-transaction on the database and returns to state +** OPEN after the read-transaction is completed. However a connection +** running in locking_mode=exclusive (including temp databases) remains in +** this state even after the read-transaction is closed. The only way +** a locking_mode=exclusive connection can transition from READER to OPEN +** is via the ERROR state (see below). +** +** * A read transaction may be active (but a write-transaction cannot). +** * A SHARED or greater lock is held on the database file. +** * The dbSize variable may be trusted (even if a user-level read +** transaction is not active). The dbOrigSize and dbFileSize variables +** may not be trusted at this point. +** * If the database is a WAL database, then the WAL connection is open. +** * Even if a read-transaction is not open, it is guaranteed that +** there is no hot-journal in the file-system. +** +** WRITER_LOCKED: +** +** The pager moves to this state from READER when a write-transaction +** is first opened on the database. In WRITER_LOCKED state, all locks +** required to start a write-transaction are held, but no actual +** modifications to the cache or database have taken place. +** +** In rollback mode, a RESERVED or (if the transaction was opened with +** BEGIN EXCLUSIVE) EXCLUSIVE lock is obtained on the database file when +** moving to this state, but the journal file is not written to or opened +** to in this state. If the transaction is committed or rolled back while +** in WRITER_LOCKED state, all that is required is to unlock the database +** file. +** +** IN WAL mode, WalBeginWriteTransaction() is called to lock the log file. +** If the connection is running with locking_mode=exclusive, an attempt +** is made to obtain an EXCLUSIVE lock on the database file. +** +** * A write transaction is active. +** * If the connection is open in rollback-mode, a RESERVED or greater +** lock is held on the database file. +** * If the connection is open in WAL-mode, a WAL write transaction +** is open (i.e. sqlite3WalBeginWriteTransaction() has been successfully +** called). +** * The dbSize, dbOrigSize and dbFileSize variables are all valid. +** * The contents of the pager cache have not been modified. +** * The journal file may or may not be open. +** * Nothing (not even the first header) has been written to the journal. +** +** WRITER_CACHEMOD: +** +** A pager moves from WRITER_LOCKED state to this state when a page is +** first modified by the upper layer. In rollback mode the journal file +** is opened (if it is not already open) and a header written to the +** start of it. The database file on disk has not been modified. +** +** * A write transaction is active. +** * A RESERVED or greater lock is held on the database file. +** * The journal file is open and the first header has been written +** to it, but the header has not been synced to disk. +** * The contents of the page cache have been modified. +** +** WRITER_DBMOD: +** +** The pager transitions from WRITER_CACHEMOD into WRITER_DBMOD state +** when it modifies the contents of the database file. WAL connections +** never enter this state (since they do not modify the database file, +** just the log file). +** +** * A write transaction is active. +** * An EXCLUSIVE or greater lock is held on the database file. +** * The journal file is open and the first header has been written +** and synced to disk. +** * The contents of the page cache have been modified (and possibly +** written to disk). +** +** WRITER_FINISHED: +** +** It is not possible for a WAL connection to enter this state. +** +** A rollback-mode pager changes to WRITER_FINISHED state from WRITER_DBMOD +** state after the entire transaction has been successfully written into the +** database file. In this state the transaction may be committed simply +** by finalizing the journal file. Once in WRITER_FINISHED state, it is +** not possible to modify the database further. At this point, the upper +** layer must either commit or rollback the transaction. +** +** * A write transaction is active. +** * An EXCLUSIVE or greater lock is held on the database file. +** * All writing and syncing of journal and database data has finished. +** If no error occured, all that remains is to finalize the journal to +** commit the transaction. If an error did occur, the caller will need +** to rollback the transaction. +** +** ERROR: +** +** The ERROR state is entered when an IO or disk-full error (including +** SQLITE_IOERR_NOMEM) occurs at a point in the code that makes it +** difficult to be sure that the in-memory pager state (cache contents, +** db size etc.) are consistent with the contents of the file-system. +** +** Temporary pager files may enter the ERROR state, but in-memory pagers +** cannot. +** +** For example, if an IO error occurs while performing a rollback, +** the contents of the page-cache may be left in an inconsistent state. +** At this point it would be dangerous to change back to READER state +** (as usually happens after a rollback). Any subsequent readers might +** report database corruption (due to the inconsistent cache), and if +** they upgrade to writers, they may inadvertently corrupt the database +** file. To avoid this hazard, the pager switches into the ERROR state +** instead of READER following such an error. +** +** Once it has entered the ERROR state, any attempt to use the pager +** to read or write data returns an error. Eventually, once all +** outstanding transactions have been abandoned, the pager is able to +** transition back to OPEN state, discarding the contents of the +** page-cache and any other in-memory state at the same time. Everything +** is reloaded from disk (and, if necessary, hot-journal rollback peformed) +** when a read-transaction is next opened on the pager (transitioning +** the pager into READER state). At that point the system has recovered +** from the error. +** +** Specifically, the pager jumps into the ERROR state if: +** +** 1. An error occurs while attempting a rollback. This happens in +** function sqlite3PagerRollback(). +** +** 2. An error occurs while attempting to finalize a journal file +** following a commit in function sqlite3PagerCommitPhaseTwo(). +** +** 3. An error occurs while attempting to write to the journal or +** database file in function pagerStress() in order to free up +** memory. +** +** In other cases, the error is returned to the b-tree layer. The b-tree +** layer then attempts a rollback operation. If the error condition +** persists, the pager enters the ERROR state via condition (1) above. +** +** Condition (3) is necessary because it can be triggered by a read-only +** statement executed within a transaction. In this case, if the error +** code were simply returned to the user, the b-tree layer would not +** automatically attempt a rollback, as it assumes that an error in a +** read-only statement cannot leave the pager in an internally inconsistent +** state. +** +** * The Pager.errCode variable is set to something other than SQLITE_OK. +** * There are one or more outstanding references to pages (after the +** last reference is dropped the pager should move back to OPEN state). +** * The pager is not an in-memory pager. +** +** +** Notes: +** +** * A pager is never in WRITER_DBMOD or WRITER_FINISHED state if the +** connection is open in WAL mode. A WAL connection is always in one +** of the first four states. +** +** * Normally, a connection open in exclusive mode is never in PAGER_OPEN +** state. There are two exceptions: immediately after exclusive-mode has +** been turned on (and before any read or write transactions are +** executed), and when the pager is leaving the "error state". +** +** * See also: assert_pager_state(). */ -#define PAGER_UNLOCK 0 -#define PAGER_SHARED 1 /* same as SHARED_LOCK */ -#define PAGER_RESERVED 2 /* same as RESERVED_LOCK */ -#define PAGER_EXCLUSIVE 4 /* same as EXCLUSIVE_LOCK */ -#define PAGER_SYNCED 5 +#define PAGER_OPEN 0 +#define PAGER_READER 1 +#define PAGER_WRITER_LOCKED 2 +#define PAGER_WRITER_CACHEMOD 3 +#define PAGER_WRITER_DBMOD 4 +#define PAGER_WRITER_FINISHED 5 +#define PAGER_ERROR 6 + +/* +** The Pager.eLock variable is almost always set to one of the +** following locking-states, according to the lock currently held on +** the database file: NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. +** This variable is kept up to date as locks are taken and released by +** the pagerLockDb() and pagerUnlockDb() wrappers. +** +** If the VFS xLock() or xUnlock() returns an error other than SQLITE_BUSY +** (i.e. one of the SQLITE_IOERR subtypes), it is not clear whether or not +** the operation was successful. In these circumstances pagerLockDb() and +** pagerUnlockDb() take a conservative approach - eLock is always updated +** when unlocking the file, and only updated when locking the file if the +** VFS call is successful. This way, the Pager.eLock variable may be set +** to a less exclusive (lower) value than the lock that is actually held +** at the system level, but it is never set to a more exclusive value. +** +** This is usually safe. If an xUnlock fails or appears to fail, there may +** be a few redundant xLock() calls or a lock may be held for longer than +** required, but nothing really goes wrong. +** +** The exception is when the database file is unlocked as the pager moves +** from ERROR to OPEN state. At this point there may be a hot-journal file +** in the file-system that needs to be rolled back (as part of a OPEN->SHARED +** transition, by the same pager or any other). If the call to xUnlock() +** fails at this point and the pager is left holding an EXCLUSIVE lock, this +** can confuse the call to xCheckReservedLock() call made later as part +** of hot-journal detection. +** +** xCheckReservedLock() is defined as returning true "if there is a RESERVED +** lock held by this process or any others". So xCheckReservedLock may +** return true because the caller itself is holding an EXCLUSIVE lock (but +** doesn't know it because of a previous error in xUnlock). If this happens +** a hot-journal may be mistaken for a journal being created by an active +** transaction in another process, causing SQLite to read from the database +** without rolling it back. +** +** To work around this, if a call to xUnlock() fails when unlocking the +** database in the ERROR state, Pager.eLock is set to UNKNOWN_LOCK. It +** is only changed back to a real locking state after a successful call +** to xLock(EXCLUSIVE). Also, the code to do the OPEN->SHARED state transition +** omits the check for a hot-journal if Pager.eLock is set to UNKNOWN_LOCK +** lock. Instead, it assumes a hot-journal exists and obtains an EXCLUSIVE +** lock on the database file before attempting to roll it back. See function +** PagerSharedLock() for more detail. +** +** Pager.eLock may only be set to UNKNOWN_LOCK when the pager is in +** PAGER_OPEN state. +*/ +#define UNKNOWN_LOCK (EXCLUSIVE_LOCK+1) /* ** A macro used for invoking the codec if there is one @@ -31469,36 +35249,34 @@ struct PagerSavepoint { Bitvec *pInSavepoint; /* Set of pages in this savepoint */ Pgno nOrig; /* Original number of pages in file */ Pgno iSubRec; /* Index of first record in sub-journal */ +#ifndef SQLITE_OMIT_WAL + u32 aWalData[WAL_SAVEPOINT_NDATA]; /* WAL savepoint context */ +#endif }; /* -** A open page cache is an instance of the following structure. +** A open page cache is an instance of struct Pager. A description of +** some of the more important member variables follows: ** -** errCode +** eState ** -** Pager.errCode may be set to SQLITE_IOERR, SQLITE_CORRUPT, or -** or SQLITE_FULL. Once one of the first three errors occurs, it persists -** and is returned as the result of every major pager API call. The -** SQLITE_FULL return code is slightly different. It persists only until the -** next successful rollback is performed on the pager cache. Also, -** SQLITE_FULL does not affect the sqlite3PagerGet() and sqlite3PagerLookup() -** APIs, they may still be used successfully. +** The current 'state' of the pager object. See the comment and state +** diagram above for a description of the pager state. ** -** dbSizeValid, dbSize, dbOrigSize, dbFileSize +** eLock ** -** Managing the size of the database file in pages is a little complicated. -** The variable Pager.dbSize contains the number of pages that the database -** image currently contains. As the database image grows or shrinks this -** variable is updated. The variable Pager.dbFileSize contains the number -** of pages in the database file. This may be different from Pager.dbSize -** if some pages have been appended to the database image but not yet written -** out from the cache to the actual file on disk. Or if the image has been -** truncated by an incremental-vacuum operation. The Pager.dbOrigSize variable -** contains the number of pages in the database image when the current -** transaction was opened. The contents of all three of these variables is -** only guaranteed to be correct if the boolean Pager.dbSizeValid is true. +** For a real on-disk database, the current lock held on the database file - +** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. ** -** TODO: Under what conditions is dbSizeValid set? Cleared? +** For a temporary or in-memory database (neither of which require any +** locks), this variable is always set to EXCLUSIVE_LOCK. Since such +** databases always have Pager.exclusiveMode==1, this tricks the pager +** logic into thinking that it already has all the locks it will ever +** need (and no reason to release them). +** +** In some (obscure) circumstances, this variable may also be set to +** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for +** details. ** ** changeCountDone ** @@ -31517,60 +35295,123 @@ struct PagerSavepoint { ** need only update the change-counter once, for the first transaction ** committed. ** -** dbModified -** -** The dbModified flag is set whenever a database page is dirtied. -** It is cleared at the end of each transaction. -** -** It is used when committing or otherwise ending a transaction. If -** the dbModified flag is clear then less work has to be done. -** -** journalStarted -** -** This flag is set whenever the the main journal is synced. -** -** The point of this flag is that it must be set after the -** first journal header in a journal file has been synced to disk. -** After this has happened, new pages appended to the database -** do not need the PGHDR_NEED_SYNC flag set, as they do not need -** to wait for a journal sync before they can be written out to -** the database file (see function pager_write()). -** ** setMaster ** -** This variable is used to ensure that the master journal file name -** (if any) is only written into the journal file once. +** When PagerCommitPhaseOne() is called to commit a transaction, it may +** (or may not) specify a master-journal name to be written into the +** journal file before it is synced to disk. ** -** When committing a transaction, the master journal file name (if any) -** may be written into the journal file while the pager is still in -** PAGER_RESERVED state (see CommitPhaseOne() for the action). It -** then attempts to upgrade to an exclusive lock. If this attempt -** fails, then SQLITE_BUSY may be returned to the user and the user -** may attempt to commit the transaction again later (calling -** CommitPhaseOne() again). This flag is used to ensure that the -** master journal name is only written to the journal file the first -** time CommitPhaseOne() is called. +** Whether or not a journal file contains a master-journal pointer affects +** the way in which the journal file is finalized after the transaction is +** committed or rolled back when running in "journal_mode=PERSIST" mode. +** If a journal file does not contain a master-journal pointer, it is +** finalized by overwriting the first journal header with zeroes. If +** it does contain a master-journal pointer the journal file is finalized +** by truncating it to zero bytes, just as if the connection were +** running in "journal_mode=truncate" mode. ** -** doNotSync +** Journal files that contain master journal pointers cannot be finalized +** simply by overwriting the first journal-header with zeroes, as the +** master journal pointer could interfere with hot-journal rollback of any +** subsequently interrupted transaction that reuses the journal file. ** -** This variable is set and cleared by sqlite3PagerWrite(). +** The flag is cleared as soon as the journal file is finalized (either +** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the +** journal file from being successfully finalized, the setMaster flag +** is cleared anyway (and the pager will move to ERROR state). ** -** needSync +** doNotSpill, doNotSyncSpill ** -** TODO: It might be easier to set this variable in writeJournalHdr() -** and writeMasterJournal() only. Change its meaning to "unsynced data -** has been written to the journal". +** These two boolean variables control the behaviour of cache-spills +** (calls made by the pcache module to the pagerStress() routine to +** write cached data to the file-system in order to free up memory). +** +** When doNotSpill is non-zero, writing to the database from pagerStress() +** is disabled altogether. This is done in a very obscure case that +** comes up during savepoint rollback that requires the pcache module +** to allocate a new page to prevent the journal file from being written +** while it is being traversed by code in pager_playback(). +** +** If doNotSyncSpill is non-zero, writing to the database from pagerStress() +** is permitted, but syncing the journal file is not. This flag is set +** by sqlite3PagerWrite() when the file-system sector-size is larger than +** the database page-size in order to prevent a journal sync from happening +** in between the journalling of two pages on the same sector. ** ** subjInMemory ** ** This is a boolean variable. If true, then any required sub-journal ** is opened as an in-memory journal file. If false, then in-memory ** sub-journals are only used for in-memory pager files. +** +** This variable is updated by the upper layer each time a new +** write-transaction is opened. +** +** dbSize, dbOrigSize, dbFileSize +** +** Variable dbSize is set to the number of pages in the database file. +** It is valid in PAGER_READER and higher states (all states except for +** OPEN and ERROR). +** +** dbSize is set based on the size of the database file, which may be +** larger than the size of the database (the value stored at offset +** 28 of the database header by the btree). If the size of the file +** is not an integer multiple of the page-size, the value stored in +** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). +** Except, any file that is greater than 0 bytes in size is considered +** to have at least one page. (i.e. a 1KB file with 2K page-size leads +** to dbSize==1). +** +** During a write-transaction, if pages with page-numbers greater than +** dbSize are modified in the cache, dbSize is updated accordingly. +** Similarly, if the database is truncated using PagerTruncateImage(), +** dbSize is updated. +** +** Variables dbOrigSize and dbFileSize are valid in states +** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize +** variable at the start of the transaction. It is used during rollback, +** and to determine whether or not pages need to be journalled before +** being modified. +** +** Throughout a write-transaction, dbFileSize contains the size of +** the file on disk in pages. It is set to a copy of dbSize when the +** write-transaction is first opened, and updated when VFS calls are made +** to write or truncate the database file on disk. +** +** The only reason the dbFileSize variable is required is to suppress +** unnecessary calls to xTruncate() after committing a transaction. If, +** when a transaction is committed, the dbFileSize variable indicates +** that the database file is larger than the database image (Pager.dbSize), +** pager_truncate() is called. The pager_truncate() call uses xFilesize() +** to measure the database file on disk, and then truncates it if required. +** dbFileSize is not used when rolling back a transaction. In this case +** pager_truncate() is called unconditionally (which means there may be +** a call to xFilesize() that is not strictly required). In either case, +** pager_truncate() may cause the file to become smaller or larger. +** +** dbHintSize +** +** The dbHintSize variable is used to limit the number of calls made to +** the VFS xFileControl(FCNTL_SIZE_HINT) method. +** +** dbHintSize is set to a copy of the dbSize variable when a +** write-transaction is opened (at the same time as dbFileSize and +** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, +** dbHintSize is increased to the number of pages that correspond to the +** size-hint passed to the method call. See pager_write_pagelist() for +** details. +** +** errCode +** +** The Pager.errCode variable is only ever used in PAGER_ERROR state. It +** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode +** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX +** sub-codes. */ struct Pager { sqlite3_vfs *pVfs; /* OS functions to use for IO */ u8 exclusiveMode; /* Boolean. True if locking_mode==EXCLUSIVE */ - u8 journalMode; /* On of the PAGER_JOURNALMODE_* values */ + u8 journalMode; /* One of the PAGER_JOURNALMODE_* values */ u8 useJournal; /* Use a rollback journal on this file */ u8 noReadlock; /* Do not bother to obtain readlocks */ u8 noSync; /* Do not sync the journal if true */ @@ -31580,29 +35421,26 @@ struct Pager { u8 readOnly; /* True for a read-only database */ u8 memDb; /* True to inhibit all file I/O */ - /* The following block contains those class members that are dynamically - ** modified during normal operations. The other variables in this structure - ** are either constant throughout the lifetime of the pager, or else - ** used to store configuration parameters that affect the way the pager - ** operates. - ** - ** The 'state' variable is described in more detail along with the - ** descriptions of the values it may take - PAGER_UNLOCK etc. Many of the - ** other variables in this block are described in the comment directly - ** above this class definition. + /************************************************************************** + ** The following block contains those class members that change during + ** routine opertion. Class members not in this block are either fixed + ** when the pager is first created or else only change when there is a + ** significant mode change (such as changing the page_size, locking_mode, + ** or the journal_mode). From another view, these class members describe + ** the "state" of the pager, while other class members describe the + ** "configuration" of the pager. */ - u8 state; /* PAGER_UNLOCK, _SHARED, _RESERVED, etc. */ - u8 dbModified; /* True if there are any changes to the Db */ - u8 needSync; /* True if an fsync() is needed on the journal */ - u8 journalStarted; /* True if header of journal is synced */ + u8 eState; /* Pager state (OPEN, READER, WRITER_LOCKED..) */ + u8 eLock; /* Current lock held on database file */ u8 changeCountDone; /* Set after incrementing the change-counter */ u8 setMaster; /* True if a m-j name has been written to jrnl */ - u8 doNotSync; /* Boolean. While true, do not spill the cache */ - u8 dbSizeValid; /* Set when dbSize is correct */ + u8 doNotSpill; /* Do not spill the cache when non-zero */ + u8 doNotSyncSpill; /* Do not do a spill that requires jrnl sync */ u8 subjInMemory; /* True to use in-memory sub-journals */ Pgno dbSize; /* Number of pages in the database */ Pgno dbOrigSize; /* dbSize before the current transaction */ Pgno dbFileSize; /* Number of pages in the database file */ + Pgno dbHintSize; /* Value passed to FCNTL_SIZE_HINT call */ int errCode; /* One of several kinds of errors */ int nRec; /* Pages journalled since last j-header written */ u32 cksumInit; /* Quasi-random value added to every checksum */ @@ -31613,16 +35451,21 @@ struct Pager { sqlite3_file *sjfd; /* File descriptor for sub-journal */ i64 journalOff; /* Current write offset in the journal file */ i64 journalHdr; /* Byte offset to previous journal header */ + sqlite3_backup *pBackup; /* Pointer to list of ongoing backup processes */ PagerSavepoint *aSavepoint; /* Array of active savepoints */ int nSavepoint; /* Number of elements in aSavepoint[] */ char dbFileVers[16]; /* Changes whenever database file changes */ - u32 sectorSize; /* Assumed sector size during rollback */ + /* + ** End of the routinely-changing class members + ***************************************************************************/ u16 nExtra; /* Add this many bytes to each in-memory page */ i16 nReserve; /* Number of unused bytes at end of each page */ u32 vfsFlags; /* Flags for sqlite3_vfs.xOpen() */ + u32 sectorSize; /* Assumed sector size during rollback */ int pageSize; /* Number of bytes in a page */ Pgno mxPgno; /* Maximum allowed size of the database */ + i64 journalSizeLimit; /* Size limit for persistent journal files */ char *zFilename; /* Name of the database file */ char *zJournal; /* Name of the journal file */ int (*xBusyHandler)(void*); /* Function to call when busy */ @@ -31639,9 +35482,11 @@ struct Pager { void *pCodec; /* First argument to xCodec... methods */ #endif char *pTmpSpace; /* Pager.pageSize bytes of space for tmp use */ - i64 journalSizeLimit; /* Size limit for persistent journal files */ PCache *pPCache; /* Pointer to page cache object */ - sqlite3_backup *pBackup; /* Pointer to list of ongoing backup processes */ +#ifndef SQLITE_OMIT_WAL + Wal *pWal; /* Write-ahead log used by "journal_mode=wal" */ + char *zWal; /* File name for write-ahead log */ +#endif }; /* @@ -31716,22 +35561,221 @@ static const unsigned char aJournalMagic[] = { */ #define PAGER_MAX_PGNO 2147483647 +/* +** The argument to this macro is a file descriptor (type sqlite3_file*). +** Return 0 if it is not open, or non-zero (but not 1) if it is. +** +** This is so that expressions can be written as: +** +** if( isOpen(pPager->jfd) ){ ... +** +** instead of +** +** if( pPager->jfd->pMethods ){ ... +*/ +#define isOpen(pFd) ((pFd)->pMethods) + +/* +** Return true if this pager uses a write-ahead log instead of the usual +** rollback journal. Otherwise false. +*/ +#ifndef SQLITE_OMIT_WAL +static int pagerUseWal(Pager *pPager){ + return (pPager->pWal!=0); +} +#else +# define pagerUseWal(x) 0 +# define pagerRollbackWal(x) 0 +# define pagerWalFrames(v,w,x,y,z) 0 +# define pagerOpenWalIfPresent(z) SQLITE_OK +# define pagerBeginReadTransaction(z) SQLITE_OK +#endif + #ifndef NDEBUG /* ** Usage: ** ** assert( assert_pager_state(pPager) ); +** +** This function runs many asserts to try to find inconsistencies in +** the internal state of the Pager object. */ -static int assert_pager_state(Pager *pPager){ +static int assert_pager_state(Pager *p){ + Pager *pPager = p; - /* A temp-file is always in PAGER_EXCLUSIVE or PAGER_SYNCED state. */ - assert( pPager->tempFile==0 || pPager->state>=PAGER_EXCLUSIVE ); + /* State must be valid. */ + assert( p->eState==PAGER_OPEN + || p->eState==PAGER_READER + || p->eState==PAGER_WRITER_LOCKED + || p->eState==PAGER_WRITER_CACHEMOD + || p->eState==PAGER_WRITER_DBMOD + || p->eState==PAGER_WRITER_FINISHED + || p->eState==PAGER_ERROR + ); - /* The changeCountDone flag is always set for temp-files */ - assert( pPager->tempFile==0 || pPager->changeCountDone ); + /* Regardless of the current state, a temp-file connection always behaves + ** as if it has an exclusive lock on the database file. It never updates + ** the change-counter field, so the changeCountDone flag is always set. + */ + assert( p->tempFile==0 || p->eLock==EXCLUSIVE_LOCK ); + assert( p->tempFile==0 || pPager->changeCountDone ); + + /* If the useJournal flag is clear, the journal-mode must be "OFF". + ** And if the journal-mode is "OFF", the journal file must not be open. + */ + assert( p->journalMode==PAGER_JOURNALMODE_OFF || p->useJournal ); + assert( p->journalMode!=PAGER_JOURNALMODE_OFF || !isOpen(p->jfd) ); + + /* Check that MEMDB implies noSync. And an in-memory journal. Since + ** this means an in-memory pager performs no IO at all, it cannot encounter + ** either SQLITE_IOERR or SQLITE_FULL during rollback or while finalizing + ** a journal file. (although the in-memory journal implementation may + ** return SQLITE_IOERR_NOMEM while the journal file is being written). It + ** is therefore not possible for an in-memory pager to enter the ERROR + ** state. + */ + if( MEMDB ){ + assert( p->noSync ); + assert( p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_MEMORY + ); + assert( p->eState!=PAGER_ERROR && p->eState!=PAGER_OPEN ); + assert( pagerUseWal(p)==0 ); + } + + /* If changeCountDone is set, a RESERVED lock or greater must be held + ** on the file. + */ + assert( pPager->changeCountDone==0 || pPager->eLock>=RESERVED_LOCK ); + assert( p->eLock!=PENDING_LOCK ); + + switch( p->eState ){ + case PAGER_OPEN: + assert( !MEMDB ); + assert( pPager->errCode==SQLITE_OK ); + assert( sqlite3PcacheRefCount(pPager->pPCache)==0 || pPager->tempFile ); + break; + + case PAGER_READER: + assert( pPager->errCode==SQLITE_OK ); + assert( p->eLock!=UNKNOWN_LOCK ); + assert( p->eLock>=SHARED_LOCK || p->noReadlock ); + break; + + case PAGER_WRITER_LOCKED: + assert( p->eLock!=UNKNOWN_LOCK ); + assert( pPager->errCode==SQLITE_OK ); + if( !pagerUseWal(pPager) ){ + assert( p->eLock>=RESERVED_LOCK ); + } + assert( pPager->dbSize==pPager->dbOrigSize ); + assert( pPager->dbOrigSize==pPager->dbFileSize ); + assert( pPager->dbOrigSize==pPager->dbHintSize ); + assert( pPager->setMaster==0 ); + break; + + case PAGER_WRITER_CACHEMOD: + assert( p->eLock!=UNKNOWN_LOCK ); + assert( pPager->errCode==SQLITE_OK ); + if( !pagerUseWal(pPager) ){ + /* It is possible that if journal_mode=wal here that neither the + ** journal file nor the WAL file are open. This happens during + ** a rollback transaction that switches from journal_mode=off + ** to journal_mode=wal. + */ + assert( p->eLock>=RESERVED_LOCK ); + assert( isOpen(p->jfd) + || p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_WAL + ); + } + assert( pPager->dbOrigSize==pPager->dbFileSize ); + assert( pPager->dbOrigSize==pPager->dbHintSize ); + break; + + case PAGER_WRITER_DBMOD: + assert( p->eLock==EXCLUSIVE_LOCK ); + assert( pPager->errCode==SQLITE_OK ); + assert( !pagerUseWal(pPager) ); + assert( p->eLock>=EXCLUSIVE_LOCK ); + assert( isOpen(p->jfd) + || p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_WAL + ); + assert( pPager->dbOrigSize<=pPager->dbHintSize ); + break; + + case PAGER_WRITER_FINISHED: + assert( p->eLock==EXCLUSIVE_LOCK ); + assert( pPager->errCode==SQLITE_OK ); + assert( !pagerUseWal(pPager) ); + assert( isOpen(p->jfd) + || p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_WAL + ); + break; + + case PAGER_ERROR: + /* There must be at least one outstanding reference to the pager if + ** in ERROR state. Otherwise the pager should have already dropped + ** back to OPEN state. + */ + assert( pPager->errCode!=SQLITE_OK ); + assert( sqlite3PcacheRefCount(pPager->pPCache)>0 ); + break; + } return 1; } + +/* +** Return a pointer to a human readable string in a static buffer +** containing the state of the Pager object passed as an argument. This +** is intended to be used within debuggers. For example, as an alternative +** to "print *pPager" in gdb: +** +** (gdb) printf "%s", print_pager_state(pPager) +*/ +static char *print_pager_state(Pager *p){ + static char zRet[1024]; + + sqlite3_snprintf(1024, zRet, + "Filename: %s\n" + "State: %s errCode=%d\n" + "Lock: %s\n" + "Locking mode: locking_mode=%s\n" + "Journal mode: journal_mode=%s\n" + "Backing store: tempFile=%d memDb=%d useJournal=%d\n" + "Journal: journalOff=%lld journalHdr=%lld\n" + "Size: dbsize=%d dbOrigSize=%d dbFileSize=%d\n" + , p->zFilename + , p->eState==PAGER_OPEN ? "OPEN" : + p->eState==PAGER_READER ? "READER" : + p->eState==PAGER_WRITER_LOCKED ? "WRITER_LOCKED" : + p->eState==PAGER_WRITER_CACHEMOD ? "WRITER_CACHEMOD" : + p->eState==PAGER_WRITER_DBMOD ? "WRITER_DBMOD" : + p->eState==PAGER_WRITER_FINISHED ? "WRITER_FINISHED" : + p->eState==PAGER_ERROR ? "ERROR" : "?error?" + , (int)p->errCode + , p->eLock==NO_LOCK ? "NO_LOCK" : + p->eLock==RESERVED_LOCK ? "RESERVED" : + p->eLock==EXCLUSIVE_LOCK ? "EXCLUSIVE" : + p->eLock==SHARED_LOCK ? "SHARED" : + p->eLock==UNKNOWN_LOCK ? "UNKNOWN" : "?error?" + , p->exclusiveMode ? "exclusive" : "normal" + , p->journalMode==PAGER_JOURNALMODE_MEMORY ? "memory" : + p->journalMode==PAGER_JOURNALMODE_OFF ? "off" : + p->journalMode==PAGER_JOURNALMODE_DELETE ? "delete" : + p->journalMode==PAGER_JOURNALMODE_PERSIST ? "persist" : + p->journalMode==PAGER_JOURNALMODE_TRUNCATE ? "truncate" : + p->journalMode==PAGER_JOURNALMODE_WAL ? "wal" : "?error?" + , (int)p->tempFile, (int)p->memDb, (int)p->useJournal + , p->journalOff, p->journalHdr + , (int)p->dbSize, (int)p->dbOrigSize, (int)p->dbFileSize + ); + + return zRet; +} #endif /* @@ -31784,6 +35828,7 @@ static int read32bits(sqlite3_file *fd, i64 offset, u32 *pRes){ */ #define put32bits(A,B) sqlite3Put4byte((u8*)A,B) + /* ** Write a 32-bit integer into the given file descriptor. Return SQLITE_OK ** on success or an error code is something goes wrong. @@ -31795,27 +35840,53 @@ static int write32bits(sqlite3_file *fd, i64 offset, u32 val){ } /* -** The argument to this macro is a file descriptor (type sqlite3_file*). -** Return 0 if it is not open, or non-zero (but not 1) if it is. +** Unlock the database file to level eLock, which must be either NO_LOCK +** or SHARED_LOCK. Regardless of whether or not the call to xUnlock() +** succeeds, set the Pager.eLock variable to match the (attempted) new lock. ** -** This is so that expressions can be written as: -** -** if( isOpen(pPager->jfd) ){ ... -** -** instead of -** -** if( pPager->jfd->pMethods ){ ... +** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is +** called, do not modify it. See the comment above the #define of +** UNKNOWN_LOCK for an explanation of this. */ -#define isOpen(pFd) ((pFd)->pMethods) +static int pagerUnlockDb(Pager *pPager, int eLock){ + int rc = SQLITE_OK; + + assert( !pPager->exclusiveMode ); + assert( eLock==NO_LOCK || eLock==SHARED_LOCK ); + assert( eLock!=NO_LOCK || pagerUseWal(pPager)==0 ); + if( isOpen(pPager->fd) ){ + assert( pPager->eLock>=eLock ); + rc = sqlite3OsUnlock(pPager->fd, eLock); + if( pPager->eLock!=UNKNOWN_LOCK ){ + pPager->eLock = (u8)eLock; + } + IOTRACE(("UNLOCK %p %d\n", pPager, eLock)) + } + return rc; +} /* -** If file pFd is open, call sqlite3OsUnlock() on it. +** Lock the database file to level eLock, which must be either SHARED_LOCK, +** RESERVED_LOCK or EXCLUSIVE_LOCK. If the caller is successful, set the +** Pager.eLock variable to the new locking state. +** +** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is +** called, do not modify it unless the new locking state is EXCLUSIVE_LOCK. +** See the comment above the #define of UNKNOWN_LOCK for an explanation +** of this. */ -static int osUnlock(sqlite3_file *pFd, int eLock){ - if( !isOpen(pFd) ){ - return SQLITE_OK; +static int pagerLockDb(Pager *pPager, int eLock){ + int rc = SQLITE_OK; + + assert( eLock==SHARED_LOCK || eLock==RESERVED_LOCK || eLock==EXCLUSIVE_LOCK ); + if( pPager->eLockeLock==UNKNOWN_LOCK ){ + rc = sqlite3OsLock(pPager->fd, eLock); + if( rc==SQLITE_OK && (pPager->eLock!=UNKNOWN_LOCK||eLock==EXCLUSIVE_LOCK) ){ + pPager->eLock = (u8)eLock; + IOTRACE(("LOCK %p %d\n", pPager, eLock)) + } } - return sqlite3OsUnlock(pFd, eLock); + return rc; } /* @@ -31891,13 +35962,14 @@ static void pager_set_pagehash(PgHdr *pPage){ #define CHECK_PAGE(x) checkPage(x) static void checkPage(PgHdr *pPg){ Pager *pPager = pPg->pPager; - assert( !pPg->pageHash || pPager->errCode - || (pPg->flags&PGHDR_DIRTY) || pPg->pageHash==pager_pagehash(pPg) ); + assert( pPager->eState!=PAGER_ERROR ); + assert( (pPg->flags&PGHDR_DIRTY) || pPg->pageHash==pager_pagehash(pPg) ); } #else #define pager_datahash(X,Y) 0 #define pager_pagehash(X) 0 +#define pager_set_pagehash(X) #define CHECK_PAGE(x) #endif /* SQLITE_CHECK_PAGES */ @@ -32064,7 +36136,7 @@ static int zeroJournalHdr(Pager *pPager, int doTruncate){ static int writeJournalHdr(Pager *pPager){ int rc = SQLITE_OK; /* Return code */ char *zHeader = pPager->pTmpSpace; /* Temporary space used to build header */ - u32 nHeader = pPager->pageSize; /* Size of buffer pointed to by zHeader */ + u32 nHeader = (u32)pPager->pageSize;/* Size of buffer pointed to by zHeader */ u32 nWrite; /* Bytes of header sector written */ int ii; /* Loop counter */ @@ -32107,7 +36179,7 @@ static int writeJournalHdr(Pager *pPager){ ** that garbage data is never appended to the journal file. */ assert( isOpen(pPager->fd) || pPager->noSync ); - if( (pPager->noSync) || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY) + if( pPager->noSync || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY) || (sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) ){ memcpy(zHeader, aJournalMagic, sizeof(aJournalMagic)); @@ -32155,6 +36227,7 @@ static int writeJournalHdr(Pager *pPager){ for(nWrite=0; rc==SQLITE_OK&&nWritejournalHdr, nHeader)) rc = sqlite3OsWrite(pPager->jfd, zHeader, nHeader, pPager->journalOff); + assert( pPager->journalHdr <= pPager->journalOff ); pPager->journalOff += nHeader; } @@ -32230,7 +36303,6 @@ static int readJournalHdr( if( pPager->journalOff==0 ){ u32 iPageSize; /* Page-size field of journal header */ u32 iSectorSize; /* Sector-size field of journal header */ - u16 iPageSize16; /* Copy of iPageSize in 16-bit variable */ /* Read the page-size and sector-size journal header fields. */ if( SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+20, &iSectorSize)) @@ -32239,12 +36311,20 @@ static int readJournalHdr( return rc; } + /* Versions of SQLite prior to 3.5.8 set the page-size field of the + ** journal header to zero. In this case, assume that the Pager.pageSize + ** variable is already set to the correct page size. + */ + if( iPageSize==0 ){ + iPageSize = pPager->pageSize; + } + /* Check that the values read from the page-size and sector-size fields ** are within range. To be 'in range', both values need to be a power - ** of two greater than or equal to 512, and not greater than their + ** of two greater than or equal to 512 or 32, and not greater than their ** respective compile time maximum limits. */ - if( iPageSize<512 || iSectorSize<512 + if( iPageSize<512 || iSectorSize<32 || iPageSize>SQLITE_MAX_PAGE_SIZE || iSectorSize>MAX_SECTOR_SIZE || ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0 ){ @@ -32260,10 +36340,8 @@ static int readJournalHdr( ** Use a testcase() macro to make sure that malloc failure within ** PagerSetPagesize() is tested. */ - iPageSize16 = (u16)iPageSize; - rc = sqlite3PagerSetPagesize(pPager, &iPageSize16, -1); + rc = sqlite3PagerSetPagesize(pPager, &iPageSize, -1); testcase( rc!=SQLITE_OK ); - assert( rc!=SQLITE_OK || iPageSize16==(u16)iPageSize ); /* Update the assumed sector-size to match the value used by ** the process that created this journal. If this journal was @@ -32305,7 +36383,10 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){ i64 jrnlSize; /* Size of journal file on disk */ u32 cksum = 0; /* Checksum of string zMaster */ - if( !zMaster || pPager->setMaster + assert( pPager->setMaster==0 ); + assert( !pagerUseWal(pPager) ); + + if( !zMaster || pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->journalMode==PAGER_JOURNALMODE_OFF ){ @@ -32313,6 +36394,7 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){ } pPager->setMaster = 1; assert( isOpen(pPager->jfd) ); + assert( pPager->journalHdr <= pPager->journalOff ); /* Calculate the length in bytes and the checksum of zMaster */ for(nMaster=0; zMaster[nMaster]; nMaster++){ @@ -32340,7 +36422,6 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){ return rc; } pPager->journalOff += (nMaster+20); - pPager->needSync = !pPager->noSync; /* If the pager is in peristent-journal mode, then the physical ** journal-file may extend past the end of the master-journal name @@ -32376,17 +36457,11 @@ static PgHdr *pager_lookup(Pager *pPager, Pgno pgno){ } /* -** Unless the pager is in error-state, discard all in-memory pages. If -** the pager is in error-state, then this call is a no-op. -** -** TODO: Why can we not reset the pager while in error state? +** Discard the entire contents of the in-memory page-cache. */ static void pager_reset(Pager *pPager){ - if( SQLITE_OK==pPager->errCode ){ - sqlite3BackupRestart(pPager->pBackup); - sqlite3PcacheClear(pPager->pPCache); - pPager->dbSizeValid = 0; - } + sqlite3BackupRestart(pPager->pBackup); + sqlite3PcacheClear(pPager->pPCache); } /* @@ -32429,70 +36504,108 @@ static int addToSavepointBitvecs(Pager *pPager, Pgno pgno){ } /* -** Unlock the database file. This function is a no-op if the pager -** is in exclusive mode. +** This function is a no-op if the pager is in exclusive mode and not +** in the ERROR state. Otherwise, it switches the pager to PAGER_OPEN +** state. ** -** If the pager is currently in error state, discard the contents of -** the cache and reset the Pager structure internal state. If there is -** an open journal-file, then the next time a shared-lock is obtained -** on the pager file (by this or any other process), it will be -** treated as a hot-journal and rolled back. +** If the pager is not in exclusive-access mode, the database file is +** completely unlocked. If the file is unlocked and the file-system does +** not exhibit the UNDELETABLE_WHEN_OPEN property, the journal file is +** closed (if it is open). +** +** If the pager is in ERROR state when this function is called, the +** contents of the pager cache are discarded before switching back to +** the OPEN state. Regardless of whether the pager is in exclusive-mode +** or not, any journal file left in the file-system will be treated +** as a hot-journal and rolled back the next time a read-transaction +** is opened (by this or by any other connection). */ static void pager_unlock(Pager *pPager){ - if( !pPager->exclusiveMode ){ - int rc; /* Return code */ - /* Always close the journal file when dropping the database lock. - ** Otherwise, another connection with journal_mode=delete might - ** delete the file out from under us. + assert( pPager->eState==PAGER_READER + || pPager->eState==PAGER_OPEN + || pPager->eState==PAGER_ERROR + ); + + sqlite3BitvecDestroy(pPager->pInJournal); + pPager->pInJournal = 0; + releaseAllSavepoints(pPager); + + if( pagerUseWal(pPager) ){ + assert( !isOpen(pPager->jfd) ); + sqlite3WalEndReadTransaction(pPager->pWal); + pPager->eState = PAGER_OPEN; + }else if( !pPager->exclusiveMode ){ + int rc; /* Error code returned by pagerUnlockDb() */ + int iDc = isOpen(pPager->fd)?sqlite3OsDeviceCharacteristics(pPager->fd):0; + + /* If the operating system support deletion of open files, then + ** close the journal file when dropping the database lock. Otherwise + ** another connection with journal_mode=delete might delete the file + ** out from under us. */ - sqlite3OsClose(pPager->jfd); - sqlite3BitvecDestroy(pPager->pInJournal); - pPager->pInJournal = 0; - releaseAllSavepoints(pPager); - - /* If the file is unlocked, somebody else might change it. The - ** values stored in Pager.dbSize etc. might become invalid if - ** this happens. TODO: Really, this doesn't need to be cleared - ** until the change-counter check fails in PagerSharedLock(). - */ - pPager->dbSizeValid = 0; - - rc = osUnlock(pPager->fd, NO_LOCK); - if( rc ){ - pPager->errCode = rc; - } - IOTRACE(("UNLOCK %p\n", pPager)) - - /* If Pager.errCode is set, the contents of the pager cache cannot be - ** trusted. Now that the pager file is unlocked, the contents of the - ** cache can be discarded and the error code safely cleared. - */ - if( pPager->errCode ){ - if( rc==SQLITE_OK ){ - pPager->errCode = SQLITE_OK; - } - pager_reset(pPager); + assert( (PAGER_JOURNALMODE_MEMORY & 5)!=1 ); + assert( (PAGER_JOURNALMODE_OFF & 5)!=1 ); + assert( (PAGER_JOURNALMODE_WAL & 5)!=1 ); + assert( (PAGER_JOURNALMODE_DELETE & 5)!=1 ); + assert( (PAGER_JOURNALMODE_TRUNCATE & 5)==1 ); + assert( (PAGER_JOURNALMODE_PERSIST & 5)==1 ); + if( 0==(iDc & SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN) + || 1!=(pPager->journalMode & 5) + ){ + sqlite3OsClose(pPager->jfd); } + /* If the pager is in the ERROR state and the call to unlock the database + ** file fails, set the current lock to UNKNOWN_LOCK. See the comment + ** above the #define for UNKNOWN_LOCK for an explanation of why this + ** is necessary. + */ + rc = pagerUnlockDb(pPager, NO_LOCK); + if( rc!=SQLITE_OK && pPager->eState==PAGER_ERROR ){ + pPager->eLock = UNKNOWN_LOCK; + } + + /* The pager state may be changed from PAGER_ERROR to PAGER_OPEN here + ** without clearing the error code. This is intentional - the error + ** code is cleared and the cache reset in the block below. + */ + assert( pPager->errCode || pPager->eState!=PAGER_ERROR ); pPager->changeCountDone = 0; - pPager->state = PAGER_UNLOCK; + pPager->eState = PAGER_OPEN; } + + /* If Pager.errCode is set, the contents of the pager cache cannot be + ** trusted. Now that there are no outstanding references to the pager, + ** it can safely move back to PAGER_OPEN state. This happens in both + ** normal and exclusive-locking mode. + */ + if( pPager->errCode ){ + assert( !MEMDB ); + pager_reset(pPager); + pPager->changeCountDone = pPager->tempFile; + pPager->eState = PAGER_OPEN; + pPager->errCode = SQLITE_OK; + } + + pPager->journalOff = 0; + pPager->journalHdr = 0; + pPager->setMaster = 0; } /* -** This function should be called when an IOERR, CORRUPT or FULL error -** may have occurred. The first argument is a pointer to the pager -** structure, the second the error-code about to be returned by a pager -** API function. The value returned is a copy of the second argument -** to this function. +** This function is called whenever an IOERR or FULL error that requires +** the pager to transition into the ERROR state may ahve occurred. +** The first argument is a pointer to the pager structure, the second +** the error-code about to be returned by a pager API function. The +** value returned is a copy of the second argument to this function. ** -** If the second argument is SQLITE_IOERR, SQLITE_CORRUPT, or SQLITE_FULL -** the error becomes persistent. Until the persisten error is cleared, -** subsequent API calls on this Pager will immediately return the same -** error code. +** If the second argument is SQLITE_FULL, SQLITE_IOERR or one of the +** IOERR sub-codes, the pager enters the ERROR state and the error code +** is stored in Pager.errCode. While the pager remains in the ERROR state, +** all major API calls on the Pager will immediately return Pager.errCode. ** -** A persistent error indicates that the contents of the pager-cache +** The ERROR state indicates that the contents of the pager-cache ** cannot be trusted. This state can be cleared by completely discarding ** the contents of the pager-cache. If a transaction was active when ** the persistent error occurred, then the rollback journal may need @@ -32509,36 +36622,11 @@ static int pager_error(Pager *pPager, int rc){ ); if( rc2==SQLITE_FULL || rc2==SQLITE_IOERR ){ pPager->errCode = rc; + pPager->eState = PAGER_ERROR; } return rc; } -/* -** Execute a rollback if a transaction is active and unlock the -** database file. -** -** If the pager has already entered the error state, do not attempt -** the rollback at this time. Instead, pager_unlock() is called. The -** call to pager_unlock() will discard all in-memory pages, unlock -** the database file and clear the error state. If this means that -** there is a hot-journal left in the file-system, the next connection -** to obtain a shared lock on the pager (which may be this one) will -** roll it back. -** -** If the pager has not already entered the error state, but an IO or -** malloc error occurs during a rollback, then this will itself cause -** the pager to enter the error state. Which will be cleared by the -** call to pager_unlock(), as described above. -*/ -static void pagerUnlockAndRollback(Pager *pPager){ - if( pPager->errCode==SQLITE_OK && pPager->state>=PAGER_RESERVED ){ - sqlite3BeginBenignMalloc(); - sqlite3PagerRollback(pPager); - sqlite3EndBenignMalloc(); - } - pager_unlock(pPager); -} - /* ** This routine ends a transaction. A transaction is usually ended by ** either a COMMIT or a ROLLBACK operation. This routine may be called @@ -32546,8 +36634,9 @@ static void pagerUnlockAndRollback(Pager *pPager){ ** the journal file or writing the very first journal-header of a ** database transaction. ** -** If the pager is in PAGER_SHARED or PAGER_UNLOCK state when this -** routine is called, it is a no-op (returns SQLITE_OK). +** This routine is never called in PAGER_ERROR state. If it is called +** in PAGER_NONE or PAGER_SHARED state and the lock held is less +** exclusive than a RESERVED lock, it is a no-op. ** ** Otherwise, any active savepoints are released. ** @@ -32578,13 +36667,9 @@ static void pagerUnlockAndRollback(Pager *pPager){ ** DELETE and the pager is in exclusive mode, the method described under ** journalMode==PERSIST is used instead. ** -** After the journal is finalized, if running in non-exclusive mode, the -** pager moves to PAGER_SHARED state (and downgrades the lock on the -** database file accordingly). -** -** If the pager is running in exclusive mode and is in PAGER_SYNCED state, -** it moves to PAGER_EXCLUSIVE. No locks are downgraded when running in -** exclusive mode. +** After the journal is finalized, the pager moves to PAGER_READER state. +** If running in non-exclusive rollback mode, the lock on the file is +** downgraded to a SHARED_LOCK. ** ** SQLITE_OK is returned if no error occurs. If an error occurs during ** any of the IO operations to finalize the journal file or unlock the @@ -32599,13 +36684,29 @@ static int pager_end_transaction(Pager *pPager, int hasMaster){ int rc = SQLITE_OK; /* Error code from journal finalization operation */ int rc2 = SQLITE_OK; /* Error code from db file unlock operation */ - if( pPager->stateeState!=PAGER_ERROR ); + if( pPager->eStateeLockjfd) || pPager->pInJournal==0 ); if( isOpen(pPager->jfd) ){ + assert( !pagerUseWal(pPager) ); /* Finalize the journal file. */ if( sqlite3IsMemJournal(pPager->jfd) ){ @@ -32618,60 +36719,97 @@ static int pager_end_transaction(Pager *pPager, int hasMaster){ rc = sqlite3OsTruncate(pPager->jfd, 0); } pPager->journalOff = 0; - pPager->journalStarted = 0; - }else if( pPager->exclusiveMode - || pPager->journalMode==PAGER_JOURNALMODE_PERSIST + }else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST + || (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL) ){ rc = zeroJournalHdr(pPager, hasMaster); - pager_error(pPager, rc); pPager->journalOff = 0; - pPager->journalStarted = 0; }else{ /* This branch may be executed with Pager.journalMode==MEMORY if ** a hot-journal was just rolled back. In this case the journal ** file should be closed and deleted. If this connection writes to - ** the database file, it will do so using an in-memory journal. */ + ** the database file, it will do so using an in-memory journal. + */ assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE || pPager->journalMode==PAGER_JOURNALMODE_MEMORY + || pPager->journalMode==PAGER_JOURNALMODE_WAL ); sqlite3OsClose(pPager->jfd); if( !pPager->tempFile ){ rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0); } } + } #ifdef SQLITE_CHECK_PAGES - sqlite3PcacheIterateDirty(pPager->pPCache, pager_set_pagehash); + sqlite3PcacheIterateDirty(pPager->pPCache, pager_set_pagehash); + if( pPager->dbSize==0 && sqlite3PcacheRefCount(pPager->pPCache)>0 ){ + PgHdr *p = pager_lookup(pPager, 1); + if( p ){ + p->pageHash = 0; + sqlite3PagerUnref(p); + } + } #endif - sqlite3PcacheCleanAll(pPager->pPCache); - sqlite3BitvecDestroy(pPager->pInJournal); - pPager->pInJournal = 0; - pPager->nRec = 0; - } - - if( !pPager->exclusiveMode ){ - rc2 = osUnlock(pPager->fd, SHARED_LOCK); - pPager->state = PAGER_SHARED; - pPager->changeCountDone = 0; - }else if( pPager->state==PAGER_SYNCED ){ - pPager->state = PAGER_EXCLUSIVE; - } - pPager->setMaster = 0; - pPager->needSync = 0; - pPager->dbModified = 0; - - /* TODO: Is this optimal? Why is the db size invalidated here - ** when the database file is not unlocked? */ - pPager->dbOrigSize = 0; + sqlite3BitvecDestroy(pPager->pInJournal); + pPager->pInJournal = 0; + pPager->nRec = 0; + sqlite3PcacheCleanAll(pPager->pPCache); sqlite3PcacheTruncate(pPager->pPCache, pPager->dbSize); - if( !MEMDB ){ - pPager->dbSizeValid = 0; + + if( pagerUseWal(pPager) ){ + /* Drop the WAL write-lock, if any. Also, if the connection was in + ** locking_mode=exclusive mode but is no longer, drop the EXCLUSIVE + ** lock held on the database file. + */ + rc2 = sqlite3WalEndWriteTransaction(pPager->pWal); + assert( rc2==SQLITE_OK ); } + if( !pPager->exclusiveMode + && (!pagerUseWal(pPager) || sqlite3WalExclusiveMode(pPager->pWal, 0)) + ){ + rc2 = pagerUnlockDb(pPager, SHARED_LOCK); + pPager->changeCountDone = 0; + } + pPager->eState = PAGER_READER; + pPager->setMaster = 0; return (rc==SQLITE_OK?rc2:rc); } +/* +** Execute a rollback if a transaction is active and unlock the +** database file. +** +** If the pager has already entered the ERROR state, do not attempt +** the rollback at this time. Instead, pager_unlock() is called. The +** call to pager_unlock() will discard all in-memory pages, unlock +** the database file and move the pager back to OPEN state. If this +** means that there is a hot-journal left in the file-system, the next +** connection to obtain a shared lock on the pager (which may be this one) +** will roll it back. +** +** If the pager has not already entered the ERROR state, but an IO or +** malloc error occurs during a rollback, then this will itself cause +** the pager to enter the ERROR state. Which will be cleared by the +** call to pager_unlock(), as described above. +*/ +static void pagerUnlockAndRollback(Pager *pPager){ + if( pPager->eState!=PAGER_ERROR && pPager->eState!=PAGER_OPEN ){ + assert( assert_pager_state(pPager) ); + if( pPager->eState>=PAGER_WRITER_LOCKED ){ + sqlite3BeginBenignMalloc(); + sqlite3PagerRollback(pPager); + sqlite3EndBenignMalloc(); + }else if( !pPager->exclusiveMode ){ + assert( pPager->eState==PAGER_READER ); + pager_end_transaction(pPager, 0); + } + } + pager_unlock(pPager); +} + /* ** Parameter aData must point to a buffer of pPager->pageSize bytes ** of data. Compute and return a checksum based ont the contents of the @@ -32701,15 +36839,29 @@ static u32 pager_cksum(Pager *pPager, const u8 *aData){ return cksum; } +/* +** Report the current page size and number of reserved bytes back +** to the codec. +*/ +#ifdef SQLITE_HAS_CODEC +static void pagerReportSize(Pager *pPager){ + if( pPager->xCodecSizeChng ){ + pPager->xCodecSizeChng(pPager->pCodec, pPager->pageSize, + (int)pPager->nReserve); + } +} +#else +# define pagerReportSize(X) /* No-op if we do not support a codec */ +#endif + /* ** Read a single page from either the journal file (if isMainJrnl==1) or ** from the sub-journal (if isMainJrnl==0) and playback that page. ** The page begins at offset *pOffset into the file. The *pOffset ** value is increased to the start of the next page in the journal. ** -** The isMainJrnl flag is true if this is the main rollback journal and -** false for the statement journal. The main rollback journal uses -** checksums - the statement journal does not. +** The main rollback journal uses checksums - the statement journal does +** not. ** ** If the page number of the page record read from the (sub-)journal file ** is greater than the current value of Pager.dbSize, then playback is @@ -32741,26 +36893,38 @@ static u32 pager_cksum(Pager *pPager, const u8 *aData){ */ static int pager_playback_one_page( Pager *pPager, /* The pager being played back */ - int isMainJrnl, /* 1 -> main journal. 0 -> sub-journal. */ - int isUnsync, /* True if reading from unsynced main journal */ i64 *pOffset, /* Offset of record to playback */ - int isSavepnt, /* True for a savepoint rollback */ - Bitvec *pDone /* Bitvec of pages already played back */ + Bitvec *pDone, /* Bitvec of pages already played back */ + int isMainJrnl, /* 1 -> main journal. 0 -> sub-journal. */ + int isSavepnt /* True for a savepoint rollback */ ){ int rc; PgHdr *pPg; /* An existing page in the cache */ Pgno pgno; /* The page number of a page in journal */ u32 cksum; /* Checksum used for sanity checking */ - u8 *aData; /* Temporary storage for the page */ + char *aData; /* Temporary storage for the page */ sqlite3_file *jfd; /* The file descriptor for the journal file */ + int isSynced; /* True if journal page is synced */ assert( (isMainJrnl&~1)==0 ); /* isMainJrnl is 0 or 1 */ assert( (isSavepnt&~1)==0 ); /* isSavepnt is 0 or 1 */ assert( isMainJrnl || pDone ); /* pDone always used on sub-journals */ assert( isSavepnt || pDone==0 ); /* pDone never used on non-savepoint */ - aData = (u8*)pPager->pTmpSpace; + aData = pPager->pTmpSpace; assert( aData ); /* Temp storage must have already been allocated */ + assert( pagerUseWal(pPager)==0 || (!isMainJrnl && isSavepnt) ); + + /* Either the state is greater than PAGER_WRITER_CACHEMOD (a transaction + ** or savepoint rollback done at the request of the caller) or this is + ** a hot-journal rollback. If it is a hot-journal rollback, the pager + ** is in state OPEN and holds an EXCLUSIVE lock. Hot-journal rollback + ** only reads from the main journal, not the sub-journal. + */ + assert( pPager->eState>=PAGER_WRITER_CACHEMOD + || (pPager->eState==PAGER_OPEN && pPager->eLock==EXCLUSIVE_LOCK) + ); + assert( pPager->eState>=PAGER_WRITER_CACHEMOD || isMainJrnl ); /* Read the page number and page data from the journal or sub-journal ** file. Return an error code to the caller if an IO error occurs. @@ -32768,7 +36932,7 @@ static int pager_playback_one_page( jfd = isMainJrnl ? pPager->jfd : pPager->sjfd; rc = read32bits(jfd, *pOffset, &pgno); if( rc!=SQLITE_OK ) return rc; - rc = sqlite3OsRead(jfd, aData, pPager->pageSize, (*pOffset)+4); + rc = sqlite3OsRead(jfd, (u8*)aData, pPager->pageSize, (*pOffset)+4); if( rc!=SQLITE_OK ) return rc; *pOffset += pPager->pageSize + 4 + isMainJrnl*4; @@ -32787,18 +36951,26 @@ static int pager_playback_one_page( if( isMainJrnl ){ rc = read32bits(jfd, (*pOffset)-4, &cksum); if( rc ) return rc; - if( !isSavepnt && pager_cksum(pPager, aData)!=cksum ){ + if( !isSavepnt && pager_cksum(pPager, (u8*)aData)!=cksum ){ return SQLITE_DONE; } } + /* If this page has already been played by before during the current + ** rollback, then don't bother to play it back again. + */ if( pDone && (rc = sqlite3BitvecSet(pDone, pgno))!=SQLITE_OK ){ return rc; } - assert( pPager->state==PAGER_RESERVED || pPager->state>=PAGER_EXCLUSIVE ); + /* When playing back page 1, restore the nReserve setting + */ + if( pgno==1 && pPager->nReserve!=((u8*)aData)[20] ){ + pPager->nReserve = ((u8*)aData)[20]; + pagerReportSize(pPager); + } - /* If the pager is in RESERVED state, then there must be a copy of this + /* If the pager is in CACHEMOD state, then there must be a copy of this ** page in the pager cache. In this case just update the pager cache, ** not the database file. The page is left marked dirty in this case. ** @@ -32809,8 +36981,11 @@ static int pager_playback_one_page( ** either. So the condition described in the above paragraph is not ** assert()able. ** - ** If in EXCLUSIVE state, then we update the pager cache if it exists - ** and the main file. The page is then marked not dirty. + ** If in WRITER_DBMOD, WRITER_FINISHED or OPEN state, then we update the + ** pager cache if it exists and the main file. The page is then marked + ** not dirty. Since this code is only executed in PAGER_OPEN state for + ** a hot-journal rollback, it is guaranteed that the page-cache is empty + ** if the pager is in OPEN state. ** ** Ticket #1171: The statement journal might contain page content that is ** different from the page content at the start of the transaction. @@ -32830,26 +37005,37 @@ static int pager_playback_one_page( ** is possible to fail a statement on a database that does not yet exist. ** Do not attempt to write if database file has never been opened. */ - pPg = pager_lookup(pPager, pgno); + if( pagerUseWal(pPager) ){ + pPg = 0; + }else{ + pPg = pager_lookup(pPager, pgno); + } assert( pPg || !MEMDB ); + assert( pPager->eState!=PAGER_OPEN || pPg==0 ); PAGERTRACE(("PLAYBACK %d page %d hash(%08x) %s\n", - PAGERID(pPager), pgno, pager_datahash(pPager->pageSize, aData), - (isMainJrnl?"main-journal":"sub-journal") + PAGERID(pPager), pgno, pager_datahash(pPager->pageSize, (u8*)aData), + (isMainJrnl?"main-journal":"sub-journal") )); - if( (pPager->state>=PAGER_EXCLUSIVE) - && (pPg==0 || 0==(pPg->flags&PGHDR_NEED_SYNC)) - && isOpen(pPager->fd) - && !isUnsync + if( isMainJrnl ){ + isSynced = pPager->noSync || (*pOffset <= pPager->journalHdr); + }else{ + isSynced = (pPg==0 || 0==(pPg->flags & PGHDR_NEED_SYNC)); + } + if( isOpen(pPager->fd) + && (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) + && isSynced ){ i64 ofst = (pgno-1)*(i64)pPager->pageSize; - rc = sqlite3OsWrite(pPager->fd, aData, pPager->pageSize, ofst); + testcase( !isSavepnt && pPg!=0 && (pPg->flags&PGHDR_NEED_SYNC)!=0 ); + assert( !pagerUseWal(pPager) ); + rc = sqlite3OsWrite(pPager->fd, (u8*)aData, pPager->pageSize, ofst); if( pgno>pPager->dbFileSize ){ pPager->dbFileSize = pgno; } if( pPager->pBackup ){ CODEC1(pPager, aData, pgno, 3, rc=SQLITE_NOMEM); - sqlite3BackupUpdate(pPager->pBackup, pgno, aData); - CODEC1(pPager, aData, pgno, 0, rc=SQLITE_NOMEM); + sqlite3BackupUpdate(pPager->pBackup, pgno, (u8*)aData); + CODEC2(pPager, aData, pgno, 7, rc=SQLITE_NOMEM, aData); } }else if( !isMainJrnl && pPg==0 ){ /* If this is a rollback of a savepoint and data was not written to @@ -32869,9 +37055,12 @@ static int pager_playback_one_page( ** requiring a journal-sync before it is written. */ assert( isSavepnt ); - if( (rc = sqlite3PagerAcquire(pPager, pgno, &pPg, 1))!=SQLITE_OK ){ - return rc; - } + assert( pPager->doNotSpill==0 ); + pPager->doNotSpill++; + rc = sqlite3PagerAcquire(pPager, pgno, &pPg, 1); + assert( pPager->doNotSpill==1 ); + pPager->doNotSpill--; + if( rc!=SQLITE_OK ) return rc; pPg->flags &= ~PGHDR_NEED_READ; sqlite3PcacheMakeDirty(pPg); } @@ -32884,13 +37073,14 @@ static int pager_playback_one_page( */ void *pData; pData = pPg->pData; - memcpy(pData, aData, pPager->pageSize); + memcpy(pData, (u8*)aData, pPager->pageSize); pPager->xReiniter(pPg); if( isMainJrnl && (!isSavepnt || *pOffset<=pPager->journalHdr) ){ /* If the contents of this page were just restored from the main ** journal file, then its content must be as they were when the ** transaction was first opened. In this case we can mark the page - ** as clean, since there will be no need to write it out to the. + ** as clean, since there will be no need to write it out to the + ** database. ** ** There is one exception to this rule. If the page is being rolled ** back as part of a savepoint (or statement) rollback from an @@ -32905,11 +37095,11 @@ static int pager_playback_one_page( ** segment is synced. If a crash occurs during or following this, ** database corruption may ensue. */ + assert( !pagerUseWal(pPager) ); sqlite3PcacheMakeClean(pPg); } -#ifdef SQLITE_CHECK_PAGES - pPg->pageHash = pager_pagehash(pPg); -#endif + pager_set_pagehash(pPg); + /* If this was page 1, then restore the value of Pager.dbFileVers. ** Do this before any decoding. */ if( pgno==1 ){ @@ -32973,6 +37163,9 @@ static int pager_delmaster(Pager *pPager, const char *zMaster){ sqlite3_file *pJournal; /* Malloc'd child-journal file descriptor */ char *zMasterJournal = 0; /* Contents of master journal file */ i64 nMasterJournal; /* Size of master journal file */ + char *zJournal; /* Pointer to one journal within MJ file */ + char *zMasterPtr; /* Space to hold MJ filename from a journal file */ + int nMasterPtr; /* Amount of space allocated to zMasterPtr[] */ /* Allocate space for both the pJournal and pMaster file descriptors. ** If successful, open the master journal file for reading. @@ -32987,73 +37180,68 @@ static int pager_delmaster(Pager *pPager, const char *zMaster){ } if( rc!=SQLITE_OK ) goto delmaster_out; + /* Load the entire master journal file into space obtained from + ** sqlite3_malloc() and pointed to by zMasterJournal. Also obtain + ** sufficient space (in zMasterPtr) to hold the names of master + ** journal files extracted from regular rollback-journals. + */ rc = sqlite3OsFileSize(pMaster, &nMasterJournal); if( rc!=SQLITE_OK ) goto delmaster_out; + nMasterPtr = pVfs->mxPathname+1; + zMasterJournal = sqlite3Malloc((int)nMasterJournal + nMasterPtr + 1); + if( !zMasterJournal ){ + rc = SQLITE_NOMEM; + goto delmaster_out; + } + zMasterPtr = &zMasterJournal[nMasterJournal+1]; + rc = sqlite3OsRead(pMaster, zMasterJournal, (int)nMasterJournal, 0); + if( rc!=SQLITE_OK ) goto delmaster_out; + zMasterJournal[nMasterJournal] = 0; - if( nMasterJournal>0 ){ - char *zJournal; - char *zMasterPtr = 0; - int nMasterPtr = pVfs->mxPathname+1; - - /* Load the entire master journal file into space obtained from - ** sqlite3_malloc() and pointed to by zMasterJournal. - */ - zMasterJournal = sqlite3Malloc((int)nMasterJournal + nMasterPtr + 1); - if( !zMasterJournal ){ - rc = SQLITE_NOMEM; + zJournal = zMasterJournal; + while( (zJournal-zMasterJournal)pageSize bytes). If the file -** on disk is currently larger than nPage pages, then use the VFS +** If the main database file is not open, or the pager is not in either +** DBMOD or OPEN state, this function is a no-op. Otherwise, the size +** of the file is changed to nPage pages (nPage*pPager->pageSize bytes). +** If the file on disk is currently larger than nPage pages, then use the VFS ** xTruncate() method to truncate it. ** ** Or, it might might be the case that the file on disk is smaller than @@ -33080,8 +37268,14 @@ delmaster_out: */ static int pager_truncate(Pager *pPager, Pgno nPage){ int rc = SQLITE_OK; - if( pPager->state>=PAGER_EXCLUSIVE && isOpen(pPager->fd) ){ + assert( pPager->eState!=PAGER_ERROR ); + assert( pPager->eState!=PAGER_READER ); + + if( isOpen(pPager->fd) + && (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) + ){ i64 currentSize, newSize; + assert( pPager->eLock==EXCLUSIVE_LOCK ); /* TODO: Is it safe to use Pager.dbFileSize here? */ rc = sqlite3OsFileSize(pPager->fd, ¤tSize); newSize = pPager->pageSize*(i64)nPage; @@ -33109,8 +37303,8 @@ static int pager_truncate(Pager *pPager, Pgno nPage){ ** For temporary files the effective sector size is always 512 bytes. ** ** Otherwise, for non-temporary files, the effective sector size is -** the value returned by the xSectorSize() method rounded up to 512 if -** it is less than 512, or rounded down to MAX_SECTOR_SIZE if it +** the value returned by the xSectorSize() method rounded up to 32 if +** it is less than 32, or rounded down to MAX_SECTOR_SIZE if it ** is greater than MAX_SECTOR_SIZE. */ static void setSectorSize(Pager *pPager){ @@ -33123,7 +37317,7 @@ static void setSectorSize(Pager *pPager){ */ pPager->sectorSize = sqlite3OsSectorSize(pPager->fd); } - if( pPager->sectorSize<512 ){ + if( pPager->sectorSize<32 ){ pPager->sectorSize = 512; } if( pPager->sectorSize>MAX_SECTOR_SIZE ){ @@ -33205,7 +37399,7 @@ static int pager_playback(Pager *pPager, int isHot){ */ assert( isOpen(pPager->jfd) ); rc = sqlite3OsFileSize(pPager->jfd, &szJ); - if( rc!=SQLITE_OK || szJ==0 ){ + if( rc!=SQLITE_OK ){ goto end_playback; } @@ -33237,11 +37431,9 @@ static int pager_playback(Pager *pPager, int isHot){ ** occurs. */ while( 1 ){ - int isUnsync = 0; - /* Read the next journal header from the journal file. If there are ** not enough bytes left in the journal file for a complete header, or - ** it is corrupted, then a process must of failed while writing it. + ** it is corrupted, then a process must have failed while writing it. ** This indicates nothing more needs to be rolled back. */ rc = readJournalHdr(pPager, isHot, szJ, &nRec, &mxPg); @@ -33279,7 +37471,6 @@ static int pager_playback(Pager *pPager, int isHot){ if( nRec==0 && !isHot && pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff ){ nRec = (int)((szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager)); - isUnsync = 1; } /* If this is the first header read from the journal, truncate the @@ -33301,12 +37492,20 @@ static int pager_playback(Pager *pPager, int isHot){ pager_reset(pPager); needPagerReset = 0; } - rc = pager_playback_one_page(pPager,1,isUnsync,&pPager->journalOff,0,0); + rc = pager_playback_one_page(pPager,&pPager->journalOff,0,1,0); if( rc!=SQLITE_OK ){ if( rc==SQLITE_DONE ){ rc = SQLITE_OK; pPager->journalOff = szJ; break; + }else if( rc==SQLITE_IOERR_SHORT_READ ){ + /* If the journal has been truncated, simply stop reading and + ** processing the journal. This might happen if the journal was + ** not completely written and synced prior to a crash. In that + ** case, the database should have never been written in the + ** first place so it is OK to simply abandon the rollback. */ + rc = SQLITE_OK; + goto end_playback; }else{ /* If we are unable to rollback, quit and return the error ** code. This will cause the pager to enter the error state @@ -33348,6 +37547,11 @@ end_playback: rc = readMasterJournal(pPager->jfd, zMaster, pPager->pVfs->mxPathname+1); testcase( rc!=SQLITE_OK ); } + if( rc==SQLITE_OK && !pPager->noSync + && (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) + ){ + rc = sqlite3OsSync(pPager->fd, pPager->sync_flags); + } if( rc==SQLITE_OK ){ rc = pager_end_transaction(pPager, zMaster[0]!='\0'); testcase( rc!=SQLITE_OK ); @@ -33368,6 +37572,320 @@ end_playback: return rc; } + +/* +** Read the content for page pPg out of the database file and into +** pPg->pData. A shared lock or greater must be held on the database +** file before this function is called. +** +** If page 1 is read, then the value of Pager.dbFileVers[] is set to +** the value read from the database file. +** +** If an IO error occurs, then the IO error is returned to the caller. +** Otherwise, SQLITE_OK is returned. +*/ +static int readDbPage(PgHdr *pPg){ + Pager *pPager = pPg->pPager; /* Pager object associated with page pPg */ + Pgno pgno = pPg->pgno; /* Page number to read */ + int rc = SQLITE_OK; /* Return code */ + int isInWal = 0; /* True if page is in log file */ + int pgsz = pPager->pageSize; /* Number of bytes to read */ + + assert( pPager->eState>=PAGER_READER && !MEMDB ); + assert( isOpen(pPager->fd) ); + + if( NEVER(!isOpen(pPager->fd)) ){ + assert( pPager->tempFile ); + memset(pPg->pData, 0, pPager->pageSize); + return SQLITE_OK; + } + + if( pagerUseWal(pPager) ){ + /* Try to pull the page from the write-ahead log. */ + rc = sqlite3WalRead(pPager->pWal, pgno, &isInWal, pgsz, pPg->pData); + } + if( rc==SQLITE_OK && !isInWal ){ + i64 iOffset = (pgno-1)*(i64)pPager->pageSize; + rc = sqlite3OsRead(pPager->fd, pPg->pData, pgsz, iOffset); + if( rc==SQLITE_IOERR_SHORT_READ ){ + rc = SQLITE_OK; + } + } + + if( pgno==1 ){ + if( rc ){ + /* If the read is unsuccessful, set the dbFileVers[] to something + ** that will never be a valid file version. dbFileVers[] is a copy + ** of bytes 24..39 of the database. Bytes 28..31 should always be + ** zero or the size of the database in page. Bytes 32..35 and 35..39 + ** should be page numbers which are never 0xffffffff. So filling + ** pPager->dbFileVers[] with all 0xff bytes should suffice. + ** + ** For an encrypted database, the situation is more complex: bytes + ** 24..39 of the database are white noise. But the probability of + ** white noising equaling 16 bytes of 0xff is vanishingly small so + ** we should still be ok. + */ + memset(pPager->dbFileVers, 0xff, sizeof(pPager->dbFileVers)); + }else{ + u8 *dbFileVers = &((u8*)pPg->pData)[24]; + memcpy(&pPager->dbFileVers, dbFileVers, sizeof(pPager->dbFileVers)); + } + } + CODEC1(pPager, pPg->pData, pgno, 3, rc = SQLITE_NOMEM); + + PAGER_INCR(sqlite3_pager_readdb_count); + PAGER_INCR(pPager->nRead); + IOTRACE(("PGIN %p %d\n", pPager, pgno)); + PAGERTRACE(("FETCH %d page %d hash(%08x)\n", + PAGERID(pPager), pgno, pager_pagehash(pPg))); + + return rc; +} + +#ifndef SQLITE_OMIT_WAL +/* +** This function is invoked once for each page that has already been +** written into the log file when a WAL transaction is rolled back. +** Parameter iPg is the page number of said page. The pCtx argument +** is actually a pointer to the Pager structure. +** +** If page iPg is present in the cache, and has no outstanding references, +** it is discarded. Otherwise, if there are one or more outstanding +** references, the page content is reloaded from the database. If the +** attempt to reload content from the database is required and fails, +** return an SQLite error code. Otherwise, SQLITE_OK. +*/ +static int pagerUndoCallback(void *pCtx, Pgno iPg){ + int rc = SQLITE_OK; + Pager *pPager = (Pager *)pCtx; + PgHdr *pPg; + + pPg = sqlite3PagerLookup(pPager, iPg); + if( pPg ){ + if( sqlite3PcachePageRefcount(pPg)==1 ){ + sqlite3PcacheDrop(pPg); + }else{ + rc = readDbPage(pPg); + if( rc==SQLITE_OK ){ + pPager->xReiniter(pPg); + } + sqlite3PagerUnref(pPg); + } + } + + /* Normally, if a transaction is rolled back, any backup processes are + ** updated as data is copied out of the rollback journal and into the + ** database. This is not generally possible with a WAL database, as + ** rollback involves simply truncating the log file. Therefore, if one + ** or more frames have already been written to the log (and therefore + ** also copied into the backup databases) as part of this transaction, + ** the backups must be restarted. + */ + sqlite3BackupRestart(pPager->pBackup); + + return rc; +} + +/* +** This function is called to rollback a transaction on a WAL database. +*/ +static int pagerRollbackWal(Pager *pPager){ + int rc; /* Return Code */ + PgHdr *pList; /* List of dirty pages to revert */ + + /* For all pages in the cache that are currently dirty or have already + ** been written (but not committed) to the log file, do one of the + ** following: + ** + ** + Discard the cached page (if refcount==0), or + ** + Reload page content from the database (if refcount>0). + */ + pPager->dbSize = pPager->dbOrigSize; + rc = sqlite3WalUndo(pPager->pWal, pagerUndoCallback, (void *)pPager); + pList = sqlite3PcacheDirtyList(pPager->pPCache); + while( pList && rc==SQLITE_OK ){ + PgHdr *pNext = pList->pDirty; + rc = pagerUndoCallback((void *)pPager, pList->pgno); + pList = pNext; + } + + return rc; +} + +/* +** This function is a wrapper around sqlite3WalFrames(). As well as logging +** the contents of the list of pages headed by pList (connected by pDirty), +** this function notifies any active backup processes that the pages have +** changed. +*/ +static int pagerWalFrames( + Pager *pPager, /* Pager object */ + PgHdr *pList, /* List of frames to log */ + Pgno nTruncate, /* Database size after this commit */ + int isCommit, /* True if this is a commit */ + int sync_flags /* Flags to pass to OsSync() (or 0) */ +){ + int rc; /* Return code */ + + assert( pPager->pWal ); + rc = sqlite3WalFrames(pPager->pWal, + pPager->pageSize, pList, nTruncate, isCommit, sync_flags + ); + if( rc==SQLITE_OK && pPager->pBackup ){ + PgHdr *p; + for(p=pList; p; p=p->pDirty){ + sqlite3BackupUpdate(pPager->pBackup, p->pgno, (u8 *)p->pData); + } + } + +#ifdef SQLITE_CHECK_PAGES + { + PgHdr *p; + for(p=pList; p; p=p->pDirty) pager_set_pagehash(p); + } +#endif + + return rc; +} + +/* +** Begin a read transaction on the WAL. +** +** This routine used to be called "pagerOpenSnapshot()" because it essentially +** makes a snapshot of the database at the current point in time and preserves +** that snapshot for use by the reader in spite of concurrently changes by +** other writers or checkpointers. +*/ +static int pagerBeginReadTransaction(Pager *pPager){ + int rc; /* Return code */ + int changed = 0; /* True if cache must be reset */ + + assert( pagerUseWal(pPager) ); + assert( pPager->eState==PAGER_OPEN || pPager->eState==PAGER_READER ); + + /* sqlite3WalEndReadTransaction() was not called for the previous + ** transaction in locking_mode=EXCLUSIVE. So call it now. If we + ** are in locking_mode=NORMAL and EndRead() was previously called, + ** the duplicate call is harmless. + */ + sqlite3WalEndReadTransaction(pPager->pWal); + + rc = sqlite3WalBeginReadTransaction(pPager->pWal, &changed); + if( rc!=SQLITE_OK || changed ){ + pager_reset(pPager); + } + + return rc; +} +#endif + +/* +** This function is called as part of the transition from PAGER_OPEN +** to PAGER_READER state to determine the size of the database file +** in pages (assuming the page size currently stored in Pager.pageSize). +** +** If no error occurs, SQLITE_OK is returned and the size of the database +** in pages is stored in *pnPage. Otherwise, an error code (perhaps +** SQLITE_IOERR_FSTAT) is returned and *pnPage is left unmodified. +*/ +static int pagerPagecount(Pager *pPager, Pgno *pnPage){ + Pgno nPage; /* Value to return via *pnPage */ + + /* Query the WAL sub-system for the database size. The WalDbsize() + ** function returns zero if the WAL is not open (i.e. Pager.pWal==0), or + ** if the database size is not available. The database size is not + ** available from the WAL sub-system if the log file is empty or + ** contains no valid committed transactions. + */ + assert( pPager->eState==PAGER_OPEN ); + assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock ); + nPage = sqlite3WalDbsize(pPager->pWal); + + /* If the database size was not available from the WAL sub-system, + ** determine it based on the size of the database file. If the size + ** of the database file is not an integer multiple of the page-size, + ** round down to the nearest page. Except, any file larger than 0 + ** bytes in size is considered to contain at least one page. + */ + if( nPage==0 ){ + i64 n = 0; /* Size of db file in bytes */ + assert( isOpen(pPager->fd) || pPager->tempFile ); + if( isOpen(pPager->fd) ){ + int rc = sqlite3OsFileSize(pPager->fd, &n); + if( rc!=SQLITE_OK ){ + return rc; + } + } + nPage = (Pgno)(n / pPager->pageSize); + if( nPage==0 && n>0 ){ + nPage = 1; + } + } + + /* If the current number of pages in the file is greater than the + ** configured maximum pager number, increase the allowed limit so + ** that the file can be read. + */ + if( nPage>pPager->mxPgno ){ + pPager->mxPgno = (Pgno)nPage; + } + + *pnPage = nPage; + return SQLITE_OK; +} + +#ifndef SQLITE_OMIT_WAL +/* +** Check if the *-wal file that corresponds to the database opened by pPager +** exists if the database is not empy, or verify that the *-wal file does +** not exist (by deleting it) if the database file is empty. +** +** If the database is not empty and the *-wal file exists, open the pager +** in WAL mode. If the database is empty or if no *-wal file exists and +** if no error occurs, make sure Pager.journalMode is not set to +** PAGER_JOURNALMODE_WAL. +** +** Return SQLITE_OK or an error code. +** +** The caller must hold a SHARED lock on the database file to call this +** function. Because an EXCLUSIVE lock on the db file is required to delete +** a WAL on a none-empty database, this ensures there is no race condition +** between the xAccess() below and an xDelete() being executed by some +** other connection. +*/ +static int pagerOpenWalIfPresent(Pager *pPager){ + int rc = SQLITE_OK; + assert( pPager->eState==PAGER_OPEN ); + assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock ); + + if( !pPager->tempFile ){ + int isWal; /* True if WAL file exists */ + Pgno nPage; /* Size of the database file */ + + rc = pagerPagecount(pPager, &nPage); + if( rc ) return rc; + if( nPage==0 ){ + rc = sqlite3OsDelete(pPager->pVfs, pPager->zWal, 0); + isWal = 0; + }else{ + rc = sqlite3OsAccess( + pPager->pVfs, pPager->zWal, SQLITE_ACCESS_EXISTS, &isWal + ); + } + if( rc==SQLITE_OK ){ + if( isWal ){ + testcase( sqlite3PcachePagecount(pPager->pPCache)==0 ); + rc = sqlite3PagerOpenWal(pPager, 0); + }else if( pPager->journalMode==PAGER_JOURNALMODE_WAL ){ + pPager->journalMode = PAGER_JOURNALMODE_DELETE; + } + } + } + return rc; +} +#endif + /* ** Playback savepoint pSavepoint. Or, if pSavepoint==NULL, then playback ** the entire master journal file. The case pSavepoint==NULL occurs when @@ -33410,7 +37928,8 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ int rc = SQLITE_OK; /* Return code */ Bitvec *pDone = 0; /* Bitvec to ensure pages played back only once */ - assert( pPager->state>=PAGER_SHARED ); + assert( pPager->eState!=PAGER_ERROR ); + assert( pPager->eState>=PAGER_WRITER_LOCKED ); /* Allocate a bitvec to use to store the set of pages rolled back */ if( pSavepoint ){ @@ -33424,6 +37943,11 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ ** being reverted was opened. */ pPager->dbSize = pSavepoint ? pSavepoint->nOrig : pPager->dbOrigSize; + pPager->changeCountDone = pPager->tempFile; + + if( !pSavepoint && pagerUseWal(pPager) ){ + return pagerRollbackWal(pPager); + } /* Use pPager->journalOff as the effective size of the main rollback ** journal. The actual file might be larger than this in @@ -33431,6 +37955,7 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ ** past pPager->journalOff is off-limits to us. */ szJ = pPager->journalOff; + assert( pagerUseWal(pPager)==0 || szJ==0 ); /* Begin by rolling back records from the main journal starting at ** PagerSavepoint.iOffset and continuing to the next journal header. @@ -33439,11 +37964,11 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ ** will be skipped automatically. Pages are added to pDone as they ** are played back. */ - if( pSavepoint ){ + if( pSavepoint && !pagerUseWal(pPager) ){ iHdrOff = pSavepoint->iHdrOffset ? pSavepoint->iHdrOffset : szJ; pPager->journalOff = pSavepoint->iOffset; while( rc==SQLITE_OK && pPager->journalOffjournalOff, 1, pDone); + rc = pager_playback_one_page(pPager, &pPager->journalOff, pDone, 1, 1); } assert( rc!=SQLITE_DONE ); }else{ @@ -33473,11 +37998,11 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ nJRec = (u32)((szJ - pPager->journalOff)/JOURNAL_PG_SZ(pPager)); } for(ii=0; rc==SQLITE_OK && iijournalOffjournalOff, 1, pDone); + rc = pager_playback_one_page(pPager, &pPager->journalOff, pDone, 1, 1); } assert( rc!=SQLITE_DONE ); } - assert( rc!=SQLITE_OK || pPager->journalOff==szJ ); + assert( rc!=SQLITE_OK || pPager->journalOff>=szJ ); /* Finally, rollback pages from the sub-journal. Page that were ** previously rolled back out of the main journal (and are hence in pDone) @@ -33486,9 +38011,13 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ if( pSavepoint ){ u32 ii; /* Loop counter */ i64 offset = pSavepoint->iSubRec*(4+pPager->pageSize); + + if( pagerUseWal(pPager) ){ + rc = sqlite3WalSavepointUndo(pPager->pWal, pSavepoint->aWalData); + } for(ii=pSavepoint->iSubRec; rc==SQLITE_OK && iinSubRec; ii++){ assert( offset==ii*(4+pPager->pageSize) ); - rc = pager_playback_one_page(pPager, 0, 0, &offset, 1, pDone); + rc = pager_playback_one_page(pPager, &offset, pDone, 0, 1); } assert( rc!=SQLITE_DONE ); } @@ -33497,6 +38026,7 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ if( rc==SQLITE_OK ){ pPager->journalOff = szJ; } + return rc; } @@ -33538,7 +38068,6 @@ SQLITE_PRIVATE void sqlite3PagerSetSafetyLevel(Pager *pPager, int level, int bFu pPager->noSync = (level==1 || pPager->tempFile) ?1:0; pPager->fullSync = (level==3 && !pPager->tempFile) ?1:0; pPager->sync_flags = (bFullFsync?SQLITE_SYNC_FULL:SQLITE_SYNC_NORMAL); - if( pPager->noSync ) pPager->needSync = 0; } #endif @@ -33614,28 +38143,13 @@ SQLITE_PRIVATE void sqlite3PagerSetBusyhandler( pPager->pBusyHandlerArg = pBusyHandlerArg; } -/* -** Report the current page size and number of reserved bytes back -** to the codec. -*/ -#ifdef SQLITE_HAS_CODEC -static void pagerReportSize(Pager *pPager){ - if( pPager->xCodecSizeChng ){ - pPager->xCodecSizeChng(pPager->pCodec, pPager->pageSize, - (int)pPager->nReserve); - } -} -#else -# define pagerReportSize(X) /* No-op if we do not support a codec */ -#endif - /* ** Change the page size used by the Pager object. The new page size ** is passed in *pPageSize. ** ** If the pager is in the error state when this function is called, it ** is a no-op. The value returned is the error state error code (i.e. -** one of SQLITE_IOERR, SQLITE_CORRUPT or SQLITE_FULL). +** one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL). ** ** Otherwise, if all of the following are true: ** @@ -33659,28 +38173,48 @@ static void pagerReportSize(Pager *pPager){ ** function was called, or because the memory allocation attempt failed, ** then *pPageSize is set to the old, retained page size before returning. */ -SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, u16 *pPageSize, int nReserve){ - int rc = pPager->errCode; +SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nReserve){ + int rc = SQLITE_OK; - if( rc==SQLITE_OK ){ - u16 pageSize = *pPageSize; - assert( pageSize==0 || (pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE) ); - if( (pPager->memDb==0 || pPager->dbSize==0) - && sqlite3PcacheRefCount(pPager->pPCache)==0 - && pageSize && pageSize!=pPager->pageSize - ){ - char *pNew = (char *)sqlite3PageMalloc(pageSize); - if( !pNew ){ - rc = SQLITE_NOMEM; - }else{ - pager_reset(pPager); - pPager->pageSize = pageSize; - sqlite3PageFree(pPager->pTmpSpace); - pPager->pTmpSpace = pNew; - sqlite3PcacheSetPageSize(pPager->pPCache, pageSize); - } + /* It is not possible to do a full assert_pager_state() here, as this + ** function may be called from within PagerOpen(), before the state + ** of the Pager object is internally consistent. + ** + ** At one point this function returned an error if the pager was in + ** PAGER_ERROR state. But since PAGER_ERROR state guarantees that + ** there is at least one outstanding page reference, this function + ** is a no-op for that case anyhow. + */ + + u32 pageSize = *pPageSize; + assert( pageSize==0 || (pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE) ); + if( (pPager->memDb==0 || pPager->dbSize==0) + && sqlite3PcacheRefCount(pPager->pPCache)==0 + && pageSize && pageSize!=(u32)pPager->pageSize + ){ + char *pNew = NULL; /* New temp space */ + i64 nByte = 0; + + if( pPager->eState>PAGER_OPEN && isOpen(pPager->fd) ){ + rc = sqlite3OsFileSize(pPager->fd, &nByte); } - *pPageSize = (u16)pPager->pageSize; + if( rc==SQLITE_OK ){ + pNew = (char *)sqlite3PageMalloc(pageSize); + if( !pNew ) rc = SQLITE_NOMEM; + } + + if( rc==SQLITE_OK ){ + pager_reset(pPager); + pPager->dbSize = (Pgno)(nByte/pageSize); + pPager->pageSize = pageSize; + sqlite3PageFree(pPager->pTmpSpace); + pPager->pTmpSpace = pNew; + sqlite3PcacheSetPageSize(pPager->pPCache, pageSize); + } + } + + *pPageSize = pPager->pageSize; + if( rc==SQLITE_OK ){ if( nReserve<0 ) nReserve = pPager->nReserve; assert( nReserve>=0 && nReserve<1000 ); pPager->nReserve = (i16)nReserve; @@ -33712,7 +38246,9 @@ SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager *pPager, int mxPage){ if( mxPage>0 ){ pPager->mxPgno = mxPage; } - sqlite3PagerPagecount(pPager, 0); + if( pPager->eState!=PAGER_OPEN && pPager->mxPgnodbSize ){ + pPager->mxPgno = pPager->dbSize; + } return pPager->mxPgno; } @@ -33758,6 +38294,13 @@ SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned cha int rc = SQLITE_OK; memset(pDest, 0, N); assert( isOpen(pPager->fd) || pPager->tempFile ); + + /* This routine is only called by btree immediately after creating + ** the Pager object. There has not been an opportunity to transition + ** to WAL mode yet. + */ + assert( !pagerUseWal(pPager) ); + if( isOpen(pPager->fd) ){ IOTRACE(("DBHDR %p 0 %d\n", pPager, N)) rc = sqlite3OsRead(pPager->fd, pDest, N, 0); @@ -33769,65 +38312,16 @@ SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned cha } /* -** Return the total number of pages in the database file associated -** with pPager. Normally, this is calculated as (/). +** This function may only be called when a read-transaction is open on +** the pager. It returns the total number of pages in the database. +** ** However, if the file is between 1 and bytes in size, then ** this is considered a 1 page file. -** -** If the pager is in error state when this function is called, then the -** error state error code is returned and *pnPage left unchanged. Or, -** if the file system has to be queried for the size of the file and -** the query attempt returns an IO error, the IO error code is returned -** and *pnPage is left unchanged. -** -** Otherwise, if everything is successful, then SQLITE_OK is returned -** and *pnPage is set to the number of pages in the database. */ -SQLITE_PRIVATE int sqlite3PagerPagecount(Pager *pPager, int *pnPage){ - Pgno nPage; /* Value to return via *pnPage */ - - /* If the pager is already in the error state, return the error code. */ - if( pPager->errCode ){ - return pPager->errCode; - } - - /* Determine the number of pages in the file. Store this in nPage. */ - if( pPager->dbSizeValid ){ - nPage = pPager->dbSize; - }else{ - int rc; /* Error returned by OsFileSize() */ - i64 n = 0; /* File size in bytes returned by OsFileSize() */ - - assert( isOpen(pPager->fd) || pPager->tempFile ); - if( isOpen(pPager->fd) && (0 != (rc = sqlite3OsFileSize(pPager->fd, &n))) ){ - pager_error(pPager, rc); - return rc; - } - if( n>0 && npageSize ){ - nPage = 1; - }else{ - nPage = (Pgno)(n / pPager->pageSize); - } - if( pPager->state!=PAGER_UNLOCK ){ - pPager->dbSize = nPage; - pPager->dbFileSize = nPage; - pPager->dbSizeValid = 1; - } - } - - /* If the current number of pages in the file is greater than the - ** configured maximum pager number, increase the allowed limit so - ** that the file can be read. - */ - if( nPage>pPager->mxPgno ){ - pPager->mxPgno = (Pgno)nPage; - } - - /* Set the output variable and return SQLITE_OK */ - if( pnPage ){ - *pnPage = nPage; - } - return SQLITE_OK; +SQLITE_PRIVATE void sqlite3PagerPagecount(Pager *pPager, int *pnPage){ + assert( pPager->eState>=PAGER_READER ); + assert( pPager->eState!=PAGER_WRITER_FINISHED ); + *pnPage = (int)pPager->dbSize; } @@ -33848,35 +38342,19 @@ SQLITE_PRIVATE int sqlite3PagerPagecount(Pager *pPager, int *pnPage){ static int pager_wait_on_lock(Pager *pPager, int locktype){ int rc; /* Return code */ - /* The OS lock values must be the same as the Pager lock values */ - assert( PAGER_SHARED==SHARED_LOCK ); - assert( PAGER_RESERVED==RESERVED_LOCK ); - assert( PAGER_EXCLUSIVE==EXCLUSIVE_LOCK ); - - /* If the file is currently unlocked then the size must be unknown */ - assert( pPager->state>=PAGER_SHARED || pPager->dbSizeValid==0 ); - /* Check that this is either a no-op (because the requested lock is ** already held, or one of the transistions that the busy-handler ** may be invoked during, according to the comment above ** sqlite3PagerSetBusyhandler(). */ - assert( (pPager->state>=locktype) - || (pPager->state==PAGER_UNLOCK && locktype==PAGER_SHARED) - || (pPager->state==PAGER_RESERVED && locktype==PAGER_EXCLUSIVE) + assert( (pPager->eLock>=locktype) + || (pPager->eLock==NO_LOCK && locktype==SHARED_LOCK) + || (pPager->eLock==RESERVED_LOCK && locktype==EXCLUSIVE_LOCK) ); - if( pPager->state>=locktype ){ - rc = SQLITE_OK; - }else{ - do { - rc = sqlite3OsLock(pPager->fd, locktype); - }while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) ); - if( rc==SQLITE_OK ){ - pPager->state = (u8)locktype; - IOTRACE(("LOCK %p %d\n", pPager, locktype)) - } - } + do { + rc = pagerLockDb(pPager, locktype); + }while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) ); return rc; } @@ -33921,13 +38399,38 @@ static void assertTruncateConstraint(Pager *pPager){ ** truncation will be done when the current transaction is committed. */ SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){ - assert( pPager->dbSizeValid ); assert( pPager->dbSize>=nPage ); - assert( pPager->state>=PAGER_RESERVED ); + assert( pPager->eState>=PAGER_WRITER_CACHEMOD ); pPager->dbSize = nPage; assertTruncateConstraint(pPager); } + +/* +** This function is called before attempting a hot-journal rollback. It +** syncs the journal file to disk, then sets pPager->journalHdr to the +** size of the journal file so that the pager_playback() routine knows +** that the entire journal file has been synced. +** +** Syncing a hot-journal to disk before attempting to roll it back ensures +** that if a power-failure occurs during the rollback, the process that +** attempts rollback following system recovery sees the same journal +** content as this process. +** +** If everything goes as planned, SQLITE_OK is returned. Otherwise, +** an SQLite error code. +*/ +static int pagerSyncHotJournal(Pager *pPager){ + int rc = SQLITE_OK; + if( !pPager->noSync ){ + rc = sqlite3OsSync(pPager->jfd, SQLITE_SYNC_NORMAL); + } + if( rc==SQLITE_OK ){ + rc = sqlite3OsFileSize(pPager->jfd, &pPager->journalHdr); + } + return rc; +} + /* ** Shutdown the page cache. Free all memory and close all files. ** @@ -33943,29 +38446,46 @@ SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){ ** to the caller. */ SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager){ + u8 *pTmp = (u8 *)pPager->pTmpSpace; + disable_simulated_io_errors(); sqlite3BeginBenignMalloc(); - pPager->errCode = 0; + /* pPager->errCode = 0; */ pPager->exclusiveMode = 0; +#ifndef SQLITE_OMIT_WAL + sqlite3WalClose(pPager->pWal, + (pPager->noSync ? 0 : pPager->sync_flags), + pPager->pageSize, pTmp + ); + pPager->pWal = 0; +#endif pager_reset(pPager); if( MEMDB ){ pager_unlock(pPager); }else{ - /* Set Pager.journalHdr to -1 for the benefit of the pager_playback() - ** call which may be made from within pagerUnlockAndRollback(). If it - ** is not -1, then the unsynced portion of an open journal file may - ** be played back into the database. If a power failure occurs while - ** this is happening, the database may become corrupt. + /* If it is open, sync the journal file before calling UnlockAndRollback. + ** If this is not done, then an unsynced portion of the open journal + ** file may be played back into the database. If a power failure occurs + ** while this is happening, the database could become corrupt. + ** + ** If an error occurs while trying to sync the journal, shift the pager + ** into the ERROR state. This causes UnlockAndRollback to unlock the + ** database and close the journal file without attempting to roll it + ** back or finalize it. The next database user will have to do hot-journal + ** rollback before accessing the database file. */ - pPager->journalHdr = -1; + if( isOpen(pPager->jfd) ){ + pager_error(pPager, pagerSyncHotJournal(pPager)); + } pagerUnlockAndRollback(pPager); } sqlite3EndBenignMalloc(); enable_simulated_io_errors(); PAGERTRACE(("CLOSE %d\n", PAGERID(pPager))); IOTRACE(("CLOSE %p\n", pPager)) + sqlite3OsClose(pPager->jfd); sqlite3OsClose(pPager->fd); - sqlite3PageFree(pPager->pTmpSpace); + sqlite3PageFree(pTmp); sqlite3PcacheClose(pPager->pPCache); #ifdef SQLITE_HAS_CODEC @@ -34000,9 +38520,9 @@ SQLITE_PRIVATE void sqlite3PagerRef(DbPage *pPg){ ** been written to the journal have actually reached the surface of the ** disk and can be restored in the event of a hot-journal rollback. ** -** If the Pager.needSync flag is not set, then this function is a -** no-op. Otherwise, the actions required depend on the journal-mode -** and the device characteristics of the the file-system, as follows: +** If the Pager.noSync flag is set, then this function is a no-op. +** Otherwise, the actions required depend on the journal-mode and the +** device characteristics of the the file-system, as follows: ** ** * If the journal file is an in-memory journal file, no action need ** be taken. @@ -34026,18 +38546,25 @@ SQLITE_PRIVATE void sqlite3PagerRef(DbPage *pPg){ ** if( NOT SEQUENTIAL ) xSync(); ** } ** -** The Pager.needSync flag is never be set for temporary files, or any -** file operating in no-sync mode (Pager.noSync set to non-zero). -** ** If successful, this routine clears the PGHDR_NEED_SYNC flag of every ** page currently held in memory before returning SQLITE_OK. If an IO ** error is encountered, then the IO error code is returned to the caller. */ -static int syncJournal(Pager *pPager){ - if( pPager->needSync ){ +static int syncJournal(Pager *pPager, int newHdr){ + int rc; /* Return code */ + + assert( pPager->eState==PAGER_WRITER_CACHEMOD + || pPager->eState==PAGER_WRITER_DBMOD + ); + assert( assert_pager_state(pPager) ); + assert( !pagerUseWal(pPager) ); + + rc = sqlite3PagerExclusiveLock(pPager); + if( rc!=SQLITE_OK ) return rc; + + if( !pPager->noSync ){ assert( !pPager->tempFile ); - if( pPager->journalMode!=PAGER_JOURNALMODE_MEMORY ){ - int rc; /* Return code */ + if( isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_MEMORY ){ const int iDc = sqlite3OsDeviceCharacteristics(pPager->fd); assert( isOpen(pPager->jfd) ); @@ -34047,7 +38574,7 @@ static int syncJournal(Pager *pPager){ ** mode, then the journal file may at this point actually be larger ** than Pager.journalOff bytes. If the next thing in the journal ** file happens to be a journal-header (written as part of the - ** previous connections transaction), and a crash or power-failure + ** previous connection's transaction), and a crash or power-failure ** occurs after nRec is updated but before this connection writes ** anything else to the journal file (or commits/rolls back its ** transaction), then SQLite may become confused when doing the @@ -34066,10 +38593,10 @@ static int syncJournal(Pager *pPager){ */ i64 iNextHdrOffset; u8 aMagic[8]; - u8 zHeader[sizeof(aJournalMagic)+4]; + u8 zHeader[sizeof(aJournalMagic)+4]; - memcpy(zHeader, aJournalMagic, sizeof(aJournalMagic)); - put32bits(&zHeader[sizeof(aJournalMagic)], pPager->nRec); + memcpy(zHeader, aJournalMagic, sizeof(aJournalMagic)); + put32bits(&zHeader[sizeof(aJournalMagic)], pPager->nRec); iNextHdrOffset = journalHdrOffset(pPager); rc = sqlite3OsRead(pPager->jfd, aMagic, 8, iNextHdrOffset); @@ -34101,7 +38628,7 @@ static int syncJournal(Pager *pPager){ IOTRACE(("JHDR %p %lld\n", pPager, pPager->journalHdr)); rc = sqlite3OsWrite( pPager->jfd, zHeader, sizeof(zHeader), pPager->journalHdr - ); + ); if( rc!=SQLITE_OK ) return rc; } if( 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ @@ -34112,16 +38639,25 @@ static int syncJournal(Pager *pPager){ ); if( rc!=SQLITE_OK ) return rc; } - } - /* The journal file was just successfully synced. Set Pager.needSync - ** to zero and clear the PGHDR_NEED_SYNC flag on all pagess. - */ - pPager->needSync = 0; - pPager->journalStarted = 1; - sqlite3PcacheClearSyncFlags(pPager->pPCache); + pPager->journalHdr = pPager->journalOff; + if( newHdr && 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){ + pPager->nRec = 0; + rc = writeJournalHdr(pPager); + if( rc!=SQLITE_OK ) return rc; + } + }else{ + pPager->journalHdr = pPager->journalOff; + } } + /* Unless the pager is in noSync mode, the journal file was just + ** successfully synced. Either way, clear the PGHDR_NEED_SYNC flag on + ** all pages. + */ + sqlite3PcacheClearSyncFlags(pPager->pPCache); + pPager->eState = PAGER_WRITER_DBMOD; + assert( assert_pager_state(pPager) ); return SQLITE_OK; } @@ -34157,31 +38693,13 @@ static int syncJournal(Pager *pPager){ ** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot ** be obtained, SQLITE_BUSY is returned. */ -static int pager_write_pagelist(PgHdr *pList){ - Pager *pPager; /* Pager object */ - int rc; /* Return code */ +static int pager_write_pagelist(Pager *pPager, PgHdr *pList){ + int rc = SQLITE_OK; /* Return code */ - if( NEVER(pList==0) ) return SQLITE_OK; - pPager = pList->pPager; - - /* At this point there may be either a RESERVED or EXCLUSIVE lock on the - ** database file. If there is already an EXCLUSIVE lock, the following - ** call is a no-op. - ** - ** Moving the lock from RESERVED to EXCLUSIVE actually involves going - ** through an intermediate state PENDING. A PENDING lock prevents new - ** readers from attaching to the database but is unsufficient for us to - ** write. The idea of a PENDING lock is to prevent new readers from - ** coming in while we wait for existing readers to clear. - ** - ** While the pager is in the RESERVED state, the original database file - ** is unchanged and we can rollback without having to playback the - ** journal into the original database file. Once we transition to - ** EXCLUSIVE, it means the database file has been changed and any rollback - ** will require a journal playback. - */ - assert( pPager->state>=PAGER_RESERVED ); - rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); + /* This function is only called for rollback pagers in WRITER_DBMOD state. */ + assert( !pagerUseWal(pPager) ); + assert( pPager->eState==PAGER_WRITER_DBMOD ); + assert( pPager->eLock==EXCLUSIVE_LOCK ); /* If the file is a temp-file has not yet been opened, open it now. It ** is not possible for rc to be other than SQLITE_OK if this branch @@ -34192,6 +38710,16 @@ static int pager_write_pagelist(PgHdr *pList){ rc = pagerOpentemp(pPager, pPager->fd, pPager->vfsFlags); } + /* Before the first write, give the VFS a hint of what the final + ** file size will be. + */ + assert( rc!=SQLITE_OK || isOpen(pPager->fd) ); + if( rc==SQLITE_OK && pPager->dbSize>pPager->dbHintSize ){ + sqlite3_int64 szFile = pPager->pageSize * (sqlite3_int64)pPager->dbSize; + sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &szFile); + pPager->dbHintSize = pPager->dbSize; + } + while( rc==SQLITE_OK && pList ){ Pgno pgno = pList->pgno; @@ -34207,6 +38735,8 @@ static int pager_write_pagelist(PgHdr *pList){ i64 offset = (pgno-1)*(i64)pPager->pageSize; /* Offset to write */ char *pData; /* Data to write */ + assert( (pList->flags&PGHDR_NEED_SYNC)==0 ); + /* Encode the database */ CODEC2(pPager, pList->pData, pgno, 6, return SQLITE_NOMEM, pData); @@ -34235,15 +38765,33 @@ static int pager_write_pagelist(PgHdr *pList){ }else{ PAGERTRACE(("NOSTORE %d page %d\n", PAGERID(pPager), pgno)); } -#ifdef SQLITE_CHECK_PAGES - pList->pageHash = pager_pagehash(pList); -#endif + pager_set_pagehash(pList); pList = pList->pDirty; } return rc; } +/* +** Ensure that the sub-journal file is open. If it is already open, this +** function is a no-op. +** +** SQLITE_OK is returned if everything goes according to plan. An +** SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen() +** fails. +*/ +static int openSubJournal(Pager *pPager){ + int rc = SQLITE_OK; + if( !isOpen(pPager->sjfd) ){ + if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){ + sqlite3MemJournalOpen(pPager->sjfd); + }else{ + rc = pagerOpentemp(pPager, pPager->sjfd, SQLITE_OPEN_SUBJOURNAL); + } + } + return rc; +} + /* ** Append a record of the current state of page pPg to the sub-journal. ** It is the callers responsibility to use subjRequiresPage() to check @@ -34260,18 +38808,31 @@ static int pager_write_pagelist(PgHdr *pList){ static int subjournalPage(PgHdr *pPg){ int rc = SQLITE_OK; Pager *pPager = pPg->pPager; - if( isOpen(pPager->sjfd) ){ - void *pData = pPg->pData; - i64 offset = pPager->nSubRec*(4+pPager->pageSize); - char *pData2; + if( pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ - CODEC2(pPager, pData, pPg->pgno, 7, return SQLITE_NOMEM, pData2); - PAGERTRACE(("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno)); - - assert( pageInJournal(pPg) || pPg->pgno>pPager->dbOrigSize ); - rc = write32bits(pPager->sjfd, offset, pPg->pgno); + /* Open the sub-journal, if it has not already been opened */ + assert( pPager->useJournal ); + assert( isOpen(pPager->jfd) || pagerUseWal(pPager) ); + assert( isOpen(pPager->sjfd) || pPager->nSubRec==0 ); + assert( pagerUseWal(pPager) + || pageInJournal(pPg) + || pPg->pgno>pPager->dbOrigSize + ); + rc = openSubJournal(pPager); + + /* If the sub-journal was opened successfully (or was already open), + ** write the journal record into the file. */ if( rc==SQLITE_OK ){ - rc = sqlite3OsWrite(pPager->sjfd, pData2, pPager->pageSize, offset+4); + void *pData = pPg->pData; + i64 offset = pPager->nSubRec*(4+pPager->pageSize); + char *pData2; + + CODEC2(pPager, pData, pPg->pgno, 7, return SQLITE_NOMEM, pData2); + PAGERTRACE(("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno)); + rc = write32bits(pPager->sjfd, offset, pPg->pgno); + if( rc==SQLITE_OK ){ + rc = sqlite3OsWrite(pPager->sjfd, pData2, pPager->pageSize, offset+4); + } } } if( rc==SQLITE_OK ){ @@ -34282,7 +38843,6 @@ static int subjournalPage(PgHdr *pPg){ return rc; } - /* ** This function is called by the pcache layer when it has reached some ** soft memory limit. The first argument is a pointer to a Pager object @@ -34309,74 +38869,83 @@ static int pagerStress(void *p, PgHdr *pPg){ assert( pPg->pPager==pPager ); assert( pPg->flags&PGHDR_DIRTY ); - /* The doNotSync flag is set by the sqlite3PagerWrite() function while it - ** is journalling a set of two or more database pages that are stored - ** on the same disk sector. Syncing the journal is not allowed while - ** this is happening as it is important that all members of such a - ** set of pages are synced to disk together. So, if the page this function - ** is trying to make clean will require a journal sync and the doNotSync - ** flag is set, return without doing anything. The pcache layer will - ** just have to go ahead and allocate a new page buffer instead of - ** reusing pPg. + /* The doNotSyncSpill flag is set during times when doing a sync of + ** journal (and adding a new header) is not allowed. This occurs + ** during calls to sqlite3PagerWrite() while trying to journal multiple + ** pages belonging to the same sector. ** - ** Similarly, if the pager has already entered the error state, do not - ** try to write the contents of pPg to disk. + ** The doNotSpill flag inhibits all cache spilling regardless of whether + ** or not a sync is required. This is set during a rollback. + ** + ** Spilling is also prohibited when in an error state since that could + ** lead to database corruption. In the current implementaton it + ** is impossible for sqlite3PCacheFetch() to be called with createFlag==1 + ** while in the error state, hence it is impossible for this routine to + ** be called in the error state. Nevertheless, we include a NEVER() + ** test for the error state as a safeguard against future changes. */ - if( NEVER(pPager->errCode) - || (pPager->doNotSync && pPg->flags&PGHDR_NEED_SYNC) - ){ + if( NEVER(pPager->errCode) ) return SQLITE_OK; + if( pPager->doNotSpill ) return SQLITE_OK; + if( pPager->doNotSyncSpill && (pPg->flags & PGHDR_NEED_SYNC)!=0 ){ return SQLITE_OK; } - /* Sync the journal file if required. */ - if( pPg->flags&PGHDR_NEED_SYNC ){ - rc = syncJournal(pPager); - if( rc==SQLITE_OK && pPager->fullSync && - !(pPager->journalMode==PAGER_JOURNALMODE_MEMORY) && - !(sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) - ){ - pPager->nRec = 0; - rc = writeJournalHdr(pPager); + pPg->pDirty = 0; + if( pagerUseWal(pPager) ){ + /* Write a single frame for this page to the log. */ + if( subjRequiresPage(pPg) ){ + rc = subjournalPage(pPg); + } + if( rc==SQLITE_OK ){ + rc = pagerWalFrames(pPager, pPg, 0, 0, 0); + } + }else{ + + /* Sync the journal file if required. */ + if( pPg->flags&PGHDR_NEED_SYNC + || pPager->eState==PAGER_WRITER_CACHEMOD + ){ + rc = syncJournal(pPager, 1); + } + + /* If the page number of this page is larger than the current size of + ** the database image, it may need to be written to the sub-journal. + ** This is because the call to pager_write_pagelist() below will not + ** actually write data to the file in this case. + ** + ** Consider the following sequence of events: + ** + ** BEGIN; + ** + ** + ** SAVEPOINT sp; + ** + ** pagerStress(page X) + ** ROLLBACK TO sp; + ** + ** If (X>Y), then when pagerStress is called page X will not be written + ** out to the database file, but will be dropped from the cache. Then, + ** following the "ROLLBACK TO sp" statement, reading page X will read + ** data from the database file. This will be the copy of page X as it + ** was when the transaction started, not as it was when "SAVEPOINT sp" + ** was executed. + ** + ** The solution is to write the current data for page X into the + ** sub-journal file now (if it is not already there), so that it will + ** be restored to its current value when the "ROLLBACK TO sp" is + ** executed. + */ + if( NEVER( + rc==SQLITE_OK && pPg->pgno>pPager->dbSize && subjRequiresPage(pPg) + ) ){ + rc = subjournalPage(pPg); + } + + /* Write the contents of the page out to the database file. */ + if( rc==SQLITE_OK ){ + assert( (pPg->flags&PGHDR_NEED_SYNC)==0 ); + rc = pager_write_pagelist(pPager, pPg); } - } - - /* If the page number of this page is larger than the current size of - ** the database image, it may need to be written to the sub-journal. - ** This is because the call to pager_write_pagelist() below will not - ** actually write data to the file in this case. - ** - ** Consider the following sequence of events: - ** - ** BEGIN; - ** - ** - ** SAVEPOINT sp; - ** - ** pagerStress(page X) - ** ROLLBACK TO sp; - ** - ** If (X>Y), then when pagerStress is called page X will not be written - ** out to the database file, but will be dropped from the cache. Then, - ** following the "ROLLBACK TO sp" statement, reading page X will read - ** data from the database file. This will be the copy of page X as it - ** was when the transaction started, not as it was when "SAVEPOINT sp" - ** was executed. - ** - ** The solution is to write the current data for page X into the - ** sub-journal file now (if it is not already there), so that it will - ** be restored to its current value when the "ROLLBACK TO sp" is - ** executed. - */ - if( NEVER( - rc==SQLITE_OK && pPg->pgno>pPager->dbSize && subjRequiresPage(pPg) - ) ){ - rc = subjournalPage(pPg); - } - - /* Write the contents of the page out to the database file. */ - if( rc==SQLITE_OK ){ - pPg->pDirty = 0; - rc = pager_write_pagelist(pPg); } /* Mark the page as clean. */ @@ -34385,7 +38954,7 @@ static int pagerStress(void *p, PgHdr *pPg){ sqlite3PcacheMakeClean(pPg); } - return pager_error(pPager, rc); + return pager_error(pPager, rc); } @@ -34440,7 +39009,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen( int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */ int noReadlock = (flags & PAGER_NO_READLOCK)!=0; /* True to omit read-lock */ int pcacheSize = sqlite3PcacheSize(); /* Bytes to allocate for PCache */ - u16 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */ + u32 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */ /* Figure out how much space is required for each journal file-handle ** (there are two of them, the main journal and the sub-journal). This @@ -34459,6 +39028,13 @@ SQLITE_PRIVATE int sqlite3PagerOpen( /* Set the output variable to NULL in case an error occurs. */ *ppPager = 0; +#ifndef SQLITE_OMIT_MEMORYDB + if( flags & PAGER_MEMORY ){ + memDb = 1; + zFilename = 0; + } +#endif + /* Compute and store the full pathname in an allocated buffer pointed ** to by zPathname, length nPathname. Or, if this is a temporary file, ** leave both nPathname and zPathname set to 0. @@ -34469,17 +39045,8 @@ SQLITE_PRIVATE int sqlite3PagerOpen( if( zPathname==0 ){ return SQLITE_NOMEM; } -#ifndef SQLITE_OMIT_MEMORYDB - if( strcmp(zFilename,":memory:")==0 ){ - memDb = 1; - zPathname[0] = 0; - }else -#endif - { - zPathname[0] = 0; /* Make sure initialized even if FullPathname() fails */ - rc = sqlite3OsFullPathname(pVfs, zFilename, nPathname, zPathname); - } - + zPathname[0] = 0; /* Make sure initialized even if FullPathname() fails */ + rc = sqlite3OsFullPathname(pVfs, zFilename, nPathname, zPathname); nPathname = sqlite3Strlen30(zPathname); if( rc==SQLITE_OK && nPathname+8>pVfs->mxPathname ){ /* This branch is taken when the journal path required by @@ -34488,7 +39055,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen( ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = SQLITE_CANTOPEN; + rc = SQLITE_CANTOPEN_BKPT; } if( rc!=SQLITE_OK ){ sqlite3_free(zPathname); @@ -34515,6 +39082,9 @@ SQLITE_PRIVATE int sqlite3PagerOpen( journalFileSize * 2 + /* The two journal files */ nPathname + 1 + /* zFilename */ nPathname + 8 + 1 /* zJournal */ +#ifndef SQLITE_OMIT_WAL + + nPathname + 4 + 1 /* zWal */ +#endif ); assert( EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize)) ); if( !pPtr ){ @@ -34531,11 +39101,16 @@ SQLITE_PRIVATE int sqlite3PagerOpen( /* Fill in the Pager.zFilename and Pager.zJournal buffers, if required. */ if( zPathname ){ + assert( nPathname>0 ); pPager->zJournal = (char*)(pPtr += nPathname + 1); memcpy(pPager->zFilename, zPathname, nPathname); memcpy(pPager->zJournal, zPathname, nPathname); memcpy(&pPager->zJournal[nPathname], "-journal", 8); - if( pPager->zFilename[0]==0 ) pPager->zJournal[0] = 0; +#ifndef SQLITE_OMIT_WAL + pPager->zWal = &pPager->zJournal[nPathname+8+1]; + memcpy(pPager->zWal, zPathname, nPathname); + memcpy(&pPager->zWal[nPathname], "-wal", 4); +#endif sqlite3_free(zPathname); } pPager->pVfs = pVfs; @@ -34543,9 +39118,10 @@ SQLITE_PRIVATE int sqlite3PagerOpen( /* Open the pager file. */ - if( zFilename && zFilename[0] && !memDb ){ + if( zFilename && zFilename[0] ){ int fout = 0; /* VFS flags returned by xOpen() */ rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, vfsFlags, &fout); + assert( !memDb ); readOnly = (fout&SQLITE_OPEN_READONLY); /* If the file was successfully opened for read/write access, @@ -34563,7 +39139,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen( if( pPager->sectorSize>SQLITE_MAX_DEFAULT_PAGE_SIZE ){ szPageDflt = SQLITE_MAX_DEFAULT_PAGE_SIZE; }else{ - szPageDflt = (u16)pPager->sectorSize; + szPageDflt = (u32)pPager->sectorSize; } } #ifdef SQLITE_ENABLE_ATOMIC_WRITE @@ -34591,7 +39167,8 @@ SQLITE_PRIVATE int sqlite3PagerOpen( ** disk and uses an in-memory rollback journal. */ tempFile = 1; - pPager->state = PAGER_EXCLUSIVE; + pPager->eState = PAGER_READER; + pPager->eLock = EXCLUSIVE_LOCK; readOnly = (vfsFlags&SQLITE_OPEN_READONLY); } @@ -34628,13 +39205,14 @@ SQLITE_PRIVATE int sqlite3PagerOpen( /* pPager->stmtOpen = 0; */ /* pPager->stmtInUse = 0; */ /* pPager->nRef = 0; */ - pPager->dbSizeValid = (u8)memDb; /* pPager->stmtSize = 0; */ /* pPager->stmtJSize = 0; */ /* pPager->nPage = 0; */ pPager->mxPgno = SQLITE_MAX_PAGE_COUNT; /* pPager->state = PAGER_UNLOCK; */ +#if 0 assert( pPager->state == (tempFile ? PAGER_EXCLUSIVE : PAGER_UNLOCK) ); +#endif /* pPager->errMask = 0; */ pPager->tempFile = (u8)tempFile; assert( tempFile==PAGER_LOCKINGMODE_NORMAL @@ -34644,7 +39222,6 @@ SQLITE_PRIVATE int sqlite3PagerOpen( pPager->changeCountDone = pPager->tempFile; pPager->memDb = (u8)memDb; pPager->readOnly = (u8)readOnly; - /* pPager->needSync = 0; */ assert( useJournal || pPager->tempFile ); pPager->noSync = pPager->tempFile; pPager->fullSync = pPager->noSync ?0:1; @@ -34665,6 +39242,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen( /* pPager->pBusyHandlerArg = 0; */ pPager->xReiniter = xReinit; /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ + *ppPager = pPager; return SQLITE_OK; } @@ -34704,19 +39282,24 @@ SQLITE_PRIVATE int sqlite3PagerOpen( */ static int hasHotJournal(Pager *pPager, int *pExists){ sqlite3_vfs * const pVfs = pPager->pVfs; - int rc; /* Return code */ - int exists; /* True if a journal file is present */ + int rc = SQLITE_OK; /* Return code */ + int exists = 1; /* True if a journal file is present */ + int jrnlOpen = !!isOpen(pPager->jfd); - assert( pPager!=0 ); assert( pPager->useJournal ); assert( isOpen(pPager->fd) ); - assert( !isOpen(pPager->jfd) ); - assert( pPager->state <= PAGER_SHARED ); + assert( pPager->eState==PAGER_OPEN ); + + assert( jrnlOpen==0 || ( sqlite3OsDeviceCharacteristics(pPager->jfd) & + SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN + )); *pExists = 0; - rc = sqlite3OsAccess(pVfs, pPager->zJournal, SQLITE_ACCESS_EXISTS, &exists); + if( !jrnlOpen ){ + rc = sqlite3OsAccess(pVfs, pPager->zJournal, SQLITE_ACCESS_EXISTS, &exists); + } if( rc==SQLITE_OK && exists ){ - int locked; /* True if some process holds a RESERVED lock */ + int locked = 0; /* True if some process holds a RESERVED lock */ /* Race condition here: Another process might have been holding the ** the RESERVED lock and have a journal open at the sqlite3OsAccess() @@ -34728,7 +39311,7 @@ static int hasHotJournal(Pager *pPager, int *pExists){ */ rc = sqlite3OsCheckReservedLock(pPager->fd, &locked); if( rc==SQLITE_OK && !locked ){ - int nPage; + Pgno nPage; /* Number of pages in database file */ /* Check the size of the database file. If it consists of 0 pages, ** then delete the journal file. See the header comment above for @@ -34736,13 +39319,13 @@ static int hasHotJournal(Pager *pPager, int *pExists){ ** a RESERVED lock to avoid race conditions and to avoid violating ** [H33020]. */ - rc = sqlite3PagerPagecount(pPager, &nPage); + rc = pagerPagecount(pPager, &nPage); if( rc==SQLITE_OK ){ if( nPage==0 ){ sqlite3BeginBenignMalloc(); - if( sqlite3OsLock(pPager->fd, RESERVED_LOCK)==SQLITE_OK ){ + if( pagerLockDb(pPager, RESERVED_LOCK)==SQLITE_OK ){ sqlite3OsDelete(pVfs, pPager->zJournal, 0); - sqlite3OsUnlock(pPager->fd, SHARED_LOCK); + pagerUnlockDb(pPager, SHARED_LOCK); } sqlite3EndBenignMalloc(); }else{ @@ -34752,15 +39335,19 @@ static int hasHotJournal(Pager *pPager, int *pExists){ ** If there is, then we consider this journal to be hot. If not, ** it can be ignored. */ - int f = SQLITE_OPEN_READONLY|SQLITE_OPEN_MAIN_JOURNAL; - rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, f, &f); + if( !jrnlOpen ){ + int f = SQLITE_OPEN_READONLY|SQLITE_OPEN_MAIN_JOURNAL; + rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, f, &f); + } if( rc==SQLITE_OK ){ u8 first = 0; rc = sqlite3OsRead(pPager->jfd, (void *)&first, 1, 0); if( rc==SQLITE_IOERR_SHORT_READ ){ rc = SQLITE_OK; } - sqlite3OsClose(pPager->jfd); + if( !jrnlOpen ){ + sqlite3OsClose(pPager->jfd); + } *pExists = (first!=0); }else if( rc==SQLITE_CANTOPEN ){ /* If we cannot open the rollback journal file in order to see if @@ -34783,51 +39370,6 @@ static int hasHotJournal(Pager *pPager, int *pExists){ return rc; } -/* -** Read the content for page pPg out of the database file and into -** pPg->pData. A shared lock or greater must be held on the database -** file before this function is called. -** -** If page 1 is read, then the value of Pager.dbFileVers[] is set to -** the value read from the database file. -** -** If an IO error occurs, then the IO error is returned to the caller. -** Otherwise, SQLITE_OK is returned. -*/ -static int readDbPage(PgHdr *pPg){ - Pager *pPager = pPg->pPager; /* Pager object associated with page pPg */ - Pgno pgno = pPg->pgno; /* Page number to read */ - int rc; /* Return code */ - i64 iOffset; /* Byte offset of file to read from */ - - assert( pPager->state>=PAGER_SHARED && !MEMDB ); - assert( isOpen(pPager->fd) ); - - if( NEVER(!isOpen(pPager->fd)) ){ - assert( pPager->tempFile ); - memset(pPg->pData, 0, pPager->pageSize); - return SQLITE_OK; - } - iOffset = (pgno-1)*(i64)pPager->pageSize; - rc = sqlite3OsRead(pPager->fd, pPg->pData, pPager->pageSize, iOffset); - if( rc==SQLITE_IOERR_SHORT_READ ){ - rc = SQLITE_OK; - } - if( pgno==1 ){ - u8 *dbFileVers = &((u8*)pPg->pData)[24]; - memcpy(&pPager->dbFileVers, dbFileVers, sizeof(pPager->dbFileVers)); - } - CODEC1(pPager, pPg->pData, pgno, 3, rc = SQLITE_NOMEM); - - PAGER_INCR(sqlite3_pager_readdb_count); - PAGER_INCR(pPager->nRead); - IOTRACE(("PGIN %p %d\n", pPager, pgno)); - PAGERTRACE(("FETCH %d page %d hash(%08x)\n", - PAGERID(pPager), pgno, pager_pagehash(pPg))); - - return rc; -} - /* ** This function is called to obtain a shared lock on the database file. ** It is illegal to call sqlite3PagerAcquire() until after this function @@ -34836,7 +39378,7 @@ static int readDbPage(PgHdr *pPg){ ** ** The following operations are also performed by this function. ** -** 1) If the pager is currently in PAGER_UNLOCK state (no lock held +** 1) If the pager is currently in PAGER_OPEN state (no lock held ** on the database file), then an attempt is made to obtain a ** SHARED lock on the database file. Immediately after obtaining ** the SHARED lock, the file-system is checked for a hot-journal, @@ -34851,64 +39393,47 @@ static int readDbPage(PgHdr *pPg){ ** the contents of the page cache and rolling back any open journal ** file. ** -** If the operation described by (2) above is not attempted, and if the -** pager is in an error state other than SQLITE_FULL when this is called, -** the error state error code is returned. It is permitted to read the -** database when in SQLITE_FULL error state. -** -** Otherwise, if everything is successful, SQLITE_OK is returned. If an -** IO error occurs while locking the database, checking for a hot-journal -** file or rolling back a journal file, the IO error code is returned. +** If everything is successful, SQLITE_OK is returned. If an IO error +** occurs while locking the database, checking for a hot-journal file or +** rolling back a journal file, the IO error code is returned. */ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ int rc = SQLITE_OK; /* Return code */ - int isErrorReset = 0; /* True if recovering from error state */ /* This routine is only called from b-tree and only when there are no - ** outstanding pages */ + ** outstanding pages. This implies that the pager state should either + ** be OPEN or READER. READER is only possible if the pager is or was in + ** exclusive access mode. + */ assert( sqlite3PcacheRefCount(pPager->pPCache)==0 ); + assert( assert_pager_state(pPager) ); + assert( pPager->eState==PAGER_OPEN || pPager->eState==PAGER_READER ); if( NEVER(MEMDB && pPager->errCode) ){ return pPager->errCode; } - /* If this database is in an error-state, now is a chance to clear - ** the error. Discard the contents of the pager-cache and rollback - ** any hot journal in the file-system. - */ - if( pPager->errCode ){ - if( isOpen(pPager->jfd) || pPager->zJournal ){ - isErrorReset = 1; - } - pPager->errCode = SQLITE_OK; - pager_reset(pPager); - } + if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){ + int bHotJournal = 1; /* True if there exists a hot journal-file */ - if( pPager->state==PAGER_UNLOCK || isErrorReset ){ - sqlite3_vfs * const pVfs = pPager->pVfs; - int isHotJournal = 0; assert( !MEMDB ); - assert( sqlite3PcacheRefCount(pPager->pPCache)==0 ); - if( pPager->noReadlock ){ - assert( pPager->readOnly ); - pPager->state = PAGER_SHARED; - }else{ + assert( pPager->noReadlock==0 || pPager->readOnly ); + + if( pPager->noReadlock==0 ){ rc = pager_wait_on_lock(pPager, SHARED_LOCK); if( rc!=SQLITE_OK ){ - assert( pPager->state==PAGER_UNLOCK ); - return pager_error(pPager, rc); + assert( pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK ); + goto failed; } } - assert( pPager->state>=SHARED_LOCK ); /* If a journal file exists, and there is no RESERVED lock on the ** database file, then it either needs to be played back or deleted. */ - if( !isErrorReset ){ - assert( pPager->state <= PAGER_SHARED ); - rc = hasHotJournal(pPager, &isHotJournal); - if( rc!=SQLITE_OK ){ - goto failed; - } + if( pPager->eLock<=SHARED_LOCK ){ + rc = hasHotJournal(pPager, &bHotJournal); } - if( isErrorReset || isHotJournal ){ + if( rc!=SQLITE_OK ){ + goto failed; + } + if( bHotJournal ){ /* Get an EXCLUSIVE lock on the database file. At this point it is ** important that a RESERVED lock is not obtained on the way to the ** EXCLUSIVE lock. If it were, another process might open the @@ -34920,74 +39445,95 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ ** other process attempting to access the database file will get to ** this point in the code and fail to obtain its own EXCLUSIVE lock ** on the database file. + ** + ** Unless the pager is in locking_mode=exclusive mode, the lock is + ** downgraded to SHARED_LOCK before this function returns. */ - if( pPager->statefd, EXCLUSIVE_LOCK); - if( rc!=SQLITE_OK ){ - rc = pager_error(pPager, rc); - goto failed; - } - pPager->state = PAGER_EXCLUSIVE; - } - - /* Open the journal for read/write access. This is because in - ** exclusive-access mode the file descriptor will be kept open and - ** possibly used for a transaction later on. On some systems, the - ** OsTruncate() call used in exclusive-access mode also requires - ** a read/write file handle. - */ - if( !isOpen(pPager->jfd) ){ - int res; - rc = sqlite3OsAccess(pVfs,pPager->zJournal,SQLITE_ACCESS_EXISTS,&res); - if( rc==SQLITE_OK ){ - if( res ){ - int fout = 0; - int f = SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_JOURNAL; - assert( !pPager->tempFile ); - rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, f, &fout); - assert( rc!=SQLITE_OK || isOpen(pPager->jfd) ); - if( rc==SQLITE_OK && fout&SQLITE_OPEN_READONLY ){ - rc = SQLITE_CANTOPEN; - sqlite3OsClose(pPager->jfd); - } - }else{ - /* If the journal does not exist, it usually means that some - ** other connection managed to get in and roll it back before - ** this connection obtained the exclusive lock above. Or, it - ** may mean that the pager was in the error-state when this - ** function was called and the journal file does not exist. */ - rc = pager_end_transaction(pPager, 0); - } - } - } + rc = pagerLockDb(pPager, EXCLUSIVE_LOCK); if( rc!=SQLITE_OK ){ goto failed; } - - /* TODO: Why are these cleared here? Is it necessary? */ - pPager->journalStarted = 0; - pPager->journalOff = 0; - pPager->setMaster = 0; - pPager->journalHdr = 0; + + /* If it is not already open and the file exists on disk, open the + ** journal for read/write access. Write access is required because + ** in exclusive-access mode the file descriptor will be kept open + ** and possibly used for a transaction later on. Also, write-access + ** is usually required to finalize the journal in journal_mode=persist + ** mode (and also for journal_mode=truncate on some systems). + ** + ** If the journal does not exist, it usually means that some + ** other connection managed to get in and roll it back before + ** this connection obtained the exclusive lock above. Or, it + ** may mean that the pager was in the error-state when this + ** function was called and the journal file does not exist. + */ + if( !isOpen(pPager->jfd) ){ + sqlite3_vfs * const pVfs = pPager->pVfs; + int bExists; /* True if journal file exists */ + rc = sqlite3OsAccess( + pVfs, pPager->zJournal, SQLITE_ACCESS_EXISTS, &bExists); + if( rc==SQLITE_OK && bExists ){ + int fout = 0; + int f = SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_JOURNAL; + assert( !pPager->tempFile ); + rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, f, &fout); + assert( rc!=SQLITE_OK || isOpen(pPager->jfd) ); + if( rc==SQLITE_OK && fout&SQLITE_OPEN_READONLY ){ + rc = SQLITE_CANTOPEN_BKPT; + sqlite3OsClose(pPager->jfd); + } + } + } /* Playback and delete the journal. Drop the database write ** lock and reacquire the read lock. Purge the cache before ** playing back the hot-journal so that we don't end up with - ** an inconsistent cache. + ** an inconsistent cache. Sync the hot journal before playing + ** it back since the process that crashed and left the hot journal + ** probably did not sync it and we are required to always sync + ** the journal before playing it back. */ if( isOpen(pPager->jfd) ){ - rc = pager_playback(pPager, 1); - if( rc!=SQLITE_OK ){ - rc = pager_error(pPager, rc); - goto failed; + assert( rc==SQLITE_OK ); + rc = pagerSyncHotJournal(pPager); + if( rc==SQLITE_OK ){ + rc = pager_playback(pPager, 1); + pPager->eState = PAGER_OPEN; } + }else if( !pPager->exclusiveMode ){ + pagerUnlockDb(pPager, SHARED_LOCK); } - assert( (pPager->state==PAGER_SHARED) - || (pPager->exclusiveMode && pPager->state>PAGER_SHARED) + + if( rc!=SQLITE_OK ){ + /* This branch is taken if an error occurs while trying to open + ** or roll back a hot-journal while holding an EXCLUSIVE lock. The + ** pager_unlock() routine will be called before returning to unlock + ** the file. If the unlock attempt fails, then Pager.eLock must be + ** set to UNKNOWN_LOCK (see the comment above the #define for + ** UNKNOWN_LOCK above for an explanation). + ** + ** In order to get pager_unlock() to do this, set Pager.eState to + ** PAGER_ERROR now. This is not actually counted as a transition + ** to ERROR state in the state diagram at the top of this file, + ** since we know that the same call to pager_unlock() will very + ** shortly transition the pager object to the OPEN state. Calling + ** assert_pager_state() would fail now, as it should not be possible + ** to be in ERROR state when there are zero outstanding page + ** references. + */ + pager_error(pPager, rc); + goto failed; + } + + assert( pPager->eState==PAGER_OPEN ); + assert( (pPager->eLock==SHARED_LOCK) + || (pPager->exclusiveMode && pPager->eLock>SHARED_LOCK) ); } - if( pPager->pBackup || sqlite3PcachePagecount(pPager->pPCache)>0 ){ + if( !pPager->tempFile + && (pPager->pBackup || sqlite3PcachePagecount(pPager->pPCache)>0) + ){ /* The shared-lock has just been acquired on the database file ** and there are already pages in the cache (from a previous ** read or write transaction). Check to see if the database @@ -35004,16 +39550,13 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ ** detected. The chance of an undetected change is so small that ** it can be neglected. */ + Pgno nPage = 0; char dbFileVers[sizeof(pPager->dbFileVers)]; - sqlite3PagerPagecount(pPager, 0); - if( pPager->errCode ){ - rc = pPager->errCode; - goto failed; - } + rc = pagerPagecount(pPager, &nPage); + if( rc ) goto failed; - assert( pPager->dbSizeValid ); - if( pPager->dbSize>0 ){ + if( nPage>0 ){ IOTRACE(("CKVERS %p %d\n", pPager, sizeof(dbFileVers))); rc = sqlite3OsRead(pPager->fd, &dbFileVers, sizeof(dbFileVers), 24); if( rc!=SQLITE_OK ){ @@ -35027,13 +39570,32 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ pager_reset(pPager); } } - assert( pPager->exclusiveMode || pPager->state==PAGER_SHARED ); + + /* If there is a WAL file in the file-system, open this database in WAL + ** mode. Otherwise, the following function call is a no-op. + */ + rc = pagerOpenWalIfPresent(pPager); +#ifndef SQLITE_OMIT_WAL + assert( pPager->pWal==0 || rc==SQLITE_OK ); +#endif + } + + if( pagerUseWal(pPager) ){ + assert( rc==SQLITE_OK ); + rc = pagerBeginReadTransaction(pPager); + } + + if( pPager->eState==PAGER_OPEN && rc==SQLITE_OK ){ + rc = pagerPagecount(pPager, &pPager->dbSize); } failed: if( rc!=SQLITE_OK ){ - /* pager_unlock() is a no-op for exclusive mode and in-memory databases. */ + assert( !MEMDB ); pager_unlock(pPager); + assert( pPager->eState==PAGER_OPEN ); + }else{ + pPager->eState = PAGER_READER; } return rc; } @@ -35047,9 +39609,7 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ ** nothing to rollback, so this routine is a no-op. */ static void pagerUnlockIfUnused(Pager *pPager){ - if( (sqlite3PcacheRefCount(pPager->pPCache)==0) - && (!pPager->exclusiveMode || pPager->journalOff>0) - ){ + if( (sqlite3PcacheRefCount(pPager->pPCache)==0) ){ pagerUnlockAndRollback(pPager); } } @@ -35077,12 +39637,12 @@ static void pagerUnlockIfUnused(Pager *pPager){ ** page is initialized to all zeros. ** ** If noContent is true, it means that we do not care about the contents -** of the page. This occurs in two separate scenarios: +** of the page. This occurs in two seperate scenarios: ** ** a) When reading a free-list leaf page from the database, and ** ** b) When a savepoint is being rolled back and we need to load -** a new page into the cache to populate with the data read +** a new page into the cache to be filled with the data read ** from the savepoint journal. ** ** If noContent is true, then the data returned is zeroed instead of @@ -35113,8 +39673,8 @@ SQLITE_PRIVATE int sqlite3PagerAcquire( int rc; PgHdr *pPg; + assert( pPager->eState>=PAGER_READER ); assert( assert_pager_state(pPager) ); - assert( pPager->state>PAGER_UNLOCK ); if( pgno==0 ){ return SQLITE_CORRUPT_BKPT; @@ -35122,7 +39682,7 @@ SQLITE_PRIVATE int sqlite3PagerAcquire( /* If the pager is in the error state, return an error immediately. ** Otherwise, request the page from the PCache layer. */ - if( pPager->errCode!=SQLITE_OK && pPager->errCode!=SQLITE_FULL ){ + if( pPager->errCode!=SQLITE_OK ){ rc = pPager->errCode; }else{ rc = sqlite3PcacheFetch(pPager->pPCache, pgno, 1, ppPage); @@ -35138,7 +39698,7 @@ SQLITE_PRIVATE int sqlite3PagerAcquire( assert( (*ppPage)->pgno==pgno ); assert( (*ppPage)->pPager==pPager || (*ppPage)->pPager==0 ); - if( (*ppPage)->pPager ){ + if( (*ppPage)->pPager && !noContent ){ /* In this case the pcache already contains an initialized copy of ** the page. Return without further ado. */ assert( pgno<=PAGER_MAX_PGNO && pgno!=PAGER_MJ_PGNO(pPager) ); @@ -35148,7 +39708,6 @@ SQLITE_PRIVATE int sqlite3PagerAcquire( }else{ /* The pager cache has created a new page. Its content needs to ** be initialized. */ - int nMax; PAGER_INCR(pPager->nMiss); pPg = *ppPage; @@ -35161,15 +39720,10 @@ SQLITE_PRIVATE int sqlite3PagerAcquire( goto pager_acquire_err; } - rc = sqlite3PagerPagecount(pPager, &nMax); - if( rc!=SQLITE_OK ){ - goto pager_acquire_err; - } - - if( nMax<(int)pgno || MEMDB || noContent ){ + if( MEMDB || pPager->dbSizefd) ){ if( pgno>pPager->mxPgno ){ - rc = SQLITE_FULL; - goto pager_acquire_err; + rc = SQLITE_FULL; + goto pager_acquire_err; } if( noContent ){ /* Failure to set the bits in the InJournal bit-vectors is benign. @@ -35186,9 +39740,8 @@ SQLITE_PRIVATE int sqlite3PagerAcquire( TESTONLY( rc = ) addToSavepointBitvecs(pPager, pgno); testcase( rc==SQLITE_NOMEM ); sqlite3EndBenignMalloc(); - }else{ - memset(pPg->pData, 0, pPager->pageSize); } + memset(pPg->pData, 0, pPager->pageSize); IOTRACE(("ZERO %p %d\n", pPager, pgno)); }else{ assert( pPg->pPager==pPager ); @@ -35197,9 +39750,7 @@ SQLITE_PRIVATE int sqlite3PagerAcquire( goto pager_acquire_err; } } -#ifdef SQLITE_CHECK_PAGES - pPg->pageHash = pager_pagehash(pPg); -#endif + pager_set_pagehash(pPg); } return SQLITE_OK; @@ -35218,9 +39769,7 @@ pager_acquire_err: /* ** Acquire a page if it is already in the in-memory cache. Do ** not read the page from disk. Return a pointer to the page, -** or 0 if the page is not in cache. Also, return 0 if the -** pager is in PAGER_UNLOCK state when this function is called, -** or if the pager is in an error state other than SQLITE_FULL. +** or 0 if the page is not in cache. ** ** See also sqlite3PagerGet(). The difference between this routine ** and sqlite3PagerGet() is that _get() will go to the disk and read @@ -35233,7 +39782,7 @@ SQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){ assert( pPager!=0 ); assert( pgno!=0 ); assert( pPager->pPCache!=0 ); - assert( pPager->state > PAGER_UNLOCK ); + assert( pPager->eState>=PAGER_READER && pPager->eState!=PAGER_ERROR ); sqlite3PcacheFetch(pPager->pPCache, pgno, 0, &pPg); return pPg; } @@ -35254,27 +39803,6 @@ SQLITE_PRIVATE void sqlite3PagerUnref(DbPage *pPg){ } } -/* -** If the main journal file has already been opened, ensure that the -** sub-journal file is open too. If the main journal is not open, -** this function is a no-op. -** -** SQLITE_OK is returned if everything goes according to plan. -** An SQLITE_IOERR_XXX error code is returned if a call to -** sqlite3OsOpen() fails. -*/ -static int openSubJournal(Pager *pPager){ - int rc = SQLITE_OK; - if( isOpen(pPager->jfd) && !isOpen(pPager->sjfd) ){ - if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){ - sqlite3MemJournalOpen(pPager->sjfd); - }else{ - rc = pagerOpentemp(pPager, pPager->sjfd, SQLITE_OPEN_SUBJOURNAL); - } - } - return rc; -} - /* ** This function is called at the start of every write transaction. ** There must already be a RESERVED or EXCLUSIVE lock on the database @@ -35301,9 +39829,8 @@ static int pager_open_journal(Pager *pPager){ int rc = SQLITE_OK; /* Return code */ sqlite3_vfs * const pVfs = pPager->pVfs; /* Local cache of vfs pointer */ - assert( pPager->state>=PAGER_RESERVED ); - assert( pPager->useJournal ); - assert( pPager->journalMode!=PAGER_JOURNALMODE_OFF ); + assert( pPager->eState==PAGER_WRITER_LOCKED ); + assert( assert_pager_state(pPager) ); assert( pPager->pInJournal==0 ); /* If already in the error state, this function is a no-op. But on @@ -35311,62 +39838,56 @@ static int pager_open_journal(Pager *pPager){ ** an error state. */ if( NEVER(pPager->errCode) ) return pPager->errCode; - /* TODO: Is it really possible to get here with dbSizeValid==0? If not, - ** the call to PagerPagecount() can be removed. - */ - testcase( pPager->dbSizeValid==0 ); - sqlite3PagerPagecount(pPager, 0); - - pPager->pInJournal = sqlite3BitvecCreate(pPager->dbSize); - if( pPager->pInJournal==0 ){ - return SQLITE_NOMEM; - } - - /* Open the journal file if it is not already open. */ - if( !isOpen(pPager->jfd) ){ - if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){ - sqlite3MemJournalOpen(pPager->jfd); - }else{ - const int flags = /* VFS flags to open journal file */ - SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE| - (pPager->tempFile ? - (SQLITE_OPEN_DELETEONCLOSE|SQLITE_OPEN_TEMP_JOURNAL): - (SQLITE_OPEN_MAIN_JOURNAL) - ); -#ifdef SQLITE_ENABLE_ATOMIC_WRITE - rc = sqlite3JournalOpen( - pVfs, pPager->zJournal, pPager->jfd, flags, jrnlBufferSize(pPager) - ); -#else - rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, flags, 0); -#endif + if( !pagerUseWal(pPager) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ + pPager->pInJournal = sqlite3BitvecCreate(pPager->dbSize); + if( pPager->pInJournal==0 ){ + return SQLITE_NOMEM; + } + + /* Open the journal file if it is not already open. */ + if( !isOpen(pPager->jfd) ){ + if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){ + sqlite3MemJournalOpen(pPager->jfd); + }else{ + const int flags = /* VFS flags to open journal file */ + SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE| + (pPager->tempFile ? + (SQLITE_OPEN_DELETEONCLOSE|SQLITE_OPEN_TEMP_JOURNAL): + (SQLITE_OPEN_MAIN_JOURNAL) + ); + #ifdef SQLITE_ENABLE_ATOMIC_WRITE + rc = sqlite3JournalOpen( + pVfs, pPager->zJournal, pPager->jfd, flags, jrnlBufferSize(pPager) + ); + #else + rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, flags, 0); + #endif + } + assert( rc!=SQLITE_OK || isOpen(pPager->jfd) ); + } + + + /* Write the first journal header to the journal file and open + ** the sub-journal if necessary. + */ + if( rc==SQLITE_OK ){ + /* TODO: Check if all of these are really required. */ + pPager->nRec = 0; + pPager->journalOff = 0; + pPager->setMaster = 0; + pPager->journalHdr = 0; + rc = writeJournalHdr(pPager); } - assert( rc!=SQLITE_OK || isOpen(pPager->jfd) ); - } - - - /* Write the first journal header to the journal file and open - ** the sub-journal if necessary. - */ - if( rc==SQLITE_OK ){ - /* TODO: Check if all of these are really required. */ - pPager->dbOrigSize = pPager->dbSize; - pPager->journalStarted = 0; - pPager->needSync = 0; - pPager->nRec = 0; - pPager->journalOff = 0; - pPager->setMaster = 0; - pPager->journalHdr = 0; - rc = writeJournalHdr(pPager); - } - if( rc==SQLITE_OK && pPager->nSavepoint ){ - rc = openSubJournal(pPager); } if( rc!=SQLITE_OK ){ sqlite3BitvecDestroy(pPager->pInJournal); pPager->pInJournal = 0; + }else{ + assert( pPager->eState==PAGER_WRITER_LOCKED ); + pPager->eState = PAGER_WRITER_CACHEMOD; } + return rc; } @@ -35379,14 +39900,6 @@ static int pager_open_journal(Pager *pPager){ ** an EXCLUSIVE lock. If such a lock is already held, no locking ** functions need be called. ** -** If this is not a temporary or in-memory file and, the journal file is -** opened if it has not been already. For a temporary file, the opening -** of the journal file is deferred until there is an actual need to -** write to the journal. TODO: Why handle temporary files differently? -** -** If the journal file is opened (or if it is already open), then a -** journal-header is written to the start of it. -** ** If the subjInMemory argument is non-zero, then any sub-journal opened ** within this transaction will be opened as an in-memory file. This ** has no effect if the sub-journal is already opened (as it may be when @@ -35397,55 +39910,67 @@ static int pager_open_journal(Pager *pPager){ */ SQLITE_PRIVATE int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){ int rc = SQLITE_OK; - assert( pPager->state!=PAGER_UNLOCK ); - pPager->subjInMemory = (u8)subjInMemory; - if( pPager->state==PAGER_SHARED ){ - assert( pPager->pInJournal==0 ); - assert( !MEMDB && !pPager->tempFile ); - /* Obtain a RESERVED lock on the database file. If the exFlag parameter - ** is true, then immediately upgrade this to an EXCLUSIVE lock. The - ** busy-handler callback can be used when upgrading to the EXCLUSIVE - ** lock, but not when obtaining the RESERVED lock. - */ - rc = sqlite3OsLock(pPager->fd, RESERVED_LOCK); - if( rc==SQLITE_OK ){ - pPager->state = PAGER_RESERVED; - if( exFlag ){ + if( pPager->errCode ) return pPager->errCode; + assert( pPager->eState>=PAGER_READER && pPager->eStatesubjInMemory = (u8)subjInMemory; + + if( ALWAYS(pPager->eState==PAGER_READER) ){ + assert( pPager->pInJournal==0 ); + + if( pagerUseWal(pPager) ){ + /* If the pager is configured to use locking_mode=exclusive, and an + ** exclusive lock on the database is not already held, obtain it now. + */ + if( pPager->exclusiveMode && sqlite3WalExclusiveMode(pPager->pWal, -1) ){ + rc = pagerLockDb(pPager, EXCLUSIVE_LOCK); + if( rc!=SQLITE_OK ){ + return rc; + } + sqlite3WalExclusiveMode(pPager->pWal, 1); + } + + /* Grab the write lock on the log file. If successful, upgrade to + ** PAGER_RESERVED state. Otherwise, return an error code to the caller. + ** The busy-handler is not invoked if another connection already + ** holds the write-lock. If possible, the upper layer will call it. + */ + rc = sqlite3WalBeginWriteTransaction(pPager->pWal); + }else{ + /* Obtain a RESERVED lock on the database file. If the exFlag parameter + ** is true, then immediately upgrade this to an EXCLUSIVE lock. The + ** busy-handler callback can be used when upgrading to the EXCLUSIVE + ** lock, but not when obtaining the RESERVED lock. + */ + rc = pagerLockDb(pPager, RESERVED_LOCK); + if( rc==SQLITE_OK && exFlag ){ rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); } } - /* If the required locks were successfully obtained, open the journal - ** file and write the first journal-header to it. - */ - if( rc==SQLITE_OK && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ - rc = pager_open_journal(pPager); + if( rc==SQLITE_OK ){ + /* Change to WRITER_LOCKED state. + ** + ** WAL mode sets Pager.eState to PAGER_WRITER_LOCKED or CACHEMOD + ** when it has an open transaction, but never to DBMOD or FINISHED. + ** This is because in those states the code to roll back savepoint + ** transactions may copy data from the sub-journal into the database + ** file as well as into the page cache. Which would be incorrect in + ** WAL mode. + */ + pPager->eState = PAGER_WRITER_LOCKED; + pPager->dbHintSize = pPager->dbSize; + pPager->dbFileSize = pPager->dbSize; + pPager->dbOrigSize = pPager->dbSize; + pPager->journalOff = 0; } - }else if( isOpen(pPager->jfd) && pPager->journalOff==0 ){ - /* This happens when the pager was in exclusive-access mode the last - ** time a (read or write) transaction was successfully concluded - ** by this connection. Instead of deleting the journal file it was - ** kept open and either was truncated to 0 bytes or its header was - ** overwritten with zeros. - */ - assert( pPager->nRec==0 ); - assert( pPager->dbOrigSize==0 ); - assert( pPager->pInJournal==0 ); - rc = pager_open_journal(pPager); + + assert( rc==SQLITE_OK || pPager->eState==PAGER_READER ); + assert( rc!=SQLITE_OK || pPager->eState==PAGER_WRITER_LOCKED ); + assert( assert_pager_state(pPager) ); } PAGERTRACE(("TRANSACTION %d\n", PAGERID(pPager))); - assert( !isOpen(pPager->jfd) || pPager->journalOff>0 || rc!=SQLITE_OK ); - if( rc!=SQLITE_OK ){ - assert( !pPager->dbModified ); - /* Ignore any IO error that occurs within pager_end_transaction(). The - ** purpose of this call is to reset the internal state of the pager - ** sub-system. It doesn't matter if the journal-file is not properly - ** finalized at this point (since it is not a valid journal file anyway). - */ - pager_end_transaction(pPager, 0); - } return rc; } @@ -35461,76 +39986,86 @@ static int pager_write(PgHdr *pPg){ Pager *pPager = pPg->pPager; int rc = SQLITE_OK; - /* This routine is not called unless a transaction has already been - ** started. + /* This routine is not called unless a write-transaction has already + ** been started. The journal file may or may not be open at this point. + ** It is never called in the ERROR state. */ - assert( pPager->state>=PAGER_RESERVED ); + assert( pPager->eState==PAGER_WRITER_LOCKED + || pPager->eState==PAGER_WRITER_CACHEMOD + || pPager->eState==PAGER_WRITER_DBMOD + ); + assert( assert_pager_state(pPager) ); - /* If an error has been previously detected, we should not be - ** calling this routine. Repeat the error for robustness. - */ + /* If an error has been previously detected, report the same error + ** again. This should not happen, but the check provides robustness. */ if( NEVER(pPager->errCode) ) return pPager->errCode; /* Higher-level routines never call this function if database is not ** writable. But check anyway, just for robustness. */ if( NEVER(pPager->readOnly) ) return SQLITE_PERM; - assert( !pPager->setMaster ); - CHECK_PAGE(pPg); + /* The journal file needs to be opened. Higher level routines have already + ** obtained the necessary locks to begin the write-transaction, but the + ** rollback journal might not yet be open. Open it now if this is the case. + ** + ** This is done before calling sqlite3PcacheMakeDirty() on the page. + ** Otherwise, if it were done after calling sqlite3PcacheMakeDirty(), then + ** an error might occur and the pager would end up in WRITER_LOCKED state + ** with pages marked as dirty in the cache. + */ + if( pPager->eState==PAGER_WRITER_LOCKED ){ + rc = pager_open_journal(pPager); + if( rc!=SQLITE_OK ) return rc; + } + assert( pPager->eState>=PAGER_WRITER_CACHEMOD ); + assert( assert_pager_state(pPager) ); + /* Mark the page as dirty. If the page has already been written ** to the journal then we can return right away. */ sqlite3PcacheMakeDirty(pPg); if( pageInJournal(pPg) && !subjRequiresPage(pPg) ){ - pPager->dbModified = 1; + assert( !pagerUseWal(pPager) ); }else{ - - /* If we get this far, it means that the page needs to be - ** written to the transaction journal or the ckeckpoint journal - ** or both. - ** - ** Higher level routines should have already started a transaction, - ** which means they have acquired the necessary locks and opened - ** a rollback journal. Double-check to makes sure this is the case. - */ - rc = sqlite3PagerBegin(pPager, 0, pPager->subjInMemory); - if( NEVER(rc!=SQLITE_OK) ){ - return rc; - } - if( !isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ - assert( pPager->useJournal ); - rc = pager_open_journal(pPager); - if( rc!=SQLITE_OK ) return rc; - } - pPager->dbModified = 1; /* The transaction journal now exists and we have a RESERVED or an ** EXCLUSIVE lock on the main database file. Write the current page to ** the transaction journal if it is not there already. */ - if( !pageInJournal(pPg) && isOpen(pPager->jfd) ){ - if( pPg->pgno<=pPager->dbOrigSize ){ + if( !pageInJournal(pPg) && !pagerUseWal(pPager) ){ + assert( pagerUseWal(pPager)==0 ); + if( pPg->pgno<=pPager->dbOrigSize && isOpen(pPager->jfd) ){ u32 cksum; char *pData2; + i64 iOff = pPager->journalOff; /* We should never write to the journal file the page that ** contains the database locks. The following assert verifies ** that we do not. */ assert( pPg->pgno!=PAGER_MJ_PGNO(pPager) ); + + assert( pPager->journalHdr<=pPager->journalOff ); CODEC2(pPager, pData, pPg->pgno, 7, return SQLITE_NOMEM, pData2); cksum = pager_cksum(pPager, (u8*)pData2); - rc = write32bits(pPager->jfd, pPager->journalOff, pPg->pgno); - if( rc==SQLITE_OK ){ - rc = sqlite3OsWrite(pPager->jfd, pData2, pPager->pageSize, - pPager->journalOff + 4); - pPager->journalOff += pPager->pageSize+4; - } - if( rc==SQLITE_OK ){ - rc = write32bits(pPager->jfd, pPager->journalOff, cksum); - pPager->journalOff += 4; - } + + /* Even if an IO or diskfull error occurs while journalling the + ** page in the block above, set the need-sync flag for the page. + ** Otherwise, when the transaction is rolled back, the logic in + ** playback_one_page() will think that the page needs to be restored + ** in the database file. And if an IO error occurs while doing so, + ** then corruption may follow. + */ + pPg->flags |= PGHDR_NEED_SYNC; + + rc = write32bits(pPager->jfd, iOff, pPg->pgno); + if( rc!=SQLITE_OK ) return rc; + rc = sqlite3OsWrite(pPager->jfd, pData2, pPager->pageSize, iOff+4); + if( rc!=SQLITE_OK ) return rc; + rc = write32bits(pPager->jfd, iOff+pPager->pageSize+4, cksum); + if( rc!=SQLITE_OK ) return rc; + IOTRACE(("JOUT %p %d %lld %d\n", pPager, pPg->pgno, pPager->journalOff, pPager->pageSize)); PAGER_INCR(sqlite3_pager_writej_count); @@ -35538,25 +40073,7 @@ static int pager_write(PgHdr *pPg){ PAGERID(pPager), pPg->pgno, ((pPg->flags&PGHDR_NEED_SYNC)?1:0), pager_pagehash(pPg))); - /* Even if an IO or diskfull error occurred while journalling the - ** page in the block above, set the need-sync flag for the page. - ** Otherwise, when the transaction is rolled back, the logic in - ** playback_one_page() will think that the page needs to be restored - ** in the database file. And if an IO error occurs while doing so, - ** then corruption may follow. - */ - if( !pPager->noSync ){ - pPg->flags |= PGHDR_NEED_SYNC; - pPager->needSync = 1; - } - - /* An error has occurred writing to the journal file. The - ** transaction will be rolled back by the layer above. - */ - if( rc!=SQLITE_OK ){ - return rc; - } - + pPager->journalOff += 8 + pPager->pageSize; pPager->nRec++; assert( pPager->pInJournal!=0 ); rc = sqlite3BitvecSet(pPager->pInJournal, pPg->pgno); @@ -35568,9 +40085,8 @@ static int pager_write(PgHdr *pPg){ return rc; } }else{ - if( !pPager->journalStarted && !pPager->noSync ){ + if( pPager->eState!=PAGER_WRITER_DBMOD ){ pPg->flags |= PGHDR_NEED_SYNC; - pPager->needSync = 1; } PAGERTRACE(("APPEND %d page %d needSync=%d\n", PAGERID(pPager), pPg->pgno, @@ -35590,7 +40106,6 @@ static int pager_write(PgHdr *pPg){ /* Update the database size and return. */ - assert( pPager->state>=PAGER_SHARED ); if( pPager->dbSizepgno ){ pPager->dbSize = pPg->pgno; } @@ -35618,19 +40133,24 @@ SQLITE_PRIVATE int sqlite3PagerWrite(DbPage *pDbPage){ Pager *pPager = pPg->pPager; Pgno nPagePerSector = (pPager->sectorSize/pPager->pageSize); + assert( pPager->eState>=PAGER_WRITER_LOCKED ); + assert( pPager->eState!=PAGER_ERROR ); + assert( assert_pager_state(pPager) ); + if( nPagePerSector>1 ){ Pgno nPageCount; /* Total number of pages in database file */ Pgno pg1; /* First page of the sector pPg is located on. */ - int nPage; /* Number of pages starting at pg1 to journal */ + int nPage = 0; /* Number of pages starting at pg1 to journal */ int ii; /* Loop counter */ int needSync = 0; /* True if any page has PGHDR_NEED_SYNC */ - /* Set the doNotSync flag to 1. This is because we cannot allow a journal - ** header to be written between the pages journaled by this function. + /* Set the doNotSyncSpill flag to 1. This is because we cannot allow + ** a journal header to be written between the pages journaled by + ** this function. */ assert( !MEMDB ); - assert( pPager->doNotSync==0 ); - pPager->doNotSync = 1; + assert( pPager->doNotSyncSpill==0 ); + pPager->doNotSyncSpill++; /* This trick assumes that both the page-size and sector-size are ** an integer power of 2. It sets variable pg1 to the identifier @@ -35638,7 +40158,7 @@ SQLITE_PRIVATE int sqlite3PagerWrite(DbPage *pDbPage){ */ pg1 = ((pPg->pgno-1) & ~(nPagePerSector-1)) + 1; - sqlite3PagerPagecount(pPager, (int *)&nPageCount); + nPageCount = pPager->dbSize; if( pPg->pgno>nPageCount ){ nPage = (pPg->pgno - pg1)+1; }else if( (pg1+nPagePerSector-1)>nPageCount ){ @@ -35660,7 +40180,6 @@ SQLITE_PRIVATE int sqlite3PagerWrite(DbPage *pDbPage){ rc = pager_write(pPage); if( pPage->flags&PGHDR_NEED_SYNC ){ needSync = 1; - assert(pPager->needSync); } sqlite3PagerUnref(pPage); } @@ -35680,7 +40199,7 @@ SQLITE_PRIVATE int sqlite3PagerWrite(DbPage *pDbPage){ ** before any of them can be written out to the database file. */ if( rc==SQLITE_OK && needSync ){ - assert( !MEMDB && pPager->noSync==0 ); + assert( !MEMDB ); for(ii=0; iineedSync); } - assert( pPager->doNotSync==1 ); - pPager->doNotSync = 0; + assert( pPager->doNotSyncSpill==1 ); + pPager->doNotSyncSpill--; }else{ rc = pager_write(pDbPage); } @@ -35730,9 +40248,7 @@ SQLITE_PRIVATE void sqlite3PagerDontWrite(PgHdr *pPg){ PAGERTRACE(("DONT_WRITE page %d of %d\n", pPg->pgno, PAGERID(pPager))); IOTRACE(("CLEAN %p %d\n", pPager, pPg->pgno)) pPg->flags |= PGHDR_DONT_WRITE; -#ifdef SQLITE_CHECK_PAGES - pPg->pageHash = pager_pagehash(pPg); -#endif + pager_set_pagehash(pPg); } } @@ -35755,6 +40271,11 @@ SQLITE_PRIVATE void sqlite3PagerDontWrite(PgHdr *pPg){ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){ int rc = SQLITE_OK; + assert( pPager->eState==PAGER_WRITER_CACHEMOD + || pPager->eState==PAGER_WRITER_DBMOD + ); + assert( assert_pager_state(pPager) ); + /* Declare and initialize constant integer 'isDirect'. If the ** atomic-write optimization is enabled in this build, then isDirect ** is initialized to the value passed as the isDirectMode parameter @@ -35773,8 +40294,7 @@ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){ # define DIRECT_MODE isDirectMode #endif - assert( pPager->state>=PAGER_RESERVED ); - if( !pPager->changeCountDone && ALWAYS(pPager->dbSize>0) ){ + if( !pPager->changeCountDone && pPager->dbSize>0 ){ PgHdr *pPgHdr; /* Reference to page 1 */ u32 change_counter; /* Initial value of change-counter field */ @@ -35799,11 +40319,20 @@ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){ change_counter++; put32bits(((char*)pPgHdr->pData)+24, change_counter); + /* Also store the SQLite version number in bytes 96..99 and in + ** bytes 92..95 store the change counter for which the version number + ** is valid. */ + put32bits(((char*)pPgHdr->pData)+92, change_counter); + put32bits(((char*)pPgHdr->pData)+96, SQLITE_VERSION_NUMBER); + /* If running in direct mode, write the contents of page 1 to the file. */ if( DIRECT_MODE ){ - const void *zBuf = pPgHdr->pData; + const void *zBuf; assert( pPager->dbFileSize>0 ); - rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0); + CODEC2(pPager, pPgHdr->pData, 1, 6, rc=SQLITE_NOMEM, zBuf); + if( rc==SQLITE_OK ){ + rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0); + } if( rc==SQLITE_OK ){ pPager->changeCountDone = 1; } @@ -35836,6 +40365,30 @@ SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager){ return rc; } +/* +** This function may only be called while a write-transaction is active in +** rollback. If the connection is in WAL mode, this call is a no-op. +** Otherwise, if the connection does not already have an EXCLUSIVE lock on +** the database file, an attempt is made to obtain one. +** +** If the EXCLUSIVE lock is already held or the attempt to obtain it is +** successful, or the connection is in WAL mode, SQLITE_OK is returned. +** Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is +** returned. +*/ +SQLITE_PRIVATE int sqlite3PagerExclusiveLock(Pager *pPager){ + int rc = SQLITE_OK; + assert( pPager->eState==PAGER_WRITER_CACHEMOD + || pPager->eState==PAGER_WRITER_DBMOD + || pPager->eState==PAGER_WRITER_LOCKED + ); + assert( assert_pager_state(pPager) ); + if( 0==pagerUseWal(pPager) ){ + rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); + } + return rc; +} + /* ** Sync the database file for the pager pPager. zMaster points to the name ** of a master journal file that should be written into the individual @@ -35869,151 +40422,174 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne( ){ int rc = SQLITE_OK; /* Return code */ - /* The dbOrigSize is never set if journal_mode=OFF */ - assert( pPager->journalMode!=PAGER_JOURNALMODE_OFF || pPager->dbOrigSize==0 ); + assert( pPager->eState==PAGER_WRITER_LOCKED + || pPager->eState==PAGER_WRITER_CACHEMOD + || pPager->eState==PAGER_WRITER_DBMOD + || pPager->eState==PAGER_ERROR + ); + assert( assert_pager_state(pPager) ); - /* If a prior error occurred, this routine should not be called. ROLLBACK - ** is the appropriate response to an error, not COMMIT. Guard against - ** coding errors by repeating the prior error. */ + /* If a prior error occurred, report that error again. */ if( NEVER(pPager->errCode) ) return pPager->errCode; PAGERTRACE(("DATABASE SYNC: File=%s zMaster=%s nSize=%d\n", pPager->zFilename, zMaster, pPager->dbSize)); - if( MEMDB && pPager->dbModified ){ + /* If no database changes have been made, return early. */ + if( pPager->eStatepBackup); - }else if( pPager->state!=PAGER_SYNCED && pPager->dbModified ){ - - /* The following block updates the change-counter. Exactly how it - ** does this depends on whether or not the atomic-update optimization - ** was enabled at compile time, and if this transaction meets the - ** runtime criteria to use the operation: - ** - ** * The file-system supports the atomic-write property for - ** blocks of size page-size, and - ** * This commit is not part of a multi-file transaction, and - ** * Exactly one page has been modified and store in the journal file. - ** - ** If the optimization was not enabled at compile time, then the - ** pager_incr_changecounter() function is called to update the change - ** counter in 'indirect-mode'. If the optimization is compiled in but - ** is not applicable to this transaction, call sqlite3JournalCreate() - ** to make sure the journal file has actually been created, then call - ** pager_incr_changecounter() to update the change-counter in indirect - ** mode. - ** - ** Otherwise, if the optimization is both enabled and applicable, - ** then call pager_incr_changecounter() to update the change-counter - ** in 'direct' mode. In this case the journal file will never be - ** created for this transaction. - */ -#ifdef SQLITE_ENABLE_ATOMIC_WRITE - PgHdr *pPg; - assert( isOpen(pPager->jfd) || pPager->journalMode==PAGER_JOURNALMODE_OFF ); - if( !zMaster && isOpen(pPager->jfd) - && pPager->journalOff==jrnlBufferSize(pPager) - && pPager->dbSize>=pPager->dbFileSize - && (0==(pPg = sqlite3PcacheDirtyList(pPager->pPCache)) || 0==pPg->pDirty) - ){ - /* Update the db file change counter via the direct-write method. The - ** following call will modify the in-memory representation of page 1 - ** to include the updated change counter and then write page 1 - ** directly to the database file. Because of the atomic-write - ** property of the host file-system, this is safe. - */ - rc = pager_incr_changecounter(pPager, 1); - }else{ - rc = sqlite3JournalCreate(pPager->jfd); - if( rc==SQLITE_OK ){ - rc = pager_incr_changecounter(pPager, 0); + }else{ + if( pagerUseWal(pPager) ){ + PgHdr *pList = sqlite3PcacheDirtyList(pPager->pPCache); + if( pList ){ + rc = pagerWalFrames(pPager, pList, pPager->dbSize, 1, + (pPager->fullSync ? pPager->sync_flags : 0) + ); } - } -#else - rc = pager_incr_changecounter(pPager, 0); -#endif - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - - /* If this transaction has made the database smaller, then all pages - ** being discarded by the truncation must be written to the journal - ** file. This can only happen in auto-vacuum mode. - ** - ** Before reading the pages with page numbers larger than the - ** current value of Pager.dbSize, set dbSize back to the value - ** that it took at the start of the transaction. Otherwise, the - ** calls to sqlite3PagerGet() return zeroed pages instead of - ** reading data from the database file. - ** - ** When journal_mode==OFF the dbOrigSize is always zero, so this - ** block never runs if journal_mode=OFF. - */ -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pPager->dbSizedbOrigSize - && ALWAYS(pPager->journalMode!=PAGER_JOURNALMODE_OFF) - ){ - Pgno i; /* Iterator variable */ - const Pgno iSkip = PAGER_MJ_PGNO(pPager); /* Pending lock page */ - const Pgno dbSize = pPager->dbSize; /* Database image size */ - pPager->dbSize = pPager->dbOrigSize; - for( i=dbSize+1; i<=pPager->dbOrigSize; i++ ){ - if( !sqlite3BitvecTest(pPager->pInJournal, i) && i!=iSkip ){ - PgHdr *pPage; /* Page to journal */ - rc = sqlite3PagerGet(pPager, i, &pPage); - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - rc = sqlite3PagerWrite(pPage); - sqlite3PagerUnref(pPage); - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; + if( rc==SQLITE_OK ){ + sqlite3PcacheCleanAll(pPager->pPCache); + } + }else{ + /* The following block updates the change-counter. Exactly how it + ** does this depends on whether or not the atomic-update optimization + ** was enabled at compile time, and if this transaction meets the + ** runtime criteria to use the operation: + ** + ** * The file-system supports the atomic-write property for + ** blocks of size page-size, and + ** * This commit is not part of a multi-file transaction, and + ** * Exactly one page has been modified and store in the journal file. + ** + ** If the optimization was not enabled at compile time, then the + ** pager_incr_changecounter() function is called to update the change + ** counter in 'indirect-mode'. If the optimization is compiled in but + ** is not applicable to this transaction, call sqlite3JournalCreate() + ** to make sure the journal file has actually been created, then call + ** pager_incr_changecounter() to update the change-counter in indirect + ** mode. + ** + ** Otherwise, if the optimization is both enabled and applicable, + ** then call pager_incr_changecounter() to update the change-counter + ** in 'direct' mode. In this case the journal file will never be + ** created for this transaction. + */ + #ifdef SQLITE_ENABLE_ATOMIC_WRITE + PgHdr *pPg; + assert( isOpen(pPager->jfd) + || pPager->journalMode==PAGER_JOURNALMODE_OFF + || pPager->journalMode==PAGER_JOURNALMODE_WAL + ); + if( !zMaster && isOpen(pPager->jfd) + && pPager->journalOff==jrnlBufferSize(pPager) + && pPager->dbSize>=pPager->dbOrigSize + && (0==(pPg = sqlite3PcacheDirtyList(pPager->pPCache)) || 0==pPg->pDirty) + ){ + /* Update the db file change counter via the direct-write method. The + ** following call will modify the in-memory representation of page 1 + ** to include the updated change counter and then write page 1 + ** directly to the database file. Because of the atomic-write + ** property of the host file-system, this is safe. + */ + rc = pager_incr_changecounter(pPager, 1); + }else{ + rc = sqlite3JournalCreate(pPager->jfd); + if( rc==SQLITE_OK ){ + rc = pager_incr_changecounter(pPager, 0); } - } - pPager->dbSize = dbSize; - } -#endif - - /* Write the master journal name into the journal file. If a master - ** journal file name has already been written to the journal file, - ** or if zMaster is NULL (no master journal), then this call is a no-op. - */ - rc = writeMasterJournal(pPager, zMaster); - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - - /* Sync the journal file. If the atomic-update optimization is being - ** used, this call will not create the journal file or perform any - ** real IO. - */ - rc = syncJournal(pPager); - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - - /* Write all dirty pages to the database file. */ - rc = pager_write_pagelist(sqlite3PcacheDirtyList(pPager->pPCache)); - if( rc!=SQLITE_OK ){ - assert( rc!=SQLITE_IOERR_BLOCKED ); - goto commit_phase_one_exit; - } - sqlite3PcacheCleanAll(pPager->pPCache); - - /* If the file on disk is not the same size as the database image, - ** then use pager_truncate to grow or shrink the file here. - */ - if( pPager->dbSize!=pPager->dbFileSize ){ - Pgno nNew = pPager->dbSize - (pPager->dbSize==PAGER_MJ_PGNO(pPager)); - assert( pPager->state>=PAGER_EXCLUSIVE ); - rc = pager_truncate(pPager, nNew); + } + #else + rc = pager_incr_changecounter(pPager, 0); + #endif if( rc!=SQLITE_OK ) goto commit_phase_one_exit; + + /* If this transaction has made the database smaller, then all pages + ** being discarded by the truncation must be written to the journal + ** file. This can only happen in auto-vacuum mode. + ** + ** Before reading the pages with page numbers larger than the + ** current value of Pager.dbSize, set dbSize back to the value + ** that it took at the start of the transaction. Otherwise, the + ** calls to sqlite3PagerGet() return zeroed pages instead of + ** reading data from the database file. + */ + #ifndef SQLITE_OMIT_AUTOVACUUM + if( pPager->dbSizedbOrigSize + && pPager->journalMode!=PAGER_JOURNALMODE_OFF + ){ + Pgno i; /* Iterator variable */ + const Pgno iSkip = PAGER_MJ_PGNO(pPager); /* Pending lock page */ + const Pgno dbSize = pPager->dbSize; /* Database image size */ + pPager->dbSize = pPager->dbOrigSize; + for( i=dbSize+1; i<=pPager->dbOrigSize; i++ ){ + if( !sqlite3BitvecTest(pPager->pInJournal, i) && i!=iSkip ){ + PgHdr *pPage; /* Page to journal */ + rc = sqlite3PagerGet(pPager, i, &pPage); + if( rc!=SQLITE_OK ) goto commit_phase_one_exit; + rc = sqlite3PagerWrite(pPage); + sqlite3PagerUnref(pPage); + if( rc!=SQLITE_OK ) goto commit_phase_one_exit; + } + } + pPager->dbSize = dbSize; + } + #endif + + /* Write the master journal name into the journal file. If a master + ** journal file name has already been written to the journal file, + ** or if zMaster is NULL (no master journal), then this call is a no-op. + */ + rc = writeMasterJournal(pPager, zMaster); + if( rc!=SQLITE_OK ) goto commit_phase_one_exit; + + /* Sync the journal file and write all dirty pages to the database. + ** If the atomic-update optimization is being used, this sync will not + ** create the journal file or perform any real IO. + ** + ** Because the change-counter page was just modified, unless the + ** atomic-update optimization is used it is almost certain that the + ** journal requires a sync here. However, in locking_mode=exclusive + ** on a system under memory pressure it is just possible that this is + ** not the case. In this case it is likely enough that the redundant + ** xSync() call will be changed to a no-op by the OS anyhow. + */ + rc = syncJournal(pPager, 0); + if( rc!=SQLITE_OK ) goto commit_phase_one_exit; + + rc = pager_write_pagelist(pPager,sqlite3PcacheDirtyList(pPager->pPCache)); + if( rc!=SQLITE_OK ){ + assert( rc!=SQLITE_IOERR_BLOCKED ); + goto commit_phase_one_exit; + } + sqlite3PcacheCleanAll(pPager->pPCache); + + /* If the file on disk is not the same size as the database image, + ** then use pager_truncate to grow or shrink the file here. + */ + if( pPager->dbSize!=pPager->dbFileSize ){ + Pgno nNew = pPager->dbSize - (pPager->dbSize==PAGER_MJ_PGNO(pPager)); + assert( pPager->eState==PAGER_WRITER_DBMOD ); + rc = pager_truncate(pPager, nNew); + if( rc!=SQLITE_OK ) goto commit_phase_one_exit; + } + + /* Finally, sync the database file. */ + if( !pPager->noSync && !noSync ){ + rc = sqlite3OsSync(pPager->fd, pPager->sync_flags); + } + IOTRACE(("DBSYNC %p\n", pPager)) } - - /* Finally, sync the database file. */ - if( !pPager->noSync && !noSync ){ - rc = sqlite3OsSync(pPager->fd, pPager->sync_flags); - } - IOTRACE(("DBSYNC %p\n", pPager)) - - pPager->state = PAGER_SYNCED; } commit_phase_one_exit: + if( rc==SQLITE_OK && !pagerUseWal(pPager) ){ + pPager->eState = PAGER_WRITER_FINISHED; + } return rc; } @@ -36041,11 +40617,11 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager *pPager){ ** called, just return the same error code without doing anything. */ if( NEVER(pPager->errCode) ) return pPager->errCode; - /* This function should not be called if the pager is not in at least - ** PAGER_RESERVED state. And indeed SQLite never does this. But it is - ** nice to have this defensive test here anyway. - */ - if( NEVER(pPager->stateeState==PAGER_WRITER_LOCKED + || pPager->eState==PAGER_WRITER_FINISHED + || (pagerUseWal(pPager) && pPager->eState==PAGER_WRITER_CACHEMOD) + ); + assert( assert_pager_state(pPager) ); /* An optimization. If the database was not actually modified during ** this transaction, the pager is running in exclusive-mode and is @@ -36058,95 +40634,76 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager *pPager){ ** header. Since the pager is in exclusive mode, there is no need ** to drop any locks either. */ - if( pPager->dbModified==0 && pPager->exclusiveMode + if( pPager->eState==PAGER_WRITER_LOCKED + && pPager->exclusiveMode && pPager->journalMode==PAGER_JOURNALMODE_PERSIST ){ - assert( pPager->journalOff==JOURNAL_HDR_SZ(pPager) ); + assert( pPager->journalOff==JOURNAL_HDR_SZ(pPager) || !pPager->journalOff ); + pPager->eState = PAGER_READER; return SQLITE_OK; } PAGERTRACE(("COMMIT %d\n", PAGERID(pPager))); - assert( pPager->state==PAGER_SYNCED || MEMDB || !pPager->dbModified ); rc = pager_end_transaction(pPager, pPager->setMaster); return pager_error(pPager, rc); } /* -** Rollback all changes. The database falls back to PAGER_SHARED mode. +** If a write transaction is open, then all changes made within the +** transaction are reverted and the current write-transaction is closed. +** The pager falls back to PAGER_READER state if successful, or PAGER_ERROR +** state if an error occurs. ** -** This function performs two tasks: +** If the pager is already in PAGER_ERROR state when this function is called, +** it returns Pager.errCode immediately. No work is performed in this case. +** +** Otherwise, in rollback mode, this function performs two functions: ** ** 1) It rolls back the journal file, restoring all database file and ** in-memory cache pages to the state they were in when the transaction ** was opened, and +** ** 2) It finalizes the journal file, so that it is not used for hot ** rollback at any point in the future. ** -** subject to the following qualifications: +** Finalization of the journal file (task 2) is only performed if the +** rollback is successful. ** -** * If the journal file is not yet open when this function is called, -** then only (2) is performed. In this case there is no journal file -** to roll back. -** -** * If in an error state other than SQLITE_FULL, then task (1) is -** performed. If successful, task (2). Regardless of the outcome -** of either, the error state error code is returned to the caller -** (i.e. either SQLITE_IOERR or SQLITE_CORRUPT). -** -** * If the pager is in PAGER_RESERVED state, then attempt (1). Whether -** or not (1) is succussful, also attempt (2). If successful, return -** SQLITE_OK. Otherwise, enter the error state and return the first -** error code encountered. -** -** In this case there is no chance that the database was written to. -** So is safe to finalize the journal file even if the playback -** (operation 1) failed. However the pager must enter the error state -** as the contents of the in-memory cache are now suspect. -** -** * Finally, if in PAGER_EXCLUSIVE state, then attempt (1). Only -** attempt (2) if (1) is successful. Return SQLITE_OK if successful, -** otherwise enter the error state and return the error code from the -** failing operation. -** -** In this case the database file may have been written to. So if the -** playback operation did not succeed it would not be safe to finalize -** the journal file. It needs to be left in the file-system so that -** some other process can use it to restore the database state (by -** hot-journal rollback). +** In WAL mode, all cache-entries containing data modified within the +** current transaction are either expelled from the cache or reverted to +** their pre-transaction state by re-reading data from the database or +** WAL files. The WAL transaction is then closed. */ SQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){ int rc = SQLITE_OK; /* Return code */ PAGERTRACE(("ROLLBACK %d\n", PAGERID(pPager))); - if( !pPager->dbModified || !isOpen(pPager->jfd) ){ - rc = pager_end_transaction(pPager, pPager->setMaster); - }else if( pPager->errCode && pPager->errCode!=SQLITE_FULL ){ - if( pPager->state>=PAGER_EXCLUSIVE ){ - pager_playback(pPager, 0); - } - rc = pPager->errCode; + + /* PagerRollback() is a no-op if called in READER or OPEN state. If + ** the pager is already in the ERROR state, the rollback is not + ** attempted here. Instead, the error code is returned to the caller. + */ + assert( assert_pager_state(pPager) ); + if( pPager->eState==PAGER_ERROR ) return pPager->errCode; + if( pPager->eState<=PAGER_READER ) return SQLITE_OK; + + if( pagerUseWal(pPager) ){ + int rc2; + rc = sqlite3PagerSavepoint(pPager, SAVEPOINT_ROLLBACK, -1); + rc2 = pager_end_transaction(pPager, pPager->setMaster); + if( rc==SQLITE_OK ) rc = rc2; + }else if( !isOpen(pPager->jfd) || pPager->eState==PAGER_WRITER_LOCKED ){ + rc = pager_end_transaction(pPager, 0); }else{ - if( pPager->state==PAGER_RESERVED ){ - int rc2; - rc = pager_playback(pPager, 0); - rc2 = pager_end_transaction(pPager, pPager->setMaster); - if( rc==SQLITE_OK ){ - rc = rc2; - } - }else{ - rc = pager_playback(pPager, 0); - } - - if( !MEMDB ){ - pPager->dbSizeValid = 0; - } - - /* If an error occurs during a ROLLBACK, we can no longer trust the pager - ** cache. So call pager_error() on the way out to make any error - ** persistent. - */ - rc = pager_error(pPager, rc); + rc = pager_playback(pPager, 0); } - return rc; + + assert( pPager->eState==PAGER_READER || rc!=SQLITE_OK ); + assert( rc==SQLITE_OK || rc==SQLITE_FULL || (rc&0xFF)==SQLITE_IOERR ); + + /* If an error occurs during a ROLLBACK, we can no longer trust the pager + ** cache. So call pager_error() on the way out to make any error persistent. + */ + return pager_error(pPager, rc); } /* @@ -36164,6 +40721,18 @@ SQLITE_PRIVATE int sqlite3PagerRefcount(Pager *pPager){ return sqlite3PcacheRefCount(pPager->pPCache); } +/* +** Return the approximate number of bytes of memory currently +** used by the pager and its associated cache. +*/ +SQLITE_PRIVATE int sqlite3PagerMemUsed(Pager *pPager){ + int perPageSize = pPager->pageSize + pPager->nExtra + sizeof(PgHdr) + + 5*sizeof(void*); + return perPageSize*sqlite3PcachePagecount(pPager->pPCache) + + sqlite3MallocSize(pPager) + + pPager->pageSize; +} + /* ** Return the number of references to the specified page. */ @@ -36180,8 +40749,8 @@ SQLITE_PRIVATE int *sqlite3PagerStats(Pager *pPager){ a[0] = sqlite3PcacheRefCount(pPager->pPCache); a[1] = sqlite3PcachePagecount(pPager->pPCache); a[2] = sqlite3PcacheGetCachesize(pPager->pPCache); - a[3] = pPager->dbSizeValid ? (int) pPager->dbSize : -1; - a[4] = pPager->state; + a[3] = pPager->eState==PAGER_OPEN ? -1 : (int) pPager->dbSize; + a[4] = pPager->eState; a[5] = pPager->errCode; a[6] = pPager->nHit; a[7] = pPager->nMiss; @@ -36213,15 +40782,13 @@ SQLITE_PRIVATE int sqlite3PagerOpenSavepoint(Pager *pPager, int nSavepoint){ int rc = SQLITE_OK; /* Return code */ int nCurrent = pPager->nSavepoint; /* Current number of savepoints */ + assert( pPager->eState>=PAGER_WRITER_LOCKED ); + assert( assert_pager_state(pPager) ); + if( nSavepoint>nCurrent && pPager->useJournal ){ int ii; /* Iterator variable */ PagerSavepoint *aNew; /* New Pager.aSavepoint array */ - /* Either there is no active journal or the sub-journal is open or - ** the journal is always stored in memory */ - assert( pPager->nSavepoint==0 || isOpen(pPager->sjfd) || - pPager->journalMode==PAGER_JOURNALMODE_MEMORY ); - /* Grow the Pager.aSavepoint array using realloc(). Return SQLITE_NOMEM ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. @@ -36234,13 +40801,11 @@ SQLITE_PRIVATE int sqlite3PagerOpenSavepoint(Pager *pPager, int nSavepoint){ } memset(&aNew[nCurrent], 0, (nSavepoint-nCurrent) * sizeof(PagerSavepoint)); pPager->aSavepoint = aNew; - pPager->nSavepoint = nSavepoint; /* Populate the PagerSavepoint structures just allocated. */ for(ii=nCurrent; iidbSizeValid ); aNew[ii].nOrig = pPager->dbSize; - if( isOpen(pPager->jfd) && ALWAYS(pPager->journalOff>0) ){ + if( isOpen(pPager->jfd) && pPager->journalOff>0 ){ aNew[ii].iOffset = pPager->journalOff; }else{ aNew[ii].iOffset = JOURNAL_HDR_SZ(pPager); @@ -36250,10 +40815,12 @@ SQLITE_PRIVATE int sqlite3PagerOpenSavepoint(Pager *pPager, int nSavepoint){ if( !aNew[ii].pInSavepoint ){ return SQLITE_NOMEM; } + if( pagerUseWal(pPager) ){ + sqlite3WalSavepoint(pPager->pWal, aNew[ii].aWalData); + } + pPager->nSavepoint = ii+1; } - - /* Open the sub-journal, if it is not already opened. */ - rc = openSubJournal(pPager); + assert( pPager->nSavepoint==nSavepoint ); assertTruncateConstraint(pPager); } @@ -36291,12 +40858,12 @@ SQLITE_PRIVATE int sqlite3PagerOpenSavepoint(Pager *pPager, int nSavepoint){ ** savepoint. If no errors occur, SQLITE_OK is returned. */ SQLITE_PRIVATE int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ - int rc = SQLITE_OK; + int rc = pPager->errCode; /* Return code */ assert( op==SAVEPOINT_RELEASE || op==SAVEPOINT_ROLLBACK ); assert( iSavepoint>=0 || op==SAVEPOINT_ROLLBACK ); - if( iSavepointnSavepoint ){ + if( rc==SQLITE_OK && iSavepointnSavepoint ){ int ii; /* Iterator variable */ int nNew; /* Number of remaining savepoints after this op. */ @@ -36304,31 +40871,36 @@ SQLITE_PRIVATE int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ ** operation. Store this value in nNew. Then free resources associated ** with any savepoints that are destroyed by this operation. */ - nNew = iSavepoint + (op==SAVEPOINT_ROLLBACK); + nNew = iSavepoint + (( op==SAVEPOINT_RELEASE ) ? 0 : 1); for(ii=nNew; iinSavepoint; ii++){ sqlite3BitvecDestroy(pPager->aSavepoint[ii].pInSavepoint); } pPager->nSavepoint = nNew; - /* If this is a rollback operation, playback the specified savepoint. + /* If this is a release of the outermost savepoint, truncate + ** the sub-journal to zero bytes in size. */ + if( op==SAVEPOINT_RELEASE ){ + if( nNew==0 && isOpen(pPager->sjfd) ){ + /* Only truncate if it is an in-memory sub-journal. */ + if( sqlite3IsMemJournal(pPager->sjfd) ){ + rc = sqlite3OsTruncate(pPager->sjfd, 0); + assert( rc==SQLITE_OK ); + } + pPager->nSubRec = 0; + } + } + /* Else this is a rollback operation, playback the specified savepoint. ** If this is a temp-file, it is possible that the journal file has ** not yet been opened. In this case there have been no changes to ** the database file, so the playback operation can be skipped. */ - if( op==SAVEPOINT_ROLLBACK && isOpen(pPager->jfd) ){ + else if( pagerUseWal(pPager) || isOpen(pPager->jfd) ){ PagerSavepoint *pSavepoint = (nNew==0)?0:&pPager->aSavepoint[nNew-1]; rc = pagerPlaybackSavepoint(pPager, pSavepoint); assert(rc!=SQLITE_DONE); } - - /* If this is a release of the outermost savepoint, truncate - ** the sub-journal to zero bytes in size. */ - if( nNew==0 && op==SAVEPOINT_RELEASE && isOpen(pPager->sjfd) ){ - assert( rc==SQLITE_OK ); - rc = sqlite3OsTruncate(pPager->sjfd, 0); - pPager->nSubRec = 0; - } } + return rc; } @@ -36374,7 +40946,7 @@ SQLITE_PRIVATE int sqlite3PagerNosync(Pager *pPager){ /* ** Set or retrieve the codec for this pager */ -static void sqlite3PagerSetCodec( +SQLITE_PRIVATE void sqlite3PagerSetCodec( Pager *pPager, void *(*xCodec)(void*,void*,Pgno,int), void (*xCodecSizeChng)(void*,int,int), @@ -36382,13 +40954,13 @@ static void sqlite3PagerSetCodec( void *pCodec ){ if( pPager->xCodecFree ) pPager->xCodecFree(pPager->pCodec); - pPager->xCodec = xCodec; + pPager->xCodec = pPager->memDb ? 0 : xCodec; pPager->xCodecSizeChng = xCodecSizeChng; pPager->xCodecFree = xCodecFree; pPager->pCodec = pCodec; pagerReportSize(pPager); } -static void *sqlite3PagerGetCodec(Pager *pPager){ +SQLITE_PRIVATE void *sqlite3PagerGetCodec(Pager *pPager){ return pPager->pCodec; } #endif @@ -36426,6 +40998,18 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i Pgno origPgno; /* The original page number */ assert( pPg->nRef>0 ); + assert( pPager->eState==PAGER_WRITER_CACHEMOD + || pPager->eState==PAGER_WRITER_DBMOD + ); + assert( assert_pager_state(pPager) ); + + /* In order to be able to rollback, an in-memory database must journal + ** the page we are moving from. + */ + if( MEMDB ){ + rc = sqlite3PagerWrite(pPg); + if( rc ) return rc; + } /* If the page being moved is dirty and has not been saved by the latest ** savepoint, then save the current contents of the page into the @@ -36445,7 +41029,7 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i ** one or more savepoint bitvecs. This is the reason this function ** may return SQLITE_NOMEM. */ - if( pPg->flags&PGHDR_DIRTY + if( pPg->flags&PGHDR_DIRTY && subjRequiresPage(pPg) && SQLITE_OK!=(rc = subjournalPage(pPg)) ){ @@ -36467,11 +41051,10 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i needSyncPgno = pPg->pgno; assert( pageInJournal(pPg) || pPg->pgno>pPager->dbOrigSize ); assert( pPg->flags&PGHDR_DIRTY ); - assert( pPager->needSync ); } /* If the cache contains a page with page-number pgno, remove it - ** from its hash chain. Also, if the PgHdr.needSync was set for + ** from its hash chain. Also, if the PGHDR_NEED_SYNC flag was set for ** page pgno before the 'move' operation, it needs to be retained ** for the page moved there. */ @@ -36480,20 +41063,35 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i assert( !pPgOld || pPgOld->nRef==1 ); if( pPgOld ){ pPg->flags |= (pPgOld->flags&PGHDR_NEED_SYNC); - sqlite3PcacheDrop(pPgOld); + if( MEMDB ){ + /* Do not discard pages from an in-memory database since we might + ** need to rollback later. Just move the page out of the way. */ + sqlite3PcacheMove(pPgOld, pPager->dbSize+1); + }else{ + sqlite3PcacheDrop(pPgOld); + } } origPgno = pPg->pgno; sqlite3PcacheMove(pPg, pgno); sqlite3PcacheMakeDirty(pPg); - pPager->dbModified = 1; + + /* For an in-memory database, make sure the original page continues + ** to exist, in case the transaction needs to roll back. Use pPgOld + ** as the original page since it has already been allocated. + */ + if( MEMDB ){ + assert( pPgOld ); + sqlite3PcacheMove(pPgOld, origPgno); + sqlite3PagerUnref(pPgOld); + } if( needSyncPgno ){ /* If needSyncPgno is non-zero, then the journal file needs to be ** sync()ed before any data is written to database file page needSyncPgno. ** Currently, no such page exists in the page-cache and the ** "is journaled" bitvec flag has been set. This needs to be remedied by - ** loading the page into the pager-cache and setting the PgHdr.needSync + ** loading the page into the pager-cache and setting the PGHDR_NEED_SYNC ** flag. ** ** If the attempt to load the page into the page-cache fails, (due @@ -36502,12 +41100,8 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i ** this transaction, it may be written to the database file before ** it is synced into the journal file. This way, it may end up in ** the journal file twice, but that is not a problem. - ** - ** The sqlite3PagerGet() call may cause the journal to sync. So make - ** sure the Pager.needSync flag is set too. */ PgHdr *pPgHdr; - assert( pPager->needSync ); rc = sqlite3PagerGet(pPager, needSyncPgno, &pPgHdr); if( rc!=SQLITE_OK ){ if( needSyncPgno<=pPager->dbOrigSize ){ @@ -36516,29 +41110,11 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i } return rc; } - pPager->needSync = 1; - assert( pPager->noSync==0 && !MEMDB ); pPgHdr->flags |= PGHDR_NEED_SYNC; sqlite3PcacheMakeDirty(pPgHdr); sqlite3PagerUnref(pPgHdr); } - /* - ** For an in-memory database, make sure the original page continues - ** to exist, in case the transaction needs to roll back. We allocate - ** the page now, instead of at rollback, because we can better deal - ** with an out-of-memory error now. Ticket #3761. - */ - if( MEMDB ){ - DbPage *pNew; - rc = sqlite3PagerAcquire(pPager, origPgno, &pNew, 1); - if( rc!=SQLITE_OK ){ - sqlite3PcacheMove(pPg, origPgno); - return rc; - } - sqlite3PagerUnref(pNew); - } - return SQLITE_OK; } #endif @@ -36582,48 +41158,137 @@ SQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *pPager, int eMode){ } /* -** Get/set the journal-mode for this pager. Parameter eMode must be one of: +** Set the journal-mode for this pager. Parameter eMode must be one of: ** -** PAGER_JOURNALMODE_QUERY ** PAGER_JOURNALMODE_DELETE ** PAGER_JOURNALMODE_TRUNCATE ** PAGER_JOURNALMODE_PERSIST ** PAGER_JOURNALMODE_OFF ** PAGER_JOURNALMODE_MEMORY +** PAGER_JOURNALMODE_WAL ** -** If the parameter is not _QUERY, then the journal_mode is set to the -** value specified if the change is allowed. The change is disallowed -** for the following reasons: +** The journalmode is set to the value specified if the change is allowed. +** The change may be disallowed for the following reasons: ** ** * An in-memory database can only have its journal_mode set to _OFF ** or _MEMORY. ** -** * The journal mode may not be changed while a transaction is active. +** * Temporary databases cannot have _WAL journalmode. ** ** The returned indicate the current (possibly updated) journal-mode. */ -SQLITE_PRIVATE int sqlite3PagerJournalMode(Pager *pPager, int eMode){ - assert( eMode==PAGER_JOURNALMODE_QUERY - || eMode==PAGER_JOURNALMODE_DELETE +SQLITE_PRIVATE int sqlite3PagerSetJournalMode(Pager *pPager, int eMode){ + u8 eOld = pPager->journalMode; /* Prior journalmode */ + +#ifdef SQLITE_DEBUG + /* The print_pager_state() routine is intended to be used by the debugger + ** only. We invoke it once here to suppress a compiler warning. */ + print_pager_state(pPager); +#endif + + + /* The eMode parameter is always valid */ + assert( eMode==PAGER_JOURNALMODE_DELETE || eMode==PAGER_JOURNALMODE_TRUNCATE || eMode==PAGER_JOURNALMODE_PERSIST || eMode==PAGER_JOURNALMODE_OFF + || eMode==PAGER_JOURNALMODE_WAL || eMode==PAGER_JOURNALMODE_MEMORY ); - assert( PAGER_JOURNALMODE_QUERY<0 ); - if( eMode>=0 - && (!MEMDB || eMode==PAGER_JOURNALMODE_MEMORY - || eMode==PAGER_JOURNALMODE_OFF) - && !pPager->dbModified - && (!isOpen(pPager->jfd) || 0==pPager->journalOff) - ){ - if( isOpen(pPager->jfd) ){ - sqlite3OsClose(pPager->jfd); + + /* This routine is only called from the OP_JournalMode opcode, and + ** the logic there will never allow a temporary file to be changed + ** to WAL mode. + */ + assert( pPager->tempFile==0 || eMode!=PAGER_JOURNALMODE_WAL ); + + /* Do allow the journalmode of an in-memory database to be set to + ** anything other than MEMORY or OFF + */ + if( MEMDB ){ + assert( eOld==PAGER_JOURNALMODE_MEMORY || eOld==PAGER_JOURNALMODE_OFF ); + if( eMode!=PAGER_JOURNALMODE_MEMORY && eMode!=PAGER_JOURNALMODE_OFF ){ + eMode = eOld; } - pPager->journalMode = (u8)eMode; } + + if( eMode!=eOld ){ + + /* Change the journal mode. */ + assert( pPager->eState!=PAGER_ERROR ); + pPager->journalMode = (u8)eMode; + + /* When transistioning from TRUNCATE or PERSIST to any other journal + ** mode except WAL, unless the pager is in locking_mode=exclusive mode, + ** delete the journal file. + */ + assert( (PAGER_JOURNALMODE_TRUNCATE & 5)==1 ); + assert( (PAGER_JOURNALMODE_PERSIST & 5)==1 ); + assert( (PAGER_JOURNALMODE_DELETE & 5)==0 ); + assert( (PAGER_JOURNALMODE_MEMORY & 5)==4 ); + assert( (PAGER_JOURNALMODE_OFF & 5)==0 ); + assert( (PAGER_JOURNALMODE_WAL & 5)==5 ); + + assert( isOpen(pPager->fd) || pPager->exclusiveMode ); + if( !pPager->exclusiveMode && (eOld & 5)==1 && (eMode & 1)==0 ){ + + /* In this case we would like to delete the journal file. If it is + ** not possible, then that is not a problem. Deleting the journal file + ** here is an optimization only. + ** + ** Before deleting the journal file, obtain a RESERVED lock on the + ** database file. This ensures that the journal file is not deleted + ** while it is in use by some other client. + */ + sqlite3OsClose(pPager->jfd); + if( pPager->eLock>=RESERVED_LOCK ){ + sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0); + }else{ + int rc = SQLITE_OK; + int state = pPager->eState; + assert( state==PAGER_OPEN || state==PAGER_READER ); + if( state==PAGER_OPEN ){ + rc = sqlite3PagerSharedLock(pPager); + } + if( pPager->eState==PAGER_READER ){ + assert( rc==SQLITE_OK ); + rc = pagerLockDb(pPager, RESERVED_LOCK); + } + if( rc==SQLITE_OK ){ + sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0); + } + if( rc==SQLITE_OK && state==PAGER_READER ){ + pagerUnlockDb(pPager, SHARED_LOCK); + }else if( state==PAGER_OPEN ){ + pager_unlock(pPager); + } + assert( state==pPager->eState ); + } + } + } + + /* Return the new journal mode */ return (int)pPager->journalMode; } +/* +** Return the current journal mode. +*/ +SQLITE_PRIVATE int sqlite3PagerGetJournalMode(Pager *pPager){ + return (int)pPager->journalMode; +} + +/* +** Return TRUE if the pager is in a state where it is OK to change the +** journalmode. Journalmode changes can only happen when the database +** is unmodified. +*/ +SQLITE_PRIVATE int sqlite3PagerOkToChangeJournalMode(Pager *pPager){ + assert( assert_pager_state(pPager) ); + if( pPager->eState>=PAGER_WRITER_CACHEMOD ) return 0; + if( NEVER(isOpen(pPager->jfd) && pPager->journalOff>0) ) return 0; + return 1; +} + /* ** Get/set the size-limit used for persistent journal files. ** @@ -36647,9 +41312,2868 @@ SQLITE_PRIVATE sqlite3_backup **sqlite3PagerBackupPtr(Pager *pPager){ return &pPager->pBackup; } +#ifndef SQLITE_OMIT_WAL +/* +** This function is called when the user invokes "PRAGMA checkpoint". +*/ +SQLITE_PRIVATE int sqlite3PagerCheckpoint(Pager *pPager){ + int rc = SQLITE_OK; + if( pPager->pWal ){ + u8 *zBuf = (u8 *)pPager->pTmpSpace; + rc = sqlite3WalCheckpoint(pPager->pWal, + (pPager->noSync ? 0 : pPager->sync_flags), + pPager->pageSize, zBuf + ); + } + return rc; +} + +SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager){ + return sqlite3WalCallback(pPager->pWal); +} + +/* +** Return true if the underlying VFS for the given pager supports the +** primitives necessary for write-ahead logging. +*/ +SQLITE_PRIVATE int sqlite3PagerWalSupported(Pager *pPager){ + const sqlite3_io_methods *pMethods = pPager->fd->pMethods; + return pMethods->iVersion>=2 && pMethods->xShmMap!=0; +} + +/* +** The caller must be holding a SHARED lock on the database file to call +** this function. +** +** If the pager passed as the first argument is open on a real database +** file (not a temp file or an in-memory database), and the WAL file +** is not already open, make an attempt to open it now. If successful, +** return SQLITE_OK. If an error occurs or the VFS used by the pager does +** not support the xShmXXX() methods, return an error code. *pbOpen is +** not modified in either case. +** +** If the pager is open on a temp-file (or in-memory database), or if +** the WAL file is already open, set *pbOpen to 1 and return SQLITE_OK +** without doing anything. +*/ +SQLITE_PRIVATE int sqlite3PagerOpenWal( + Pager *pPager, /* Pager object */ + int *pbOpen /* OUT: Set to true if call is a no-op */ +){ + int rc = SQLITE_OK; /* Return code */ + + assert( assert_pager_state(pPager) ); + assert( pPager->eState==PAGER_OPEN || pbOpen ); + assert( pPager->eState==PAGER_READER || !pbOpen ); + assert( pbOpen==0 || *pbOpen==0 ); + assert( pbOpen!=0 || (!pPager->tempFile && !pPager->pWal) ); + + if( !pPager->tempFile && !pPager->pWal ){ + if( !sqlite3PagerWalSupported(pPager) ) return SQLITE_CANTOPEN; + + /* Close any rollback journal previously open */ + sqlite3OsClose(pPager->jfd); + + /* Open the connection to the log file. If this operation fails, + ** (e.g. due to malloc() failure), unlock the database file and + ** return an error code. + */ + rc = sqlite3WalOpen(pPager->pVfs, pPager->fd, pPager->zWal, &pPager->pWal); + if( rc==SQLITE_OK ){ + pPager->journalMode = PAGER_JOURNALMODE_WAL; + pPager->eState = PAGER_OPEN; + } + }else{ + *pbOpen = 1; + } + + return rc; +} + +/* +** This function is called to close the connection to the log file prior +** to switching from WAL to rollback mode. +** +** Before closing the log file, this function attempts to take an +** EXCLUSIVE lock on the database file. If this cannot be obtained, an +** error (SQLITE_BUSY) is returned and the log connection is not closed. +** If successful, the EXCLUSIVE lock is not released before returning. +*/ +SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager){ + int rc = SQLITE_OK; + + assert( pPager->journalMode==PAGER_JOURNALMODE_WAL ); + + /* If the log file is not already open, but does exist in the file-system, + ** it may need to be checkpointed before the connection can switch to + ** rollback mode. Open it now so this can happen. + */ + if( !pPager->pWal ){ + int logexists = 0; + rc = pagerLockDb(pPager, SHARED_LOCK); + if( rc==SQLITE_OK ){ + rc = sqlite3OsAccess( + pPager->pVfs, pPager->zWal, SQLITE_ACCESS_EXISTS, &logexists + ); + } + if( rc==SQLITE_OK && logexists ){ + rc = sqlite3WalOpen(pPager->pVfs, pPager->fd, + pPager->zWal, &pPager->pWal); + } + } + + /* Checkpoint and close the log. Because an EXCLUSIVE lock is held on + ** the database file, the log and log-summary files will be deleted. + */ + if( rc==SQLITE_OK && pPager->pWal ){ + rc = pagerLockDb(pPager, EXCLUSIVE_LOCK); + if( rc==SQLITE_OK ){ + rc = sqlite3WalClose(pPager->pWal, + (pPager->noSync ? 0 : pPager->sync_flags), + pPager->pageSize, (u8*)pPager->pTmpSpace + ); + pPager->pWal = 0; + }else{ + /* If we cannot get an EXCLUSIVE lock, downgrade the PENDING lock + ** that we did get back to SHARED. */ + pagerUnlockDb(pPager, SQLITE_LOCK_SHARED); + } + } + return rc; +} + +#ifdef SQLITE_HAS_CODEC +/* +** This function is called by the wal module when writing page content +** into the log file. +** +** This function returns a pointer to a buffer containing the encrypted +** page content. If a malloc fails, this function may return NULL. +*/ +SQLITE_PRIVATE void *sqlite3PagerCodec(PgHdr *pPg){ + void *aData = 0; + CODEC2(pPg->pPager, pPg->pData, pPg->pgno, 6, return 0, aData); + return aData; +} +#endif /* SQLITE_HAS_CODEC */ + +#endif /* !SQLITE_OMIT_WAL */ + #endif /* SQLITE_OMIT_DISKIO */ /************** End of pager.c ***********************************************/ +/************** Begin file wal.c *********************************************/ +/* +** 2010 February 1 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file contains the implementation of a write-ahead log (WAL) used in +** "journal_mode=WAL" mode. +** +** WRITE-AHEAD LOG (WAL) FILE FORMAT +** +** A WAL file consists of a header followed by zero or more "frames". +** Each frame records the revised content of a single page from the +** database file. All changes to the database are recorded by writing +** frames into the WAL. Transactions commit when a frame is written that +** contains a commit marker. A single WAL can and usually does record +** multiple transactions. Periodically, the content of the WAL is +** transferred back into the database file in an operation called a +** "checkpoint". +** +** A single WAL file can be used multiple times. In other words, the +** WAL can fill up with frames and then be checkpointed and then new +** frames can overwrite the old ones. A WAL always grows from beginning +** toward the end. Checksums and counters attached to each frame are +** used to determine which frames within the WAL are valid and which +** are leftovers from prior checkpoints. +** +** The WAL header is 32 bytes in size and consists of the following eight +** big-endian 32-bit unsigned integer values: +** +** 0: Magic number. 0x377f0682 or 0x377f0683 +** 4: File format version. Currently 3007000 +** 8: Database page size. Example: 1024 +** 12: Checkpoint sequence number +** 16: Salt-1, random integer incremented with each checkpoint +** 20: Salt-2, a different random integer changing with each ckpt +** 24: Checksum-1 (first part of checksum for first 24 bytes of header). +** 28: Checksum-2 (second part of checksum for first 24 bytes of header). +** +** Immediately following the wal-header are zero or more frames. Each +** frame consists of a 24-byte frame-header followed by a bytes +** of page data. The frame-header is six big-endian 32-bit unsigned +** integer values, as follows: +** +** 0: Page number. +** 4: For commit records, the size of the database image in pages +** after the commit. For all other records, zero. +** 8: Salt-1 (copied from the header) +** 12: Salt-2 (copied from the header) +** 16: Checksum-1. +** 20: Checksum-2. +** +** A frame is considered valid if and only if the following conditions are +** true: +** +** (1) The salt-1 and salt-2 values in the frame-header match +** salt values in the wal-header +** +** (2) The checksum values in the final 8 bytes of the frame-header +** exactly match the checksum computed consecutively on the +** WAL header and the first 8 bytes and the content of all frames +** up to and including the current frame. +** +** The checksum is computed using 32-bit big-endian integers if the +** magic number in the first 4 bytes of the WAL is 0x377f0683 and it +** is computed using little-endian if the magic number is 0x377f0682. +** The checksum values are always stored in the frame header in a +** big-endian format regardless of which byte order is used to compute +** the checksum. The checksum is computed by interpreting the input as +** an even number of unsigned 32-bit integers: x[0] through x[N]. The +** algorithm used for the checksum is as follows: +** +** for i from 0 to n-1 step 2: +** s0 += x[i] + s1; +** s1 += x[i+1] + s0; +** endfor +** +** Note that s0 and s1 are both weighted checksums using fibonacci weights +** in reverse order (the largest fibonacci weight occurs on the first element +** of the sequence being summed.) The s1 value spans all 32-bit +** terms of the sequence whereas s0 omits the final term. +** +** On a checkpoint, the WAL is first VFS.xSync-ed, then valid content of the +** WAL is transferred into the database, then the database is VFS.xSync-ed. +** The VFS.xSync operations serve as write barriers - all writes launched +** before the xSync must complete before any write that launches after the +** xSync begins. +** +** After each checkpoint, the salt-1 value is incremented and the salt-2 +** value is randomized. This prevents old and new frames in the WAL from +** being considered valid at the same time and being checkpointing together +** following a crash. +** +** READER ALGORITHM +** +** To read a page from the database (call it page number P), a reader +** first checks the WAL to see if it contains page P. If so, then the +** last valid instance of page P that is a followed by a commit frame +** or is a commit frame itself becomes the value read. If the WAL +** contains no copies of page P that are valid and which are a commit +** frame or are followed by a commit frame, then page P is read from +** the database file. +** +** To start a read transaction, the reader records the index of the last +** valid frame in the WAL. The reader uses this recorded "mxFrame" value +** for all subsequent read operations. New transactions can be appended +** to the WAL, but as long as the reader uses its original mxFrame value +** and ignores the newly appended content, it will see a consistent snapshot +** of the database from a single point in time. This technique allows +** multiple concurrent readers to view different versions of the database +** content simultaneously. +** +** The reader algorithm in the previous paragraphs works correctly, but +** because frames for page P can appear anywhere within the WAL, the +** reader has to scan the entire WAL looking for page P frames. If the +** WAL is large (multiple megabytes is typical) that scan can be slow, +** and read performance suffers. To overcome this problem, a separate +** data structure called the wal-index is maintained to expedite the +** search for frames of a particular page. +** +** WAL-INDEX FORMAT +** +** Conceptually, the wal-index is shared memory, though VFS implementations +** might choose to implement the wal-index using a mmapped file. Because +** the wal-index is shared memory, SQLite does not support journal_mode=WAL +** on a network filesystem. All users of the database must be able to +** share memory. +** +** The wal-index is transient. After a crash, the wal-index can (and should +** be) reconstructed from the original WAL file. In fact, the VFS is required +** to either truncate or zero the header of the wal-index when the last +** connection to it closes. Because the wal-index is transient, it can +** use an architecture-specific format; it does not have to be cross-platform. +** Hence, unlike the database and WAL file formats which store all values +** as big endian, the wal-index can store multi-byte values in the native +** byte order of the host computer. +** +** The purpose of the wal-index is to answer this question quickly: Given +** a page number P, return the index of the last frame for page P in the WAL, +** or return NULL if there are no frames for page P in the WAL. +** +** The wal-index consists of a header region, followed by an one or +** more index blocks. +** +** The wal-index header contains the total number of frames within the WAL +** in the the mxFrame field. +** +** Each index block except for the first contains information on +** HASHTABLE_NPAGE frames. The first index block contains information on +** HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and +** HASHTABLE_NPAGE are selected so that together the wal-index header and +** first index block are the same size as all other index blocks in the +** wal-index. +** +** Each index block contains two sections, a page-mapping that contains the +** database page number associated with each wal frame, and a hash-table +** that allows readers to query an index block for a specific page number. +** The page-mapping is an array of HASHTABLE_NPAGE (or HASHTABLE_NPAGE_ONE +** for the first index block) 32-bit page numbers. The first entry in the +** first index-block contains the database page number corresponding to the +** first frame in the WAL file. The first entry in the second index block +** in the WAL file corresponds to the (HASHTABLE_NPAGE_ONE+1)th frame in +** the log, and so on. +** +** The last index block in a wal-index usually contains less than the full +** complement of HASHTABLE_NPAGE (or HASHTABLE_NPAGE_ONE) page-numbers, +** depending on the contents of the WAL file. This does not change the +** allocated size of the page-mapping array - the page-mapping array merely +** contains unused entries. +** +** Even without using the hash table, the last frame for page P +** can be found by scanning the page-mapping sections of each index block +** starting with the last index block and moving toward the first, and +** within each index block, starting at the end and moving toward the +** beginning. The first entry that equals P corresponds to the frame +** holding the content for that page. +** +** The hash table consists of HASHTABLE_NSLOT 16-bit unsigned integers. +** HASHTABLE_NSLOT = 2*HASHTABLE_NPAGE, and there is one entry in the +** hash table for each page number in the mapping section, so the hash +** table is never more than half full. The expected number of collisions +** prior to finding a match is 1. Each entry of the hash table is an +** 1-based index of an entry in the mapping section of the same +** index block. Let K be the 1-based index of the largest entry in +** the mapping section. (For index blocks other than the last, K will +** always be exactly HASHTABLE_NPAGE (4096) and for the last index block +** K will be (mxFrame%HASHTABLE_NPAGE).) Unused slots of the hash table +** contain a value of 0. +** +** To look for page P in the hash table, first compute a hash iKey on +** P as follows: +** +** iKey = (P * 383) % HASHTABLE_NSLOT +** +** Then start scanning entries of the hash table, starting with iKey +** (wrapping around to the beginning when the end of the hash table is +** reached) until an unused hash slot is found. Let the first unused slot +** be at index iUnused. (iUnused might be less than iKey if there was +** wrap-around.) Because the hash table is never more than half full, +** the search is guaranteed to eventually hit an unused entry. Let +** iMax be the value between iKey and iUnused, closest to iUnused, +** where aHash[iMax]==P. If there is no iMax entry (if there exists +** no hash slot such that aHash[i]==p) then page P is not in the +** current index block. Otherwise the iMax-th mapping entry of the +** current index block corresponds to the last entry that references +** page P. +** +** A hash search begins with the last index block and moves toward the +** first index block, looking for entries corresponding to page P. On +** average, only two or three slots in each index block need to be +** examined in order to either find the last entry for page P, or to +** establish that no such entry exists in the block. Each index block +** holds over 4000 entries. So two or three index blocks are sufficient +** to cover a typical 10 megabyte WAL file, assuming 1K pages. 8 or 10 +** comparisons (on average) suffice to either locate a frame in the +** WAL or to establish that the frame does not exist in the WAL. This +** is much faster than scanning the entire 10MB WAL. +** +** Note that entries are added in order of increasing K. Hence, one +** reader might be using some value K0 and a second reader that started +** at a later time (after additional transactions were added to the WAL +** and to the wal-index) might be using a different value K1, where K1>K0. +** Both readers can use the same hash table and mapping section to get +** the correct result. There may be entries in the hash table with +** K>K0 but to the first reader, those entries will appear to be unused +** slots in the hash table and so the first reader will get an answer as +** if no values greater than K0 had ever been inserted into the hash table +** in the first place - which is what reader one wants. Meanwhile, the +** second reader using K1 will see additional values that were inserted +** later, which is exactly what reader two wants. +** +** When a rollback occurs, the value of K is decreased. Hash table entries +** that correspond to frames greater than the new K value are removed +** from the hash table at this point. +*/ +#ifndef SQLITE_OMIT_WAL + + +/* +** Trace output macros +*/ +#if defined(SQLITE_TEST) && defined(SQLITE_DEBUG) +SQLITE_PRIVATE int sqlite3WalTrace = 0; +# define WALTRACE(X) if(sqlite3WalTrace) sqlite3DebugPrintf X +#else +# define WALTRACE(X) +#endif + +/* +** The maximum (and only) versions of the wal and wal-index formats +** that may be interpreted by this version of SQLite. +** +** If a client begins recovering a WAL file and finds that (a) the checksum +** values in the wal-header are correct and (b) the version field is not +** WAL_MAX_VERSION, recovery fails and SQLite returns SQLITE_CANTOPEN. +** +** Similarly, if a client successfully reads a wal-index header (i.e. the +** checksum test is successful) and finds that the version field is not +** WALINDEX_MAX_VERSION, then no read-transaction is opened and SQLite +** returns SQLITE_CANTOPEN. +*/ +#define WAL_MAX_VERSION 3007000 +#define WALINDEX_MAX_VERSION 3007000 + +/* +** Indices of various locking bytes. WAL_NREADER is the number +** of available reader locks and should be at least 3. +*/ +#define WAL_WRITE_LOCK 0 +#define WAL_ALL_BUT_WRITE 1 +#define WAL_CKPT_LOCK 1 +#define WAL_RECOVER_LOCK 2 +#define WAL_READ_LOCK(I) (3+(I)) +#define WAL_NREADER (SQLITE_SHM_NLOCK-3) + + +/* Object declarations */ +typedef struct WalIndexHdr WalIndexHdr; +typedef struct WalIterator WalIterator; +typedef struct WalCkptInfo WalCkptInfo; + + +/* +** The following object holds a copy of the wal-index header content. +** +** The actual header in the wal-index consists of two copies of this +** object. +** +** The szPage value can be any power of 2 between 512 and 32768, inclusive. +** Or it can be 1 to represent a 65536-byte page. The latter case was +** added in 3.7.1 when support for 64K pages was added. +*/ +struct WalIndexHdr { + u32 iVersion; /* Wal-index version */ + u32 unused; /* Unused (padding) field */ + u32 iChange; /* Counter incremented each transaction */ + u8 isInit; /* 1 when initialized */ + u8 bigEndCksum; /* True if checksums in WAL are big-endian */ + u16 szPage; /* Database page size in bytes. 1==64K */ + u32 mxFrame; /* Index of last valid frame in the WAL */ + u32 nPage; /* Size of database in pages */ + u32 aFrameCksum[2]; /* Checksum of last frame in log */ + u32 aSalt[2]; /* Two salt values copied from WAL header */ + u32 aCksum[2]; /* Checksum over all prior fields */ +}; + +/* +** A copy of the following object occurs in the wal-index immediately +** following the second copy of the WalIndexHdr. This object stores +** information used by checkpoint. +** +** nBackfill is the number of frames in the WAL that have been written +** back into the database. (We call the act of moving content from WAL to +** database "backfilling".) The nBackfill number is never greater than +** WalIndexHdr.mxFrame. nBackfill can only be increased by threads +** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). +** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from +** mxFrame back to zero when the WAL is reset. +** +** There is one entry in aReadMark[] for each reader lock. If a reader +** holds read-lock K, then the value in aReadMark[K] is no greater than +** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) +** for any aReadMark[] means that entry is unused. aReadMark[0] is +** a special case; its value is never used and it exists as a place-holder +** to avoid having to offset aReadMark[] indexs by one. Readers holding +** WAL_READ_LOCK(0) always ignore the entire WAL and read all content +** directly from the database. +** +** The value of aReadMark[K] may only be changed by a thread that +** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of +** aReadMark[K] cannot changed while there is a reader is using that mark +** since the reader will be holding a shared lock on WAL_READ_LOCK(K). +** +** The checkpointer may only transfer frames from WAL to database where +** the frame numbers are less than or equal to every aReadMark[] that is +** in use (that is, every aReadMark[j] for which there is a corresponding +** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the +** largest value and will increase an unused aReadMark[] to mxFrame if there +** is not already an aReadMark[] equal to mxFrame. The exception to the +** previous sentence is when nBackfill equals mxFrame (meaning that everything +** in the WAL has been backfilled into the database) then new readers +** will choose aReadMark[0] which has value 0 and hence such reader will +** get all their all content directly from the database file and ignore +** the WAL. +** +** Writers normally append new frames to the end of the WAL. However, +** if nBackfill equals mxFrame (meaning that all WAL content has been +** written back into the database) and if no readers are using the WAL +** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then +** the writer will first "reset" the WAL back to the beginning and start +** writing new content beginning at frame 1. +** +** We assume that 32-bit loads are atomic and so no locks are needed in +** order to read from any aReadMark[] entries. +*/ +struct WalCkptInfo { + u32 nBackfill; /* Number of WAL frames backfilled into DB */ + u32 aReadMark[WAL_NREADER]; /* Reader marks */ +}; +#define READMARK_NOT_USED 0xffffffff + + +/* A block of WALINDEX_LOCK_RESERVED bytes beginning at +** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems +** only support mandatory file-locks, we do not read or write data +** from the region of the file on which locks are applied. +*/ +#define WALINDEX_LOCK_OFFSET (sizeof(WalIndexHdr)*2 + sizeof(WalCkptInfo)) +#define WALINDEX_LOCK_RESERVED 16 +#define WALINDEX_HDR_SIZE (WALINDEX_LOCK_OFFSET+WALINDEX_LOCK_RESERVED) + +/* Size of header before each frame in wal */ +#define WAL_FRAME_HDRSIZE 24 + +/* Size of write ahead log header, including checksum. */ +/* #define WAL_HDRSIZE 24 */ +#define WAL_HDRSIZE 32 + +/* WAL magic value. Either this value, or the same value with the least +** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit +** big-endian format in the first 4 bytes of a WAL file. +** +** If the LSB is set, then the checksums for each frame within the WAL +** file are calculated by treating all data as an array of 32-bit +** big-endian words. Otherwise, they are calculated by interpreting +** all data as 32-bit little-endian words. +*/ +#define WAL_MAGIC 0x377f0682 + +/* +** Return the offset of frame iFrame in the write-ahead log file, +** assuming a database page size of szPage bytes. The offset returned +** is to the start of the write-ahead log frame-header. +*/ +#define walFrameOffset(iFrame, szPage) ( \ + WAL_HDRSIZE + ((iFrame)-1)*(i64)((szPage)+WAL_FRAME_HDRSIZE) \ +) + +/* +** An open write-ahead log file is represented by an instance of the +** following object. +*/ +struct Wal { + sqlite3_vfs *pVfs; /* The VFS used to create pDbFd */ + sqlite3_file *pDbFd; /* File handle for the database file */ + sqlite3_file *pWalFd; /* File handle for WAL file */ + u32 iCallback; /* Value to pass to log callback (or 0) */ + int nWiData; /* Size of array apWiData */ + volatile u32 **apWiData; /* Pointer to wal-index content in memory */ + u32 szPage; /* Database page size */ + i16 readLock; /* Which read lock is being held. -1 for none */ + u8 exclusiveMode; /* Non-zero if connection is in exclusive mode */ + u8 writeLock; /* True if in a write transaction */ + u8 ckptLock; /* True if holding a checkpoint lock */ + u8 readOnly; /* True if the WAL file is open read-only */ + WalIndexHdr hdr; /* Wal-index header for current transaction */ + const char *zWalName; /* Name of WAL file */ + u32 nCkpt; /* Checkpoint sequence counter in the wal-header */ +#ifdef SQLITE_DEBUG + u8 lockError; /* True if a locking error has occurred */ +#endif +}; + +/* +** Each page of the wal-index mapping contains a hash-table made up of +** an array of HASHTABLE_NSLOT elements of the following type. +*/ +typedef u16 ht_slot; + +/* +** This structure is used to implement an iterator that loops through +** all frames in the WAL in database page order. Where two or more frames +** correspond to the same database page, the iterator visits only the +** frame most recently written to the WAL (in other words, the frame with +** the largest index). +** +** The internals of this structure are only accessed by: +** +** walIteratorInit() - Create a new iterator, +** walIteratorNext() - Step an iterator, +** walIteratorFree() - Free an iterator. +** +** This functionality is used by the checkpoint code (see walCheckpoint()). +*/ +struct WalIterator { + int iPrior; /* Last result returned from the iterator */ + int nSegment; /* Size of the aSegment[] array */ + struct WalSegment { + int iNext; /* Next slot in aIndex[] not yet returned */ + ht_slot *aIndex; /* i0, i1, i2... such that aPgno[iN] ascend */ + u32 *aPgno; /* Array of page numbers. */ + int nEntry; /* Max size of aPgno[] and aIndex[] arrays */ + int iZero; /* Frame number associated with aPgno[0] */ + } aSegment[1]; /* One for every 32KB page in the WAL */ +}; + +/* +** Define the parameters of the hash tables in the wal-index file. There +** is a hash-table following every HASHTABLE_NPAGE page numbers in the +** wal-index. +** +** Changing any of these constants will alter the wal-index format and +** create incompatibilities. +*/ +#define HASHTABLE_NPAGE 4096 /* Must be power of 2 */ +#define HASHTABLE_HASH_1 383 /* Should be prime */ +#define HASHTABLE_NSLOT (HASHTABLE_NPAGE*2) /* Must be a power of 2 */ + +/* +** The block of page numbers associated with the first hash-table in a +** wal-index is smaller than usual. This is so that there is a complete +** hash-table on each aligned 32KB page of the wal-index. +*/ +#define HASHTABLE_NPAGE_ONE (HASHTABLE_NPAGE - (WALINDEX_HDR_SIZE/sizeof(u32))) + +/* The wal-index is divided into pages of WALINDEX_PGSZ bytes each. */ +#define WALINDEX_PGSZ ( \ + sizeof(ht_slot)*HASHTABLE_NSLOT + HASHTABLE_NPAGE*sizeof(u32) \ +) + +/* +** Obtain a pointer to the iPage'th page of the wal-index. The wal-index +** is broken into pages of WALINDEX_PGSZ bytes. Wal-index pages are +** numbered from zero. +** +** If this call is successful, *ppPage is set to point to the wal-index +** page and SQLITE_OK is returned. If an error (an OOM or VFS error) occurs, +** then an SQLite error code is returned and *ppPage is set to 0. +*/ +static int walIndexPage(Wal *pWal, int iPage, volatile u32 **ppPage){ + int rc = SQLITE_OK; + + /* Enlarge the pWal->apWiData[] array if required */ + if( pWal->nWiData<=iPage ){ + int nByte = sizeof(u32*)*(iPage+1); + volatile u32 **apNew; + apNew = (volatile u32 **)sqlite3_realloc((void *)pWal->apWiData, nByte); + if( !apNew ){ + *ppPage = 0; + return SQLITE_NOMEM; + } + memset((void*)&apNew[pWal->nWiData], 0, + sizeof(u32*)*(iPage+1-pWal->nWiData)); + pWal->apWiData = apNew; + pWal->nWiData = iPage+1; + } + + /* Request a pointer to the required page from the VFS */ + if( pWal->apWiData[iPage]==0 ){ + rc = sqlite3OsShmMap(pWal->pDbFd, iPage, WALINDEX_PGSZ, + pWal->writeLock, (void volatile **)&pWal->apWiData[iPage] + ); + } + + *ppPage = pWal->apWiData[iPage]; + assert( iPage==0 || *ppPage || rc!=SQLITE_OK ); + return rc; +} + +/* +** Return a pointer to the WalCkptInfo structure in the wal-index. +*/ +static volatile WalCkptInfo *walCkptInfo(Wal *pWal){ + assert( pWal->nWiData>0 && pWal->apWiData[0] ); + return (volatile WalCkptInfo*)&(pWal->apWiData[0][sizeof(WalIndexHdr)/2]); +} + +/* +** Return a pointer to the WalIndexHdr structure in the wal-index. +*/ +static volatile WalIndexHdr *walIndexHdr(Wal *pWal){ + assert( pWal->nWiData>0 && pWal->apWiData[0] ); + return (volatile WalIndexHdr*)pWal->apWiData[0]; +} + +/* +** The argument to this macro must be of type u32. On a little-endian +** architecture, it returns the u32 value that results from interpreting +** the 4 bytes as a big-endian value. On a big-endian architecture, it +** returns the value that would be produced by intepreting the 4 bytes +** of the input value as a little-endian integer. +*/ +#define BYTESWAP32(x) ( \ + (((x)&0x000000FF)<<24) + (((x)&0x0000FF00)<<8) \ + + (((x)&0x00FF0000)>>8) + (((x)&0xFF000000)>>24) \ +) + +/* +** Generate or extend an 8 byte checksum based on the data in +** array aByte[] and the initial values of aIn[0] and aIn[1] (or +** initial values of 0 and 0 if aIn==NULL). +** +** The checksum is written back into aOut[] before returning. +** +** nByte must be a positive multiple of 8. +*/ +static void walChecksumBytes( + int nativeCksum, /* True for native byte-order, false for non-native */ + u8 *a, /* Content to be checksummed */ + int nByte, /* Bytes of content in a[]. Must be a multiple of 8. */ + const u32 *aIn, /* Initial checksum value input */ + u32 *aOut /* OUT: Final checksum value output */ +){ + u32 s1, s2; + u32 *aData = (u32 *)a; + u32 *aEnd = (u32 *)&a[nByte]; + + if( aIn ){ + s1 = aIn[0]; + s2 = aIn[1]; + }else{ + s1 = s2 = 0; + } + + assert( nByte>=8 ); + assert( (nByte&0x00000007)==0 ); + + if( nativeCksum ){ + do { + s1 += *aData++ + s2; + s2 += *aData++ + s1; + }while( aDatahdr into the wal-index. +** +** The checksum on pWal->hdr is updated before it is written. +*/ +static void walIndexWriteHdr(Wal *pWal){ + volatile WalIndexHdr *aHdr = walIndexHdr(pWal); + const int nCksum = offsetof(WalIndexHdr, aCksum); + + assert( pWal->writeLock ); + pWal->hdr.isInit = 1; + pWal->hdr.iVersion = WALINDEX_MAX_VERSION; + walChecksumBytes(1, (u8*)&pWal->hdr, nCksum, 0, pWal->hdr.aCksum); + memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr)); + sqlite3OsShmBarrier(pWal->pDbFd); + memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr)); +} + +/* +** This function encodes a single frame header and writes it to a buffer +** supplied by the caller. A frame-header is made up of a series of +** 4-byte big-endian integers, as follows: +** +** 0: Page number. +** 4: For commit records, the size of the database image in pages +** after the commit. For all other records, zero. +** 8: Salt-1 (copied from the wal-header) +** 12: Salt-2 (copied from the wal-header) +** 16: Checksum-1. +** 20: Checksum-2. +*/ +static void walEncodeFrame( + Wal *pWal, /* The write-ahead log */ + u32 iPage, /* Database page number for frame */ + u32 nTruncate, /* New db size (or 0 for non-commit frames) */ + u8 *aData, /* Pointer to page data */ + u8 *aFrame /* OUT: Write encoded frame here */ +){ + int nativeCksum; /* True for native byte-order checksums */ + u32 *aCksum = pWal->hdr.aFrameCksum; + assert( WAL_FRAME_HDRSIZE==24 ); + sqlite3Put4byte(&aFrame[0], iPage); + sqlite3Put4byte(&aFrame[4], nTruncate); + memcpy(&aFrame[8], pWal->hdr.aSalt, 8); + + nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN); + walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum); + walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum); + + sqlite3Put4byte(&aFrame[16], aCksum[0]); + sqlite3Put4byte(&aFrame[20], aCksum[1]); +} + +/* +** Check to see if the frame with header in aFrame[] and content +** in aData[] is valid. If it is a valid frame, fill *piPage and +** *pnTruncate and return true. Return if the frame is not valid. +*/ +static int walDecodeFrame( + Wal *pWal, /* The write-ahead log */ + u32 *piPage, /* OUT: Database page number for frame */ + u32 *pnTruncate, /* OUT: New db size (or 0 if not commit) */ + u8 *aData, /* Pointer to page data (for checksum) */ + u8 *aFrame /* Frame data */ +){ + int nativeCksum; /* True for native byte-order checksums */ + u32 *aCksum = pWal->hdr.aFrameCksum; + u32 pgno; /* Page number of the frame */ + assert( WAL_FRAME_HDRSIZE==24 ); + + /* A frame is only valid if the salt values in the frame-header + ** match the salt values in the wal-header. + */ + if( memcmp(&pWal->hdr.aSalt, &aFrame[8], 8)!=0 ){ + return 0; + } + + /* A frame is only valid if the page number is creater than zero. + */ + pgno = sqlite3Get4byte(&aFrame[0]); + if( pgno==0 ){ + return 0; + } + + /* A frame is only valid if a checksum of the WAL header, + ** all prior frams, the first 16 bytes of this frame-header, + ** and the frame-data matches the checksum in the last 8 + ** bytes of this frame-header. + */ + nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN); + walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum); + walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum); + if( aCksum[0]!=sqlite3Get4byte(&aFrame[16]) + || aCksum[1]!=sqlite3Get4byte(&aFrame[20]) + ){ + /* Checksum failed. */ + return 0; + } + + /* If we reach this point, the frame is valid. Return the page number + ** and the new database size. + */ + *piPage = pgno; + *pnTruncate = sqlite3Get4byte(&aFrame[4]); + return 1; +} + + +#if defined(SQLITE_TEST) && defined(SQLITE_DEBUG) +/* +** Names of locks. This routine is used to provide debugging output and is not +** a part of an ordinary build. +*/ +static const char *walLockName(int lockIdx){ + if( lockIdx==WAL_WRITE_LOCK ){ + return "WRITE-LOCK"; + }else if( lockIdx==WAL_CKPT_LOCK ){ + return "CKPT-LOCK"; + }else if( lockIdx==WAL_RECOVER_LOCK ){ + return "RECOVER-LOCK"; + }else{ + static char zName[15]; + sqlite3_snprintf(sizeof(zName), zName, "READ-LOCK[%d]", + lockIdx-WAL_READ_LOCK(0)); + return zName; + } +} +#endif /*defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */ + + +/* +** Set or release locks on the WAL. Locks are either shared or exclusive. +** A lock cannot be moved directly between shared and exclusive - it must go +** through the unlocked state first. +** +** In locking_mode=EXCLUSIVE, all of these routines become no-ops. +*/ +static int walLockShared(Wal *pWal, int lockIdx){ + int rc; + if( pWal->exclusiveMode ) return SQLITE_OK; + rc = sqlite3OsShmLock(pWal->pDbFd, lockIdx, 1, + SQLITE_SHM_LOCK | SQLITE_SHM_SHARED); + WALTRACE(("WAL%p: acquire SHARED-%s %s\n", pWal, + walLockName(lockIdx), rc ? "failed" : "ok")); + VVA_ONLY( pWal->lockError = (u8)(rc!=SQLITE_OK && rc!=SQLITE_BUSY); ) + return rc; +} +static void walUnlockShared(Wal *pWal, int lockIdx){ + if( pWal->exclusiveMode ) return; + (void)sqlite3OsShmLock(pWal->pDbFd, lockIdx, 1, + SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED); + WALTRACE(("WAL%p: release SHARED-%s\n", pWal, walLockName(lockIdx))); +} +static int walLockExclusive(Wal *pWal, int lockIdx, int n){ + int rc; + if( pWal->exclusiveMode ) return SQLITE_OK; + rc = sqlite3OsShmLock(pWal->pDbFd, lockIdx, n, + SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE); + WALTRACE(("WAL%p: acquire EXCLUSIVE-%s cnt=%d %s\n", pWal, + walLockName(lockIdx), n, rc ? "failed" : "ok")); + VVA_ONLY( pWal->lockError = (u8)(rc!=SQLITE_OK && rc!=SQLITE_BUSY); ) + return rc; +} +static void walUnlockExclusive(Wal *pWal, int lockIdx, int n){ + if( pWal->exclusiveMode ) return; + (void)sqlite3OsShmLock(pWal->pDbFd, lockIdx, n, + SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE); + WALTRACE(("WAL%p: release EXCLUSIVE-%s cnt=%d\n", pWal, + walLockName(lockIdx), n)); +} + +/* +** Compute a hash on a page number. The resulting hash value must land +** between 0 and (HASHTABLE_NSLOT-1). The walHashNext() function advances +** the hash to the next value in the event of a collision. +*/ +static int walHash(u32 iPage){ + assert( iPage>0 ); + assert( (HASHTABLE_NSLOT & (HASHTABLE_NSLOT-1))==0 ); + return (iPage*HASHTABLE_HASH_1) & (HASHTABLE_NSLOT-1); +} +static int walNextHash(int iPriorHash){ + return (iPriorHash+1)&(HASHTABLE_NSLOT-1); +} + +/* +** Return pointers to the hash table and page number array stored on +** page iHash of the wal-index. The wal-index is broken into 32KB pages +** numbered starting from 0. +** +** Set output variable *paHash to point to the start of the hash table +** in the wal-index file. Set *piZero to one less than the frame +** number of the first frame indexed by this hash table. If a +** slot in the hash table is set to N, it refers to frame number +** (*piZero+N) in the log. +** +** Finally, set *paPgno so that *paPgno[1] is the page number of the +** first frame indexed by the hash table, frame (*piZero+1). +*/ +static int walHashGet( + Wal *pWal, /* WAL handle */ + int iHash, /* Find the iHash'th table */ + volatile ht_slot **paHash, /* OUT: Pointer to hash index */ + volatile u32 **paPgno, /* OUT: Pointer to page number array */ + u32 *piZero /* OUT: Frame associated with *paPgno[0] */ +){ + int rc; /* Return code */ + volatile u32 *aPgno; + + rc = walIndexPage(pWal, iHash, &aPgno); + assert( rc==SQLITE_OK || iHash>0 ); + + if( rc==SQLITE_OK ){ + u32 iZero; + volatile ht_slot *aHash; + + aHash = (volatile ht_slot *)&aPgno[HASHTABLE_NPAGE]; + if( iHash==0 ){ + aPgno = &aPgno[WALINDEX_HDR_SIZE/sizeof(u32)]; + iZero = 0; + }else{ + iZero = HASHTABLE_NPAGE_ONE + (iHash-1)*HASHTABLE_NPAGE; + } + + *paPgno = &aPgno[-1]; + *paHash = aHash; + *piZero = iZero; + } + return rc; +} + +/* +** Return the number of the wal-index page that contains the hash-table +** and page-number array that contain entries corresponding to WAL frame +** iFrame. The wal-index is broken up into 32KB pages. Wal-index pages +** are numbered starting from 0. +*/ +static int walFramePage(u32 iFrame){ + int iHash = (iFrame+HASHTABLE_NPAGE-HASHTABLE_NPAGE_ONE-1) / HASHTABLE_NPAGE; + assert( (iHash==0 || iFrame>HASHTABLE_NPAGE_ONE) + && (iHash>=1 || iFrame<=HASHTABLE_NPAGE_ONE) + && (iHash<=1 || iFrame>(HASHTABLE_NPAGE_ONE+HASHTABLE_NPAGE)) + && (iHash>=2 || iFrame<=HASHTABLE_NPAGE_ONE+HASHTABLE_NPAGE) + && (iHash<=2 || iFrame>(HASHTABLE_NPAGE_ONE+2*HASHTABLE_NPAGE)) + ); + return iHash; +} + +/* +** Return the page number associated with frame iFrame in this WAL. +*/ +static u32 walFramePgno(Wal *pWal, u32 iFrame){ + int iHash = walFramePage(iFrame); + if( iHash==0 ){ + return pWal->apWiData[0][WALINDEX_HDR_SIZE/sizeof(u32) + iFrame - 1]; + } + return pWal->apWiData[iHash][(iFrame-1-HASHTABLE_NPAGE_ONE)%HASHTABLE_NPAGE]; +} + +/* +** Remove entries from the hash table that point to WAL slots greater +** than pWal->hdr.mxFrame. +** +** This function is called whenever pWal->hdr.mxFrame is decreased due +** to a rollback or savepoint. +** +** At most only the hash table containing pWal->hdr.mxFrame needs to be +** updated. Any later hash tables will be automatically cleared when +** pWal->hdr.mxFrame advances to the point where those hash tables are +** actually needed. +*/ +static void walCleanupHash(Wal *pWal){ + volatile ht_slot *aHash = 0; /* Pointer to hash table to clear */ + volatile u32 *aPgno = 0; /* Page number array for hash table */ + u32 iZero = 0; /* frame == (aHash[x]+iZero) */ + int iLimit = 0; /* Zero values greater than this */ + int nByte; /* Number of bytes to zero in aPgno[] */ + int i; /* Used to iterate through aHash[] */ + + assert( pWal->writeLock ); + testcase( pWal->hdr.mxFrame==HASHTABLE_NPAGE_ONE-1 ); + testcase( pWal->hdr.mxFrame==HASHTABLE_NPAGE_ONE ); + testcase( pWal->hdr.mxFrame==HASHTABLE_NPAGE_ONE+1 ); + + if( pWal->hdr.mxFrame==0 ) return; + + /* Obtain pointers to the hash-table and page-number array containing + ** the entry that corresponds to frame pWal->hdr.mxFrame. It is guaranteed + ** that the page said hash-table and array reside on is already mapped. + */ + assert( pWal->nWiData>walFramePage(pWal->hdr.mxFrame) ); + assert( pWal->apWiData[walFramePage(pWal->hdr.mxFrame)] ); + walHashGet(pWal, walFramePage(pWal->hdr.mxFrame), &aHash, &aPgno, &iZero); + + /* Zero all hash-table entries that correspond to frame numbers greater + ** than pWal->hdr.mxFrame. + */ + iLimit = pWal->hdr.mxFrame - iZero; + assert( iLimit>0 ); + for(i=0; iiLimit ){ + aHash[i] = 0; + } + } + + /* Zero the entries in the aPgno array that correspond to frames with + ** frame numbers greater than pWal->hdr.mxFrame. + */ + nByte = (int)((char *)aHash - (char *)&aPgno[iLimit+1]); + memset((void *)&aPgno[iLimit+1], 0, nByte); + +#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT + /* Verify that the every entry in the mapping region is still reachable + ** via the hash table even after the cleanup. + */ + if( iLimit ){ + int i; /* Loop counter */ + int iKey; /* Hash key */ + for(i=1; i<=iLimit; i++){ + for(iKey=walHash(aPgno[i]); aHash[iKey]; iKey=walNextHash(iKey)){ + if( aHash[iKey]==i ) break; + } + assert( aHash[iKey]==i ); + } + } +#endif /* SQLITE_ENABLE_EXPENSIVE_ASSERT */ +} + + +/* +** Set an entry in the wal-index that will map database page number +** pPage into WAL frame iFrame. +*/ +static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){ + int rc; /* Return code */ + u32 iZero = 0; /* One less than frame number of aPgno[1] */ + volatile u32 *aPgno = 0; /* Page number array */ + volatile ht_slot *aHash = 0; /* Hash table */ + + rc = walHashGet(pWal, walFramePage(iFrame), &aHash, &aPgno, &iZero); + + /* Assuming the wal-index file was successfully mapped, populate the + ** page number array and hash table entry. + */ + if( rc==SQLITE_OK ){ + int iKey; /* Hash table key */ + int idx; /* Value to write to hash-table slot */ + int nCollide; /* Number of hash collisions */ + + idx = iFrame - iZero; + assert( idx <= HASHTABLE_NSLOT/2 + 1 ); + + /* If this is the first entry to be added to this hash-table, zero the + ** entire hash table and aPgno[] array before proceding. + */ + if( idx==1 ){ + int nByte = (int)((u8 *)&aHash[HASHTABLE_NSLOT] - (u8 *)&aPgno[1]); + memset((void*)&aPgno[1], 0, nByte); + } + + /* If the entry in aPgno[] is already set, then the previous writer + ** must have exited unexpectedly in the middle of a transaction (after + ** writing one or more dirty pages to the WAL to free up memory). + ** Remove the remnants of that writers uncommitted transaction from + ** the hash-table before writing any new entries. + */ + if( aPgno[idx] ){ + walCleanupHash(pWal); + assert( !aPgno[idx] ); + } + + /* Write the aPgno[] array entry and the hash-table slot. */ + nCollide = idx; + for(iKey=walHash(iPage); aHash[iKey]; iKey=walNextHash(iKey)){ + if( (nCollide--)==0 ) return SQLITE_CORRUPT_BKPT; + } + aPgno[idx] = iPage; + aHash[iKey] = (ht_slot)idx; + +#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT + /* Verify that the number of entries in the hash table exactly equals + ** the number of entries in the mapping region. + */ + { + int i; /* Loop counter */ + int nEntry = 0; /* Number of entries in the hash table */ + for(i=0; ickptLock==1 || pWal->ckptLock==0 ); + assert( WAL_ALL_BUT_WRITE==WAL_WRITE_LOCK+1 ); + assert( WAL_CKPT_LOCK==WAL_ALL_BUT_WRITE ); + assert( pWal->writeLock ); + iLock = WAL_ALL_BUT_WRITE + pWal->ckptLock; + nLock = SQLITE_SHM_NLOCK - iLock; + rc = walLockExclusive(pWal, iLock, nLock); + if( rc ){ + return rc; + } + WALTRACE(("WAL%p: recovery begin...\n", pWal)); + + memset(&pWal->hdr, 0, sizeof(WalIndexHdr)); + + rc = sqlite3OsFileSize(pWal->pWalFd, &nSize); + if( rc!=SQLITE_OK ){ + goto recovery_error; + } + + if( nSize>WAL_HDRSIZE ){ + u8 aBuf[WAL_HDRSIZE]; /* Buffer to load WAL header into */ + u8 *aFrame = 0; /* Malloc'd buffer to load entire frame */ + int szFrame; /* Number of bytes in buffer aFrame[] */ + u8 *aData; /* Pointer to data part of aFrame buffer */ + int iFrame; /* Index of last frame read */ + i64 iOffset; /* Next offset to read from log file */ + int szPage; /* Page size according to the log */ + u32 magic; /* Magic value read from WAL header */ + u32 version; /* Magic value read from WAL header */ + + /* Read in the WAL header. */ + rc = sqlite3OsRead(pWal->pWalFd, aBuf, WAL_HDRSIZE, 0); + if( rc!=SQLITE_OK ){ + goto recovery_error; + } + + /* If the database page size is not a power of two, or is greater than + ** SQLITE_MAX_PAGE_SIZE, conclude that the WAL file contains no valid + ** data. Similarly, if the 'magic' value is invalid, ignore the whole + ** WAL file. + */ + magic = sqlite3Get4byte(&aBuf[0]); + szPage = sqlite3Get4byte(&aBuf[8]); + if( (magic&0xFFFFFFFE)!=WAL_MAGIC + || szPage&(szPage-1) + || szPage>SQLITE_MAX_PAGE_SIZE + || szPage<512 + ){ + goto finished; + } + pWal->hdr.bigEndCksum = (u8)(magic&0x00000001); + pWal->szPage = szPage; + pWal->nCkpt = sqlite3Get4byte(&aBuf[12]); + memcpy(&pWal->hdr.aSalt, &aBuf[16], 8); + + /* Verify that the WAL header checksum is correct */ + walChecksumBytes(pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN, + aBuf, WAL_HDRSIZE-2*4, 0, pWal->hdr.aFrameCksum + ); + if( pWal->hdr.aFrameCksum[0]!=sqlite3Get4byte(&aBuf[24]) + || pWal->hdr.aFrameCksum[1]!=sqlite3Get4byte(&aBuf[28]) + ){ + goto finished; + } + + /* Verify that the version number on the WAL format is one that + ** are able to understand */ + version = sqlite3Get4byte(&aBuf[4]); + if( version!=WAL_MAX_VERSION ){ + rc = SQLITE_CANTOPEN_BKPT; + goto finished; + } + + /* Malloc a buffer to read frames into. */ + szFrame = szPage + WAL_FRAME_HDRSIZE; + aFrame = (u8 *)sqlite3_malloc(szFrame); + if( !aFrame ){ + rc = SQLITE_NOMEM; + goto recovery_error; + } + aData = &aFrame[WAL_FRAME_HDRSIZE]; + + /* Read all frames from the log file. */ + iFrame = 0; + for(iOffset=WAL_HDRSIZE; (iOffset+szFrame)<=nSize; iOffset+=szFrame){ + u32 pgno; /* Database page number for frame */ + u32 nTruncate; /* dbsize field from frame header */ + int isValid; /* True if this frame is valid */ + + /* Read and decode the next log frame. */ + rc = sqlite3OsRead(pWal->pWalFd, aFrame, szFrame, iOffset); + if( rc!=SQLITE_OK ) break; + isValid = walDecodeFrame(pWal, &pgno, &nTruncate, aData, aFrame); + if( !isValid ) break; + rc = walIndexAppend(pWal, ++iFrame, pgno); + if( rc!=SQLITE_OK ) break; + + /* If nTruncate is non-zero, this is a commit record. */ + if( nTruncate ){ + pWal->hdr.mxFrame = iFrame; + pWal->hdr.nPage = nTruncate; + pWal->hdr.szPage = (u16)((szPage&0xff00) | (szPage>>16)); + testcase( szPage<=32768 ); + testcase( szPage>=65536 ); + aFrameCksum[0] = pWal->hdr.aFrameCksum[0]; + aFrameCksum[1] = pWal->hdr.aFrameCksum[1]; + } + } + + sqlite3_free(aFrame); + } + +finished: + if( rc==SQLITE_OK ){ + volatile WalCkptInfo *pInfo; + int i; + pWal->hdr.aFrameCksum[0] = aFrameCksum[0]; + pWal->hdr.aFrameCksum[1] = aFrameCksum[1]; + walIndexWriteHdr(pWal); + + /* Reset the checkpoint-header. This is safe because this thread is + ** currently holding locks that exclude all other readers, writers and + ** checkpointers. + */ + pInfo = walCkptInfo(pWal); + pInfo->nBackfill = 0; + pInfo->aReadMark[0] = 0; + for(i=1; iaReadMark[i] = READMARK_NOT_USED; + + /* If more than one frame was recovered from the log file, report an + ** event via sqlite3_log(). This is to help with identifying performance + ** problems caused by applications routinely shutting down without + ** checkpointing the log file. + */ + if( pWal->hdr.nPage ){ + sqlite3_log(SQLITE_OK, "Recovered %d frames from WAL file %s", + pWal->hdr.nPage, pWal->zWalName + ); + } + } + +recovery_error: + WALTRACE(("WAL%p: recovery %s\n", pWal, rc ? "failed" : "ok")); + walUnlockExclusive(pWal, iLock, nLock); + return rc; +} + +/* +** Close an open wal-index. +*/ +static void walIndexClose(Wal *pWal, int isDelete){ + sqlite3OsShmUnmap(pWal->pDbFd, isDelete); +} + +/* +** Open a connection to the WAL file zWalName. The database file must +** already be opened on connection pDbFd. The buffer that zWalName points +** to must remain valid for the lifetime of the returned Wal* handle. +** +** A SHARED lock should be held on the database file when this function +** is called. The purpose of this SHARED lock is to prevent any other +** client from unlinking the WAL or wal-index file. If another process +** were to do this just after this client opened one of these files, the +** system would be badly broken. +** +** If the log file is successfully opened, SQLITE_OK is returned and +** *ppWal is set to point to a new WAL handle. If an error occurs, +** an SQLite error code is returned and *ppWal is left unmodified. +*/ +SQLITE_PRIVATE int sqlite3WalOpen( + sqlite3_vfs *pVfs, /* vfs module to open wal and wal-index */ + sqlite3_file *pDbFd, /* The open database file */ + const char *zWalName, /* Name of the WAL file */ + Wal **ppWal /* OUT: Allocated Wal handle */ +){ + int rc; /* Return Code */ + Wal *pRet; /* Object to allocate and return */ + int flags; /* Flags passed to OsOpen() */ + + assert( zWalName && zWalName[0] ); + assert( pDbFd ); + + /* In the amalgamation, the os_unix.c and os_win.c source files come before + ** this source file. Verify that the #defines of the locking byte offsets + ** in os_unix.c and os_win.c agree with the WALINDEX_LOCK_OFFSET value. + */ +#ifdef WIN_SHM_BASE + assert( WIN_SHM_BASE==WALINDEX_LOCK_OFFSET ); +#endif +#ifdef UNIX_SHM_BASE + assert( UNIX_SHM_BASE==WALINDEX_LOCK_OFFSET ); +#endif + + + /* Allocate an instance of struct Wal to return. */ + *ppWal = 0; + pRet = (Wal*)sqlite3MallocZero(sizeof(Wal) + pVfs->szOsFile); + if( !pRet ){ + return SQLITE_NOMEM; + } + + pRet->pVfs = pVfs; + pRet->pWalFd = (sqlite3_file *)&pRet[1]; + pRet->pDbFd = pDbFd; + pRet->readLock = -1; + pRet->zWalName = zWalName; + + /* Open file handle on the write-ahead log file. */ + flags = (SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE|SQLITE_OPEN_WAL); + rc = sqlite3OsOpen(pVfs, zWalName, pRet->pWalFd, flags, &flags); + if( rc==SQLITE_OK && flags&SQLITE_OPEN_READONLY ){ + pRet->readOnly = 1; + } + + if( rc!=SQLITE_OK ){ + walIndexClose(pRet, 0); + sqlite3OsClose(pRet->pWalFd); + sqlite3_free(pRet); + }else{ + *ppWal = pRet; + WALTRACE(("WAL%d: opened\n", pRet)); + } + return rc; +} + +/* +** Find the smallest page number out of all pages held in the WAL that +** has not been returned by any prior invocation of this method on the +** same WalIterator object. Write into *piFrame the frame index where +** that page was last written into the WAL. Write into *piPage the page +** number. +** +** Return 0 on success. If there are no pages in the WAL with a page +** number larger than *piPage, then return 1. +*/ +static int walIteratorNext( + WalIterator *p, /* Iterator */ + u32 *piPage, /* OUT: The page number of the next page */ + u32 *piFrame /* OUT: Wal frame index of next page */ +){ + u32 iMin; /* Result pgno must be greater than iMin */ + u32 iRet = 0xFFFFFFFF; /* 0xffffffff is never a valid page number */ + int i; /* For looping through segments */ + + iMin = p->iPrior; + assert( iMin<0xffffffff ); + for(i=p->nSegment-1; i>=0; i--){ + struct WalSegment *pSegment = &p->aSegment[i]; + while( pSegment->iNextnEntry ){ + u32 iPg = pSegment->aPgno[pSegment->aIndex[pSegment->iNext]]; + if( iPg>iMin ){ + if( iPgiZero + pSegment->aIndex[pSegment->iNext]; + } + break; + } + pSegment->iNext++; + } + } + + *piPage = p->iPrior = iRet; + return (iRet==0xFFFFFFFF); +} + +/* +** This function merges two sorted lists into a single sorted list. +*/ +static void walMerge( + u32 *aContent, /* Pages in wal */ + ht_slot *aLeft, /* IN: Left hand input list */ + int nLeft, /* IN: Elements in array *paLeft */ + ht_slot **paRight, /* IN/OUT: Right hand input list */ + int *pnRight, /* IN/OUT: Elements in *paRight */ + ht_slot *aTmp /* Temporary buffer */ +){ + int iLeft = 0; /* Current index in aLeft */ + int iRight = 0; /* Current index in aRight */ + int iOut = 0; /* Current index in output buffer */ + int nRight = *pnRight; + ht_slot *aRight = *paRight; + + assert( nLeft>0 && nRight>0 ); + while( iRight=nRight || aContent[aLeft[iLeft]]=nLeft || aContent[aLeft[iLeft]]>dbpage ); + assert( iRight>=nRight || aContent[aRight[iRight]]>dbpage ); + } + + *paRight = aLeft; + *pnRight = iOut; + memcpy(aLeft, aTmp, sizeof(aTmp[0])*iOut); +} + +/* +** Sort the elements in list aList, removing any duplicates. +*/ +static void walMergesort( + u32 *aContent, /* Pages in wal */ + ht_slot *aBuffer, /* Buffer of at least *pnList items to use */ + ht_slot *aList, /* IN/OUT: List to sort */ + int *pnList /* IN/OUT: Number of elements in aList[] */ +){ + struct Sublist { + int nList; /* Number of elements in aList */ + ht_slot *aList; /* Pointer to sub-list content */ + }; + + const int nList = *pnList; /* Size of input list */ + int nMerge = 0; /* Number of elements in list aMerge */ + ht_slot *aMerge = 0; /* List to be merged */ + int iList; /* Index into input list */ + int iSub = 0; /* Index into aSub array */ + struct Sublist aSub[13]; /* Array of sub-lists */ + + memset(aSub, 0, sizeof(aSub)); + assert( nList<=HASHTABLE_NPAGE && nList>0 ); + assert( HASHTABLE_NPAGE==(1<<(ArraySize(aSub)-1)) ); + + for(iList=0; iListaList && p->nList<=(1<aList==&aList[iList&~((2<aList, p->nList, &aMerge, &nMerge, aBuffer); + } + aSub[iSub].aList = aMerge; + aSub[iSub].nList = nMerge; + } + + for(iSub++; iSubnList<=(1<aList==&aList[nList&~((2<aList, p->nList, &aMerge, &nMerge, aBuffer); + } + } + assert( aMerge==aList ); + *pnList = nMerge; + +#ifdef SQLITE_DEBUG + { + int i; + for(i=1; i<*pnList; i++){ + assert( aContent[aList[i]] > aContent[aList[i-1]] ); + } + } +#endif +} + +/* +** Free an iterator allocated by walIteratorInit(). +*/ +static void walIteratorFree(WalIterator *p){ + sqlite3ScratchFree(p); +} + +/* +** Construct a WalInterator object that can be used to loop over all +** pages in the WAL in ascending order. The caller must hold the checkpoint +** +** On success, make *pp point to the newly allocated WalInterator object +** return SQLITE_OK. Otherwise, return an error code. If this routine +** returns an error, the value of *pp is undefined. +** +** The calling routine should invoke walIteratorFree() to destroy the +** WalIterator object when it has finished with it. +*/ +static int walIteratorInit(Wal *pWal, WalIterator **pp){ + WalIterator *p; /* Return value */ + int nSegment; /* Number of segments to merge */ + u32 iLast; /* Last frame in log */ + int nByte; /* Number of bytes to allocate */ + int i; /* Iterator variable */ + ht_slot *aTmp; /* Temp space used by merge-sort */ + int rc = SQLITE_OK; /* Return Code */ + + /* This routine only runs while holding the checkpoint lock. And + ** it only runs if there is actually content in the log (mxFrame>0). + */ + assert( pWal->ckptLock && pWal->hdr.mxFrame>0 ); + iLast = pWal->hdr.mxFrame; + + /* Allocate space for the WalIterator object. */ + nSegment = walFramePage(iLast) + 1; + nByte = sizeof(WalIterator) + + (nSegment-1)*sizeof(struct WalSegment) + + iLast*sizeof(ht_slot); + p = (WalIterator *)sqlite3ScratchMalloc(nByte); + if( !p ){ + return SQLITE_NOMEM; + } + memset(p, 0, nByte); + p->nSegment = nSegment; + + /* Allocate temporary space used by the merge-sort routine. This block + ** of memory will be freed before this function returns. + */ + aTmp = (ht_slot *)sqlite3ScratchMalloc( + sizeof(ht_slot) * (iLast>HASHTABLE_NPAGE?HASHTABLE_NPAGE:iLast) + ); + if( !aTmp ){ + rc = SQLITE_NOMEM; + } + + for(i=0; rc==SQLITE_OK && iaSegment[p->nSegment])[iZero]; + iZero++; + + for(j=0; jaSegment[i].iZero = iZero; + p->aSegment[i].nEntry = nEntry; + p->aSegment[i].aIndex = aIndex; + p->aSegment[i].aPgno = (u32 *)aPgno; + } + } + sqlite3ScratchFree(aTmp); + + if( rc!=SQLITE_OK ){ + walIteratorFree(p); + } + *pp = p; + return rc; +} + +/* +** Copy as much content as we can from the WAL back into the database file +** in response to an sqlite3_wal_checkpoint() request or the equivalent. +** +** The amount of information copies from WAL to database might be limited +** by active readers. This routine will never overwrite a database page +** that a concurrent reader might be using. +** +** All I/O barrier operations (a.k.a fsyncs) occur in this routine when +** SQLite is in WAL-mode in synchronous=NORMAL. That means that if +** checkpoints are always run by a background thread or background +** process, foreground threads will never block on a lengthy fsync call. +** +** Fsync is called on the WAL before writing content out of the WAL and +** into the database. This ensures that if the new content is persistent +** in the WAL and can be recovered following a power-loss or hard reset. +** +** Fsync is also called on the database file if (and only if) the entire +** WAL content is copied into the database file. This second fsync makes +** it safe to delete the WAL since the new content will persist in the +** database file. +** +** This routine uses and updates the nBackfill field of the wal-index header. +** This is the only routine tha will increase the value of nBackfill. +** (A WAL reset or recovery will revert nBackfill to zero, but not increase +** its value.) +** +** The caller must be holding sufficient locks to ensure that no other +** checkpoint is running (in any other thread or process) at the same +** time. +*/ +static int walCheckpoint( + Wal *pWal, /* Wal connection */ + int sync_flags, /* Flags for OsSync() (or 0) */ + int nBuf, /* Size of zBuf in bytes */ + u8 *zBuf /* Temporary buffer to use */ +){ + int rc; /* Return code */ + int szPage; /* Database page-size */ + WalIterator *pIter = 0; /* Wal iterator context */ + u32 iDbpage = 0; /* Next database page to write */ + u32 iFrame = 0; /* Wal frame containing data for iDbpage */ + u32 mxSafeFrame; /* Max frame that can be backfilled */ + u32 mxPage; /* Max database page to write */ + int i; /* Loop counter */ + volatile WalCkptInfo *pInfo; /* The checkpoint status information */ + + szPage = (pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16); + testcase( szPage<=32768 ); + testcase( szPage>=65536 ); + if( pWal->hdr.mxFrame==0 ) return SQLITE_OK; + + /* Allocate the iterator */ + rc = walIteratorInit(pWal, &pIter); + if( rc!=SQLITE_OK ){ + return rc; + } + assert( pIter ); + + /*** TODO: Move this test out to the caller. Make it an assert() here ***/ + if( szPage!=nBuf ){ + rc = SQLITE_CORRUPT_BKPT; + goto walcheckpoint_out; + } + + /* Compute in mxSafeFrame the index of the last frame of the WAL that is + ** safe to write into the database. Frames beyond mxSafeFrame might + ** overwrite database pages that are in use by active readers and thus + ** cannot be backfilled from the WAL. + */ + mxSafeFrame = pWal->hdr.mxFrame; + mxPage = pWal->hdr.nPage; + pInfo = walCkptInfo(pWal); + for(i=1; iaReadMark[i]; + if( mxSafeFrame>=y ){ + assert( y<=pWal->hdr.mxFrame ); + rc = walLockExclusive(pWal, WAL_READ_LOCK(i), 1); + if( rc==SQLITE_OK ){ + pInfo->aReadMark[i] = READMARK_NOT_USED; + walUnlockExclusive(pWal, WAL_READ_LOCK(i), 1); + }else if( rc==SQLITE_BUSY ){ + mxSafeFrame = y; + }else{ + goto walcheckpoint_out; + } + } + } + + if( pInfo->nBackfillnBackfill; + + /* Sync the WAL to disk */ + if( sync_flags ){ + rc = sqlite3OsSync(pWal->pWalFd, sync_flags); + } + + /* If the database file may grow as a result of this checkpoint, hint + ** about the eventual size of the db file to the VFS layer. + */ + if( rc==SQLITE_OK ){ + i64 nReq = ((i64)mxPage * szPage); + rc = sqlite3OsFileSize(pWal->pDbFd, &nSize); + if( rc==SQLITE_OK && nSizepDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq); + } + } + + /* Iterate through the contents of the WAL, copying data to the db file. */ + while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){ + i64 iOffset; + assert( walFramePgno(pWal, iFrame)==iDbpage ); + if( iFrame<=nBackfill || iFrame>mxSafeFrame || iDbpage>mxPage ) continue; + iOffset = walFrameOffset(iFrame, szPage) + WAL_FRAME_HDRSIZE; + /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL file */ + rc = sqlite3OsRead(pWal->pWalFd, zBuf, szPage, iOffset); + if( rc!=SQLITE_OK ) break; + iOffset = (iDbpage-1)*(i64)szPage; + testcase( IS_BIG_INT(iOffset) ); + rc = sqlite3OsWrite(pWal->pDbFd, zBuf, szPage, iOffset); + if( rc!=SQLITE_OK ) break; + } + + /* If work was actually accomplished... */ + if( rc==SQLITE_OK ){ + if( mxSafeFrame==walIndexHdr(pWal)->mxFrame ){ + i64 szDb = pWal->hdr.nPage*(i64)szPage; + testcase( IS_BIG_INT(szDb) ); + rc = sqlite3OsTruncate(pWal->pDbFd, szDb); + if( rc==SQLITE_OK && sync_flags ){ + rc = sqlite3OsSync(pWal->pDbFd, sync_flags); + } + } + if( rc==SQLITE_OK ){ + pInfo->nBackfill = mxSafeFrame; + } + } + + /* Release the reader lock held while backfilling */ + walUnlockExclusive(pWal, WAL_READ_LOCK(0), 1); + }else if( rc==SQLITE_BUSY ){ + /* Reset the return code so as not to report a checkpoint failure + ** just because active readers prevent any backfill. + */ + rc = SQLITE_OK; + } + + walcheckpoint_out: + walIteratorFree(pIter); + return rc; +} + +/* +** Close a connection to a log file. +*/ +SQLITE_PRIVATE int sqlite3WalClose( + Wal *pWal, /* Wal to close */ + int sync_flags, /* Flags to pass to OsSync() (or 0) */ + int nBuf, + u8 *zBuf /* Buffer of at least nBuf bytes */ +){ + int rc = SQLITE_OK; + if( pWal ){ + int isDelete = 0; /* True to unlink wal and wal-index files */ + + /* If an EXCLUSIVE lock can be obtained on the database file (using the + ** ordinary, rollback-mode locking methods, this guarantees that the + ** connection associated with this log file is the only connection to + ** the database. In this case checkpoint the database and unlink both + ** the wal and wal-index files. + ** + ** The EXCLUSIVE lock is not released before returning. + */ + rc = sqlite3OsLock(pWal->pDbFd, SQLITE_LOCK_EXCLUSIVE); + if( rc==SQLITE_OK ){ + pWal->exclusiveMode = 1; + rc = sqlite3WalCheckpoint(pWal, sync_flags, nBuf, zBuf); + if( rc==SQLITE_OK ){ + isDelete = 1; + } + } + + walIndexClose(pWal, isDelete); + sqlite3OsClose(pWal->pWalFd); + if( isDelete ){ + sqlite3OsDelete(pWal->pVfs, pWal->zWalName, 0); + } + WALTRACE(("WAL%p: closed\n", pWal)); + sqlite3_free((void *)pWal->apWiData); + sqlite3_free(pWal); + } + return rc; +} + +/* +** Try to read the wal-index header. Return 0 on success and 1 if +** there is a problem. +** +** The wal-index is in shared memory. Another thread or process might +** be writing the header at the same time this procedure is trying to +** read it, which might result in inconsistency. A dirty read is detected +** by verifying that both copies of the header are the same and also by +** a checksum on the header. +** +** If and only if the read is consistent and the header is different from +** pWal->hdr, then pWal->hdr is updated to the content of the new header +** and *pChanged is set to 1. +** +** If the checksum cannot be verified return non-zero. If the header +** is read successfully and the checksum verified, return zero. +*/ +static int walIndexTryHdr(Wal *pWal, int *pChanged){ + u32 aCksum[2]; /* Checksum on the header content */ + WalIndexHdr h1, h2; /* Two copies of the header content */ + WalIndexHdr volatile *aHdr; /* Header in shared memory */ + + /* The first page of the wal-index must be mapped at this point. */ + assert( pWal->nWiData>0 && pWal->apWiData[0] ); + + /* Read the header. This might happen concurrently with a write to the + ** same area of shared memory on a different CPU in a SMP, + ** meaning it is possible that an inconsistent snapshot is read + ** from the file. If this happens, return non-zero. + ** + ** There are two copies of the header at the beginning of the wal-index. + ** When reading, read [0] first then [1]. Writes are in the reverse order. + ** Memory barriers are used to prevent the compiler or the hardware from + ** reordering the reads and writes. + */ + aHdr = walIndexHdr(pWal); + memcpy(&h1, (void *)&aHdr[0], sizeof(h1)); + sqlite3OsShmBarrier(pWal->pDbFd); + memcpy(&h2, (void *)&aHdr[1], sizeof(h2)); + + if( memcmp(&h1, &h2, sizeof(h1))!=0 ){ + return 1; /* Dirty read */ + } + if( h1.isInit==0 ){ + return 1; /* Malformed header - probably all zeros */ + } + walChecksumBytes(1, (u8*)&h1, sizeof(h1)-sizeof(h1.aCksum), 0, aCksum); + if( aCksum[0]!=h1.aCksum[0] || aCksum[1]!=h1.aCksum[1] ){ + return 1; /* Checksum does not match */ + } + + if( memcmp(&pWal->hdr, &h1, sizeof(WalIndexHdr)) ){ + *pChanged = 1; + memcpy(&pWal->hdr, &h1, sizeof(WalIndexHdr)); + pWal->szPage = (pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16); + testcase( pWal->szPage<=32768 ); + testcase( pWal->szPage>=65536 ); + } + + /* The header was successfully read. Return zero. */ + return 0; +} + +/* +** Read the wal-index header from the wal-index and into pWal->hdr. +** If the wal-header appears to be corrupt, try to reconstruct the +** wal-index from the WAL before returning. +** +** Set *pChanged to 1 if the wal-index header value in pWal->hdr is +** changed by this opertion. If pWal->hdr is unchanged, set *pChanged +** to 0. +** +** If the wal-index header is successfully read, return SQLITE_OK. +** Otherwise an SQLite error code. +*/ +static int walIndexReadHdr(Wal *pWal, int *pChanged){ + int rc; /* Return code */ + int badHdr; /* True if a header read failed */ + volatile u32 *page0; /* Chunk of wal-index containing header */ + + /* Ensure that page 0 of the wal-index (the page that contains the + ** wal-index header) is mapped. Return early if an error occurs here. + */ + assert( pChanged ); + rc = walIndexPage(pWal, 0, &page0); + if( rc!=SQLITE_OK ){ + return rc; + }; + assert( page0 || pWal->writeLock==0 ); + + /* If the first page of the wal-index has been mapped, try to read the + ** wal-index header immediately, without holding any lock. This usually + ** works, but may fail if the wal-index header is corrupt or currently + ** being modified by another thread or process. + */ + badHdr = (page0 ? walIndexTryHdr(pWal, pChanged) : 1); + + /* If the first attempt failed, it might have been due to a race + ** with a writer. So get a WRITE lock and try again. + */ + assert( badHdr==0 || pWal->writeLock==0 ); + if( badHdr && SQLITE_OK==(rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1)) ){ + pWal->writeLock = 1; + if( SQLITE_OK==(rc = walIndexPage(pWal, 0, &page0)) ){ + badHdr = walIndexTryHdr(pWal, pChanged); + if( badHdr ){ + /* If the wal-index header is still malformed even while holding + ** a WRITE lock, it can only mean that the header is corrupted and + ** needs to be reconstructed. So run recovery to do exactly that. + */ + rc = walIndexRecover(pWal); + *pChanged = 1; + } + } + pWal->writeLock = 0; + walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1); + } + + /* If the header is read successfully, check the version number to make + ** sure the wal-index was not constructed with some future format that + ** this version of SQLite cannot understand. + */ + if( badHdr==0 && pWal->hdr.iVersion!=WALINDEX_MAX_VERSION ){ + rc = SQLITE_CANTOPEN_BKPT; + } + + return rc; +} + +/* +** This is the value that walTryBeginRead returns when it needs to +** be retried. +*/ +#define WAL_RETRY (-1) + +/* +** Attempt to start a read transaction. This might fail due to a race or +** other transient condition. When that happens, it returns WAL_RETRY to +** indicate to the caller that it is safe to retry immediately. +** +** On success return SQLITE_OK. On a permanent failure (such an +** I/O error or an SQLITE_BUSY because another process is running +** recovery) return a positive error code. +** +** The useWal parameter is true to force the use of the WAL and disable +** the case where the WAL is bypassed because it has been completely +** checkpointed. If useWal==0 then this routine calls walIndexReadHdr() +** to make a copy of the wal-index header into pWal->hdr. If the +** wal-index header has changed, *pChanged is set to 1 (as an indication +** to the caller that the local paget cache is obsolete and needs to be +** flushed.) When useWal==1, the wal-index header is assumed to already +** be loaded and the pChanged parameter is unused. +** +** The caller must set the cnt parameter to the number of prior calls to +** this routine during the current read attempt that returned WAL_RETRY. +** This routine will start taking more aggressive measures to clear the +** race conditions after multiple WAL_RETRY returns, and after an excessive +** number of errors will ultimately return SQLITE_PROTOCOL. The +** SQLITE_PROTOCOL return indicates that some other process has gone rogue +** and is not honoring the locking protocol. There is a vanishingly small +** chance that SQLITE_PROTOCOL could be returned because of a run of really +** bad luck when there is lots of contention for the wal-index, but that +** possibility is so small that it can be safely neglected, we believe. +** +** On success, this routine obtains a read lock on +** WAL_READ_LOCK(pWal->readLock). The pWal->readLock integer is +** in the range 0 <= pWal->readLock < WAL_NREADER. If pWal->readLock==(-1) +** that means the Wal does not hold any read lock. The reader must not +** access any database page that is modified by a WAL frame up to and +** including frame number aReadMark[pWal->readLock]. The reader will +** use WAL frames up to and including pWal->hdr.mxFrame if pWal->readLock>0 +** Or if pWal->readLock==0, then the reader will ignore the WAL +** completely and get all content directly from the database file. +** If the useWal parameter is 1 then the WAL will never be ignored and +** this routine will always set pWal->readLock>0 on success. +** When the read transaction is completed, the caller must release the +** lock on WAL_READ_LOCK(pWal->readLock) and set pWal->readLock to -1. +** +** This routine uses the nBackfill and aReadMark[] fields of the header +** to select a particular WAL_READ_LOCK() that strives to let the +** checkpoint process do as much work as possible. This routine might +** update values of the aReadMark[] array in the header, but if it does +** so it takes care to hold an exclusive lock on the corresponding +** WAL_READ_LOCK() while changing values. +*/ +static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ + volatile WalCkptInfo *pInfo; /* Checkpoint information in wal-index */ + u32 mxReadMark; /* Largest aReadMark[] value */ + int mxI; /* Index of largest aReadMark[] value */ + int i; /* Loop counter */ + int rc = SQLITE_OK; /* Return code */ + + assert( pWal->readLock<0 ); /* Not currently locked */ + + /* Take steps to avoid spinning forever if there is a protocol error. */ + if( cnt>5 ){ + if( cnt>100 ) return SQLITE_PROTOCOL; + sqlite3OsSleep(pWal->pVfs, 1); + } + + if( !useWal ){ + rc = walIndexReadHdr(pWal, pChanged); + if( rc==SQLITE_BUSY ){ + /* If there is not a recovery running in another thread or process + ** then convert BUSY errors to WAL_RETRY. If recovery is known to + ** be running, convert BUSY to BUSY_RECOVERY. There is a race here + ** which might cause WAL_RETRY to be returned even if BUSY_RECOVERY + ** would be technically correct. But the race is benign since with + ** WAL_RETRY this routine will be called again and will probably be + ** right on the second iteration. + */ + if( pWal->apWiData[0]==0 ){ + /* This branch is taken when the xShmMap() method returns SQLITE_BUSY. + ** We assume this is a transient condition, so return WAL_RETRY. The + ** xShmMap() implementation used by the default unix and win32 VFS + ** modules may return SQLITE_BUSY due to a race condition in the + ** code that determines whether or not the shared-memory region + ** must be zeroed before the requested page is returned. + */ + rc = WAL_RETRY; + }else if( SQLITE_OK==(rc = walLockShared(pWal, WAL_RECOVER_LOCK)) ){ + walUnlockShared(pWal, WAL_RECOVER_LOCK); + rc = WAL_RETRY; + }else if( rc==SQLITE_BUSY ){ + rc = SQLITE_BUSY_RECOVERY; + } + } + if( rc!=SQLITE_OK ){ + return rc; + } + } + + pInfo = walCkptInfo(pWal); + if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame ){ + /* The WAL has been completely backfilled (or it is empty). + ** and can be safely ignored. + */ + rc = walLockShared(pWal, WAL_READ_LOCK(0)); + sqlite3OsShmBarrier(pWal->pDbFd); + if( rc==SQLITE_OK ){ + if( memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr)) ){ + /* It is not safe to allow the reader to continue here if frames + ** may have been appended to the log before READ_LOCK(0) was obtained. + ** When holding READ_LOCK(0), the reader ignores the entire log file, + ** which implies that the database file contains a trustworthy + ** snapshoT. Since holding READ_LOCK(0) prevents a checkpoint from + ** happening, this is usually correct. + ** + ** However, if frames have been appended to the log (or if the log + ** is wrapped and written for that matter) before the READ_LOCK(0) + ** is obtained, that is not necessarily true. A checkpointer may + ** have started to backfill the appended frames but crashed before + ** it finished. Leaving a corrupt image in the database file. + */ + walUnlockShared(pWal, WAL_READ_LOCK(0)); + return WAL_RETRY; + } + pWal->readLock = 0; + return SQLITE_OK; + }else if( rc!=SQLITE_BUSY ){ + return rc; + } + } + + /* If we get this far, it means that the reader will want to use + ** the WAL to get at content from recent commits. The job now is + ** to select one of the aReadMark[] entries that is closest to + ** but not exceeding pWal->hdr.mxFrame and lock that entry. + */ + mxReadMark = 0; + mxI = 0; + for(i=1; iaReadMark[i]; + if( mxReadMark<=thisMark && thisMark<=pWal->hdr.mxFrame ){ + assert( thisMark!=READMARK_NOT_USED ); + mxReadMark = thisMark; + mxI = i; + } + } + if( mxI==0 ){ + /* If we get here, it means that all of the aReadMark[] entries between + ** 1 and WAL_NREADER-1 are zero. Try to initialize aReadMark[1] to + ** be mxFrame, then retry. + */ + rc = walLockExclusive(pWal, WAL_READ_LOCK(1), 1); + if( rc==SQLITE_OK ){ + pInfo->aReadMark[1] = pWal->hdr.mxFrame; + walUnlockExclusive(pWal, WAL_READ_LOCK(1), 1); + rc = WAL_RETRY; + }else if( rc==SQLITE_BUSY ){ + rc = WAL_RETRY; + } + return rc; + }else{ + if( mxReadMark < pWal->hdr.mxFrame ){ + for(i=1; iaReadMark[i] = pWal->hdr.mxFrame; + mxI = i; + walUnlockExclusive(pWal, WAL_READ_LOCK(i), 1); + break; + }else if( rc!=SQLITE_BUSY ){ + return rc; + } + } + } + + rc = walLockShared(pWal, WAL_READ_LOCK(mxI)); + if( rc ){ + return rc==SQLITE_BUSY ? WAL_RETRY : rc; + } + /* Now that the read-lock has been obtained, check that neither the + ** value in the aReadMark[] array or the contents of the wal-index + ** header have changed. + ** + ** It is necessary to check that the wal-index header did not change + ** between the time it was read and when the shared-lock was obtained + ** on WAL_READ_LOCK(mxI) was obtained to account for the possibility + ** that the log file may have been wrapped by a writer, or that frames + ** that occur later in the log than pWal->hdr.mxFrame may have been + ** copied into the database by a checkpointer. If either of these things + ** happened, then reading the database with the current value of + ** pWal->hdr.mxFrame risks reading a corrupted snapshot. So, retry + ** instead. + ** + ** This does not guarantee that the copy of the wal-index header is up to + ** date before proceeding. That would not be possible without somehow + ** blocking writers. It only guarantees that a dangerous checkpoint or + ** log-wrap (either of which would require an exclusive lock on + ** WAL_READ_LOCK(mxI)) has not occurred since the snapshot was valid. + */ + sqlite3OsShmBarrier(pWal->pDbFd); + if( pInfo->aReadMark[mxI]!=mxReadMark + || memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr)) + ){ + walUnlockShared(pWal, WAL_READ_LOCK(mxI)); + return WAL_RETRY; + }else{ + assert( mxReadMark<=pWal->hdr.mxFrame ); + pWal->readLock = (i16)mxI; + } + } + return rc; +} + +/* +** Begin a read transaction on the database. +** +** This routine used to be called sqlite3OpenSnapshot() and with good reason: +** it takes a snapshot of the state of the WAL and wal-index for the current +** instant in time. The current thread will continue to use this snapshot. +** Other threads might append new content to the WAL and wal-index but +** that extra content is ignored by the current thread. +** +** If the database contents have changes since the previous read +** transaction, then *pChanged is set to 1 before returning. The +** Pager layer will use this to know that is cache is stale and +** needs to be flushed. +*/ +SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ + int rc; /* Return code */ + int cnt = 0; /* Number of TryBeginRead attempts */ + + do{ + rc = walTryBeginRead(pWal, pChanged, 0, ++cnt); + }while( rc==WAL_RETRY ); + return rc; +} + +/* +** Finish with a read transaction. All this does is release the +** read-lock. +*/ +SQLITE_PRIVATE void sqlite3WalEndReadTransaction(Wal *pWal){ + sqlite3WalEndWriteTransaction(pWal); + if( pWal->readLock>=0 ){ + walUnlockShared(pWal, WAL_READ_LOCK(pWal->readLock)); + pWal->readLock = -1; + } +} + +/* +** Read a page from the WAL, if it is present in the WAL and if the +** current read transaction is configured to use the WAL. +** +** The *pInWal is set to 1 if the requested page is in the WAL and +** has been loaded. Or *pInWal is set to 0 if the page was not in +** the WAL and needs to be read out of the database. +*/ +SQLITE_PRIVATE int sqlite3WalRead( + Wal *pWal, /* WAL handle */ + Pgno pgno, /* Database page number to read data for */ + int *pInWal, /* OUT: True if data is read from WAL */ + int nOut, /* Size of buffer pOut in bytes */ + u8 *pOut /* Buffer to write page data to */ +){ + u32 iRead = 0; /* If !=0, WAL frame to return data from */ + u32 iLast = pWal->hdr.mxFrame; /* Last page in WAL for this reader */ + int iHash; /* Used to loop through N hash tables */ + + /* This routine is only be called from within a read transaction. */ + assert( pWal->readLock>=0 || pWal->lockError ); + + /* If the "last page" field of the wal-index header snapshot is 0, then + ** no data will be read from the wal under any circumstances. Return early + ** in this case as an optimization. Likewise, if pWal->readLock==0, + ** then the WAL is ignored by the reader so return early, as if the + ** WAL were empty. + */ + if( iLast==0 || pWal->readLock==0 ){ + *pInWal = 0; + return SQLITE_OK; + } + + /* Search the hash table or tables for an entry matching page number + ** pgno. Each iteration of the following for() loop searches one + ** hash table (each hash table indexes up to HASHTABLE_NPAGE frames). + ** + ** This code might run concurrently to the code in walIndexAppend() + ** that adds entries to the wal-index (and possibly to this hash + ** table). This means the value just read from the hash + ** slot (aHash[iKey]) may have been added before or after the + ** current read transaction was opened. Values added after the + ** read transaction was opened may have been written incorrectly - + ** i.e. these slots may contain garbage data. However, we assume + ** that any slots written before the current read transaction was + ** opened remain unmodified. + ** + ** For the reasons above, the if(...) condition featured in the inner + ** loop of the following block is more stringent that would be required + ** if we had exclusive access to the hash-table: + ** + ** (aPgno[iFrame]==pgno): + ** This condition filters out normal hash-table collisions. + ** + ** (iFrame<=iLast): + ** This condition filters out entries that were added to the hash + ** table after the current read-transaction had started. + */ + for(iHash=walFramePage(iLast); iHash>=0 && iRead==0; iHash--){ + volatile ht_slot *aHash; /* Pointer to hash table */ + volatile u32 *aPgno; /* Pointer to array of page numbers */ + u32 iZero; /* Frame number corresponding to aPgno[0] */ + int iKey; /* Hash slot index */ + int nCollide; /* Number of hash collisions remaining */ + int rc; /* Error code */ + + rc = walHashGet(pWal, iHash, &aHash, &aPgno, &iZero); + if( rc!=SQLITE_OK ){ + return rc; + } + nCollide = HASHTABLE_NSLOT; + for(iKey=walHash(pgno); aHash[iKey]; iKey=walNextHash(iKey)){ + u32 iFrame = aHash[iKey] + iZero; + if( iFrame<=iLast && aPgno[aHash[iKey]]==pgno ){ + assert( iFrame>iRead ); + iRead = iFrame; + } + if( (nCollide--)==0 ){ + return SQLITE_CORRUPT_BKPT; + } + } + } + +#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT + /* If expensive assert() statements are available, do a linear search + ** of the wal-index file content. Make sure the results agree with the + ** result obtained using the hash indexes above. */ + { + u32 iRead2 = 0; + u32 iTest; + for(iTest=iLast; iTest>0; iTest--){ + if( walFramePgno(pWal, iTest)==pgno ){ + iRead2 = iTest; + break; + } + } + assert( iRead==iRead2 ); + } +#endif + + /* If iRead is non-zero, then it is the log frame number that contains the + ** required page. Read and return data from the log file. + */ + if( iRead ){ + int sz; + i64 iOffset; + sz = pWal->hdr.szPage; + sz = (pWal->hdr.szPage&0xfe00) + ((pWal->hdr.szPage&0x0001)<<16); + testcase( sz<=32768 ); + testcase( sz>=65536 ); + iOffset = walFrameOffset(iRead, sz) + WAL_FRAME_HDRSIZE; + *pInWal = 1; + /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */ + return sqlite3OsRead(pWal->pWalFd, pOut, nOut, iOffset); + } + + *pInWal = 0; + return SQLITE_OK; +} + + +/* +** Return the size of the database in pages (or zero, if unknown). +*/ +SQLITE_PRIVATE Pgno sqlite3WalDbsize(Wal *pWal){ + if( pWal && ALWAYS(pWal->readLock>=0) ){ + return pWal->hdr.nPage; + } + return 0; +} + + +/* +** This function starts a write transaction on the WAL. +** +** A read transaction must have already been started by a prior call +** to sqlite3WalBeginReadTransaction(). +** +** If another thread or process has written into the database since +** the read transaction was started, then it is not possible for this +** thread to write as doing so would cause a fork. So this routine +** returns SQLITE_BUSY in that case and no write transaction is started. +** +** There can only be a single writer active at a time. +*/ +SQLITE_PRIVATE int sqlite3WalBeginWriteTransaction(Wal *pWal){ + int rc; + + /* Cannot start a write transaction without first holding a read + ** transaction. */ + assert( pWal->readLock>=0 ); + + if( pWal->readOnly ){ + return SQLITE_READONLY; + } + + /* Only one writer allowed at a time. Get the write lock. Return + ** SQLITE_BUSY if unable. + */ + rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1); + if( rc ){ + return rc; + } + pWal->writeLock = 1; + + /* If another connection has written to the database file since the + ** time the read transaction on this connection was started, then + ** the write is disallowed. + */ + if( memcmp(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr))!=0 ){ + walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1); + pWal->writeLock = 0; + rc = SQLITE_BUSY; + } + + return rc; +} + +/* +** End a write transaction. The commit has already been done. This +** routine merely releases the lock. +*/ +SQLITE_PRIVATE int sqlite3WalEndWriteTransaction(Wal *pWal){ + if( pWal->writeLock ){ + walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1); + pWal->writeLock = 0; + } + return SQLITE_OK; +} + +/* +** If any data has been written (but not committed) to the log file, this +** function moves the write-pointer back to the start of the transaction. +** +** Additionally, the callback function is invoked for each frame written +** to the WAL since the start of the transaction. If the callback returns +** other than SQLITE_OK, it is not invoked again and the error code is +** returned to the caller. +** +** Otherwise, if the callback function does not return an error, this +** function returns SQLITE_OK. +*/ +SQLITE_PRIVATE int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *pUndoCtx){ + int rc = SQLITE_OK; + if( ALWAYS(pWal->writeLock) ){ + Pgno iMax = pWal->hdr.mxFrame; + Pgno iFrame; + + /* Restore the clients cache of the wal-index header to the state it + ** was in before the client began writing to the database. + */ + memcpy(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr)); + + for(iFrame=pWal->hdr.mxFrame+1; + ALWAYS(rc==SQLITE_OK) && iFrame<=iMax; + iFrame++ + ){ + /* This call cannot fail. Unless the page for which the page number + ** is passed as the second argument is (a) in the cache and + ** (b) has an outstanding reference, then xUndo is either a no-op + ** (if (a) is false) or simply expels the page from the cache (if (b) + ** is false). + ** + ** If the upper layer is doing a rollback, it is guaranteed that there + ** are no outstanding references to any page other than page 1. And + ** page 1 is never written to the log until the transaction is + ** committed. As a result, the call to xUndo may not fail. + */ + assert( walFramePgno(pWal, iFrame)!=1 ); + rc = xUndo(pUndoCtx, walFramePgno(pWal, iFrame)); + } + walCleanupHash(pWal); + } + assert( rc==SQLITE_OK ); + return rc; +} + +/* +** Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32 +** values. This function populates the array with values required to +** "rollback" the write position of the WAL handle back to the current +** point in the event of a savepoint rollback (via WalSavepointUndo()). +*/ +SQLITE_PRIVATE void sqlite3WalSavepoint(Wal *pWal, u32 *aWalData){ + assert( pWal->writeLock ); + aWalData[0] = pWal->hdr.mxFrame; + aWalData[1] = pWal->hdr.aFrameCksum[0]; + aWalData[2] = pWal->hdr.aFrameCksum[1]; + aWalData[3] = pWal->nCkpt; +} + +/* +** Move the write position of the WAL back to the point identified by +** the values in the aWalData[] array. aWalData must point to an array +** of WAL_SAVEPOINT_NDATA u32 values that has been previously populated +** by a call to WalSavepoint(). +*/ +SQLITE_PRIVATE int sqlite3WalSavepointUndo(Wal *pWal, u32 *aWalData){ + int rc = SQLITE_OK; + + assert( pWal->writeLock ); + assert( aWalData[3]!=pWal->nCkpt || aWalData[0]<=pWal->hdr.mxFrame ); + + if( aWalData[3]!=pWal->nCkpt ){ + /* This savepoint was opened immediately after the write-transaction + ** was started. Right after that, the writer decided to wrap around + ** to the start of the log. Update the savepoint values to match. + */ + aWalData[0] = 0; + aWalData[3] = pWal->nCkpt; + } + + if( aWalData[0]hdr.mxFrame ){ + pWal->hdr.mxFrame = aWalData[0]; + pWal->hdr.aFrameCksum[0] = aWalData[1]; + pWal->hdr.aFrameCksum[1] = aWalData[2]; + walCleanupHash(pWal); + } + + return rc; +} + +/* +** This function is called just before writing a set of frames to the log +** file (see sqlite3WalFrames()). It checks to see if, instead of appending +** to the current log file, it is possible to overwrite the start of the +** existing log file with the new frames (i.e. "reset" the log). If so, +** it sets pWal->hdr.mxFrame to 0. Otherwise, pWal->hdr.mxFrame is left +** unchanged. +** +** SQLITE_OK is returned if no error is encountered (regardless of whether +** or not pWal->hdr.mxFrame is modified). An SQLite error code is returned +** if an error occurs. +*/ +static int walRestartLog(Wal *pWal){ + int rc = SQLITE_OK; + int cnt; + + if( pWal->readLock==0 ){ + volatile WalCkptInfo *pInfo = walCkptInfo(pWal); + assert( pInfo->nBackfill==pWal->hdr.mxFrame ); + if( pInfo->nBackfill>0 ){ + rc = walLockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1); + if( rc==SQLITE_OK ){ + /* If all readers are using WAL_READ_LOCK(0) (in other words if no + ** readers are currently using the WAL), then the transactions + ** frames will overwrite the start of the existing log. Update the + ** wal-index header to reflect this. + ** + ** In theory it would be Ok to update the cache of the header only + ** at this point. But updating the actual wal-index header is also + ** safe and means there is no special case for sqlite3WalUndo() + ** to handle if this transaction is rolled back. + */ + int i; /* Loop counter */ + u32 *aSalt = pWal->hdr.aSalt; /* Big-endian salt values */ + pWal->nCkpt++; + pWal->hdr.mxFrame = 0; + sqlite3Put4byte((u8*)&aSalt[0], 1 + sqlite3Get4byte((u8*)&aSalt[0])); + sqlite3_randomness(4, &aSalt[1]); + walIndexWriteHdr(pWal); + pInfo->nBackfill = 0; + for(i=1; iaReadMark[i] = READMARK_NOT_USED; + assert( pInfo->aReadMark[0]==0 ); + walUnlockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1); + }else if( rc!=SQLITE_BUSY ){ + return rc; + } + } + walUnlockShared(pWal, WAL_READ_LOCK(0)); + pWal->readLock = -1; + cnt = 0; + do{ + int notUsed; + rc = walTryBeginRead(pWal, ¬Used, 1, ++cnt); + }while( rc==WAL_RETRY ); + } + return rc; +} + +/* +** Write a set of frames to the log. The caller must hold the write-lock +** on the log file (obtained using sqlite3WalBeginWriteTransaction()). +*/ +SQLITE_PRIVATE int sqlite3WalFrames( + Wal *pWal, /* Wal handle to write to */ + int szPage, /* Database page-size in bytes */ + PgHdr *pList, /* List of dirty pages to write */ + Pgno nTruncate, /* Database size after this commit */ + int isCommit, /* True if this is a commit */ + int sync_flags /* Flags to pass to OsSync() (or 0) */ +){ + int rc; /* Used to catch return codes */ + u32 iFrame; /* Next frame address */ + u8 aFrame[WAL_FRAME_HDRSIZE]; /* Buffer to assemble frame-header in */ + PgHdr *p; /* Iterator to run through pList with. */ + PgHdr *pLast = 0; /* Last frame in list */ + int nLast = 0; /* Number of extra copies of last page */ + + assert( pList ); + assert( pWal->writeLock ); + +#if defined(SQLITE_TEST) && defined(SQLITE_DEBUG) + { int cnt; for(cnt=0, p=pList; p; p=p->pDirty, cnt++){} + WALTRACE(("WAL%p: frame write begin. %d frames. mxFrame=%d. %s\n", + pWal, cnt, pWal->hdr.mxFrame, isCommit ? "Commit" : "Spill")); + } +#endif + + /* See if it is possible to write these frames into the start of the + ** log file, instead of appending to it at pWal->hdr.mxFrame. + */ + if( SQLITE_OK!=(rc = walRestartLog(pWal)) ){ + return rc; + } + + /* If this is the first frame written into the log, write the WAL + ** header to the start of the WAL file. See comments at the top of + ** this source file for a description of the WAL header format. + */ + iFrame = pWal->hdr.mxFrame; + if( iFrame==0 ){ + u8 aWalHdr[WAL_HDRSIZE]; /* Buffer to assemble wal-header in */ + u32 aCksum[2]; /* Checksum for wal-header */ + + sqlite3Put4byte(&aWalHdr[0], (WAL_MAGIC | SQLITE_BIGENDIAN)); + sqlite3Put4byte(&aWalHdr[4], WAL_MAX_VERSION); + sqlite3Put4byte(&aWalHdr[8], szPage); + sqlite3Put4byte(&aWalHdr[12], pWal->nCkpt); + sqlite3_randomness(8, pWal->hdr.aSalt); + memcpy(&aWalHdr[16], pWal->hdr.aSalt, 8); + walChecksumBytes(1, aWalHdr, WAL_HDRSIZE-2*4, 0, aCksum); + sqlite3Put4byte(&aWalHdr[24], aCksum[0]); + sqlite3Put4byte(&aWalHdr[28], aCksum[1]); + + pWal->szPage = szPage; + pWal->hdr.bigEndCksum = SQLITE_BIGENDIAN; + pWal->hdr.aFrameCksum[0] = aCksum[0]; + pWal->hdr.aFrameCksum[1] = aCksum[1]; + + rc = sqlite3OsWrite(pWal->pWalFd, aWalHdr, sizeof(aWalHdr), 0); + WALTRACE(("WAL%p: wal-header write %s\n", pWal, rc ? "failed" : "ok")); + if( rc!=SQLITE_OK ){ + return rc; + } + } + assert( (int)pWal->szPage==szPage ); + + /* Write the log file. */ + for(p=pList; p; p=p->pDirty){ + u32 nDbsize; /* Db-size field for frame header */ + i64 iOffset; /* Write offset in log file */ + void *pData; + + iOffset = walFrameOffset(++iFrame, szPage); + /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */ + + /* Populate and write the frame header */ + nDbsize = (isCommit && p->pDirty==0) ? nTruncate : 0; +#if defined(SQLITE_HAS_CODEC) + if( (pData = sqlite3PagerCodec(p))==0 ) return SQLITE_NOMEM; +#else + pData = p->pData; +#endif + walEncodeFrame(pWal, p->pgno, nDbsize, pData, aFrame); + rc = sqlite3OsWrite(pWal->pWalFd, aFrame, sizeof(aFrame), iOffset); + if( rc!=SQLITE_OK ){ + return rc; + } + + /* Write the page data */ + rc = sqlite3OsWrite(pWal->pWalFd, pData, szPage, iOffset+sizeof(aFrame)); + if( rc!=SQLITE_OK ){ + return rc; + } + pLast = p; + } + + /* Sync the log file if the 'isSync' flag was specified. */ + if( sync_flags ){ + i64 iSegment = sqlite3OsSectorSize(pWal->pWalFd); + i64 iOffset = walFrameOffset(iFrame+1, szPage); + + assert( isCommit ); + assert( iSegment>0 ); + + iSegment = (((iOffset+iSegment-1)/iSegment) * iSegment); + while( iOffsetpData; +#endif + walEncodeFrame(pWal, pLast->pgno, nTruncate, pData, aFrame); + /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */ + rc = sqlite3OsWrite(pWal->pWalFd, aFrame, sizeof(aFrame), iOffset); + if( rc!=SQLITE_OK ){ + return rc; + } + iOffset += WAL_FRAME_HDRSIZE; + rc = sqlite3OsWrite(pWal->pWalFd, pData, szPage, iOffset); + if( rc!=SQLITE_OK ){ + return rc; + } + nLast++; + iOffset += szPage; + } + + rc = sqlite3OsSync(pWal->pWalFd, sync_flags); + } + + /* Append data to the wal-index. It is not necessary to lock the + ** wal-index to do this as the SQLITE_SHM_WRITE lock held on the wal-index + ** guarantees that there are no other writers, and no data that may + ** be in use by existing readers is being overwritten. + */ + iFrame = pWal->hdr.mxFrame; + for(p=pList; p && rc==SQLITE_OK; p=p->pDirty){ + iFrame++; + rc = walIndexAppend(pWal, iFrame, p->pgno); + } + while( nLast>0 && rc==SQLITE_OK ){ + iFrame++; + nLast--; + rc = walIndexAppend(pWal, iFrame, pLast->pgno); + } + + if( rc==SQLITE_OK ){ + /* Update the private copy of the header. */ + pWal->hdr.szPage = (u16)((szPage&0xff00) | (szPage>>16)); + testcase( szPage<=32768 ); + testcase( szPage>=65536 ); + pWal->hdr.mxFrame = iFrame; + if( isCommit ){ + pWal->hdr.iChange++; + pWal->hdr.nPage = nTruncate; + } + /* If this is a commit, update the wal-index header too. */ + if( isCommit ){ + walIndexWriteHdr(pWal); + pWal->iCallback = iFrame; + } + } + + WALTRACE(("WAL%p: frame write %s\n", pWal, rc ? "failed" : "ok")); + return rc; +} + +/* +** This routine is called to implement sqlite3_wal_checkpoint() and +** related interfaces. +** +** Obtain a CHECKPOINT lock and then backfill as much information as +** we can from WAL into the database. +*/ +SQLITE_PRIVATE int sqlite3WalCheckpoint( + Wal *pWal, /* Wal connection */ + int sync_flags, /* Flags to sync db file with (or 0) */ + int nBuf, /* Size of temporary buffer */ + u8 *zBuf /* Temporary buffer to use */ +){ + int rc; /* Return code */ + int isChanged = 0; /* True if a new wal-index header is loaded */ + + assert( pWal->ckptLock==0 ); + + WALTRACE(("WAL%p: checkpoint begins\n", pWal)); + rc = walLockExclusive(pWal, WAL_CKPT_LOCK, 1); + if( rc ){ + /* Usually this is SQLITE_BUSY meaning that another thread or process + ** is already running a checkpoint, or maybe a recovery. But it might + ** also be SQLITE_IOERR. */ + return rc; + } + pWal->ckptLock = 1; + + /* Copy data from the log to the database file. */ + rc = walIndexReadHdr(pWal, &isChanged); + if( rc==SQLITE_OK ){ + rc = walCheckpoint(pWal, sync_flags, nBuf, zBuf); + } + if( isChanged ){ + /* If a new wal-index header was loaded before the checkpoint was + ** performed, then the pager-cache associated with pWal is now + ** out of date. So zero the cached wal-index header to ensure that + ** next time the pager opens a snapshot on this database it knows that + ** the cache needs to be reset. + */ + memset(&pWal->hdr, 0, sizeof(WalIndexHdr)); + } + + /* Release the locks. */ + walUnlockExclusive(pWal, WAL_CKPT_LOCK, 1); + pWal->ckptLock = 0; + WALTRACE(("WAL%p: checkpoint %s\n", pWal, rc ? "failed" : "ok")); + return rc; +} + +/* Return the value to pass to a sqlite3_wal_hook callback, the +** number of frames in the WAL at the point of the last commit since +** sqlite3WalCallback() was called. If no commits have occurred since +** the last call, then return 0. +*/ +SQLITE_PRIVATE int sqlite3WalCallback(Wal *pWal){ + u32 ret = 0; + if( pWal ){ + ret = pWal->iCallback; + pWal->iCallback = 0; + } + return (int)ret; +} + +/* +** This function is called to change the WAL subsystem into or out +** of locking_mode=EXCLUSIVE. +** +** If op is zero, then attempt to change from locking_mode=EXCLUSIVE +** into locking_mode=NORMAL. This means that we must acquire a lock +** on the pWal->readLock byte. If the WAL is already in locking_mode=NORMAL +** or if the acquisition of the lock fails, then return 0. If the +** transition out of exclusive-mode is successful, return 1. This +** operation must occur while the pager is still holding the exclusive +** lock on the main database file. +** +** If op is one, then change from locking_mode=NORMAL into +** locking_mode=EXCLUSIVE. This means that the pWal->readLock must +** be released. Return 1 if the transition is made and 0 if the +** WAL is already in exclusive-locking mode - meaning that this +** routine is a no-op. The pager must already hold the exclusive lock +** on the main database file before invoking this operation. +** +** If op is negative, then do a dry-run of the op==1 case but do +** not actually change anything. The pager uses this to see if it +** should acquire the database exclusive lock prior to invoking +** the op==1 case. +*/ +SQLITE_PRIVATE int sqlite3WalExclusiveMode(Wal *pWal, int op){ + int rc; + assert( pWal->writeLock==0 ); + + /* pWal->readLock is usually set, but might be -1 if there was a + ** prior error while attempting to acquire are read-lock. This cannot + ** happen if the connection is actually in exclusive mode (as no xShmLock + ** locks are taken in this case). Nor should the pager attempt to + ** upgrade to exclusive-mode following such an error. + */ + assert( pWal->readLock>=0 || pWal->lockError ); + assert( pWal->readLock>=0 || (op<=0 && pWal->exclusiveMode==0) ); + + if( op==0 ){ + if( pWal->exclusiveMode ){ + pWal->exclusiveMode = 0; + if( walLockShared(pWal, WAL_READ_LOCK(pWal->readLock))!=SQLITE_OK ){ + pWal->exclusiveMode = 1; + } + rc = pWal->exclusiveMode==0; + }else{ + /* Already in locking_mode=NORMAL */ + rc = 0; + } + }else if( op>0 ){ + assert( pWal->exclusiveMode==0 ); + assert( pWal->readLock>=0 ); + walUnlockShared(pWal, WAL_READ_LOCK(pWal->readLock)); + pWal->exclusiveMode = 1; + rc = 1; + }else{ + rc = pWal->exclusiveMode==0; + } + return rc; +} + +#endif /* #ifndef SQLITE_OMIT_WAL */ + +/************** End of wal.c *************************************************/ /************** Begin file btmutex.c *****************************************/ /* ** 2007 August 27 @@ -36663,8 +44187,6 @@ SQLITE_PRIVATE sqlite3_backup **sqlite3PagerBackupPtr(Pager *pPager){ ** ************************************************************************* ** -** $Id: btmutex.c,v 1.17 2009/07/20 12:33:33 drh Exp $ -** ** This file contains code used to implement mutexes on Btree objects. ** This code really belongs in btree.c. But btree.c is getting too ** big and we want to break it down some. This packaged seemed like @@ -36683,8 +44205,6 @@ SQLITE_PRIVATE sqlite3_backup **sqlite3PagerBackupPtr(Pager *pPager){ ** May you share freely, never taking more than you give. ** ************************************************************************* -** $Id: btreeInt.h,v 1.52 2009/07/15 17:25:46 drh Exp $ -** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to ** @@ -36722,7 +44242,7 @@ SQLITE_PRIVATE sqlite3_backup **sqlite3PagerBackupPtr(Pager *pPager){ ** ** The file is divided into pages. The first page is called page 1, ** the second is page 2, and so forth. A page number of zero indicates -** "no such page". The page size can be any power of 2 between 512 and 32768. +** "no such page". The page size can be any power of 2 between 512 and 65536. ** Each page can be either a btree page, a freelist page, an overflow ** page, or a pointer-map page. ** @@ -37082,18 +44602,23 @@ struct BtShared { MemPage *pPage1; /* First page of the database */ u8 readOnly; /* True if the underlying file is readonly */ u8 pageSizeFixed; /* True if the page size can no longer be changed */ + u8 secureDelete; /* True if secure_delete is enabled */ + u8 initiallyEmpty; /* Database is empty at start of transaction */ + u8 openFlags; /* Flags to sqlite3BtreeOpen() */ #ifndef SQLITE_OMIT_AUTOVACUUM u8 autoVacuum; /* True if auto-vacuum is enabled */ u8 incrVacuum; /* True if incr-vacuum is enabled */ #endif - u16 pageSize; /* Total number of bytes on a page */ - u16 usableSize; /* Number of usable bytes on each page */ u16 maxLocal; /* Maximum local payload in non-LEAFDATA tables */ u16 minLocal; /* Minimum local payload in non-LEAFDATA tables */ u16 maxLeaf; /* Maximum local payload in a LEAFDATA table */ u16 minLeaf; /* Minimum local payload in a LEAFDATA table */ u8 inTransaction; /* Transaction state */ + u8 doNotUseWAL; /* If true, do not open write-ahead-log file */ + u32 pageSize; /* Total number of bytes on a page */ + u32 usableSize; /* Number of usable bytes on each page */ int nTransaction; /* Number of open transactions (read + write) */ + u32 nPage; /* Number of pages in the database */ void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */ void (*xFreeSchema)(void*); /* Destructor for BtShared.pSchema */ sqlite3_mutex *mutex; /* Non-recursive mutex required to access this struct */ @@ -37391,7 +44916,7 @@ SQLITE_PRIVATE void sqlite3BtreeEnter(Btree *p){ if( p->locked ) return; /* In most cases, we should be able to acquire the lock we - ** want without having to go through the ascending lock + ** want without having to go throught the ascending lock ** procedure that follows. Just be sure not to block. */ if( sqlite3_mutex_try(p->pBt->mutex)==SQLITE_OK ){ @@ -37668,8 +45193,6 @@ SQLITE_PRIVATE void sqlite3BtreeEnterAll(sqlite3 *db){ ** May you share freely, never taking more than you give. ** ************************************************************************* -** $Id: btree.c,v 1.705 2009/08/10 03:57:58 shane Exp $ -** ** This file implements a external (disk-based) database using BTrees. ** See the header comment on "btreeInt.h" for additional information. ** Including a description of file format and an overview of operation. @@ -37692,7 +45215,16 @@ int sqlite3BtreeTrace=1; /* True to enable tracing */ # define TRACE(X) #endif - +/* +** Extract a 2-byte big-endian integer from an array of unsigned bytes. +** But if the value is zero, make it 65536. +** +** This routine is used to extract the "offset to cell content area" value +** from the header of a btree page. If the page size is 65536 and the page +** is empty, the offset should be 65536, but the 2-byte value stores zero. +** This routine makes the necessary adjustment to 65536. +*/ +#define get2byteNotZero(X) (((((int)get2byte(X))-1)&0xffff)+1) #ifndef SQLITE_OMIT_SHARED_CACHE /* @@ -38176,11 +45708,8 @@ static void invalidateIncrblobCursors( static int btreeSetHasContent(BtShared *pBt, Pgno pgno){ int rc = SQLITE_OK; if( !pBt->pHasContent ){ - int nPage = 100; - sqlite3PagerPagecount(pBt->pPager, &nPage); - /* If sqlite3PagerPagecount() fails there is no harm because the - ** nPage variable is unchanged from its default value of 100 */ - pBt->pHasContent = sqlite3BitvecCreate((u32)nPage); + assert( pgno<=pBt->nPage ); + pBt->pHasContent = sqlite3BitvecCreate(pBt->nPage); if( !pBt->pHasContent ){ rc = SQLITE_NOMEM; } @@ -38384,11 +45913,16 @@ SQLITE_PRIVATE int sqlite3BtreeCursorHasMoved(BtCursor *pCur, int *pHasMoved){ ** Given a page number of a regular database page, return the page ** number for the pointer-map page that contains the entry for the ** input page number. +** +** Return 0 (not a valid page) for pgno==1 since there is +** no pointer map associated with page 1. The integrity_check logic +** requires that ptrmapPageno(*,1)!=1. */ static Pgno ptrmapPageno(BtShared *pBt, Pgno pgno){ int nPagesPerMapPage; Pgno iPtrMap, ret; assert( sqlite3_mutex_held(pBt->mutex) ); + if( pgno<2 ) return 0; nPagesPerMapPage = (pBt->usableSize/5)+1; iPtrMap = (pgno-2)/nPagesPerMapPage; ret = (iPtrMap*nPagesPerMapPage) + 2; @@ -38803,6 +46337,7 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){ int top; /* First byte of cell content area */ int gap; /* First byte of gap between cell pointers and cell content */ int rc; /* Integer return code */ + int usableSize; /* Usable size of the page */ assert( sqlite3PagerIswriteable(pPage->pDbPage) ); assert( pPage->pBt ); @@ -38810,12 +46345,13 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){ assert( nByte>=0 ); /* Minimum cell size is 4 */ assert( pPage->nFree>=nByte ); assert( pPage->nOverflow==0 ); - assert( nBytepBt->usableSize-8 ); + usableSize = pPage->pBt->usableSize; + assert( nByte < usableSize-8 ); nFrag = data[hdr+7]; assert( pPage->cellOffset == hdr + 12 - 4*pPage->leaf ); gap = pPage->cellOffset + 2*pPage->nCell; - top = get2byte(&data[hdr+5]); + top = get2byteNotZero(&data[hdr+5]); if( gap>top ) return SQLITE_CORRUPT_BKPT; testcase( gap+2==top ); testcase( gap+1==top ); @@ -38825,15 +46361,19 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){ /* Always defragment highly fragmented pages */ rc = defragmentPage(pPage); if( rc ) return rc; - top = get2byte(&data[hdr+5]); + top = get2byteNotZero(&data[hdr+5]); }else if( gap+2<=top ){ /* Search the freelist looking for a free slot big enough to satisfy ** the request. The allocation is made from the first free slot in - ** the list that is large enough to accommodate it. + ** the list that is large enough to accomadate it. */ int pc, addr; for(addr=hdr+1; (pc = get2byte(&data[addr]))>0; addr=pc){ - int size = get2byte(&data[pc+2]); /* Size of free slot */ + int size; /* Size of the free slot */ + if( pc>usableSize-4 || pc=nByte ){ int x = size - nByte; testcase( x==4 ); @@ -38843,6 +46383,8 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){ ** fragmented bytes within the page. */ memcpy(&data[addr], &data[pc], 2); data[hdr+7] = (u8)(nFrag + x); + }else if( size+pc > usableSize ){ + return SQLITE_CORRUPT_BKPT; }else{ /* The slot remains on the free-list. Reduce its size to account ** for the portion used by the new allocation. */ @@ -38861,7 +46403,7 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){ if( gap+2+nByte>top ){ rc = defragmentPage(pPage); if( rc ) return rc; - top = get2byte(&data[hdr+5]); + top = get2byteNotZero(&data[hdr+5]); assert( gap+nByte<=top ); } @@ -38899,11 +46441,11 @@ static int freeSpace(MemPage *pPage, int start, int size){ assert( sqlite3_mutex_held(pPage->pBt->mutex) ); assert( size>=0 ); /* Minimum cell size is 4 */ -#ifdef SQLITE_SECURE_DELETE - /* Overwrite deleted information with zeros when the SECURE_DELETE - ** option is enabled at compile-time */ - memset(&data[start], 0, size); -#endif + if( pPage->pBt->secureDelete ){ + /* Overwrite deleted information with zeros when the secure_delete + ** option is enabled */ + memset(&data[start], 0, size); + } /* Add the space back into the linked list of freeblocks. Note that ** even though the freeblock list was checked by btreeInitPage(), @@ -39027,10 +46569,10 @@ static int btreeInitPage(MemPage *pPage){ u8 hdr; /* Offset to beginning of page header */ u8 *data; /* Equal to pPage->aData */ BtShared *pBt; /* The main btree structure */ - u16 usableSize; /* Amount of usable space on each page */ + int usableSize; /* Amount of usable space on each page */ u16 cellOffset; /* Offset from start of page to first cell pointer */ - u16 nFree; /* Number of unused bytes on the page */ - u16 top; /* First byte of the cell content area */ + int nFree; /* Number of unused bytes on the page */ + int top; /* First byte of the cell content area */ int iCellFirst; /* First allowable cell or freeblock offset */ int iCellLast; /* Last possible cell or freeblock offset */ @@ -39039,12 +46581,12 @@ static int btreeInitPage(MemPage *pPage){ hdr = pPage->hdrOffset; data = pPage->aData; if( decodeFlags(pPage, data[hdr]) ) return SQLITE_CORRUPT_BKPT; - assert( pBt->pageSize>=512 && pBt->pageSize<=32768 ); - pPage->maskPage = pBt->pageSize - 1; + assert( pBt->pageSize>=512 && pBt->pageSize<=65536 ); + pPage->maskPage = (u16)(pBt->pageSize - 1); pPage->nOverflow = 0; usableSize = pBt->usableSize; pPage->cellOffset = cellOffset = hdr + 12 - 4*pPage->leaf; - top = get2byte(&data[hdr+5]); + top = get2byteNotZero(&data[hdr+5]); pPage->nCell = get2byte(&data[hdr+3]); if( pPage->nCell>MX_CELL(pBt) ){ /* To many cells for a single page. The page must be corrupt */ @@ -39135,19 +46677,21 @@ static void zeroPage(MemPage *pPage, int flags){ assert( sqlite3PagerGetData(pPage->pDbPage) == data ); assert( sqlite3PagerIswriteable(pPage->pDbPage) ); assert( sqlite3_mutex_held(pBt->mutex) ); - /*memset(&data[hdr], 0, pBt->usableSize - hdr);*/ + if( pBt->secureDelete ){ + memset(&data[hdr], 0, pBt->usableSize - hdr); + } data[hdr] = (char)flags; first = hdr + 8 + 4*((flags&PTF_LEAF)==0 ?1:0); memset(&data[hdr+1], 0, 4); data[hdr+7] = 0; put2byte(&data[hdr+5], pBt->usableSize); - pPage->nFree = pBt->usableSize - first; + pPage->nFree = (u16)(pBt->usableSize - first); decodeFlags(pPage, flags); pPage->hdrOffset = hdr; pPage->cellOffset = first; pPage->nOverflow = 0; - assert( pBt->pageSize>=512 && pBt->pageSize<=32768 ); - pPage->maskPage = pBt->pageSize - 1; + assert( pBt->pageSize>=512 && pBt->pageSize<=65536 ); + pPage->maskPage = (u16)(pBt->pageSize - 1); pPage->nCell = 0; pPage->isInit = 1; } @@ -39213,13 +46757,13 @@ static MemPage *btreePageLookup(BtShared *pBt, Pgno pgno){ ** Return the size of the database file in pages. If there is any kind of ** error, return ((unsigned int)-1). */ -static Pgno pagerPagecount(BtShared *pBt){ - int nPage = -1; - int rc; - assert( pBt->pPage1 ); - rc = sqlite3PagerPagecount(pBt->pPager, &nPage); - assert( rc==SQLITE_OK || nPage==-1 ); - return (Pgno)nPage; +static Pgno btreePagecount(BtShared *pBt){ + return pBt->nPage; +} +SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree *p){ + assert( sqlite3BtreeHoldsMutex(p) ); + assert( ((p->pBt->nPage)&0x8000000)==0 ); + return (int)btreePagecount(p->pBt); } /* @@ -39236,25 +46780,22 @@ static int getAndInitPage( MemPage **ppPage /* Write the page pointer here */ ){ int rc; - TESTONLY( Pgno iLastPg = pagerPagecount(pBt); ) assert( sqlite3_mutex_held(pBt->mutex) ); - rc = btreeGetPage(pBt, pgno, ppPage, 0); - if( rc==SQLITE_OK ){ - rc = btreeInitPage(*ppPage); - if( rc!=SQLITE_OK ){ - releasePage(*ppPage); + if( pgno>btreePagecount(pBt) ){ + rc = SQLITE_CORRUPT_BKPT; + }else{ + rc = btreeGetPage(pBt, pgno, ppPage, 0); + if( rc==SQLITE_OK ){ + rc = btreeInitPage(*ppPage); + if( rc!=SQLITE_OK ){ + releasePage(*ppPage); + } } } - /* If the requested page number was either 0 or greater than the page - ** number of the last page in the database, this function should return - ** SQLITE_CORRUPT or some other error (i.e. SQLITE_FULL). Check that this - ** is the case. */ - assert( (pgno>0 && pgno<=iLastPg) || rc!=SQLITE_OK ); testcase( pgno==0 ); - testcase( pgno==iLastPg ); - + assert( pgno!=0 || rc==SQLITE_CORRUPT ); return rc; } @@ -39264,7 +46805,6 @@ static int getAndInitPage( */ static void releasePage(MemPage *pPage){ if( pPage ){ - assert( pPage->nOverflow==0 || sqlite3PagerPageRefcount(pPage->pDbPage)>1 ); assert( pPage->aData ); assert( pPage->pBt ); assert( sqlite3PagerGetExtra(pPage->pDbPage) == (void*)pPage ); @@ -39315,11 +46855,20 @@ static int btreeInvokeBusyHandler(void *pArg){ ** Open a database file. ** ** zFilename is the name of the database file. If zFilename is NULL -** a new database with a random name is created. This randomly named -** database file will be deleted when sqlite3BtreeClose() is called. +** then an ephemeral database is created. The ephemeral database might +** be exclusively in memory, or it might use a disk-based memory cache. +** Either way, the ephemeral database will be automatically deleted +** when sqlite3BtreeClose() is called. +** ** If zFilename is ":memory:" then an in-memory database is created ** that is automatically destroyed when it is closed. ** +** The "flags" parameter is a bitmask that might contain bits +** BTREE_OMIT_JOURNAL and/or BTREE_NO_READLOCK. The BTREE_NO_READLOCK +** bit is also set if the SQLITE_NoReadlock flags is set in db->flags. +** These flags are passed through into sqlite3PagerOpen() and must +** be the same values as PAGER_OMIT_JOURNAL and PAGER_NO_READLOCK. +** ** If the database is already opened in the same database connection ** and we are in shared cache mode, then the open will fail with an ** SQLITE_CONSTRAINT error. We cannot allow two or more BtShared @@ -39341,6 +46890,9 @@ SQLITE_PRIVATE int sqlite3BtreeOpen( u8 nReserve; /* Byte of unused space on each page */ unsigned char zDbHeader[100]; /* Database header content */ + /* True if opening an ephemeral, temporary database */ + const int isTempDb = zFilename==0 || zFilename[0]==0; + /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. This symbol is only required if ** either of the shared-data or autovacuum features are compiled @@ -39350,13 +46902,30 @@ SQLITE_PRIVATE int sqlite3BtreeOpen( #ifdef SQLITE_OMIT_MEMORYDB const int isMemdb = 0; #else - const int isMemdb = zFilename && !strcmp(zFilename, ":memory:"); + const int isMemdb = (zFilename && strcmp(zFilename, ":memory:")==0) + || (isTempDb && sqlite3TempInMemory(db)); #endif #endif assert( db!=0 ); assert( sqlite3_mutex_held(db->mutex) ); + assert( (flags&0xff)==flags ); /* flags fit in 8 bits */ + /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ + assert( (flags & BTREE_UNORDERED)==0 || (flags & BTREE_SINGLE)!=0 ); + + /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ + assert( (flags & BTREE_SINGLE)==0 || isTempDb ); + + if( db->flags & SQLITE_NoReadlock ){ + flags |= BTREE_NO_READLOCK; + } + if( isMemdb ){ + flags |= BTREE_MEMORY; + } + if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ + vfsFlags = (vfsFlags & ~SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB; + } pVfs = db->pVfs; p = sqlite3MallocZero(sizeof(Btree)); if( !p ){ @@ -39374,7 +46943,7 @@ SQLITE_PRIVATE int sqlite3BtreeOpen( ** If this Btree is a candidate for shared cache, try to find an ** existing BtShared object that we can share with */ - if( isMemdb==0 && zFilename && zFilename[0] ){ + if( isMemdb==0 && isTempDb==0 ){ if( vfsFlags & SQLITE_OPEN_SHAREDCACHE ){ int nFullPathname = pVfs->mxPathname+1; char *zFullPathname = sqlite3Malloc(nFullPathname); @@ -39449,6 +47018,7 @@ SQLITE_PRIVATE int sqlite3BtreeOpen( if( rc!=SQLITE_OK ){ goto btree_open_out; } + pBt->openFlags = (u8)flags; pBt->db = db; sqlite3PagerSetBusyhandler(pBt->pPager, btreeInvokeBusyHandler, pBt); p->pBt = pBt; @@ -39456,7 +47026,10 @@ SQLITE_PRIVATE int sqlite3BtreeOpen( pBt->pCursor = 0; pBt->pPage1 = 0; pBt->readOnly = sqlite3PagerIsreadonly(pBt->pPager); - pBt->pageSize = get2byte(&zDbHeader[16]); +#ifdef SQLITE_SECURE_DELETE + pBt->secureDelete = 1; +#endif + pBt->pageSize = (zDbHeader[16]<<8) | (zDbHeader[17]<<16); if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE || ((pBt->pageSize-1)&pBt->pageSize)!=0 ){ pBt->pageSize = 0; @@ -39550,6 +47123,14 @@ btree_open_out: sqlite3_free(pBt); sqlite3_free(p); *ppBtree = 0; + }else{ + /* If the B-Tree was successfully opened, set the pager-cache size to the + ** default value. Except, when opening on an existing shared pager-cache, + ** do not change the pager-cache size. + */ + if( sqlite3BtreeSchema(p, 0, 0)==0 ){ + sqlite3PagerSetCachesize(p->pBt->pPager, SQLITE_DEFAULT_CACHE_SIZE); + } } if( mutexOpen ){ assert( sqlite3_mutex_held(mutexOpen) ); @@ -39658,7 +47239,7 @@ SQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){ if( pBt->xFreeSchema && pBt->pSchema ){ pBt->xFreeSchema(pBt->pSchema); } - sqlite3_free(pBt->pSchema); + sqlite3DbFree(0, pBt->pSchema); freeTempSpace(pBt); sqlite3_free(pBt); } @@ -39770,7 +47351,7 @@ SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve, ((pageSize-1)&pageSize)==0 ){ assert( (pageSize & 7)==0 ); assert( !pBt->pPage1 && !pBt->pCursor ); - pBt->pageSize = (u16)pageSize; + pBt->pageSize = (u32)pageSize; freeTempSpace(pBt); } rc = sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize, nReserve); @@ -39812,6 +47393,23 @@ SQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree *p, int mxPage){ sqlite3BtreeLeave(p); return n; } + +/* +** Set the secureDelete flag if newFlag is 0 or 1. If newFlag is -1, +** then make no changes. Always return the value of the secureDelete +** setting after the change. +*/ +SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree *p, int newFlag){ + int b; + if( p==0 ) return 0; + sqlite3BtreeEnter(p); + if( newFlag>=0 ){ + p->pBt->secureDelete = (newFlag!=0) ? 1 : 0; + } + b = p->pBt->secureDelete; + sqlite3BtreeLeave(p); + return b; +} #endif /* !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) */ /* @@ -39871,9 +47469,11 @@ SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *p){ ** is returned if we run out of memory. */ static int lockBtree(BtShared *pBt){ - int rc; - MemPage *pPage1; - int nPage; + int rc; /* Result code from subfunctions */ + MemPage *pPage1; /* Page 1 of the database file */ + int nPage; /* Number of pages in the database */ + int nPageFile = 0; /* Number of pages in the database file */ + int nPageHeader; /* Number of pages in the database according to hdr */ assert( sqlite3_mutex_held(pBt->mutex) ); assert( pBt->pPage1==0 ); @@ -39885,23 +47485,55 @@ static int lockBtree(BtShared *pBt){ /* Do some checking to help insure the file we opened really is ** a valid database file. */ - rc = sqlite3PagerPagecount(pBt->pPager, &nPage); - if( rc!=SQLITE_OK ){ - goto page1_init_failed; - }else if( nPage>0 ){ - int pageSize; - int usableSize; + nPage = nPageHeader = get4byte(28+(u8*)pPage1->aData); + sqlite3PagerPagecount(pBt->pPager, &nPageFile); + if( nPage==0 || memcmp(24+(u8*)pPage1->aData, 92+(u8*)pPage1->aData,4)!=0 ){ + nPage = nPageFile; + } + if( nPage>0 ){ + u32 pageSize; + u32 usableSize; u8 *page1 = pPage1->aData; rc = SQLITE_NOTADB; if( memcmp(page1, zMagicHeader, 16)!=0 ){ goto page1_init_failed; } + +#ifdef SQLITE_OMIT_WAL if( page1[18]>1 ){ pBt->readOnly = 1; } if( page1[19]>1 ){ goto page1_init_failed; } +#else + if( page1[18]>2 ){ + pBt->readOnly = 1; + } + if( page1[19]>2 ){ + goto page1_init_failed; + } + + /* If the write version is set to 2, this database should be accessed + ** in WAL mode. If the log is not already open, open it now. Then + ** return SQLITE_OK and return without populating BtShared.pPage1. + ** The caller detects this and calls this function again. This is + ** required as the version of page 1 currently in the page1 buffer + ** may not be the latest version - there may be a newer one in the log + ** file. + */ + if( page1[19]==2 && pBt->doNotUseWAL==0 ){ + int isOpen = 0; + rc = sqlite3PagerOpenWal(pBt->pPager, &isOpen); + if( rc!=SQLITE_OK ){ + goto page1_init_failed; + }else if( isOpen==0 ){ + releasePage(pPage1); + return SQLITE_OK; + } + rc = SQLITE_NOTADB; + } +#endif /* The maximum embedded fraction must be exactly 25%. And the minimum ** embedded fraction must be 12.5% for both leaf-data and non-leaf-data. @@ -39911,15 +47543,16 @@ static int lockBtree(BtShared *pBt){ if( memcmp(&page1[21], "\100\040\040",3)!=0 ){ goto page1_init_failed; } - pageSize = get2byte(&page1[16]); - if( ((pageSize-1)&pageSize)!=0 || pageSize<512 || - (SQLITE_MAX_PAGE_SIZE<32768 && pageSize>SQLITE_MAX_PAGE_SIZE) + pageSize = (page1[16]<<8) | (page1[17]<<16); + if( ((pageSize-1)&pageSize)!=0 + || pageSize>SQLITE_MAX_PAGE_SIZE + || pageSize<=256 ){ goto page1_init_failed; } assert( (pageSize & 7)==0 ); usableSize = pageSize - page1[20]; - if( pageSize!=pBt->pageSize ){ + if( (u32)pageSize!=pBt->pageSize ){ /* After reading the first page of the database assuming a page size ** of BtShared.pageSize, we have discovered that the page-size is ** actually pageSize. Unlock the database, leave pBt->pPage1 at @@ -39927,18 +47560,22 @@ static int lockBtree(BtShared *pBt){ ** again with the correct page-size. */ releasePage(pPage1); - pBt->usableSize = (u16)usableSize; - pBt->pageSize = (u16)pageSize; + pBt->usableSize = usableSize; + pBt->pageSize = pageSize; freeTempSpace(pBt); rc = sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize, pageSize-usableSize); return rc; } + if( nPageHeader>nPageFile ){ + rc = SQLITE_CORRUPT_BKPT; + goto page1_init_failed; + } if( usableSize<480 ){ goto page1_init_failed; } - pBt->pageSize = (u16)pageSize; - pBt->usableSize = (u16)usableSize; + pBt->pageSize = pageSize; + pBt->usableSize = usableSize; #ifndef SQLITE_OMIT_AUTOVACUUM pBt->autoVacuum = (get4byte(&page1[36 + 4*4])?1:0); pBt->incrVacuum = (get4byte(&page1[36 + 7*4])?1:0); @@ -39954,16 +47591,17 @@ static int lockBtree(BtShared *pBt){ ** 9-byte nKey value ** 4-byte nData value ** 4-byte overflow page pointer - ** So a cell consists of a 2-byte poiner, a header which is as much as + ** So a cell consists of a 2-byte pointer, a header which is as much as ** 17 bytes long, 0 to N bytes of payload, and an optional 4 byte overflow ** page pointer. */ - pBt->maxLocal = (pBt->usableSize-12)*64/255 - 23; - pBt->minLocal = (pBt->usableSize-12)*32/255 - 23; - pBt->maxLeaf = pBt->usableSize - 35; - pBt->minLeaf = (pBt->usableSize-12)*32/255 - 23; + pBt->maxLocal = (u16)((pBt->usableSize-12)*64/255 - 23); + pBt->minLocal = (u16)((pBt->usableSize-12)*32/255 - 23); + pBt->maxLeaf = (u16)(pBt->usableSize - 35); + pBt->minLeaf = (u16)((pBt->usableSize-12)*32/255 - 23); assert( pBt->maxLeaf + 23 <= MX_CELL_SIZE(pBt) ); pBt->pPage1 = pPage1; + pBt->nPage = nPage; return SQLITE_OK; page1_init_failed: @@ -40001,15 +47639,10 @@ static int newDatabase(BtShared *pBt){ MemPage *pP1; unsigned char *data; int rc; - int nPage; assert( sqlite3_mutex_held(pBt->mutex) ); - /* The database size has already been measured and cached, so failure - ** is impossible here. If the original size measurement failed, then - ** processing aborts before entering this routine. */ - rc = sqlite3PagerPagecount(pBt->pPager, &nPage); - if( NEVER(rc!=SQLITE_OK) || nPage>0 ){ - return rc; + if( pBt->nPage>0 ){ + return SQLITE_OK; } pP1 = pBt->pPage1; assert( pP1!=0 ); @@ -40018,7 +47651,8 @@ static int newDatabase(BtShared *pBt){ if( rc ) return rc; memcpy(data, zMagicHeader, sizeof(zMagicHeader)); assert( sizeof(zMagicHeader)==16 ); - put2byte(&data[16], pBt->pageSize); + data[16] = (u8)((pBt->pageSize>>8)&0xff); + data[17] = (u8)((pBt->pageSize>>16)&0xff); data[18] = 1; data[19] = 1; assert( pBt->usableSize<=pBt->pageSize && pBt->usableSize+255>=pBt->pageSize); @@ -40035,6 +47669,8 @@ static int newDatabase(BtShared *pBt){ put4byte(&data[36 + 4*4], pBt->autoVacuum); put4byte(&data[36 + 7*4], pBt->incrVacuum); #endif + pBt->nPage = 1; + data[31] = 1; return SQLITE_OK; } @@ -40124,6 +47760,7 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ rc = querySharedCacheTableLock(p, MASTER_ROOT, READ_LOCK); if( SQLITE_OK!=rc ) goto trans_begun; + pBt->initiallyEmpty = (u8)(pBt->nPage==0); do { /* Call lockBtree() until either pBt->pPage1 is populated or ** lockBtree() returns something other than SQLITE_OK. lockBtree() @@ -40148,7 +47785,7 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ if( rc!=SQLITE_OK ){ unlockBtreeIfUnused(pBt); } - }while( rc==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE && + }while( (rc&0xFF)==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE && btreeInvokeBusyHandler(pBt) ); if( rc==SQLITE_OK ){ @@ -40167,13 +47804,27 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ if( p->inTrans>pBt->inTransaction ){ pBt->inTransaction = p->inTrans; } -#ifndef SQLITE_OMIT_SHARED_CACHE if( wrflag ){ + MemPage *pPage1 = pBt->pPage1; +#ifndef SQLITE_OMIT_SHARED_CACHE assert( !pBt->pWriter ); pBt->pWriter = p; pBt->isExclusive = (u8)(wrflag>1); - } #endif + + /* If the db-size header field is incorrect (as it may be if an old + ** client has been writing the database file), update it now. Doing + ** this sooner rather than later means the database size can safely + ** re-read the database size from page 1 if a savepoint or transaction + ** rollback occurs within the transaction. + */ + if( pBt->nPage!=get4byte(&pPage1->aData[28]) ){ + rc = sqlite3PagerWrite(pPage1->pDbPage); + if( rc==SQLITE_OK ){ + put4byte(&pPage1->aData[28], pBt->nPage); + } + } + } } @@ -40403,12 +48054,12 @@ static int allocateBtreePage(BtShared *, MemPage **, Pgno *, Pgno, u8); */ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg){ Pgno nFreeList; /* Number of pages still on the free-list */ + int rc; assert( sqlite3_mutex_held(pBt->mutex) ); assert( iLastPg>nFin ); if( !PTRMAP_ISPAGE(pBt, iLastPg) && iLastPg!=PENDING_BYTE_PAGE(pBt) ){ - int rc; u8 eType; Pgno iPtrPage; @@ -40484,7 +48135,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg){ while( iLastPg==PENDING_BYTE_PAGE(pBt)||PTRMAP_ISPAGE(pBt, iLastPg) ){ if( PTRMAP_ISPAGE(pBt, iLastPg) ){ MemPage *pPg; - int rc = btreeGetPage(pBt, iLastPg, &pPg, 0); + rc = btreeGetPage(pBt, iLastPg, &pPg, 0); if( rc!=SQLITE_OK ){ return rc; } @@ -40497,6 +48148,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg){ iLastPg--; } sqlite3PagerTruncateImage(pBt->pPager, iLastPg); + pBt->nPage = iLastPg; } return SQLITE_OK; } @@ -40519,7 +48171,11 @@ SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *p){ rc = SQLITE_DONE; }else{ invalidateAllOverflowCache(pBt); - rc = incrVacuumStep(pBt, 0, pagerPagecount(pBt)); + rc = incrVacuumStep(pBt, 0, btreePagecount(pBt)); + if( rc==SQLITE_OK ){ + rc = sqlite3PagerWrite(pBt->pPage1->pDbPage); + put4byte(&pBt->pPage1->aData[28], pBt->nPage); + } } sqlite3BtreeLeave(p); return rc; @@ -40550,7 +48206,7 @@ static int autoVacuumCommit(BtShared *pBt){ int nEntry; /* Number of entries on one ptrmap page */ Pgno nOrig; /* Database size before freeing */ - nOrig = pagerPagecount(pBt); + nOrig = btreePagecount(pBt); if( PTRMAP_ISPAGE(pBt, nOrig) || nOrig==PENDING_BYTE_PAGE(pBt) ){ /* It is not possible to create a database for which the final page ** is either a pointer-map page or the pending-byte page. If one @@ -40575,11 +48231,12 @@ static int autoVacuumCommit(BtShared *pBt){ rc = incrVacuumStep(pBt, nFin, iFree); } if( (rc==SQLITE_DONE || rc==SQLITE_OK) && nFree>0 ){ - rc = SQLITE_OK; rc = sqlite3PagerWrite(pBt->pPage1->pDbPage); put4byte(&pBt->pPage1->aData[32], 0); put4byte(&pBt->pPage1->aData[36], 0); + put4byte(&pBt->pPage1->aData[28], nFin); sqlite3PagerTruncateImage(pBt->pPager, nFin); + pBt->nPage = nFin; } if( rc!=SQLITE_OK ){ sqlite3PagerRollback(pPager); @@ -40829,6 +48486,11 @@ SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p){ ** call btreeGetPage() on page 1 again to make ** sure pPage1->aData is set correctly. */ if( btreeGetPage(pBt, 1, &pPage1, 0)==SQLITE_OK ){ + int nPage = get4byte(28+(u8*)pPage1->aData); + testcase( nPage==0 ); + if( nPage==0 ) sqlite3PagerPagecount(pBt->pPager, &nPage); + testcase( pBt->nPage!=nPage ); + pBt->nPage = nPage; releasePage(pPage1); } assert( countWriteCursors(pBt)==0 ); @@ -40866,17 +48528,13 @@ SQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree *p, int iStatement){ assert( pBt->readOnly==0 ); assert( iStatement>0 ); assert( iStatement>p->db->nSavepoint ); - if( NEVER(p->inTrans!=TRANS_WRITE || pBt->readOnly) ){ - rc = SQLITE_INTERNAL; - }else{ - assert( pBt->inTransaction==TRANS_WRITE ); - /* At the pager level, a statement transaction is a savepoint with - ** an index greater than all savepoints created explicitly using - ** SQL statements. It is illegal to open, release or rollback any - ** such savepoints while the statement transaction savepoint is active. - */ - rc = sqlite3PagerOpenSavepoint(pBt->pPager, iStatement); - } + assert( pBt->inTransaction==TRANS_WRITE ); + /* At the pager level, a statement transaction is a savepoint with + ** an index greater than all savepoints created explicitly using + ** SQL statements. It is illegal to open, release or rollback any + ** such savepoints while the statement transaction savepoint is active. + */ + rc = sqlite3PagerOpenSavepoint(pBt->pPager, iStatement); sqlite3BtreeLeave(p); return rc; } @@ -40902,7 +48560,14 @@ SQLITE_PRIVATE int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint){ sqlite3BtreeEnter(p); rc = sqlite3PagerSavepoint(pBt->pPager, op, iSavepoint); if( rc==SQLITE_OK ){ + if( iSavepoint<0 && pBt->initiallyEmpty ) pBt->nPage = 0; rc = newDatabase(pBt); + pBt->nPage = get4byte(28 + pBt->pPage1->aData); + + /* The database size was written into the offset 28 of the header + ** when the transaction started, so we know that the value at offset + ** 28 is nonzero. */ + assert( pBt->nPage>0 ); } sqlite3BtreeLeave(p); } @@ -40938,8 +48603,8 @@ SQLITE_PRIVATE int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint){ ** root page of a b-tree. If it is not, then the cursor acquired ** will not work correctly. ** -** It is assumed that the sqlite3BtreeCursorSize() bytes of memory -** pointed to by pCur have been zeroed by the caller. +** It is assumed that the sqlite3BtreeCursorZero() has been called +** on pCur to initialize the memory space prior to invoking this routine. */ static int btreeCursor( Btree *p, /* The btree */ @@ -40968,7 +48633,7 @@ static int btreeCursor( if( NEVER(wrFlag && pBt->readOnly) ){ return SQLITE_READONLY; } - if( iTable==1 && pagerPagecount(pBt)==0 ){ + if( iTable==1 && btreePagecount(pBt)==0 ){ return SQLITE_EMPTY; } @@ -41012,7 +48677,19 @@ SQLITE_PRIVATE int sqlite3BtreeCursor( ** this routine. */ SQLITE_PRIVATE int sqlite3BtreeCursorSize(void){ - return sizeof(BtCursor); + return ROUND8(sizeof(BtCursor)); +} + +/* +** Initialize memory that will be converted into a BtCursor object. +** +** The simple approach here would be to memset() the entire object +** to zero. But it turns out that the apPage[] and aiIdx[] arrays +** do not need to be zeroed and they are large, so we can save a lot +** of run-time by skipping the initialization of those elements. +*/ +SQLITE_PRIVATE void sqlite3BtreeCursorZero(BtCursor *p){ + memset(p, 0, offsetof(BtCursor, iPage)); } /* @@ -41227,7 +48904,7 @@ static int getOverflowPage( iGuess++; } - if( iGuess<=pagerPagecount(pBt) ){ + if( iGuess<=btreePagecount(pBt) ){ rc = ptrmapGet(pBt, iGuess, &eType, &pgno); if( rc==SQLITE_OK && eType==PTRMAP_OVERFLOW2 && pgno==ovfl ){ next = iGuess; @@ -41822,7 +49499,6 @@ SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){ if( pCur->eState==CURSOR_INVALID ){ assert( pCur->apPage[pCur->iPage]->nCell==0 ); *pRes = 1; - rc = SQLITE_OK; }else{ assert( pCur->apPage[pCur->iPage]->nCell>0 ); *pRes = 0; @@ -41987,9 +49663,9 @@ SQLITE_PRIVATE int sqlite3BtreeMovetoUnpacked( pCur->validNKey = 1; pCur->info.nKey = nCellKey; }else{ - /* The maximum supported page-size is 32768 bytes. This means that + /* The maximum supported page-size is 65536 bytes. This means that ** the maximum number of record bytes stored on an index B-Tree - ** page is at most 8198 bytes, which may be stored as a 2-byte + ** page is less than 16384 bytes and may be stored as a 2-byte ** varint. This information is used to attempt to avoid parsing ** the entire cell by checking for the cases where the record is ** stored entirely within the b-tree page by inspecting the first @@ -42259,7 +49935,7 @@ static int allocateBtreePage( assert( sqlite3_mutex_held(pBt->mutex) ); pPage1 = pBt->pPage1; - mxPage = pagerPagecount(pBt); + mxPage = btreePagecount(pBt); n = get4byte(&pPage1->aData[36]); testcase( n==mxPage-1 ); if( n>=mxPage ){ @@ -42352,6 +50028,10 @@ static int allocateBtreePage( if( !pPrevTrunk ){ memcpy(&pPage1->aData[32], &pTrunk->aData[0], 4); }else{ + rc = sqlite3PagerWrite(pPrevTrunk->pDbPage); + if( rc!=SQLITE_OK ){ + goto end_allocate_page; + } memcpy(&pPrevTrunk->aData[0], &pTrunk->aData[0], 4); } }else{ @@ -42455,35 +50135,35 @@ static int allocateBtreePage( }else{ /* There are no pages on the freelist, so create a new page at the ** end of the file */ - int nPage = pagerPagecount(pBt); - *pPgno = nPage + 1; - - if( *pPgno==PENDING_BYTE_PAGE(pBt) ){ - (*pPgno)++; - } + rc = sqlite3PagerWrite(pBt->pPage1->pDbPage); + if( rc ) return rc; + pBt->nPage++; + if( pBt->nPage==PENDING_BYTE_PAGE(pBt) ) pBt->nPage++; #ifndef SQLITE_OMIT_AUTOVACUUM - if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, *pPgno) ){ + if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, pBt->nPage) ){ /* If *pPgno refers to a pointer-map page, allocate two new pages ** at the end of the file instead of one. The first allocated page ** becomes a new pointer-map page, the second is used by the caller. */ MemPage *pPg = 0; - TRACE(("ALLOCATE: %d from end of file (pointer-map page)\n", *pPgno)); - assert( *pPgno!=PENDING_BYTE_PAGE(pBt) ); - rc = btreeGetPage(pBt, *pPgno, &pPg, 0); + TRACE(("ALLOCATE: %d from end of file (pointer-map page)\n", pBt->nPage)); + assert( pBt->nPage!=PENDING_BYTE_PAGE(pBt) ); + rc = btreeGetPage(pBt, pBt->nPage, &pPg, 1); if( rc==SQLITE_OK ){ rc = sqlite3PagerWrite(pPg->pDbPage); releasePage(pPg); } if( rc ) return rc; - (*pPgno)++; - if( *pPgno==PENDING_BYTE_PAGE(pBt) ){ (*pPgno)++; } + pBt->nPage++; + if( pBt->nPage==PENDING_BYTE_PAGE(pBt) ){ pBt->nPage++; } } #endif + put4byte(28 + (u8*)pBt->pPage1->aData, pBt->nPage); + *pPgno = pBt->nPage; assert( *pPgno!=PENDING_BYTE_PAGE(pBt) ); - rc = btreeGetPage(pBt, *pPgno, ppPage, 0); + rc = btreeGetPage(pBt, *pPgno, ppPage, 1); if( rc ) return rc; rc = sqlite3PagerWrite((*ppPage)->pDbPage); if( rc!=SQLITE_OK ){ @@ -42546,17 +50226,17 @@ static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){ nFree = get4byte(&pPage1->aData[36]); put4byte(&pPage1->aData[36], nFree+1); -#ifdef SQLITE_SECURE_DELETE - /* If the SQLITE_SECURE_DELETE compile-time option is enabled, then - ** always fully overwrite deleted information with zeros. - */ - if( (!pPage && (rc = btreeGetPage(pBt, iPage, &pPage, 0))) - || (rc = sqlite3PagerWrite(pPage->pDbPage)) - ){ - goto freepage_out; + if( pBt->secureDelete ){ + /* If the secure_delete option is enabled, then + ** always fully overwrite deleted information with zeros. + */ + if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) ) + || ((rc = sqlite3PagerWrite(pPage->pDbPage))!=0) + ){ + goto freepage_out; + } + memset(pPage->aData, 0, pPage->pBt->pageSize); } - memset(pPage->aData, 0, pPage->pBt->pageSize); -#endif /* If the database supports auto-vacuum, write an entry in the pointer-map ** to indicate that the page is free. @@ -42607,11 +50287,9 @@ static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){ if( rc==SQLITE_OK ){ put4byte(&pTrunk->aData[4], nLeaf+1); put4byte(&pTrunk->aData[8+nLeaf*4], iPage); -#ifndef SQLITE_SECURE_DELETE - if( pPage ){ + if( pPage && !pBt->secureDelete ){ sqlite3PagerDontWrite(pPage->pDbPage); } -#endif rc = btreeSetHasContent(pBt, iPage); } TRACE(("FREE-PAGE: %d leaf on trunk page %d\n",pPage->pgno,pTrunk->pgno)); @@ -42660,7 +50338,7 @@ static int clearCell(MemPage *pPage, unsigned char *pCell){ Pgno ovflPgno; int rc; int nOvfl; - u16 ovflPageSize; + u32 ovflPageSize; assert( sqlite3_mutex_held(pPage->pBt->mutex) ); btreeParseCellPtr(pPage, pCell, &info); @@ -42675,7 +50353,7 @@ static int clearCell(MemPage *pPage, unsigned char *pCell){ while( nOvfl-- ){ Pgno iNext = 0; MemPage *pOvfl = 0; - if( ovflPgno<2 || ovflPgno>pagerPagecount(pBt) ){ + if( ovflPgno<2 || ovflPgno>btreePagecount(pBt) ){ /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ @@ -42685,7 +50363,25 @@ static int clearCell(MemPage *pPage, unsigned char *pCell){ rc = getOverflowPage(pBt, ovflPgno, &pOvfl, &iNext); if( rc ) return rc; } - rc = freePage2(pBt, pOvfl, ovflPgno); + + if( ( pOvfl || ((pOvfl = btreePageLookup(pBt, ovflPgno))!=0) ) + && sqlite3PagerPageRefcount(pOvfl->pDbPage)!=1 + ){ + /* There is no reason any cursor should have an outstanding reference + ** to an overflow page belonging to a cell that is being deleted/updated. + ** So if there exists more than one reference to this page, then it + ** must not really be an overflow page and the database must be corrupt. + ** It is helpful to detect this before calling freePage2(), as + ** freePage2() may zero the page contents if secure-delete mode is + ** enabled. If this 'overflow' page happens to be a page that the + ** caller is iterating through or using in some other way, this + ** can be problematic. + */ + rc = SQLITE_CORRUPT_BKPT; + }else{ + rc = freePage2(pBt, pOvfl, ovflPgno); + } + if( pOvfl ){ sqlite3PagerUnref(pOvfl->pDbPage); } @@ -42867,7 +50563,7 @@ static int fillInCell( */ static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){ int i; /* Loop counter */ - int pc; /* Offset to cell content of cell being deleted */ + u32 pc; /* Offset to cell content of cell being deleted */ u8 *data; /* pPage->aData */ u8 *ptr; /* Used to move bytes around within data[] */ int rc; /* The return code */ @@ -42885,7 +50581,7 @@ static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){ hdr = pPage->hdrOffset; testcase( pc==get2byte(&data[hdr+5]) ); testcase( pc+sz==pPage->pBt->usableSize ); - if( pc < get2byte(&data[hdr+5]) || pc+sz > pPage->pBt->usableSize ){ + if( pc < (u32)get2byte(&data[hdr+5]) || pc+sz > pPage->pBt->usableSize ){ *pRC = SQLITE_CORRUPT_BKPT; return; } @@ -42929,7 +50625,7 @@ static void insertCell( Pgno iChild, /* If non-zero, replace first 4 bytes with this value */ int *pRC /* Read and write return code from here */ ){ - int idx; /* Where to write new cell content in data[] */ + int idx = 0; /* Where to write new cell content in data[] */ int j; /* Loop counter */ int end; /* First byte past the last cell pointer in data[] */ int ins; /* Index in data[] where new cell pointer is inserted */ @@ -42942,10 +50638,15 @@ static void insertCell( if( *pRC ) return; assert( i>=0 && i<=pPage->nCell+pPage->nOverflow ); - assert( pPage->nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=5460 ); + assert( pPage->nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=10921 ); assert( pPage->nOverflow<=ArraySize(pPage->aOvfl) ); - assert( sz==cellSizePtr(pPage, pCell) ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); + /* The cell should normally be sized correctly. However, when moving a + ** malformed cell from a leaf page to an interior page, if the cell size + ** wanted to be less than 4 but got rounded up to 4 on the leaf, then size + ** might be less than 8 (leaf-size + pointer) on the interior node. Hence + ** the term after the || in the following assert(). */ + assert( sz==cellSizePtr(pPage, pCell) || (sz==8 && iChild>0) ); if( pPage->nOverflow || sz+2>pPage->nFree ){ if( pTemp ){ memcpy(pTemp+nSkip, pCell+nSkip, sz-nSkip); @@ -43017,12 +50718,12 @@ static void assemblePage( assert( pPage->nOverflow==0 ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); - assert( nCell>=0 && nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=5460 ); + assert( nCell>=0 && nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=10921); assert( sqlite3PagerIswriteable(pPage->pDbPage) ); /* Check that the page has just been zeroed by zeroPage() */ assert( pPage->nCell==0 ); - assert( get2byte(&data[hdr+5])==nUsable ); + assert( get2byteNotZero(&data[hdr+5])==nUsable ); pCellptr = &data[pPage->cellOffset + nCell*2]; cellbody = nUsable; @@ -43088,6 +50789,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ assert( sqlite3PagerIswriteable(pParent->pDbPage) ); assert( pPage->nOverflow==1 ); + /* This error condition is now caught prior to reaching this function */ if( pPage->nCell<=0 ) return SQLITE_CORRUPT_BKPT; /* Allocate a new page. This page will become the right-sibling of @@ -43224,7 +50926,7 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){ u8 * const aTo = pTo->aData; int const iFromHdr = pFrom->hdrOffset; int const iToHdr = ((pTo->pgno==1) ? 100 : 0); - TESTONLY(int rc;) + int rc; int iData; @@ -43238,11 +50940,16 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){ memcpy(&aTo[iToHdr], &aFrom[iFromHdr], pFrom->cellOffset + 2*pFrom->nCell); /* Reinitialize page pTo so that the contents of the MemPage structure - ** match the new data. The initialization of pTo "cannot" fail, as the - ** data copied from pFrom is known to be valid. */ + ** match the new data. The initialization of pTo can actually fail under + ** fairly obscure circumstances, even though it is a copy of initialized + ** page pFrom. + */ pTo->isInit = 0; - TESTONLY(rc = ) btreeInitPage(pTo); - assert( rc==SQLITE_OK ); + rc = btreeInitPage(pTo); + if( rc!=SQLITE_OK ){ + *pRC = rc; + return; + } /* If this is an auto-vacuum database, update the pointer-map entries ** for any b-tree or overflow pages that pTo now contains the pointers to. @@ -43410,10 +51117,17 @@ static int balance_nonroot( ** In this case, temporarily copy the cell into the aOvflSpace[] ** buffer. It will be copied out again as soon as the aSpace[] buffer ** is allocated. */ -#ifdef SQLITE_SECURE_DELETE - memcpy(&aOvflSpace[apDiv[i]-pParent->aData], apDiv[i], szNew[i]); - apDiv[i] = &aOvflSpace[apDiv[i]-pParent->aData]; -#endif + if( pBt->secureDelete ){ + int iOff = SQLITE_PTR_TO_INT(apDiv[i]) - SQLITE_PTR_TO_INT(pParent->aData); + if( (iOff+szNew[i])>(int)pBt->usableSize ){ + rc = SQLITE_CORRUPT_BKPT; + memset(apOld, 0, (i+1)*sizeof(MemPage*)); + goto balance_cleanup; + }else{ + memcpy(&aOvflSpace[iOff], apDiv[i], szNew[i]); + apDiv[i] = &aOvflSpace[apDiv[i]-pParent->aData]; + } + } dropCell(pParent, i+nxDiv-pParent->nOverflow, szNew[i], &rc); } } @@ -43484,7 +51198,7 @@ static int balance_nonroot( szCell[nCell] = sz; pTemp = &aSpace1[iSpace1]; iSpace1 += sz; - assert( sz<=pBt->pageSize/4 ); + assert( sz<=pBt->maxLocal+23 ); assert( iSpace1<=pBt->pageSize ); memcpy(pTemp, apDiv[i], sz); apCell[nCell] = pTemp+leafCorrection; @@ -43533,7 +51247,7 @@ static int balance_nonroot( if( leafData ){ i--; } subtotal = 0; k++; - if( k>NB+1 ){ rc = SQLITE_CORRUPT; goto balance_cleanup; } + if( k>NB+1 ){ rc = SQLITE_CORRUPT_BKPT; goto balance_cleanup; } } } szNew[k] = subtotal; @@ -43587,7 +51301,7 @@ static int balance_nonroot( ** Allocate k new pages. Reuse old pages where possible. */ if( apOld[0]->pgno<=1 ){ - rc = SQLITE_CORRUPT; + rc = SQLITE_CORRUPT_BKPT; goto balance_cleanup; } pageFlags = apOld[0]->aData[0]; @@ -43730,7 +51444,7 @@ static int balance_nonroot( } } iOvflSpace += sz; - assert( sz<=pBt->pageSize/4 ); + assert( sz<=pBt->maxLocal+23 ); assert( iOvflSpace<=pBt->pageSize ); insertCell(pParent, nxDiv, pCell, sz, pTemp, pNew->pgno, &rc); if( rc!=SQLITE_OK ) goto balance_cleanup; @@ -44367,11 +52081,12 @@ SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur){ ** BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys ** BTREE_ZERODATA Used for SQL indices */ -static int btreeCreateTable(Btree *p, int *piTable, int flags){ +static int btreeCreateTable(Btree *p, int *piTable, int createTabFlags){ BtShared *pBt = p->pBt; MemPage *pRoot; Pgno pgnoRoot; int rc; + int ptfFlags; /* Page-type flage for the root page of new table */ assert( sqlite3BtreeHoldsMutex(p) ); assert( pBt->inTransaction==TRANS_WRITE ); @@ -44472,8 +52187,14 @@ static int btreeCreateTable(Btree *p, int *piTable, int flags){ releasePage(pRoot); return rc; } + + /* When the new root page was allocated, page 1 was made writable in + ** order either to increase the database filesize, or to decrement the + ** freelist count. Hence, the sqlite3BtreeUpdateMeta() call cannot fail. + */ + assert( sqlite3PagerIswriteable(pBt->pPage1->pDbPage) ); rc = sqlite3BtreeUpdateMeta(p, 4, pgnoRoot); - if( rc ){ + if( NEVER(rc) ){ releasePage(pRoot); return rc; } @@ -44484,8 +52205,14 @@ static int btreeCreateTable(Btree *p, int *piTable, int flags){ } #endif assert( sqlite3PagerIswriteable(pRoot->pDbPage) ); - zeroPage(pRoot, flags | PTF_LEAF); + if( createTabFlags & BTREE_INTKEY ){ + ptfFlags = PTF_INTKEY | PTF_LEAFDATA | PTF_LEAF; + }else{ + ptfFlags = PTF_ZERODATA | PTF_LEAF; + } + zeroPage(pRoot, ptfFlags); sqlite3PagerUnref(pRoot->pDbPage); + assert( (pBt->openFlags & BTREE_SINGLE)==0 || pgnoRoot==2 ); *piTable = (int)pgnoRoot; return SQLITE_OK; } @@ -44503,9 +52230,9 @@ SQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree *p, int *piTable, int flags){ */ static int clearDatabasePage( BtShared *pBt, /* The BTree that contains the table */ - Pgno pgno, /* Page number to clear */ - int freePageFlag, /* Deallocate page if true */ - int *pnChange + Pgno pgno, /* Page number to clear */ + int freePageFlag, /* Deallocate page if true */ + int *pnChange /* Add number of Cells freed to this counter */ ){ MemPage *pPage; int rc; @@ -44513,7 +52240,7 @@ static int clearDatabasePage( int i; assert( sqlite3_mutex_held(pBt->mutex) ); - if( pgno>pagerPagecount(pBt) ){ + if( pgno>btreePagecount(pBt) ){ return SQLITE_CORRUPT_BKPT; } @@ -44968,7 +52695,7 @@ static void checkList( checkPtrmap(pCheck, iPage, PTRMAP_FREEPAGE, 0, zContext); } #endif - if( n>pCheck->pBt->usableSize/4-2 ){ + if( n>(int)pCheck->pBt->usableSize/4-2 ){ checkAppendMsg(pCheck, zContext, "freelist leaf count too big on page %d", iPage); N--; @@ -45025,7 +52752,9 @@ static void checkList( static int checkTreePage( IntegrityCk *pCheck, /* Context for the sanity check */ int iPage, /* Page number of the page to check */ - char *zParentContext /* Parent context */ + char *zParentContext, /* Parent context */ + i64 *pnParentMinKey, + i64 *pnParentMaxKey ){ MemPage *pPage; int i, rc, depth, d2, pgno, cnt; @@ -45036,6 +52765,8 @@ static int checkTreePage( int usableSize; char zContext[100]; char *hit = 0; + i64 nMinKey = 0; + i64 nMaxKey = 0; sqlite3_snprintf(sizeof(zContext), zContext, "Page %d: ", iPage); @@ -45078,6 +52809,16 @@ static int checkTreePage( btreeParseCellPtr(pPage, pCell, &info); sz = info.nData; if( !pPage->intKey ) sz += (int)info.nKey; + /* For intKey pages, check that the keys are in order. + */ + else if( i==0 ) nMinKey = nMaxKey = info.nKey; + else{ + if( info.nKey <= nMaxKey ){ + checkAppendMsg(pCheck, zContext, + "Rowid %lld out of order (previous was %lld)", info.nKey, nMaxKey); + } + nMaxKey = info.nKey; + } assert( sz==info.nPayload ); if( (sz>info.nLocal) && (&pCell[info.iOverflow]<=&pPage->aData[pBt->usableSize]) @@ -45101,25 +52842,62 @@ static int checkTreePage( checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext); } #endif - d2 = checkTreePage(pCheck, pgno, zContext); + d2 = checkTreePage(pCheck, pgno, zContext, &nMinKey, i==0 ? NULL : &nMaxKey); if( i>0 && d2!=depth ){ checkAppendMsg(pCheck, zContext, "Child page depth differs"); } depth = d2; } } + if( !pPage->leaf ){ pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]); sqlite3_snprintf(sizeof(zContext), zContext, "On page %d at right child: ", iPage); #ifndef SQLITE_OMIT_AUTOVACUUM if( pBt->autoVacuum ){ - checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, 0); + checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext); } #endif - checkTreePage(pCheck, pgno, zContext); + checkTreePage(pCheck, pgno, zContext, NULL, !pPage->nCell ? NULL : &nMaxKey); } + /* For intKey leaf pages, check that the min/max keys are in order + ** with any left/parent/right pages. + */ + if( pPage->leaf && pPage->intKey ){ + /* if we are a left child page */ + if( pnParentMinKey ){ + /* if we are the left most child page */ + if( !pnParentMaxKey ){ + if( nMaxKey > *pnParentMinKey ){ + checkAppendMsg(pCheck, zContext, + "Rowid %lld out of order (max larger than parent min of %lld)", + nMaxKey, *pnParentMinKey); + } + }else{ + if( nMinKey <= *pnParentMinKey ){ + checkAppendMsg(pCheck, zContext, + "Rowid %lld out of order (min less than parent min of %lld)", + nMinKey, *pnParentMinKey); + } + if( nMaxKey > *pnParentMaxKey ){ + checkAppendMsg(pCheck, zContext, + "Rowid %lld out of order (max larger than parent max of %lld)", + nMaxKey, *pnParentMaxKey); + } + *pnParentMinKey = nMaxKey; + } + /* else if we're a right child page */ + } else if( pnParentMaxKey ){ + if( nMinKey <= *pnParentMaxKey ){ + checkAppendMsg(pCheck, zContext, + "Rowid %lld out of order (min less than parent max of %lld)", + nMinKey, *pnParentMaxKey); + } + } + } + /* Check for complete coverage of the page */ data = pPage->aData; @@ -45128,7 +52906,7 @@ static int checkTreePage( if( hit==0 ){ pCheck->mallocFailed = 1; }else{ - u16 contentOffset = get2byte(&data[hdr+5]); + int contentOffset = get2byteNotZero(&data[hdr+5]); assert( contentOffset<=usableSize ); /* Enforced by btreeInitPage() */ memset(hit+contentOffset, 0, usableSize-contentOffset); memset(hit, 1, contentOffset); @@ -45136,14 +52914,14 @@ static int checkTreePage( cellStart = hdr + 12 - 4*pPage->leaf; for(i=0; i=usableSize ){ + if( (int)(pc+size-1)>=usableSize ){ checkAppendMsg(pCheck, 0, - "Corruption detected in cell %d on page %d",i,iPage,0); + "Corruption detected in cell %d on page %d",i,iPage); }else{ for(j=pc+size-1; j>=pc; j--) hit[j]++; } @@ -45213,7 +52991,7 @@ SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck( nRef = sqlite3PagerRefcount(pBt->pPager); sCheck.pBt = pBt; sCheck.pPager = pBt->pPager; - sCheck.nPage = pagerPagecount(sCheck.pBt); + sCheck.nPage = btreePagecount(sCheck.pBt); sCheck.mxErr = mxErr; sCheck.nErr = 0; sCheck.mallocFailed = 0; @@ -45234,6 +53012,7 @@ SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck( sCheck.anRef[i] = 1; } sqlite3StrAccumInit(&sCheck.errMsg, zErr, sizeof(zErr), 20000); + sCheck.errMsg.useMalloc = 2; /* Check the integrity of the freelist */ @@ -45249,7 +53028,7 @@ SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck( checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0, 0); } #endif - checkTreePage(&sCheck, aRoot[i], "List of tree roots: "); + checkTreePage(&sCheck, aRoot[i], "List of tree roots: ", NULL, NULL); } /* Make sure every page in the file is referenced @@ -45332,6 +53111,29 @@ SQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree *p){ return (p && (p->inTrans==TRANS_WRITE)); } +#ifndef SQLITE_OMIT_WAL +/* +** Run a checkpoint on the Btree passed as the first argument. +** +** Return SQLITE_LOCKED if this or any other connection has an open +** transaction on the shared-cache the argument Btree is connected to. +*/ +SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree *p){ + int rc = SQLITE_OK; + if( p ){ + BtShared *pBt = p->pBt; + sqlite3BtreeEnter(p); + if( pBt->inTransaction!=TRANS_NONE ){ + rc = SQLITE_LOCKED; + }else{ + rc = sqlite3PagerCheckpoint(pBt->pPager); + } + sqlite3BtreeLeave(p); + } + return rc; +} +#endif + /* ** Return non-zero if a read (or write) transaction is active. */ @@ -45371,7 +53173,7 @@ SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void BtShared *pBt = p->pBt; sqlite3BtreeEnter(p); if( !pBt->pSchema && nBytes ){ - pBt->pSchema = sqlite3MallocZero(nBytes); + pBt->pSchema = sqlite3DbMallocZero(0, nBytes); pBt->xFreeSchema = xFree; } sqlite3BtreeLeave(p); @@ -45482,6 +53284,42 @@ SQLITE_PRIVATE void sqlite3BtreeCacheOverflow(BtCursor *pCur){ } #endif +/* +** Set both the "read version" (single byte at byte offset 18) and +** "write version" (single byte at byte offset 19) fields in the database +** header to iVersion. +*/ +SQLITE_PRIVATE int sqlite3BtreeSetVersion(Btree *pBtree, int iVersion){ + BtShared *pBt = pBtree->pBt; + int rc; /* Return code */ + + assert( pBtree->inTrans==TRANS_NONE ); + assert( iVersion==1 || iVersion==2 ); + + /* If setting the version fields to 1, do not automatically open the + ** WAL connection, even if the version fields are currently set to 2. + */ + pBt->doNotUseWAL = (u8)(iVersion==1); + + rc = sqlite3BtreeBeginTrans(pBtree, 0); + if( rc==SQLITE_OK ){ + u8 *aData = pBt->pPage1->aData; + if( aData[18]!=(u8)iVersion || aData[19]!=(u8)iVersion ){ + rc = sqlite3BtreeBeginTrans(pBtree, 2); + if( rc==SQLITE_OK ){ + rc = sqlite3PagerWrite(pBt->pPage1->pDbPage); + if( rc==SQLITE_OK ){ + aData[18] = (u8)iVersion; + aData[19] = (u8)iVersion; + } + } + } + } + + pBt->doNotUseWAL = 0; + return rc; +} + /************** End of btree.c ***********************************************/ /************** Begin file backup.c ******************************************/ /* @@ -45497,8 +53335,6 @@ SQLITE_PRIVATE void sqlite3BtreeCacheOverflow(BtCursor *pCur){ ************************************************************************* ** This file contains the implementation of the sqlite3_backup_XXX() ** API functions and the related features. -** -** $Id: backup.c,v 1.19 2009/07/06 19:03:13 drh Exp $ */ /* Macro to find the minimum of two numeric values. @@ -45584,10 +53420,10 @@ static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){ }else{ pParse->db = pDb; if( sqlite3OpenTempDatabase(pParse) ){ - sqlite3ErrorClear(pParse); sqlite3Error(pErrorDb, pParse->rc, "%s", pParse->zErrMsg); rc = SQLITE_ERROR; } + sqlite3DbFree(pErrorDb, pParse->zErrMsg); sqlite3StackFree(pErrorDb, pParse); } if( rc ){ @@ -45636,7 +53472,10 @@ SQLITE_API sqlite3_backup *sqlite3_backup_init( ); p = 0; }else { - /* Allocate space for a new sqlite3_backup object */ + /* Allocate space for a new sqlite3_backup object... + ** EVIDENCE-OF: R-64852-21591 The sqlite3_backup object is created by a + ** call to sqlite3_backup_init() and is destroyed by a call to + ** sqlite3_backup_finish(). */ p = (sqlite3_backup *)sqlite3_malloc(sizeof(sqlite3_backup)); if( !p ){ sqlite3Error(pDestDb, SQLITE_NOMEM, 0); @@ -45703,10 +53542,19 @@ static int backupOnePage(sqlite3_backup *p, Pgno iSrcPg, const u8 *zSrcData){ /* Catch the case where the destination is an in-memory database and the ** page sizes of the source and destination differ. */ - if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(sqlite3BtreePager(p->pDest)) ){ + if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(pDestPager) ){ rc = SQLITE_READONLY; } +#ifdef SQLITE_HAS_CODEC + /* Backup is not possible if the page size of the destination is changing + ** a a codec is in use. + */ + if( nSrcPgsz!=nDestPgsz && sqlite3PagerGetCodec(pDestPager)!=0 ){ + rc = SQLITE_READONLY; + } +#endif + /* This loop runs once for each destination page spanned by the source ** page. For each iteration, variable iOff is set to the byte offset ** of the destination page. @@ -45773,6 +53621,9 @@ static void attachBackupObject(sqlite3_backup *p){ */ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ int rc; + int destMode; /* Destination journal mode */ + int pgszSrc = 0; /* Source page size */ + int pgszDest = 0; /* Destination page size */ sqlite3_mutex_enter(p->pSrcDb->mutex); sqlite3BtreeEnter(p->pSrc); @@ -45813,13 +53664,21 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ rc = sqlite3BtreeBeginTrans(p->pSrc, 0); bCloseTrans = 1; } + + /* Do not allow backup if the destination database is in WAL mode + ** and the page sizes are different between source and destination */ + pgszSrc = sqlite3BtreeGetPageSize(p->pSrc); + pgszDest = sqlite3BtreeGetPageSize(p->pDest); + destMode = sqlite3PagerGetJournalMode(sqlite3BtreePager(p->pDest)); + if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){ + rc = SQLITE_READONLY; + } /* Now that there is a read-lock on the source database, query the ** source pager for the number of pages in the database. */ - if( rc==SQLITE_OK ){ - rc = sqlite3PagerPagecount(pSrcPager, &nSrcPage); - } + nSrcPage = (int)sqlite3BtreeLastPage(p->pSrc); + assert( nSrcPage>=0 ); for(ii=0; (nPage<0 || iiiNext<=(Pgno)nSrcPage && !rc; ii++){ const Pgno iSrcPg = p->iNext; /* Source page number */ if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){ @@ -45850,8 +53709,6 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ if( rc==SQLITE_DONE && (rc = sqlite3BtreeUpdateMeta(p->pDest,1,p->iDestSchema+1))==SQLITE_OK ){ - const int nSrcPagesize = sqlite3BtreeGetPageSize(p->pSrc); - const int nDestPagesize = sqlite3BtreeGetPageSize(p->pDest); int nDestTruncate; if( p->pDestDb ){ @@ -45870,18 +53727,20 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ ** journalled by PagerCommitPhaseOne() before they are destroyed ** by the file truncation. */ - if( nSrcPagesizepSrc) ); + assert( pgszDest==sqlite3BtreeGetPageSize(p->pDest) ); + if( pgszSrcpDest->pBt) ){ nDestTruncate--; } }else{ - nDestTruncate = nSrcPage * (nSrcPagesize/nDestPagesize); + nDestTruncate = nSrcPage * (pgszSrc/pgszDest); } sqlite3PagerTruncateImage(pDestPager, nDestTruncate); - if( nSrcPagesize= iSize || ( + assert( (i64)nDestTruncate*(i64)pgszDest >= iSize || ( nDestTruncate==(int)(PENDING_BYTE_PAGE(p->pDest->pBt)-1) - && iSize>=PENDING_BYTE && iSize<=PENDING_BYTE+nDestPagesize + && iSize>=PENDING_BYTE && iSize<=PENDING_BYTE+pgszDest )); if( SQLITE_OK==(rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 1)) && SQLITE_OK==(rc = backupTruncateFile(pFile, iSize)) && SQLITE_OK==(rc = sqlite3PagerSync(pDestPager)) ){ i64 iOff; - i64 iEnd = MIN(PENDING_BYTE + nDestPagesize, iSize); + i64 iEnd = MIN(PENDING_BYTE + pgszDest, iSize); for( - iOff=PENDING_BYTE+nSrcPagesize; + iOff=PENDING_BYTE+pgszSrc; rc==SQLITE_OK && iOffrc = rc; } if( p->pDestDb ){ @@ -45996,6 +53858,9 @@ SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p){ } sqlite3BtreeLeave(p->pSrc); if( p->pDestDb ){ + /* EVIDENCE-OF: R-64852-21591 The sqlite3_backup object is created by a + ** call to sqlite3_backup_init() and is destroyed by a call to + ** sqlite3_backup_finish(). */ sqlite3_free(p); } sqlite3_mutex_leave(mutex); @@ -46131,8 +53996,6 @@ SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){ ** stores a single value in the VDBE. Mem is an opaque structure visible ** only within the VDBE. Interface routines refer to a Mem using the ** name sqlite_value -** -** $Id: vdbemem.c,v 1.152 2009/07/22 18:07:41 drh Exp $ */ /* @@ -46249,6 +54112,9 @@ SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){ pMem->z[pMem->n] = 0; pMem->z[pMem->n+1] = 0; pMem->flags |= MEM_Term; +#ifdef SQLITE_DEBUG + pMem->pScopyFrom = 0; +#endif } return SQLITE_OK; @@ -46369,7 +54235,7 @@ SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){ ctx.s.db = pMem->db; ctx.pMem = pMem; ctx.pFunc = pFunc; - pFunc->xFinalize(&ctx); + pFunc->xFinalize(&ctx); /* IMP: R-24505-23230 */ assert( 0==(pMem->flags&MEM_Dyn) && !pMem->xDel ); sqlite3DbFree(pMem->db, pMem->zMalloc); memcpy(pMem, &ctx.s, sizeof(ctx.s)); @@ -46432,6 +54298,10 @@ SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p){ ** before attempting the conversion. */ static i64 doubleToInt64(double r){ +#ifdef SQLITE_OMIT_FLOATING_POINT + /* When floating-point is omitted, double and int64 are the same thing */ + return r; +#else /* ** Many compilers we encounter do not define constants for the ** minimum and maximum 64-bit integers, or they define them @@ -46453,6 +54323,7 @@ static i64 doubleToInt64(double r){ }else{ return (i64)r; } +#endif } /* @@ -46477,13 +54348,9 @@ SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){ return doubleToInt64(pMem->r); }else if( flags & (MEM_Str|MEM_Blob) ){ i64 value; - pMem->flags |= MEM_Str; - if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8) - || sqlite3VdbeMemNulTerminate(pMem) ){ - return 0; - } - assert( pMem->z ); - sqlite3Atoi64(pMem->z, &value); + assert( pMem->z || pMem->n==0 ); + testcase( pMem->z==0 ); + sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc); return value; }else{ return 0; @@ -46506,14 +54373,7 @@ SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){ }else if( pMem->flags & (MEM_Str|MEM_Blob) ){ /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ double val = (double)0; - pMem->flags |= MEM_Str; - if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8) - || sqlite3VdbeMemNulTerminate(pMem) ){ - /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ - return (double)0; - } - assert( pMem->z ); - sqlite3AtoF(pMem->z, &val); + sqlite3AtoF(pMem->z, &val, pMem->n, pMem->enc); return val; }else{ /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ @@ -46580,22 +54440,25 @@ SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem *pMem){ /* ** Convert pMem so that it has types MEM_Real or MEM_Int or both. ** Invalidate any prior representations. +** +** Every effort is made to force the conversion, even if the input +** is a string that does not look completely like a number. Convert +** as much of the string as we can and ignore the rest. */ SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem *pMem){ - double r1, r2; - i64 i; - assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))==0 ); - assert( (pMem->flags & (MEM_Blob|MEM_Str))!=0 ); - assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); - r1 = sqlite3VdbeRealValue(pMem); - i = doubleToInt64(r1); - r2 = (double)i; - if( r1==r2 ){ - sqlite3VdbeMemIntegerify(pMem); - }else{ - pMem->r = r1; - MemSetTypeFlag(pMem, MEM_Real); + if( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))==0 ){ + assert( (pMem->flags & (MEM_Blob|MEM_Str))!=0 ); + assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); + if( 0==sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc) ){ + MemSetTypeFlag(pMem, MEM_Int); + }else{ + pMem->r = sqlite3VdbeRealValue(pMem); + MemSetTypeFlag(pMem, MEM_Real); + sqlite3VdbeIntegerAffinity(pMem); + } } + assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))!=0 ); + pMem->flags &= ~(MEM_Str|MEM_Blob); return SQLITE_OK; } @@ -46646,6 +54509,7 @@ SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){ pMem->type = SQLITE_INTEGER; } +#ifndef SQLITE_OMIT_FLOATING_POINT /* ** Delete any previous value and set the value stored in *pMem to val, ** manifest type REAL. @@ -46660,6 +54524,7 @@ SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem *pMem, double val){ pMem->type = SQLITE_FLOAT; } } +#endif /* ** Delete any previous value and set the value of pMem to be an @@ -46698,6 +54563,28 @@ SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem *p){ return 0; } +#ifdef SQLITE_DEBUG +/* +** This routine prepares a memory cell for modication by breaking +** its link to a shallow copy and by marking any current shallow +** copies of this cell as invalid. +** +** This is used for testing and debugging only - to make sure shallow +** copies are not misused. +*/ +SQLITE_PRIVATE void sqlite3VdbeMemPrepareToChange(Vdbe *pVdbe, Mem *pMem){ + int i; + Mem *pX; + for(i=1, pX=&pVdbe->aMem[1]; i<=pVdbe->nMem; i++, pX++){ + if( pX->pScopyFrom==pMem ){ + pX->flags |= MEM_Invalid; + pX->pScopyFrom = 0; + } + } + pMem->pScopyFrom = 0; +} +#endif /* SQLITE_DEBUG */ + /* ** Size of struct Mem not including the Mem.zMalloc member. */ @@ -46714,7 +54601,7 @@ SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int sr sqlite3VdbeMemReleaseExternal(pTo); memcpy(pTo, pFrom, MEMCELLSIZE); pTo->xDel = 0; - if( (pFrom->flags&MEM_Dyn)!=0 || pFrom->z==pFrom->zMalloc ){ + if( (pFrom->flags&MEM_Static)==0 ){ pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Ephem); assert( srcType==MEM_Ephem || srcType==MEM_Static ); pTo->flags |= srcType; @@ -46871,9 +54758,6 @@ SQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const C int f1, f2; int combined_flags; - /* Interchange pMem1 and pMem2 if the collating sequence specifies - ** DESC order. - */ f1 = pMem1->flags; f2 = pMem2->flags; combined_flags = f1|f2; @@ -47069,7 +54953,7 @@ SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){ return 0; } } - sqlite3VdbeMemNulTerminate(pVal); + sqlite3VdbeMemNulTerminate(pVal); /* IMP: R-59893-45467 */ }else{ assert( (pVal->flags&MEM_Blob)==0 ); sqlite3VdbeMemStringify(pVal, enc); @@ -47117,23 +55001,43 @@ SQLITE_PRIVATE int sqlite3ValueFromExpr( int op; char *zVal = 0; sqlite3_value *pVal = 0; + int negInt = 1; + const char *zNeg = ""; if( !pExpr ){ *ppVal = 0; return SQLITE_OK; } op = pExpr->op; - if( op==TK_REGISTER ){ - op = pExpr->op2; + + /* op can only be TK_REGISTER if we have compiled with SQLITE_ENABLE_STAT2. + ** The ifdef here is to enable us to achieve 100% branch test coverage even + ** when SQLITE_ENABLE_STAT2 is omitted. + */ +#ifdef SQLITE_ENABLE_STAT2 + if( op==TK_REGISTER ) op = pExpr->op2; +#else + if( NEVER(op==TK_REGISTER) ) op = pExpr->op2; +#endif + + /* Handle negative integers in a single step. This is needed in the + ** case when the value is -9223372036854775808. + */ + if( op==TK_UMINUS + && (pExpr->pLeft->op==TK_INTEGER || pExpr->pLeft->op==TK_FLOAT) ){ + pExpr = pExpr->pLeft; + op = pExpr->op; + negInt = -1; + zNeg = "-"; } if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){ pVal = sqlite3ValueNew(db); if( pVal==0 ) goto no_mem; if( ExprHasProperty(pExpr, EP_IntValue) ){ - sqlite3VdbeMemSetInt64(pVal, (i64)pExpr->u.iValue); + sqlite3VdbeMemSetInt64(pVal, (i64)pExpr->u.iValue*negInt); }else{ - zVal = sqlite3DbStrDup(db, pExpr->u.zToken); + zVal = sqlite3MPrintf(db, "%s%s", zNeg, pExpr->u.zToken); if( zVal==0 ) goto no_mem; sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, SQLITE_DYNAMIC); if( op==TK_FLOAT ) pVal->type = SQLITE_FLOAT; @@ -47143,14 +55047,18 @@ SQLITE_PRIVATE int sqlite3ValueFromExpr( }else{ sqlite3ValueApplyAffinity(pVal, affinity, SQLITE_UTF8); } + if( pVal->flags & (MEM_Int|MEM_Real) ) pVal->flags &= ~MEM_Str; if( enc!=SQLITE_UTF8 ){ sqlite3VdbeChangeEncoding(pVal, enc); } }else if( op==TK_UMINUS ) { + /* This branch happens for multiple negative signs. Ex: -(-5) */ if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal) ){ + sqlite3VdbeMemNumerify(pVal); pVal->u.i = -1 * pVal->u.i; /* (double)-1 In case of SQLITE_OMIT_FLOATING_POINT... */ pVal->r = (double)-1 * pVal->r; + sqlite3ValueApplyAffinity(pVal, affinity, enc); } } #ifndef SQLITE_OMIT_BLOB_LITERAL @@ -47237,8 +55145,6 @@ SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){ ** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) Prior ** to version 2.8.7, all this code was combined into the vdbe.c source file. ** But that file was getting too big so this subroutines were split out. -** -** $Id: vdbeaux.c,v 1.480 2009/08/08 18:01:08 drh Exp $ */ @@ -47290,7 +55196,7 @@ SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepa */ SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt){ Vdbe *p = (Vdbe *)pStmt; - return (p->isPrepareV2 ? p->zSql : 0); + return (p && p->isPrepareV2) ? p->zSql : 0; } /* @@ -47419,6 +55325,22 @@ SQLITE_PRIVATE int sqlite3VdbeAddOp4( return addr; } +/* +** Add an opcode that includes the p4 value as an integer. +*/ +SQLITE_PRIVATE int sqlite3VdbeAddOp4Int( + Vdbe *p, /* Add the opcode to this VM */ + int op, /* The new opcode */ + int p1, /* The P1 operand */ + int p2, /* The P2 operand */ + int p3, /* The P3 operand */ + int p4 /* The P4 operand as an integer */ +){ + int addr = sqlite3VdbeAddOp3(p, op, p1, p2, p3); + sqlite3VdbeChangeP4(p, addr, SQLITE_INT_TO_PTR(p4), P4_INT32); + return addr; +} + /* ** Create a new symbolic label for an instruction that has yet to be ** coded. The symbolic label is really just a negative number. The @@ -47463,6 +55385,13 @@ SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe *p, int x){ } } +/* +** Mark the VDBE as one that can only be run one time. +*/ +SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe *p){ + p->runOnlyOnce = 1; +} + #ifdef SQLITE_DEBUG /* sqlite3AssertMayAbort() logic */ /* @@ -47594,6 +55523,8 @@ SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){ ** Variable *pMaxFuncArgs is set to the maximum value of any P2 argument ** to an OP_Function, OP_AggStep or OP_VFilter opcode. This is used by ** sqlite3VdbeMakeReady() to size the Vdbe.apArg[] array. +** +** The Op.opflags field is set on all opcodes. */ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){ int i; @@ -47604,15 +55535,14 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){ for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){ u8 opcode = pOp->opcode; + pOp->opflags = sqlite3OpcodeProperty[opcode]; if( opcode==OP_Function || opcode==OP_AggStep ){ if( pOp->p5>nMaxArgs ) nMaxArgs = pOp->p5; -#ifndef SQLITE_OMIT_VIRTUALTABLE - }else if( opcode==OP_VUpdate ){ - if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2; -#endif }else if( opcode==OP_Transaction && pOp->p2!=0 ){ p->readOnly = 0; #ifndef SQLITE_OMIT_VIRTUALTABLE + }else if( opcode==OP_VUpdate ){ + if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2; }else if( opcode==OP_VFilter ){ int n; assert( p->nOp - i >= 3 ); @@ -47622,7 +55552,7 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){ #endif } - if( sqlite3VdbeOpcodeHasProperty(opcode, OPFLG_JUMP) && pOp->p2<0 ){ + if( (pOp->opflags & OPFLG_JUMP)!=0 && pOp->p2<0 ){ assert( -1-pOp->p2nLabel ); pOp->p2 = aLabel[-1-pOp->p2]; } @@ -47684,7 +55614,7 @@ SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp) VdbeOp *pOut = &p->aOp[i+addr]; pOut->opcode = pIn->opcode; pOut->p1 = pIn->p1; - if( p2<0 && sqlite3VdbeOpcodeHasProperty(pOut->opcode, OPFLG_JUMP) ){ + if( p2<0 && (sqlite3OpcodeProperty[pOut->opcode] & OPFLG_JUMP)!=0 ){ pOut->p2 = addr + ADDR(p2); }else{ pOut->p2 = p2; @@ -47773,15 +55703,17 @@ static void freeEphemeralFunction(sqlite3 *db, FuncDef *pDef){ } } +static void vdbeFreeOpArray(sqlite3 *, Op *, int); + /* ** Delete a P4 value if necessary. */ static void freeP4(sqlite3 *db, int p4type, void *p4){ if( p4 ){ + assert( db ); switch( p4type ){ case P4_REAL: case P4_INT64: - case P4_MPRINTF: case P4_DYNAMIC: case P4_KEYINFO: case P4_INTARRAY: @@ -47789,10 +55721,14 @@ static void freeP4(sqlite3 *db, int p4type, void *p4){ sqlite3DbFree(db, p4); break; } + case P4_MPRINTF: { + if( db->pnBytesFreed==0 ) sqlite3_free(p4); + break; + } case P4_VDBEFUNC: { VdbeFunc *pVdbeFunc = (VdbeFunc *)p4; freeEphemeralFunction(db, pVdbeFunc->pFunc); - sqlite3VdbeDeleteAuxData(pVdbeFunc, 0); + if( db->pnBytesFreed==0 ) sqlite3VdbeDeleteAuxData(pVdbeFunc, 0); sqlite3DbFree(db, pVdbeFunc); break; } @@ -47801,15 +55737,17 @@ static void freeP4(sqlite3 *db, int p4type, void *p4){ break; } case P4_MEM: { - sqlite3ValueFree((sqlite3_value*)p4); + if( db->pnBytesFreed==0 ){ + sqlite3ValueFree((sqlite3_value*)p4); + }else{ + Mem *p = (Mem*)p4; + sqlite3DbFree(db, p->zMalloc); + sqlite3DbFree(db, p); + } break; } case P4_VTAB : { - sqlite3VtabUnlock((VTable *)p4); - break; - } - case P4_SUBPROGRAM : { - sqlite3VdbeProgramDelete(db, (SubProgram *)p4, 1); + if( db->pnBytesFreed==0 ) sqlite3VtabUnlock((VTable *)p4); break; } } @@ -47835,35 +55773,15 @@ static void vdbeFreeOpArray(sqlite3 *db, Op *aOp, int nOp){ } /* -** Decrement the ref-count on the SubProgram structure passed as the -** second argument. If the ref-count reaches zero, free the structure. -** -** The array of VDBE opcodes stored as SubProgram.aOp is freed if -** either the ref-count reaches zero or parameter freeop is non-zero. -** -** Since the array of opcodes pointed to by SubProgram.aOp may directly -** or indirectly contain a reference to the SubProgram structure itself. -** By passing a non-zero freeop parameter, the caller may ensure that all -** SubProgram structures and their aOp arrays are freed, even when there -** are such circular references. +** Link the SubProgram object passed as the second argument into the linked +** list at Vdbe.pSubProgram. This list is used to delete all sub-program +** objects when the VM is no longer required. */ -SQLITE_PRIVATE void sqlite3VdbeProgramDelete(sqlite3 *db, SubProgram *p, int freeop){ - if( p ){ - assert( p->nRef>0 ); - if( freeop || p->nRef==1 ){ - Op *aOp = p->aOp; - p->aOp = 0; - vdbeFreeOpArray(db, aOp, p->nOp); - p->nOp = 0; - } - p->nRef--; - if( p->nRef==0 ){ - sqlite3DbFree(db, p); - } - } +SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *pVdbe, SubProgram *p){ + p->pNext = pVdbe->pProgram; + pVdbe->pProgram = p; } - /* ** Change N opcodes starting at addr to No-ops. */ @@ -47939,11 +55857,11 @@ SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int nField = ((KeyInfo*)zP4)->nField; nByte = sizeof(*pKeyInfo) + (nField-1)*sizeof(pKeyInfo->aColl[0]) + nField; - pKeyInfo = sqlite3Malloc( nByte ); + pKeyInfo = sqlite3DbMallocRaw(0, nByte); pOp->p4.pKeyInfo = pKeyInfo; if( pKeyInfo ){ u8 *aSortOrder; - memcpy(pKeyInfo, zP4, nByte); + memcpy((char*)pKeyInfo, zP4, nByte - nField); aSortOrder = pKeyInfo->aSortOrder; if( aSortOrder ){ pKeyInfo->aSortOrder = (unsigned char*)&pKeyInfo->aColl[nField]; @@ -48014,9 +55932,12 @@ SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe *p, const char *zFormat, ...){ ** ** If a memory allocation error has occurred prior to the calling of this ** routine, then a pointer to a dummy VdbeOp will be returned. That opcode -** is readable and writable, but it has no effect. The return of a dummy -** opcode allows the call to continue functioning after a OOM fault without -** having to check to see if the return from this routine is a valid pointer. +** is readable but not writable, though it is cast to a writable value. +** The return of a dummy opcode allows the call to continue functioning +** after a OOM fault without having to check to see if the return from +** this routine is a valid pointer. But because the dummy.opcode is 0, +** dummy will never be written to. This is verified by code inspection and +** by running with Valgrind. ** ** About the #ifdef SQLITE_OMIT_TRACE: Normally, this routine is never called ** unless p->nOp>0. This is because in the absense of SQLITE_OMIT_TRACE, @@ -48027,17 +55948,19 @@ SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe *p, const char *zFormat, ...){ ** check the value of p->nOp-1 before continuing. */ SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){ - static VdbeOp dummy; + /* C89 specifies that the constant "dummy" will be initialized to all + ** zeros, which is correct. MSVC generates a warning, nevertheless. */ + static const VdbeOp dummy; /* Ignore the MSVC warning about no initializer */ assert( p->magic==VDBE_MAGIC_INIT ); if( addr<0 ){ #ifdef SQLITE_OMIT_TRACE - if( p->nOp==0 ) return &dummy; + if( p->nOp==0 ) return (VdbeOp*)&dummy; #endif addr = p->nOp - 1; } assert( (addr>=0 && addrnOp) || p->db->mallocFailed ); if( p->db->mallocFailed ){ - return &dummy; + return (VdbeOp*)&dummy; }else{ return &p->aOp[addr]; } @@ -48150,6 +56073,11 @@ static char *displayP4(Op *pOp, char *zTemp, int nTemp){ /* ** Declare to the Vdbe that the BTree object at db->aDb[i] is used. +** +** The prepared statement has to know in advance which Btree objects +** will be used so that it can acquire mutexes on them all in sorted +** order (via sqlite3VdbeMutexArrayEnter(). Mutexes are acquired +** in order (and released in reverse order) to avoid deadlocks. */ SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe *p, int i){ int mask; @@ -48193,6 +56121,12 @@ static void releaseMemArray(Mem *p, int N){ Mem *pEnd; sqlite3 *db = p->db; u8 malloc_failed = db->mallocFailed; + if( db->pnBytesFreed ){ + for(pEnd=&p[N]; pzMalloc); + } + return; + } for(pEnd=&p[N]; pexplain==2, only OP_Explain instructions are listed and these ** are shown in a different format. p->explain==2 is used to implement ** EXPLAIN QUERY PLAN. +** +** When p->explain==1, first the main program is listed, then each of +** the trigger subprograms are listed one by one. */ SQLITE_PRIVATE int sqlite3VdbeList( Vdbe *p /* The VDBE */ ){ - int nRow; /* Total number of rows to return */ + int nRow; /* Stop when row count reaches this */ int nSub = 0; /* Number of sub-vdbes seen so far */ SubProgram **apSub = 0; /* Array of sub-vdbes */ - Mem *pSub = 0; - sqlite3 *db = p->db; - int i; - int rc = SQLITE_OK; - Mem *pMem = p->pResultSet = &p->aMem[1]; + Mem *pSub = 0; /* Memory cell hold array of subprogs */ + sqlite3 *db = p->db; /* The database connection */ + int i; /* Loop counter */ + int rc = SQLITE_OK; /* Return code */ + Mem *pMem = p->pResultSet = &p->aMem[1]; /* First Mem of result set */ assert( p->explain ); assert( p->magic==VDBE_MAGIC_RUN ); - assert( db->magic==SQLITE_MAGIC_BUSY ); assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM ); /* Even though this opcode does not use dynamic strings for @@ -48279,12 +56215,24 @@ SQLITE_PRIVATE int sqlite3VdbeList( return SQLITE_ERROR; } - /* Figure out total number of rows that will be returned by this - ** EXPLAIN program. */ + /* When the number of output rows reaches nRow, that means the + ** listing has finished and sqlite3_step() should return SQLITE_DONE. + ** nRow is the sum of the number of rows in the main program, plus + ** the sum of the number of rows in all trigger subprograms encountered + ** so far. The nRow value will increase as new trigger subprograms are + ** encountered, but p->pc will eventually catch up to nRow. + */ nRow = p->nOp; if( p->explain==1 ){ + /* The first 8 memory cells are used for the result set. So we will + ** commandeer the 9th cell to use as storage for an array of pointers + ** to trigger subprograms. The VDBE is guaranteed to have at least 9 + ** cells. */ + assert( p->nMem>9 ); pSub = &p->aMem[9]; if( pSub->flags&MEM_Blob ){ + /* On the first call to sqlite3_step(), pSub will hold a NULL. It is + ** initialized to a BLOB by the P4_SUBPROGRAM processing logic below */ nSub = pSub->n/sizeof(Vdbe*); apSub = (SubProgram **)pSub->z; } @@ -48307,8 +56255,12 @@ SQLITE_PRIVATE int sqlite3VdbeList( char *z; Op *pOp; if( inOp ){ + /* The output line number is small enough that we are still in the + ** main program. */ pOp = &p->aOp[i]; }else{ + /* We are currently listing subprograms. Figure out which one and + ** pick up the appropriate opcode. */ int j; i -= p->nOp; for(j=0; i>=apSub[j]->nOp; j++){ @@ -48330,6 +56282,11 @@ SQLITE_PRIVATE int sqlite3VdbeList( pMem->enc = SQLITE_UTF8; pMem++; + /* When an OP_Program opcode is encounter (the only opcode that has + ** a P4_SUBPROGRAM argument), expand the size of the array of subprograms + ** kept in p->aMem[9].z to hold the new program - assuming this subprogram + ** has not already been seen. + */ if( pOp->p4type==P4_SUBPROGRAM ){ int nByte = (nSub+1)*sizeof(SubProgram*); int j; @@ -48461,38 +56418,43 @@ SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe *p){ #endif /* !SQLITE_OMIT_TRACE && SQLITE_ENABLE_IOTRACE */ /* -** Allocate space from a fixed size buffer. Make *pp point to the -** allocated space. (Note: pp is a char* rather than a void** to -** work around the pointer aliasing rules of C.) *pp should initially -** be zero. If *pp is not zero, that means that the space has already -** been allocated and this routine is a noop. +** Allocate space from a fixed size buffer and return a pointer to +** that space. If insufficient space is available, return NULL. +** +** The pBuf parameter is the initial value of a pointer which will +** receive the new memory. pBuf is normally NULL. If pBuf is not +** NULL, it means that memory space has already been allocated and that +** this routine should not allocate any new memory. When pBuf is not +** NULL simply return pBuf. Only allocate new memory space when pBuf +** is NULL. ** ** nByte is the number of bytes of space needed. ** -** *ppFrom point to available space and pEnd points to the end of the -** available space. +** *ppFrom points to available space and pEnd points to the end of the +** available space. When space is allocated, *ppFrom is advanced past +** the end of the allocated space. ** ** *pnByte is a counter of the number of bytes of space that have failed ** to allocate. If there is insufficient space in *ppFrom to satisfy the ** request, then increment *pnByte by the amount of the request. */ -static void allocSpace( - char *pp, /* IN/OUT: Set *pp to point to allocated buffer */ +static void *allocSpace( + void *pBuf, /* Where return pointer will be stored */ int nByte, /* Number of bytes to allocate */ u8 **ppFrom, /* IN/OUT: Allocate from *ppFrom */ u8 *pEnd, /* Pointer to 1 byte past the end of *ppFrom buffer */ int *pnByte /* If allocation cannot be made, increment *pnByte */ ){ assert( EIGHT_BYTE_ALIGNMENT(*ppFrom) ); - if( (*(void**)pp)==0 ){ - nByte = ROUND8(nByte); - if( &(*ppFrom)[nByte] <= pEnd ){ - *(void**)pp = (void *)*ppFrom; - *ppFrom += nByte; - }else{ - *pnByte += nByte; - } + if( pBuf ) return pBuf; + nByte = ROUND8(nByte); + if( &(*ppFrom)[nByte] <= pEnd ){ + pBuf = (void*)*ppFrom; + *ppFrom += nByte; + }else{ + *pnByte += nByte; } + return pBuf; } /* @@ -48551,9 +56513,10 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( ** being called from sqlite3_reset() to reset the virtual machine. */ if( nVar>=0 && ALWAYS(db->mallocFailed==0) ){ - u8 *zCsr = (u8 *)&p->aOp[p->nOp]; - u8 *zEnd = (u8 *)&p->aOp[p->nOpAlloc]; - int nByte; + u8 *zCsr = (u8 *)&p->aOp[p->nOp]; /* Memory avaliable for alloation */ + u8 *zEnd = (u8 *)&p->aOp[p->nOpAlloc]; /* First byte past available mem */ + int nByte; /* How much extra memory needed */ + resolveP2Values(p, &nArg); p->usesStmtJournal = (u8)usesStmtJournal; if( isExplain && nMem<10 ){ @@ -48563,15 +56526,24 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( zCsr += (zCsr - (u8*)0)&7; assert( EIGHT_BYTE_ALIGNMENT(zCsr) ); + /* Memory for registers, parameters, cursor, etc, is allocated in two + ** passes. On the first pass, we try to reuse unused space at the + ** end of the opcode array. If we are unable to satisfy all memory + ** requirements by reusing the opcode array tail, then the second + ** pass will fill in the rest using a fresh allocation. + ** + ** This two-pass approach that reuses as much memory as possible from + ** the leftover space at the end of the opcode array can significantly + ** reduce the amount of memory held by a prepared statement. + */ do { nByte = 0; - allocSpace((char*)&p->aMem, nMem*sizeof(Mem), &zCsr, zEnd, &nByte); - allocSpace((char*)&p->aVar, nVar*sizeof(Mem), &zCsr, zEnd, &nByte); - allocSpace((char*)&p->apArg, nArg*sizeof(Mem*), &zCsr, zEnd, &nByte); - allocSpace((char*)&p->azVar, nVar*sizeof(char*), &zCsr, zEnd, &nByte); - allocSpace((char*)&p->apCsr, - nCursor*sizeof(VdbeCursor*), &zCsr, zEnd, &nByte - ); + p->aMem = allocSpace(p->aMem, nMem*sizeof(Mem), &zCsr, zEnd, &nByte); + p->aVar = allocSpace(p->aVar, nVar*sizeof(Mem), &zCsr, zEnd, &nByte); + p->apArg = allocSpace(p->apArg, nArg*sizeof(Mem*), &zCsr, zEnd, &nByte); + p->azVar = allocSpace(p->azVar, nVar*sizeof(char*), &zCsr, zEnd, &nByte); + p->apCsr = allocSpace(p->apCsr, nCursor*sizeof(VdbeCursor*), + &zCsr, zEnd, &nByte); if( nByte ){ p->pFree = sqlite3DbMallocZero(db, nByte); } @@ -48611,6 +56583,7 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( p->cacheCtr = 1; p->minWriteFileFormat = 255; p->iStatement = 0; + p->nFkConstraint = 0; #ifdef VDBE_PROFILE { int i; @@ -48642,9 +56615,7 @@ SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){ sqlite3_vtab_cursor *pVtabCursor = pCx->pVtabCursor; const sqlite3_module *pModule = pCx->pModule; p->inVtabMethod = 1; - (void)sqlite3SafetyOff(p->db); pModule->xClose(pVtabCursor); - (void)sqlite3SafetyOn(p->db); p->inVtabMethod = 0; } #endif @@ -48805,9 +56776,6 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ ** to the transaction. */ rc = sqlite3VtabSync(db, &p->zErrMsg); - if( rc!=SQLITE_OK ){ - return rc; - } /* This loop determines (a) if the commit hook should be invoked and ** (b) how many database files have open write transactions, not @@ -48815,19 +56783,21 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ ** one database file has an open write transaction, a master journal ** file is required for an atomic commit. */ - for(i=0; inDb; i++){ + for(i=0; rc==SQLITE_OK && inDb; i++){ Btree *pBt = db->aDb[i].pBt; if( sqlite3BtreeIsInTrans(pBt) ){ needXcommit = 1; if( i!=1 ) nTrans++; + rc = sqlite3PagerExclusiveLock(sqlite3BtreePager(pBt)); } } + if( rc!=SQLITE_OK ){ + return rc; + } /* If there are any write-transactions at all, invoke the commit hook */ if( needXcommit && db->xCommitCallback ){ - (void)sqlite3SafetyOff(db); rc = db->xCommitCallback(db->pCommitArg); - (void)sqlite3SafetyOn(db); if( rc ){ return SQLITE_CONSTRAINT; } @@ -48913,10 +56883,12 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ */ for(i=0; inDb; i++){ Btree *pBt = db->aDb[i].pBt; - if( i==1 ) continue; /* Ignore the TEMP database */ if( sqlite3BtreeIsInTrans(pBt) ){ char const *zFile = sqlite3BtreeGetJournalname(pBt); - if( zFile[0]==0 ) continue; /* Ignore :memory: databases */ + if( zFile==0 ){ + continue; /* Ignore TEMP and :memory: databases */ + } + assert( zFile[0]!=0 ); if( !needSync && !sqlite3BtreeSyncDisabled(pBt) ){ needSync = 1; } @@ -48961,6 +56933,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ } } sqlite3OsCloseFree(pMaster); + assert( rc!=SQLITE_BUSY ); if( rc!=SQLITE_OK ){ sqlite3DbFree(db, zMaster); return rc; @@ -49219,8 +57192,17 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){ isSpecialError = mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR || mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL; if( isSpecialError ){ - /* If the query was read-only, we need do no rollback at all. Otherwise, - ** proceed with the special handling. + /* If the query was read-only and the error code is SQLITE_INTERRUPT, + ** no rollback is necessary. Otherwise, at least a savepoint + ** transaction must be rolled back to restore the database to a + ** consistent state. + ** + ** Even if the statement is read-only, it is important to perform + ** a statement or transaction rollback operation. If the error + ** occured while writing to the journal, sub-journal or database + ** file as part of an effort to free up cache space (see function + ** pagerStress() in pager.c), the rollback is required to restore + ** the pager to a consistent state. */ if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){ if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && p->usesStmtJournal ){ @@ -49292,15 +57274,27 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){ /* If eStatementOp is non-zero, then a statement transaction needs to ** be committed or rolled back. Call sqlite3VdbeCloseStatement() to ** do so. If this operation returns an error, and the current statement - ** error code is SQLITE_OK or SQLITE_CONSTRAINT, then set the error - ** code to the new value. + ** error code is SQLITE_OK or SQLITE_CONSTRAINT, then promote the + ** current statement error code. + ** + ** Note that sqlite3VdbeCloseStatement() can only fail if eStatementOp + ** is SAVEPOINT_ROLLBACK. But if p->rc==SQLITE_OK then eStatementOp + ** must be SAVEPOINT_RELEASE. Hence the NEVER(p->rc==SQLITE_OK) in + ** the following code. */ if( eStatementOp ){ rc = sqlite3VdbeCloseStatement(p, eStatementOp); - if( rc && (p->rc==SQLITE_OK || p->rc==SQLITE_CONSTRAINT) ){ - p->rc = rc; - sqlite3DbFree(db, p->zErrMsg); - p->zErrMsg = 0; + if( rc ){ + assert( eStatementOp==SAVEPOINT_ROLLBACK ); + if( NEVER(p->rc==SQLITE_OK) || p->rc==SQLITE_CONSTRAINT ){ + p->rc = rc; + sqlite3DbFree(db, p->zErrMsg); + p->zErrMsg = 0; + } + invalidateCursorsOnModifiedBtrees(db); + sqlite3RollbackAll(db); + sqlite3CloseSavepoints(db); + db->autoCommit = 1; } } @@ -49380,9 +57374,7 @@ SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){ ** error, then it might not have been halted properly. So halt ** it now. */ - (void)sqlite3SafetyOn(db); sqlite3VdbeHalt(p); - (void)sqlite3SafetyOff(db); /* If the VDBE has be run even partially, then transfer the error code ** and error message from the VDBE into the main database structure. But @@ -49402,6 +57394,7 @@ SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){ }else{ sqlite3Error(db, SQLITE_OK, 0); } + if( p->runOnlyOnce ) p->expired = 1; }else if( p->rc && p->expired ){ /* The expired flag was set on the VDBE before the first call ** to sqlite3_step(). For consistency (since sqlite3_step() was @@ -49478,6 +57471,30 @@ SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc *pVdbeFunc, int mask){ } } +/* +** Free all memory associated with the Vdbe passed as the second argument. +** The difference between this function and sqlite3VdbeDelete() is that +** VdbeDelete() also unlinks the Vdbe from the list of VMs associated with +** the database connection. +*/ +SQLITE_PRIVATE void sqlite3VdbeDeleteObject(sqlite3 *db, Vdbe *p){ + SubProgram *pSub, *pNext; + assert( p->db==0 || p->db==db ); + releaseMemArray(p->aVar, p->nVar); + releaseMemArray(p->aColName, p->nResColumn*COLNAME_N); + for(pSub=p->pProgram; pSub; pSub=pNext){ + pNext = pSub->pNext; + vdbeFreeOpArray(db, pSub->aOp, pSub->nOp); + sqlite3DbFree(db, pSub); + } + vdbeFreeOpArray(db, p->aOp, p->nOp); + sqlite3DbFree(db, p->aLabel); + sqlite3DbFree(db, p->aColName); + sqlite3DbFree(db, p->zSql); + sqlite3DbFree(db, p->pFree); + sqlite3DbFree(db, p); +} + /* ** Delete an entire VDBE. */ @@ -49495,15 +57512,9 @@ SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe *p){ if( p->pNext ){ p->pNext->pPrev = p->pPrev; } - releaseMemArray(p->aVar, p->nVar); - releaseMemArray(p->aColName, p->nResColumn*COLNAME_N); - vdbeFreeOpArray(db, p->aOp, p->nOp); - sqlite3DbFree(db, p->aLabel); - sqlite3DbFree(db, p->aColName); - sqlite3DbFree(db, p->zSql); p->magic = VDBE_MAGIC_DEAD; - sqlite3DbFree(db, p->pFree); - sqlite3DbFree(db, p); + p->db = 0; + sqlite3VdbeDeleteObject(db, p); } /* @@ -49529,11 +57540,8 @@ SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor *p){ rc = sqlite3BtreeMovetoUnpacked(p->pCursor, 0, p->movetoTarget, 0, &res); if( rc ) return rc; p->lastRowid = p->movetoTarget; - p->rowidIsValid = ALWAYS(res==0) ?1:0; - if( NEVER(res<0) ){ - rc = sqlite3BtreeNext(p->pCursor, &res); - if( rc ) return rc; - } + if( res!=0 ) return SQLITE_CORRUPT_BKPT; + p->rowidIsValid = 1; #ifdef SQLITE_TEST sqlite3_search_count++; #endif @@ -49569,7 +57577,7 @@ SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor *p){ ** the blob of data that it corresponds to. In a table record, all serial ** types are stored at the start of the record, and the blobs of data at ** the end. Hence these functions allow the caller to handle the -** serial-type and data blob separately. +** serial-type and data blob seperately. ** ** The following table describes the various storage classes for data: ** @@ -49994,9 +58002,17 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompare( pKeyInfo = pPKey2->pKeyInfo; mem1.enc = pKeyInfo->enc; mem1.db = pKeyInfo->db; - mem1.flags = 0; - mem1.u.i = 0; /* not needed, here to silence compiler warning */ - mem1.zMalloc = 0; + /* mem1.flags = 0; // Will be initialized by sqlite3VdbeSerialGet() */ + VVA_ONLY( mem1.zMalloc = 0; ) /* Only needed by assert() statements */ + + /* Compilers may complain that mem1.u.i is potentially uninitialized. + ** We could initialize it, as shown here, to silence those complaints. + ** But in fact, mem1.u.i will never actually be used initialized, and doing + ** the unnecessary initialization has a measurable negative performance + ** impact, since this routine is a very high runner. And so, we choose + ** to ignore the compiler warnings and leave this variable uninitialized. + */ + /* mem1.u.i = 0; // not needed, here to silence compiler warning */ idx1 = getVarint32(aKey1, szHdr1); d1 = szHdr1; @@ -50020,47 +58036,52 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompare( rc = sqlite3MemCompare(&mem1, &pPKey2->aMem[i], iaColl[i] : 0); if( rc!=0 ){ - break; + assert( mem1.zMalloc==0 ); /* See comment below */ + + /* Invert the result if we are using DESC sort order. */ + if( pKeyInfo->aSortOrder && iaSortOrder[i] ){ + rc = -rc; + } + + /* If the PREFIX_SEARCH flag is set and all fields except the final + ** rowid field were equal, then clear the PREFIX_SEARCH flag and set + ** pPKey2->rowid to the value of the rowid field in (pKey1, nKey1). + ** This is used by the OP_IsUnique opcode. + */ + if( (pPKey2->flags & UNPACKED_PREFIX_SEARCH) && i==(pPKey2->nField-1) ){ + assert( idx1==szHdr1 && rc ); + assert( mem1.flags & MEM_Int ); + pPKey2->flags &= ~UNPACKED_PREFIX_SEARCH; + pPKey2->rowid = mem1.u.i; + } + + return rc; } i++; } - /* No memory allocation is ever used on mem1. */ - if( NEVER(mem1.zMalloc) ) sqlite3VdbeMemRelease(&mem1); - - /* If the PREFIX_SEARCH flag is set and all fields except the final - ** rowid field were equal, then clear the PREFIX_SEARCH flag and set - ** pPKey2->rowid to the value of the rowid field in (pKey1, nKey1). - ** This is used by the OP_IsUnique opcode. + /* No memory allocation is ever used on mem1. Prove this using + ** the following assert(). If the assert() fails, it indicates a + ** memory leak and a need to call sqlite3VdbeMemRelease(&mem1). */ - if( (pPKey2->flags & UNPACKED_PREFIX_SEARCH) && i==(pPKey2->nField-1) ){ - assert( idx1==szHdr1 && rc ); - assert( mem1.flags & MEM_Int ); - pPKey2->flags &= ~UNPACKED_PREFIX_SEARCH; - pPKey2->rowid = mem1.u.i; - } + assert( mem1.zMalloc==0 ); - if( rc==0 ){ - /* rc==0 here means that one of the keys ran out of fields and - ** all the fields up to that point were equal. If the UNPACKED_INCRKEY - ** flag is set, then break the tie by treating key2 as larger. - ** If the UPACKED_PREFIX_MATCH flag is set, then keys with common prefixes - ** are considered to be equal. Otherwise, the longer key is the - ** larger. As it happens, the pPKey2 will always be the longer - ** if there is a difference. - */ - if( pPKey2->flags & UNPACKED_INCRKEY ){ - rc = -1; - }else if( pPKey2->flags & UNPACKED_PREFIX_MATCH ){ - /* Leave rc==0 */ - }else if( idx1aSortOrder && inField - && pKeyInfo->aSortOrder[i] ){ - rc = -rc; + /* rc==0 here means that one of the keys ran out of fields and + ** all the fields up to that point were equal. If the UNPACKED_INCRKEY + ** flag is set, then break the tie by treating key2 as larger. + ** If the UPACKED_PREFIX_MATCH flag is set, then keys with common prefixes + ** are considered to be equal. Otherwise, the longer key is the + ** larger. As it happens, the pPKey2 will always be the longer + ** if there is a difference. + */ + assert( rc==0 ); + if( pPKey2->flags & UNPACKED_INCRKEY ){ + rc = -1; + }else if( pPKey2->flags & UNPACKED_PREFIX_MATCH ){ + /* Leave rc==0 */ + }else if( idx10x7fffffff ){ *res = 0; - return SQLITE_CORRUPT; + return SQLITE_CORRUPT_BKPT; } memset(&m, 0, sizeof(m)); rc = sqlite3VdbeMemFromBtree(pC->pCursor, 0, (int)nCellKey, 1, &m); @@ -50280,8 +58301,6 @@ SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){ ** ** This file contains code use to implement APIs that are part of the ** VDBE. -** -** $Id: vdbeapi.c,v 1.167 2009/06/25 01:47:12 drh Exp $ */ #ifndef SQLITE_OMIT_DEPRECATED @@ -50299,6 +58318,28 @@ SQLITE_API int sqlite3_expired(sqlite3_stmt *pStmt){ } #endif +/* +** Check on a Vdbe to make sure it has not been finalized. Log +** an error and return true if it has been finalized (or is otherwise +** invalid). Return false if it is ok. +*/ +static int vdbeSafety(Vdbe *p){ + if( p->db==0 ){ + sqlite3_log(SQLITE_MISUSE, "API called with finalized prepared statement"); + return 1; + }else{ + return 0; + } +} +static int vdbeSafetyNotNull(Vdbe *p){ + if( p==0 ){ + sqlite3_log(SQLITE_MISUSE, "API called with NULL prepared statement"); + return 1; + }else{ + return vdbeSafety(p); + } +} + /* ** The following routine destroys a virtual machine that is created by ** the sqlite3_compile() routine. The integer returned is an SQLITE_ @@ -50311,12 +58352,18 @@ SQLITE_API int sqlite3_expired(sqlite3_stmt *pStmt){ SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt){ int rc; if( pStmt==0 ){ + /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL + ** pointer is a harmless no-op. */ rc = SQLITE_OK; }else{ Vdbe *v = (Vdbe*)pStmt; sqlite3 *db = v->db; #if SQLITE_THREADSAFE - sqlite3_mutex *mutex = v->db->mutex; + sqlite3_mutex *mutex; +#endif + if( vdbeSafety(v) ) return SQLITE_MISUSE_BKPT; +#if SQLITE_THREADSAFE + mutex = v->db->mutex; #endif sqlite3_mutex_enter(mutex); rc = sqlite3VdbeFinalize(v); @@ -50383,7 +58430,7 @@ SQLITE_API const void *sqlite3_value_blob(sqlite3_value *pVal){ sqlite3VdbeMemExpandBlob(p); p->flags &= ~MEM_Str; p->flags |= MEM_Blob; - return p->z; + return p->n ? p->z : 0; }else{ return sqlite3_value_text(pVal); } @@ -50548,6 +58595,27 @@ SQLITE_API void sqlite3_result_error_nomem(sqlite3_context *pCtx){ pCtx->s.db->mallocFailed = 1; } +/* +** This function is called after a transaction has been committed. It +** invokes callbacks registered with sqlite3_wal_hook() as required. +*/ +static int doWalCallbacks(sqlite3 *db){ + int rc = SQLITE_OK; +#ifndef SQLITE_OMIT_WAL + int i; + for(i=0; inDb; i++){ + Btree *pBt = db->aDb[i].pBt; + if( pBt ){ + int nEntry = sqlite3PagerWalCallback(sqlite3BtreePager(pBt)); + if( db->xWalCallback && nEntry>0 && rc==SQLITE_OK ){ + rc = db->xWalCallback(db->pWalArg, db, db->aDb[i].zName, nEntry); + } + } + } +#endif + return rc; +} + /* ** Execute the statement pStmt, either until a row of data is ready, the ** statement is completely executed or an error occurs. @@ -50563,26 +58631,26 @@ static int sqlite3Step(Vdbe *p){ assert(p); if( p->magic!=VDBE_MAGIC_RUN ){ - return SQLITE_MISUSE; + /* We used to require that sqlite3_reset() be called before retrying + ** sqlite3_step() after any error. But after 3.6.23, we changed this + ** so that sqlite3_reset() would be called automatically instead of + ** throwing the error. + */ + sqlite3_reset((sqlite3_stmt*)p); } - /* Assert that malloc() has not failed */ + /* Check that malloc() has not failed. If it has, return early. */ db = p->db; if( db->mallocFailed ){ + p->rc = SQLITE_NOMEM; return SQLITE_NOMEM; } if( p->pc<=0 && p->expired ){ - if( ALWAYS(p->rc==SQLITE_OK || p->rc==SQLITE_SCHEMA) ){ - p->rc = SQLITE_SCHEMA; - } + p->rc = SQLITE_SCHEMA; rc = SQLITE_ERROR; goto end_of_step; } - if( sqlite3SafetyOn(db) ){ - p->rc = SQLITE_MISUSE; - return SQLITE_MISUSE; - } if( p->pc<0 ){ /* If there are no other statements currently running, then ** reset the interrupt flag. This prevents a call to sqlite3_interrupt @@ -50596,9 +58664,7 @@ static int sqlite3Step(Vdbe *p){ #ifndef SQLITE_OMIT_TRACE if( db->xProfile && !db->init.busy ){ - double rNow; - sqlite3OsCurrentTime(db->pVfs, &rNow); - p->startTime = (u64)((rNow - (int)rNow)*3600.0*24.0*1000000000.0); + sqlite3OsCurrentTimeInt64(db->pVfs, &p->startTime); } #endif @@ -50615,24 +58681,24 @@ static int sqlite3Step(Vdbe *p){ rc = sqlite3VdbeExec(p); } - if( sqlite3SafetyOff(db) ){ - rc = SQLITE_MISUSE; - } - #ifndef SQLITE_OMIT_TRACE /* Invoke the profile callback if there is one */ if( rc!=SQLITE_ROW && db->xProfile && !db->init.busy && p->zSql ){ - double rNow; - u64 elapseTime; - - sqlite3OsCurrentTime(db->pVfs, &rNow); - elapseTime = (u64)((rNow - (int)rNow)*3600.0*24.0*1000000000.0); - elapseTime -= p->startTime; - db->xProfile(db->pProfileArg, p->zSql, elapseTime); + sqlite3_int64 iNow; + sqlite3OsCurrentTimeInt64(db->pVfs, &iNow); + db->xProfile(db->pProfileArg, p->zSql, (iNow - p->startTime)*1000000); } #endif + if( rc==SQLITE_DONE ){ + assert( p->rc==SQLITE_OK ); + p->rc = doWalCallbacks(db); + if( p->rc!=SQLITE_OK ){ + rc = SQLITE_ERROR; + } + } + db->errCode = rc; if( SQLITE_NOMEM==sqlite3ApiExit(p->db, p->rc) ){ p->rc = SQLITE_NOMEM; @@ -50665,39 +58731,44 @@ end_of_step: ** call sqlite3Reprepare() and try again. */ SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){ - int rc = SQLITE_MISUSE; - if( pStmt ){ - int cnt = 0; - Vdbe *v = (Vdbe*)pStmt; - sqlite3 *db = v->db; - sqlite3_mutex_enter(db->mutex); - while( (rc = sqlite3Step(v))==SQLITE_SCHEMA - && cnt++ < 5 - && (rc = sqlite3Reprepare(v))==SQLITE_OK ){ - sqlite3_reset(pStmt); - v->expired = 0; - } - if( rc==SQLITE_SCHEMA && ALWAYS(v->isPrepareV2) && ALWAYS(db->pErr) ){ - /* This case occurs after failing to recompile an sql statement. - ** The error message from the SQL compiler has already been loaded - ** into the database handle. This block copies the error message - ** from the database handle into the statement and sets the statement - ** program counter to 0 to ensure that when the statement is - ** finalized or reset the parser error message is available via - ** sqlite3_errmsg() and sqlite3_errcode(). - */ - const char *zErr = (const char *)sqlite3_value_text(db->pErr); - sqlite3DbFree(db, v->zErrMsg); - if( !db->mallocFailed ){ - v->zErrMsg = sqlite3DbStrDup(db, zErr); - } else { - v->zErrMsg = 0; - v->rc = SQLITE_NOMEM; - } - } - rc = sqlite3ApiExit(db, rc); - sqlite3_mutex_leave(db->mutex); + int rc = SQLITE_OK; /* Result from sqlite3Step() */ + int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */ + Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */ + int cnt = 0; /* Counter to prevent infinite loop of reprepares */ + sqlite3 *db; /* The database connection */ + + if( vdbeSafetyNotNull(v) ){ + return SQLITE_MISUSE_BKPT; } + db = v->db; + sqlite3_mutex_enter(db->mutex); + while( (rc = sqlite3Step(v))==SQLITE_SCHEMA + && cnt++ < 5 + && (rc2 = rc = sqlite3Reprepare(v))==SQLITE_OK ){ + sqlite3_reset(pStmt); + v->expired = 0; + } + if( rc2!=SQLITE_OK && ALWAYS(v->isPrepareV2) && ALWAYS(db->pErr) ){ + /* This case occurs after failing to recompile an sql statement. + ** The error message from the SQL compiler has already been loaded + ** into the database handle. This block copies the error message + ** from the database handle into the statement and sets the statement + ** program counter to 0 to ensure that when the statement is + ** finalized or reset the parser error message is available via + ** sqlite3_errmsg() and sqlite3_errcode(). + */ + const char *zErr = (const char *)sqlite3_value_text(db->pErr); + sqlite3DbFree(db, v->zErrMsg); + if( !db->mallocFailed ){ + v->zErrMsg = sqlite3DbStrDup(db, zErr); + v->rc = rc2; + } else { + v->zErrMsg = 0; + v->rc = rc = SQLITE_NOMEM; + } + } + rc = sqlite3ApiExit(db, rc); + sqlite3_mutex_leave(db->mutex); return rc; } @@ -50713,6 +58784,12 @@ SQLITE_API void *sqlite3_user_data(sqlite3_context *p){ /* ** Extract the user data from a sqlite3_context structure and return a ** pointer to it. +** +** IMPLEMENTATION-OF: R-46798-50301 The sqlite3_context_db_handle() interface +** returns a copy of the pointer to the database connection (the 1st +** parameter) of the sqlite3_create_function() and +** sqlite3_create_function16() routines that originally registered the +** application defined function. */ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){ assert( p && p->pFunc ); @@ -50751,8 +58828,9 @@ SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){ assert( p && p->pFunc && p->pFunc->xStep ); assert( sqlite3_mutex_held(p->s.db->mutex) ); pMem = p->pMem; + testcase( nByte<0 ); if( (pMem->flags & MEM_Agg)==0 ){ - if( nByte==0 ){ + if( nByte<=0 ){ sqlite3VdbeMemReleaseExternal(pMem); pMem->flags = MEM_Null; pMem->z = 0; @@ -50921,8 +58999,7 @@ static Mem *columnMem(sqlite3_stmt *pStmt, int i){ ** sqlite3_column_real() ** sqlite3_column_bytes() ** sqlite3_column_bytes16() -** -** But not for sqlite3_column_blob(), which never calls malloc(). +** sqiite3_column_blob() */ static void columnMallocFailure(sqlite3_stmt *pStmt) { @@ -51166,12 +59243,16 @@ SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){ */ static int vdbeUnbind(Vdbe *p, int i){ Mem *pVar; - if( p==0 ) return SQLITE_MISUSE; + if( vdbeSafetyNotNull(p) ){ + return SQLITE_MISUSE_BKPT; + } sqlite3_mutex_enter(p->db->mutex); if( p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){ sqlite3Error(p->db, SQLITE_MISUSE, 0); sqlite3_mutex_leave(p->db->mutex); - return SQLITE_MISUSE; + sqlite3_log(SQLITE_MISUSE, + "bind on a busy prepared statement: [%s]", p->zSql); + return SQLITE_MISUSE_BKPT; } if( i<1 || i>p->nVar ){ sqlite3Error(p->db, SQLITE_RANGE, 0); @@ -51186,6 +59267,12 @@ static int vdbeUnbind(Vdbe *p, int i){ /* If the bit corresponding to this variable in Vdbe.expmask is set, then ** binding a new value to this variable invalidates the current query plan. + ** + ** IMPLEMENTATION-OF: R-48440-37595 If the specific value bound to host + ** parameter in the WHERE clause might influence the choice of query plan + ** for a statement, then the statement will be automatically recompiled, + ** as if there had been a schema change, on the first sqlite3_step() call + ** following any change to the bindings of that parameter. */ if( p->isPrepareV2 && ((i<32 && p->expmask & ((u32)1 << i)) || p->expmask==0xffffffff) @@ -51388,8 +59475,7 @@ SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){ ** with that name. If there is no variable with the given name, ** return 0. */ -SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ - Vdbe *p = (Vdbe*)pStmt; +SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){ int i; if( p==0 ){ return 0; @@ -51398,13 +59484,16 @@ SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zNa if( zName ){ for(i=0; inVar; i++){ const char *z = p->azVar[i]; - if( z && strcmp(z,zName)==0 ){ + if( z && memcmp(z,zName,nName)==0 && z[nName]==0 ){ return i+1; } } } return 0; } +SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ + return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName)); +} /* ** Transfer all bindings from the first statement over to the second. @@ -51491,6 +59580,149 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){ } /************** End of vdbeapi.c *********************************************/ +/************** Begin file vdbetrace.c ***************************************/ +/* +** 2009 November 25 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file contains code used to insert the values of host parameters +** (aka "wildcards") into the SQL text output by sqlite3_trace(). +*/ + +#ifndef SQLITE_OMIT_TRACE + +/* +** zSql is a zero-terminated string of UTF-8 SQL text. Return the number of +** bytes in this text up to but excluding the first character in +** a host parameter. If the text contains no host parameters, return +** the total number of bytes in the text. +*/ +static int findNextHostParameter(const char *zSql, int *pnToken){ + int tokenType; + int nTotal = 0; + int n; + + *pnToken = 0; + while( zSql[0] ){ + n = sqlite3GetToken((u8*)zSql, &tokenType); + assert( n>0 && tokenType!=TK_ILLEGAL ); + if( tokenType==TK_VARIABLE ){ + *pnToken = n; + break; + } + nTotal += n; + zSql += n; + } + return nTotal; +} + +/* +** Return a pointer to a string in memory obtained form sqlite3DbMalloc() which +** holds a copy of zRawSql but with host parameters expanded to their +** current bindings. +** +** The calling function is responsible for making sure the memory returned +** is eventually freed. +** +** ALGORITHM: Scan the input string looking for host parameters in any of +** these forms: ?, ?N, $A, @A, :A. Take care to avoid text within +** string literals, quoted identifier names, and comments. For text forms, +** the host parameter index is found by scanning the perpared +** statement for the corresponding OP_Variable opcode. Once the host +** parameter index is known, locate the value in p->aVar[]. Then render +** the value as a literal in place of the host parameter name. +*/ +SQLITE_PRIVATE char *sqlite3VdbeExpandSql( + Vdbe *p, /* The prepared statement being evaluated */ + const char *zRawSql /* Raw text of the SQL statement */ +){ + sqlite3 *db; /* The database connection */ + int idx = 0; /* Index of a host parameter */ + int nextIndex = 1; /* Index of next ? host parameter */ + int n; /* Length of a token prefix */ + int nToken; /* Length of the parameter token */ + int i; /* Loop counter */ + Mem *pVar; /* Value of a host parameter */ + StrAccum out; /* Accumulate the output here */ + char zBase[100]; /* Initial working space */ + + db = p->db; + sqlite3StrAccumInit(&out, zBase, sizeof(zBase), + db->aLimit[SQLITE_LIMIT_LENGTH]); + out.db = db; + while( zRawSql[0] ){ + n = findNextHostParameter(zRawSql, &nToken); + assert( n>0 ); + sqlite3StrAccumAppend(&out, zRawSql, n); + zRawSql += n; + assert( zRawSql[0] || nToken==0 ); + if( nToken==0 ) break; + if( zRawSql[0]=='?' ){ + if( nToken>1 ){ + assert( sqlite3Isdigit(zRawSql[1]) ); + sqlite3GetInt32(&zRawSql[1], &idx); + }else{ + idx = nextIndex; + } + }else{ + assert( zRawSql[0]==':' || zRawSql[0]=='$' || zRawSql[0]=='@' ); + testcase( zRawSql[0]==':' ); + testcase( zRawSql[0]=='$' ); + testcase( zRawSql[0]=='@' ); + idx = sqlite3VdbeParameterIndex(p, zRawSql, nToken); + assert( idx>0 ); + } + zRawSql += nToken; + nextIndex = idx + 1; + assert( idx>0 && idx<=p->nVar ); + pVar = &p->aVar[idx-1]; + if( pVar->flags & MEM_Null ){ + sqlite3StrAccumAppend(&out, "NULL", 4); + }else if( pVar->flags & MEM_Int ){ + sqlite3XPrintf(&out, "%lld", pVar->u.i); + }else if( pVar->flags & MEM_Real ){ + sqlite3XPrintf(&out, "%!.15g", pVar->r); + }else if( pVar->flags & MEM_Str ){ +#ifndef SQLITE_OMIT_UTF16 + u8 enc = ENC(db); + if( enc!=SQLITE_UTF8 ){ + Mem utf8; + memset(&utf8, 0, sizeof(utf8)); + utf8.db = db; + sqlite3VdbeMemSetStr(&utf8, pVar->z, pVar->n, enc, SQLITE_STATIC); + sqlite3VdbeChangeEncoding(&utf8, SQLITE_UTF8); + sqlite3XPrintf(&out, "'%.*q'", utf8.n, utf8.z); + sqlite3VdbeMemRelease(&utf8); + }else +#endif + { + sqlite3XPrintf(&out, "'%.*q'", pVar->n, pVar->z); + } + }else if( pVar->flags & MEM_Zero ){ + sqlite3XPrintf(&out, "zeroblob(%d)", pVar->u.nZero); + }else{ + assert( pVar->flags & MEM_Blob ); + sqlite3StrAccumAppend(&out, "x'", 2); + for(i=0; in; i++){ + sqlite3XPrintf(&out, "%02x", pVar->z[i]&0xff); + } + sqlite3StrAccumAppend(&out, "'", 1); + } + } + return sqlite3StrAccumFinish(&out); +} + +#endif /* #ifndef SQLITE_OMIT_TRACE */ + +/************** End of vdbetrace.c *******************************************/ /************** Begin file vdbe.c ********************************************/ /* ** 2001 September 15 @@ -51536,10 +59768,19 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){ ** of the code in this file is, therefore, important. See other comments ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. -** -** $Id: vdbe.c,v 1.874 2009/07/24 17:58:53 danielk1977 Exp $ */ +/* +** Invoke this macro on memory cells just prior to changing the +** value of the cell. This macro verifies that shallow copies are +** not misused. +*/ +#ifdef SQLITE_DEBUG +# define memAboutToChange(P,M) sqlite3VdbeMemPrepareToChange(P,M) +#else +# define memAboutToChange(P,M) +#endif + /* ** The following global variable is incremented every time a cursor ** moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes. The test @@ -51664,23 +59905,6 @@ SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem){ } } -/* -** Properties of opcodes. The OPFLG_INITIALIZER macro is -** created by mkopcodeh.awk during compilation. Data is obtained -** from the comments following the "case OP_xxxx:" statements in -** this file. -*/ -static const unsigned char opcodeProperty[] = OPFLG_INITIALIZER; - -/* -** Return true if an opcode has any of the OPFLG_xxx properties -** specified by mask. -*/ -SQLITE_PRIVATE int sqlite3VdbeOpcodeHasProperty(int opcode, int mask){ - assert( opcode>0 && opcode<(int)sizeof(opcodeProperty) ); - return (opcodeProperty[opcode]&mask)!=0; -} - /* ** Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL ** if we run out of memory. @@ -51715,7 +59939,7 @@ static VdbeCursor *allocateCursor( int nByte; VdbeCursor *pCx = 0; nByte = - sizeof(VdbeCursor) + + ROUND8(sizeof(VdbeCursor)) + (isBtreeCursor?sqlite3BtreeCursorSize():0) + 2*nField*sizeof(u32); @@ -51726,15 +59950,16 @@ static VdbeCursor *allocateCursor( } if( SQLITE_OK==sqlite3VdbeMemGrow(pMem, nByte, 0) ){ p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->z; - memset(pMem->z, 0, nByte); + memset(pCx, 0, sizeof(VdbeCursor)); pCx->iDb = iDb; pCx->nField = nField; if( nField ){ - pCx->aType = (u32 *)&pMem->z[sizeof(VdbeCursor)]; + pCx->aType = (u32 *)&pMem->z[ROUND8(sizeof(VdbeCursor))]; } if( isBtreeCursor ){ pCx->pCursor = (BtCursor*) - &pMem->z[sizeof(VdbeCursor)+2*nField*sizeof(u32)]; + &pMem->z[ROUND8(sizeof(VdbeCursor))+2*nField*sizeof(u32)]; + sqlite3BtreeCursorZero(pCx->pCursor); } } return pCx; @@ -51748,18 +59973,17 @@ static VdbeCursor *allocateCursor( */ static void applyNumericAffinity(Mem *pRec){ if( (pRec->flags & (MEM_Real|MEM_Int))==0 ){ - int realnum; - sqlite3VdbeMemNulTerminate(pRec); - if( (pRec->flags&MEM_Str) - && sqlite3IsNumber(pRec->z, &realnum, pRec->enc) ){ - i64 value; - sqlite3VdbeChangeEncoding(pRec, SQLITE_UTF8); - if( !realnum && sqlite3Atoi64(pRec->z, &value) ){ - pRec->u.i = value; - MemSetTypeFlag(pRec, MEM_Int); - }else{ - sqlite3VdbeMemRealify(pRec); - } + double rValue; + i64 iValue; + u8 enc = pRec->enc; + if( (pRec->flags&MEM_Str)==0 ) return; + if( sqlite3AtoF(pRec->z, &rValue, pRec->n, enc)==0 ) return; + if( 0==sqlite3Atoi64(pRec->z, &iValue, pRec->n, enc) ){ + pRec->u.i = iValue; + pRec->flags |= MEM_Int; + }else{ + pRec->r = rValue; + pRec->flags |= MEM_Real; } } } @@ -51976,8 +60200,6 @@ static void registerTrace(FILE *out, int iReg, Mem *p){ ** ** This file contains inline asm code for retrieving "high-performance" ** counters for x86 class CPUs. -** -** $Id: hwtime.h,v 1.3 2008/08/01 14:33:15 shane Exp $ */ #ifndef _HWTIME_H_ #define _HWTIME_H_ @@ -52068,22 +60290,6 @@ SQLITE_PRIVATE sqlite_uint64 sqlite3Hwtime(void){ return ((sqlite_uint64)0); } #define CHECK_FOR_INTERRUPT \ if( db->u1.isInterrupted ) goto abort_due_to_interrupt; -#ifdef SQLITE_DEBUG -static int fileExists(sqlite3 *db, const char *zFile){ - int res = 0; - int rc = SQLITE_OK; -#ifdef SQLITE_TEST - /* If we are currently testing IO errors, then do not call OsAccess() to - ** test for the presence of zFile. This is because any IO error that - ** occurs here will not be reported, causing the test to fail. - */ - extern int sqlite3_io_error_pending; - if( sqlite3_io_error_pending<=0 ) -#endif - rc = sqlite3OsAccess(db->pVfs, zFile, SQLITE_ACCESS_EXISTS, &res); - return (res && rc==SQLITE_OK); -} -#endif #ifndef NDEBUG /* @@ -52105,6 +60311,20 @@ static int checkSavepointCount(sqlite3 *db){ } #endif +/* +** Transfer error message text from an sqlite3_vtab.zErrMsg (text stored +** in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored +** in memory obtained from sqlite3DbMalloc). +*/ +static void importVtabErrMsg(Vdbe *p, sqlite3_vtab *pVtab){ + sqlite3 *db = p->db; + sqlite3DbFree(db, p->zErrMsg); + p->zErrMsg = sqlite3DbStrDup(db, pVtab->zErrMsg); + sqlite3_free(pVtab->zErrMsg); + pVtab->zErrMsg = 0; +} + + /* ** Execute as much of a VDBE program as we can then return. ** @@ -52139,24 +60359,27 @@ static int checkSavepointCount(sqlite3 *db){ SQLITE_PRIVATE int sqlite3VdbeExec( Vdbe *p /* The VDBE */ ){ - int pc; /* The program counter */ + int pc=0; /* The program counter */ + Op *aOp = p->aOp; /* Copy of p->aOp */ Op *pOp; /* Current operation */ int rc = SQLITE_OK; /* Value to return */ sqlite3 *db = p->db; /* The database */ + u8 resetSchemaOnFault = 0; /* Reset schema after an error if true */ u8 encoding = ENC(db); /* The database encoding */ +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK + int checkProgress; /* True if progress callbacks are enabled */ + int nProgressOps = 0; /* Opcodes executed since progress callback. */ +#endif + Mem *aMem = p->aMem; /* Copy of p->aMem */ Mem *pIn1 = 0; /* 1st input operand */ Mem *pIn2 = 0; /* 2nd input operand */ Mem *pIn3 = 0; /* 3rd input operand */ Mem *pOut = 0; /* Output operand */ - u8 opProperty; int iCompare = 0; /* Result of last OP_Compare operation */ int *aPermute = 0; /* Permutation of columns for OP_Compare */ #ifdef VDBE_PROFILE u64 start; /* CPU clock count at start of opcode */ int origPc; /* Program counter at start of opcode */ -#endif -#ifndef SQLITE_OMIT_PROGRESS_CALLBACK - int nProgressOps = 0; /* Opcodes executed since progress callback. */ #endif /******************************************************************** ** Automatically generated code @@ -52171,9 +60394,6 @@ SQLITE_PRIVATE int sqlite3VdbeExec( int pcDest; } aa; struct OP_Variable_stack_vars { - int p1; /* Variable to copy from */ - int p2; /* Register to copy to */ - int n; /* Number of values left to copy */ Mem *pVar; /* Value being transferred */ } ab; struct OP_Move_stack_vars { @@ -52210,6 +60430,8 @@ SQLITE_PRIVATE int sqlite3VdbeExec( struct OP_Ge_stack_vars { int res; /* Result of the comparison of pIn1 against pIn3 */ char affinity; /* Affinity to use for comparison */ + u16 flags1; /* Copy of initial value of pIn1->flags */ + u16 flags3; /* Copy of initial value of pIn3->flags */ } ai; struct OP_Compare_stack_vars { int n; @@ -52247,16 +60469,14 @@ SQLITE_PRIVATE int sqlite3VdbeExec( u8 *zIdx; /* Index into header */ u8 *zEndHdr; /* Pointer to first byte after the header */ u32 offset; /* Offset into the data */ - u64 offset64; /* 64-bit offset. 64 bits needed to catch overflow */ + u32 szField; /* Number of bytes in the content of a field */ int szHdr; /* Size of the header size field at start of record */ int avail; /* Number of bytes of available data */ Mem *pReg; /* PseudoTable input register */ } am; struct OP_Affinity_stack_vars { - char *zAffinity; /* The affinity to be applied */ - Mem *pData0; /* First register to which to apply affinity */ - Mem *pLast; /* Last register to which to apply affinity */ - Mem *pRec; /* Current register */ + const char *zAffinity; /* The affinity to be applied */ + char cAff; /* A single character of affinity */ } an; struct OP_MakeRecord_stack_vars { u8 *zNewRecord; /* A buffer to hold the data for the new record */ @@ -52341,6 +60561,7 @@ SQLITE_PRIVATE int sqlite3VdbeExec( VdbeCursor *pC; int res; UnpackedRecord *pIdxKey; + UnpackedRecord r; char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7]; } bb; struct OP_IsUnique_stack_vars { @@ -52348,7 +60569,7 @@ SQLITE_PRIVATE int sqlite3VdbeExec( VdbeCursor *pCx; BtCursor *pCrsr; u16 nField; - Mem *aMem; + Mem *aMx; UnpackedRecord r; /* B-Tree index search key */ i64 R; /* Rowid stored in register P3 */ } bc; @@ -52461,18 +60682,13 @@ SQLITE_PRIVATE int sqlite3VdbeExec( char *z; /* Text of the error report */ Mem *pnErr; /* Register keeping track of errors remaining */ } bv; - struct OP_RowSetAdd_stack_vars { - Mem *pIdx; - Mem *pVal; - } bw; struct OP_RowSetRead_stack_vars { - Mem *pIdx; i64 val; - } bx; + } bw; struct OP_RowSetTest_stack_vars { int iSet; int exists; - } by; + } bx; struct OP_Program_stack_vars { int nMem; /* Number of memory registers for sub-program */ int nByte; /* Bytes of runtime space required for sub-program */ @@ -52482,15 +60698,15 @@ SQLITE_PRIVATE int sqlite3VdbeExec( VdbeFrame *pFrame; /* New vdbe frame to execute in */ SubProgram *pProgram; /* Sub-program to execute */ void *t; /* Token identifying trigger */ - } bz; + } by; struct OP_Param_stack_vars { VdbeFrame *pFrame; Mem *pIn; - } ca; + } bz; struct OP_MemMax_stack_vars { Mem *pIn1; VdbeFrame *pFrame; - } cb; + } ca; struct OP_AggStep_stack_vars { int n; int i; @@ -52498,9 +60714,16 @@ SQLITE_PRIVATE int sqlite3VdbeExec( Mem *pRec; sqlite3_context ctx; sqlite3_value **apVal; - } cc; + } cb; struct OP_AggFinal_stack_vars { Mem *pMem; + } cc; + struct OP_JournalMode_stack_vars { + Btree *pBt; /* Btree to change journal mode of */ + Pager *pPager; /* Pager associated with pBt */ + int eNew; /* New journal mode */ + int eOld; /* The old journal mode */ + const char *zFilename; /* Name of database file for pPager */ } cd; struct OP_IncrVacuum_stack_vars { Btree *pBt; @@ -52552,20 +60775,14 @@ SQLITE_PRIVATE int sqlite3VdbeExec( Mem **apArg; Mem *pX; } cl; - struct OP_Pagecount_stack_vars { - int p1; - int nPage; - Pager *pPager; - } cm; struct OP_Trace_stack_vars { char *zTrace; - } cn; + } cm; } u; /* End automatically generated code ********************************************************************/ assert( p->magic==VDBE_MAGIC_RUN ); /* sqlite3_step() verifies this */ - assert( db->magic==SQLITE_MAGIC_BUSY ); sqlite3VdbeMutexArrayEnter(p); if( p->rc==SQLITE_NOMEM ){ /* This happens if a malloc() inside a call to sqlite3_column_text() or @@ -52579,21 +60796,19 @@ SQLITE_PRIVATE int sqlite3VdbeExec( db->busyHandler.nBusy = 0; CHECK_FOR_INTERRUPT; sqlite3VdbeIOTraceSql(p); +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK + checkProgress = db->xProgress!=0; +#endif #ifdef SQLITE_DEBUG sqlite3BeginBenignMalloc(); - if( p->pc==0 - && ((p->db->flags & SQLITE_VdbeListing) || fileExists(db, "vdbe_explain")) - ){ + if( p->pc==0 && (p->db->flags & SQLITE_VdbeListing)!=0 ){ int i; printf("VDBE Program Listing:\n"); sqlite3VdbePrintSql(p); for(i=0; inOp; i++){ - sqlite3VdbePrintOp(stdout, i, &p->aOp[i]); + sqlite3VdbePrintOp(stdout, i, &aOp[i]); } } - if( fileExists(db, "vdbe_trace") ){ - p->trace = stdout; - } sqlite3EndBenignMalloc(); #endif for(pc=p->pc; rc==SQLITE_OK; pc++){ @@ -52603,7 +60818,7 @@ SQLITE_PRIVATE int sqlite3VdbeExec( origPc = pc; start = sqlite3Hwtime(); #endif - pOp = &p->aOp[pc]; + pOp = &aOp[pc]; /* Only allow tracing if SQLITE_DEBUG is defined. */ @@ -52615,13 +60830,6 @@ SQLITE_PRIVATE int sqlite3VdbeExec( } sqlite3VdbePrintOp(p->trace, pc, pOp); } - if( p->trace==0 && pc==0 ){ - sqlite3BeginBenignMalloc(); - if( fileExists(db, "vdbe_sqltrace") ){ - sqlite3VdbePrintSql(p); - } - sqlite3EndBenignMalloc(); - } #endif @@ -52644,12 +60852,10 @@ SQLITE_PRIVATE int sqlite3VdbeExec( ** If the progress callback returns non-zero, exit the virtual machine with ** a return code SQLITE_ABORT. */ - if( db->xProgress ){ + if( checkProgress ){ if( db->nProgressOps==nProgressOps ){ int prc; - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; - prc =db->xProgress(db->pProgressArg); - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; + prc = db->xProgress(db->pProgressArg); if( prc!=0 ){ rc = SQLITE_INTERRUPT; goto vdbe_error_halt; @@ -52660,66 +60866,53 @@ SQLITE_PRIVATE int sqlite3VdbeExec( } #endif - /* Do common setup processing for any opcode that is marked - ** with the "out2-prerelease" tag. Such opcodes have a single - ** output which is specified by the P2 parameter. The P2 register - ** is initialized to a NULL. + /* On any opcode with the "out2-prerelase" tag, free any + ** external allocations out of mem[p2] and set mem[p2] to be + ** an undefined integer. Opcodes will either fill in the integer + ** value or convert mem[p2] to a different type. */ - opProperty = opcodeProperty[pOp->opcode]; - if( (opProperty & OPFLG_OUT2_PRERELEASE)!=0 ){ + assert( pOp->opflags==sqlite3OpcodeProperty[pOp->opcode] ); + if( pOp->opflags & OPFLG_OUT2_PRERELEASE ){ assert( pOp->p2>0 ); assert( pOp->p2<=p->nMem ); - pOut = &p->aMem[pOp->p2]; + pOut = &aMem[pOp->p2]; + memAboutToChange(p, pOut); sqlite3VdbeMemReleaseExternal(pOut); - pOut->flags = MEM_Null; - pOut->n = 0; - }else - - /* Do common setup for opcodes marked with one of the following - ** combinations of properties. - ** - ** in1 - ** in1 in2 - ** in1 in2 out3 - ** in1 in3 - ** - ** Variables pIn1, pIn2, and pIn3 are made to point to appropriate - ** registers for inputs. Variable pOut points to the output register. - */ - if( (opProperty & OPFLG_IN1)!=0 ){ - assert( pOp->p1>0 ); - assert( pOp->p1<=p->nMem ); - pIn1 = &p->aMem[pOp->p1]; - REGISTER_TRACE(pOp->p1, pIn1); - if( (opProperty & OPFLG_IN2)!=0 ){ - assert( pOp->p2>0 ); - assert( pOp->p2<=p->nMem ); - pIn2 = &p->aMem[pOp->p2]; - REGISTER_TRACE(pOp->p2, pIn2); - /* As currently implemented, in2 implies out3. There is no reason - ** why this has to be, it just worked out that way. */ - assert( (opProperty & OPFLG_OUT3)!=0 ); - assert( pOp->p3>0 ); - assert( pOp->p3<=p->nMem ); - pOut = &p->aMem[pOp->p3]; - }else if( (opProperty & OPFLG_IN3)!=0 ){ - assert( pOp->p3>0 ); - assert( pOp->p3<=p->nMem ); - pIn3 = &p->aMem[pOp->p3]; - REGISTER_TRACE(pOp->p3, pIn3); - } - }else if( (opProperty & OPFLG_IN2)!=0 ){ - assert( pOp->p2>0 ); - assert( pOp->p2<=p->nMem ); - pIn2 = &p->aMem[pOp->p2]; - REGISTER_TRACE(pOp->p2, pIn2); - }else if( (opProperty & OPFLG_IN3)!=0 ){ - assert( pOp->p3>0 ); - assert( pOp->p3<=p->nMem ); - pIn3 = &p->aMem[pOp->p3]; - REGISTER_TRACE(pOp->p3, pIn3); + pOut->flags = MEM_Int; } + /* Sanity checking on other operands */ +#ifdef SQLITE_DEBUG + if( (pOp->opflags & OPFLG_IN1)!=0 ){ + assert( pOp->p1>0 ); + assert( pOp->p1<=p->nMem ); + assert( memIsValid(&aMem[pOp->p1]) ); + REGISTER_TRACE(pOp->p1, &aMem[pOp->p1]); + } + if( (pOp->opflags & OPFLG_IN2)!=0 ){ + assert( pOp->p2>0 ); + assert( pOp->p2<=p->nMem ); + assert( memIsValid(&aMem[pOp->p2]) ); + REGISTER_TRACE(pOp->p2, &aMem[pOp->p2]); + } + if( (pOp->opflags & OPFLG_IN3)!=0 ){ + assert( pOp->p3>0 ); + assert( pOp->p3<=p->nMem ); + assert( memIsValid(&aMem[pOp->p3]) ); + REGISTER_TRACE(pOp->p3, &aMem[pOp->p3]); + } + if( (pOp->opflags & OPFLG_OUT2)!=0 ){ + assert( pOp->p2>0 ); + assert( pOp->p2<=p->nMem ); + memAboutToChange(p, &aMem[pOp->p2]); + } + if( (pOp->opflags & OPFLG_OUT3)!=0 ){ + assert( pOp->p3>0 ); + assert( pOp->p3<=p->nMem ); + memAboutToChange(p, &aMem[pOp->p3]); + } +#endif + switch( pOp->opcode ){ /***************************************************************************** @@ -52775,11 +60968,10 @@ case OP_Goto: { /* jump */ ** Write the current address onto register P1 ** and then jump to address P2. */ -case OP_Gosub: { /* jump */ - assert( pOp->p1>0 ); - assert( pOp->p1<=p->nMem ); - pIn1 = &p->aMem[pOp->p1]; +case OP_Gosub: { /* jump, in1 */ + pIn1 = &aMem[pOp->p1]; assert( (pIn1->flags & MEM_Dyn)==0 ); + memAboutToChange(p, pIn1); pIn1->flags = MEM_Int; pIn1->u.i = pc; REGISTER_TRACE(pOp->p1, pIn1); @@ -52792,6 +60984,7 @@ case OP_Gosub: { /* jump */ ** Jump to the next instruction after the address in register P1. */ case OP_Return: { /* in1 */ + pIn1 = &aMem[pOp->p1]; assert( pIn1->flags & MEM_Int ); pc = (int)pIn1->u.i; break; @@ -52805,6 +60998,7 @@ case OP_Yield: { /* in1 */ #if 0 /* local variables moved into u.aa */ int pcDest; #endif /* local variables moved into u.aa */ + pIn1 = &aMem[pOp->p1]; assert( (pIn1->flags & MEM_Dyn)==0 ); pIn1->flags = MEM_Int; u.aa.pcDest = (int)pIn1->u.i; @@ -52821,6 +61015,7 @@ case OP_Yield: { /* in1 */ ** value in register P3 is not NULL, then this routine is a no-op. */ case OP_HaltIfNull: { /* in3 */ + pIn3 = &aMem[pOp->p3]; if( (pIn3->flags & MEM_Null)==0 ) break; /* Fall through into OP_Halt */ } @@ -52860,6 +61055,8 @@ case OP_Halt: { ** as the p2 of the calling OP_Program. */ pc = p->aOp[pc].p2-1; } + aOp = p->aOp; + aMem = p->aMem; break; } @@ -52867,7 +61064,13 @@ case OP_Halt: { p->errorAction = (u8)pOp->p2; p->pc = pc; if( pOp->p4.z ){ + assert( p->rc!=SQLITE_OK ); sqlite3SetString(&p->zErrMsg, db, "%s", pOp->p4.z); + testcase( sqlite3GlobalConfig.xLog!=0 ); + sqlite3_log(pOp->p1, "abort at %d in [%s]: %s", pc, p->zSql, pOp->p4.z); + }else if( p->rc ){ + testcase( sqlite3GlobalConfig.xLog!=0 ); + sqlite3_log(pOp->p1, "constraint failed at %d in [%s]", pc, p->zSql); } rc = sqlite3VdbeHalt(p); assert( rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR ); @@ -52886,7 +61089,6 @@ case OP_Halt: { ** The 32-bit integer value P1 is written into register P2. */ case OP_Integer: { /* out2-prerelease */ - pOut->flags = MEM_Int; pOut->u.i = pOp->p1; break; } @@ -52898,11 +61100,11 @@ case OP_Integer: { /* out2-prerelease */ */ case OP_Int64: { /* out2-prerelease */ assert( pOp->p4.pI64!=0 ); - pOut->flags = MEM_Int; pOut->u.i = *pOp->p4.pI64; break; } +#ifndef SQLITE_OMIT_FLOATING_POINT /* Opcode: Real * P2 * P4 * ** ** P4 is a pointer to a 64-bit floating point value. @@ -52914,6 +61116,7 @@ case OP_Real: { /* same as TK_FLOAT, out2-prerelease */ pOut->r = *pOp->p4.pReal; break; } +#endif /* Opcode: String8 * P2 * P4 * ** @@ -52968,6 +61171,7 @@ case OP_String: { /* out2-prerelease */ ** Write a NULL into register P2. */ case OP_Null: { /* out2-prerelease */ + pOut->flags = MEM_Null; break; } @@ -52975,11 +61179,7 @@ case OP_Null: { /* out2-prerelease */ /* Opcode: Blob P1 P2 * P4 ** ** P4 points to a blob of data P1 bytes long. Store this -** blob in register P2. This instruction is not coded directly -** by the compiler. Instead, the compiler layer specifies -** an OP_HexBlob opcode, with the hex string representation of -** the blob as P4. This opcode is transformed to an OP_Blob -** the first time it is executed. +** blob in register P2. */ case OP_Blob: { /* out2-prerelease */ assert( pOp->p1 <= SQLITE_MAX_LENGTH ); @@ -52989,40 +61189,25 @@ case OP_Blob: { /* out2-prerelease */ break; } -/* Opcode: Variable P1 P2 P3 P4 * +/* Opcode: Variable P1 P2 * P4 * ** -** Transfer the values of bound parameters P1..P1+P3-1 into registers -** P2..P2+P3-1. +** Transfer the values of bound parameter P1 into register P2 ** ** If the parameter is named, then its name appears in P4 and P3==1. ** The P4 value is used by sqlite3_bind_parameter_name(). */ -case OP_Variable: { +case OP_Variable: { /* out2-prerelease */ #if 0 /* local variables moved into u.ab */ - int p1; /* Variable to copy from */ - int p2; /* Register to copy to */ - int n; /* Number of values left to copy */ Mem *pVar; /* Value being transferred */ #endif /* local variables moved into u.ab */ - u.ab.p1 = pOp->p1 - 1; - u.ab.p2 = pOp->p2; - u.ab.n = pOp->p3; - assert( u.ab.p1>=0 && u.ab.p1+u.ab.n<=p->nVar ); - assert( u.ab.p2>=1 && u.ab.p2+u.ab.n-1<=p->nMem ); - assert( pOp->p4.z==0 || pOp->p3==1 || pOp->p3==0 ); - - while( u.ab.n-- > 0 ){ - u.ab.pVar = &p->aVar[u.ab.p1++]; - if( sqlite3VdbeMemTooBig(u.ab.pVar) ){ - goto too_big; - } - pOut = &p->aMem[u.ab.p2++]; - sqlite3VdbeMemReleaseExternal(pOut); - pOut->flags = MEM_Null; - sqlite3VdbeMemShallowCopy(pOut, u.ab.pVar, MEM_Static); - UPDATE_MAX_BLOBSIZE(pOut); + assert( pOp->p1>0 && pOp->p1<=p->nVar ); + u.ab.pVar = &p->aVar[pOp->p1 - 1]; + if( sqlite3VdbeMemTooBig(u.ab.pVar) ){ + goto too_big; } + sqlite3VdbeMemShallowCopy(pOut, u.ab.pVar, MEM_Static); + UPDATE_MAX_BLOBSIZE(pOut); break; } @@ -53047,11 +61232,13 @@ case OP_Move: { assert( u.ac.n>0 && u.ac.p1>0 && u.ac.p2>0 ); assert( u.ac.p1+u.ac.n<=u.ac.p2 || u.ac.p2+u.ac.n<=u.ac.p1 ); - pIn1 = &p->aMem[u.ac.p1]; - pOut = &p->aMem[u.ac.p2]; + pIn1 = &aMem[u.ac.p1]; + pOut = &aMem[u.ac.p2]; while( u.ac.n-- ){ - assert( pOut<=&p->aMem[p->nMem] ); - assert( pIn1<=&p->aMem[p->nMem] ); + assert( pOut<=&aMem[p->nMem] ); + assert( pIn1<=&aMem[p->nMem] ); + assert( memIsValid(pIn1) ); + memAboutToChange(p, pOut); u.ac.zMalloc = pOut->zMalloc; pOut->zMalloc = 0; sqlite3VdbeMemMove(pOut, pIn1); @@ -53070,10 +61257,9 @@ case OP_Move: { ** This instruction makes a deep copy of the value. A duplicate ** is made of any string or blob constant. See also OP_SCopy. */ -case OP_Copy: { /* in1 */ - assert( pOp->p2>0 ); - assert( pOp->p2<=p->nMem ); - pOut = &p->aMem[pOp->p2]; +case OP_Copy: { /* in1, out2 */ + pIn1 = &aMem[pOp->p1]; + pOut = &aMem[pOp->p2]; assert( pOut!=pIn1 ); sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem); Deephemeralize(pOut); @@ -53093,13 +61279,14 @@ case OP_Copy: { /* in1 */ ** during the lifetime of the copy. Use OP_Copy to make a complete ** copy. */ -case OP_SCopy: { /* in1 */ - REGISTER_TRACE(pOp->p1, pIn1); - assert( pOp->p2>0 ); - assert( pOp->p2<=p->nMem ); - pOut = &p->aMem[pOp->p2]; +case OP_SCopy: { /* in1, out2 */ + pIn1 = &aMem[pOp->p1]; + pOut = &aMem[pOp->p2]; assert( pOut!=pIn1 ); sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem); +#ifdef SQLITE_DEBUG + if( pOut->pScopyFrom==0 ) pOut->pScopyFrom = pIn1; +#endif REGISTER_TRACE(pOp->p2, pOut); break; } @@ -53158,8 +61345,12 @@ case OP_ResultRow: { ** and have an assigned type. The results are de-ephemeralized as ** as side effect. */ - u.ad.pMem = p->pResultSet = &p->aMem[pOp->p1]; + u.ad.pMem = p->pResultSet = &aMem[pOp->p1]; for(u.ad.i=0; u.ad.ip2; u.ad.i++){ + assert( memIsValid(&u.ad.pMem[u.ad.i]) ); + Deephemeralize(&u.ad.pMem[u.ad.i]); + assert( (u.ad.pMem[u.ad.i].flags & MEM_Ephem)==0 + || (u.ad.pMem[u.ad.i].flags & (MEM_Str|MEM_Blob))==0 ); sqlite3VdbeMemNulTerminate(&u.ad.pMem[u.ad.i]); sqlite3VdbeMemStoreType(&u.ad.pMem[u.ad.i]); REGISTER_TRACE(pOp->p1+u.ad.i, &u.ad.pMem[u.ad.i]); @@ -53190,6 +61381,9 @@ case OP_Concat: { /* same as TK_CONCAT, in1, in2, out3 */ i64 nByte; #endif /* local variables moved into u.ae */ + pIn1 = &aMem[pOp->p1]; + pIn2 = &aMem[pOp->p2]; + pOut = &aMem[pOp->p3]; assert( pIn1!=pOut ); if( (pIn1->flags | pIn2->flags) & MEM_Null ){ sqlite3VdbeMemSetNull(pOut); @@ -53265,8 +61459,11 @@ case OP_Remainder: { /* same as TK_REM, in1, in2, out3 */ double rB; /* Real value of right operand */ #endif /* local variables moved into u.af */ + pIn1 = &aMem[pOp->p1]; applyNumericAffinity(pIn1); + pIn2 = &aMem[pOp->p2]; applyNumericAffinity(pIn2); + pOut = &aMem[pOp->p3]; u.af.flags = pIn1->flags | pIn2->flags; if( (u.af.flags & MEM_Null)!=0 ) goto arithmetic_result_is_null; if( (pIn1->flags & pIn2->flags & MEM_Int)==MEM_Int ){ @@ -53320,6 +61517,10 @@ case OP_Remainder: { /* same as TK_REM, in1, in2, out3 */ break; } } +#ifdef SQLITE_OMIT_FLOATING_POINT + pOut->u.i = u.af.rB; + MemSetTypeFlag(pOut, MEM_Int); +#else if( sqlite3IsNaN(u.af.rB) ){ goto arithmetic_result_is_null; } @@ -53328,6 +61529,7 @@ case OP_Remainder: { /* same as TK_REM, in1, in2, out3 */ if( (u.af.flags & MEM_Real)==0 ){ sqlite3VdbeIntegerAffinity(pOut); } +#endif } break; @@ -53380,14 +61582,19 @@ case OP_Function: { u.ag.n = pOp->p5; u.ag.apVal = p->apArg; assert( u.ag.apVal || u.ag.n==0 ); + assert( pOp->p3>0 && pOp->p3<=p->nMem ); + pOut = &aMem[pOp->p3]; + memAboutToChange(p, pOut); assert( u.ag.n==0 || (pOp->p2>0 && pOp->p2+u.ag.n<=p->nMem+1) ); assert( pOp->p3p2 || pOp->p3>=pOp->p2+u.ag.n ); - u.ag.pArg = &p->aMem[pOp->p2]; + u.ag.pArg = &aMem[pOp->p2]; for(u.ag.i=0; u.ag.ip2, u.ag.pArg); + REGISTER_TRACE(pOp->p2+u.ag.i, u.ag.pArg); } assert( pOp->p4type==P4_FUNCDEF || pOp->p4type==P4_VDBEFUNC ); @@ -53399,8 +61606,6 @@ case OP_Function: { u.ag.ctx.pFunc = u.ag.ctx.pVdbeFunc->pFunc; } - assert( pOp->p3>0 && pOp->p3<=p->nMem ); - pOut = &p->aMem[pOp->p3]; u.ag.ctx.s.flags = MEM_Null; u.ag.ctx.s.db = db; u.ag.ctx.s.xDel = 0; @@ -53415,26 +61620,17 @@ case OP_Function: { u.ag.ctx.isError = 0; if( u.ag.ctx.pFunc->flags & SQLITE_FUNC_NEEDCOLL ){ - assert( pOp>p->aOp ); + assert( pOp>aOp ); assert( pOp[-1].p4type==P4_COLLSEQ ); assert( pOp[-1].opcode==OP_CollSeq ); u.ag.ctx.pColl = pOp[-1].p4.pColl; } - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; - (*u.ag.ctx.pFunc->xFunc)(&u.ag.ctx, u.ag.n, u.ag.apVal); - if( sqlite3SafetyOn(db) ){ - sqlite3VdbeMemRelease(&u.ag.ctx.s); - goto abort_due_to_misuse; - } + (*u.ag.ctx.pFunc->xFunc)(&u.ag.ctx, u.ag.n, u.ag.apVal); /* IMP: R-24505-23230 */ if( db->mallocFailed ){ /* Even though a malloc() has failed, the implementation of the ** user function may have called an sqlite3_result_XXX() function ** to return a value. The following call releases any resources ** associated with such a value. - ** - ** Note: Maybe MemRelease() should be called if sqlite3SafetyOn() - ** fails also (the if(...) statement above). But if people are - ** misusing sqlite, they have bigger problems than a leaked value. */ sqlite3VdbeMemRelease(&u.ag.ctx.s); goto no_mem; @@ -53481,7 +61677,7 @@ case OP_Function: { /* Opcode: ShiftLeft P1 P2 P3 * * ** ** Shift the integer value in register P2 to the left by the -** number of bits specified by the integer in regiser P1. +** number of bits specified by the integer in register P1. ** Store the result in register P3. ** If either input is NULL, the result is NULL. */ @@ -53501,6 +61697,9 @@ case OP_ShiftRight: { /* same as TK_RSHIFT, in1, in2, out3 */ i64 b; #endif /* local variables moved into u.ah */ + pIn1 = &aMem[pOp->p1]; + pIn2 = &aMem[pOp->p2]; + pOut = &aMem[pOp->p3]; if( (pIn1->flags | pIn2->flags) & MEM_Null ){ sqlite3VdbeMemSetNull(pOut); break; @@ -53527,6 +61726,8 @@ case OP_ShiftRight: { /* same as TK_RSHIFT, in1, in2, out3 */ ** To force any register to be an integer, just add 0. */ case OP_AddImm: { /* in1 */ + pIn1 = &aMem[pOp->p1]; + memAboutToChange(p, pIn1); sqlite3VdbeMemIntegerify(pIn1); pIn1->u.i += pOp->p2; break; @@ -53540,6 +61741,8 @@ case OP_AddImm: { /* in1 */ ** raise an SQLITE_MISMATCH exception. */ case OP_MustBeInt: { /* jump, in1 */ + pIn1 = &aMem[pOp->p1]; + memAboutToChange(p, pIn1); applyAffinity(pIn1, SQLITE_AFF_NUMERIC, encoding); if( (pIn1->flags & MEM_Int)==0 ){ if( pOp->p2==0 ){ @@ -53554,6 +61757,7 @@ case OP_MustBeInt: { /* jump, in1 */ break; } +#ifndef SQLITE_OMIT_FLOATING_POINT /* Opcode: RealAffinity P1 * * * * ** ** If register P1 holds an integer convert it to a real value. @@ -53564,11 +61768,13 @@ case OP_MustBeInt: { /* jump, in1 */ ** to have only a real value. */ case OP_RealAffinity: { /* in1 */ + pIn1 = &aMem[pOp->p1]; if( pIn1->flags & MEM_Int ){ sqlite3VdbeMemRealify(pIn1); } break; } +#endif #ifndef SQLITE_OMIT_CAST /* Opcode: ToText P1 * * * * @@ -53581,6 +61787,8 @@ case OP_RealAffinity: { /* in1 */ ** A NULL value is not changed by this routine. It remains NULL. */ case OP_ToText: { /* same as TK_TO_TEXT, in1 */ + pIn1 = &aMem[pOp->p1]; + memAboutToChange(p, pIn1); if( pIn1->flags & MEM_Null ) break; assert( MEM_Str==(MEM_Blob>>3) ); pIn1->flags |= (pIn1->flags&MEM_Blob)>>3; @@ -53602,6 +61810,7 @@ case OP_ToText: { /* same as TK_TO_TEXT, in1 */ ** A NULL value is not changed by this routine. It remains NULL. */ case OP_ToBlob: { /* same as TK_TO_BLOB, in1 */ + pIn1 = &aMem[pOp->p1]; if( pIn1->flags & MEM_Null ) break; if( (pIn1->flags & MEM_Blob)==0 ){ applyAffinity(pIn1, SQLITE_AFF_TEXT, encoding); @@ -53625,16 +61834,15 @@ case OP_ToBlob: { /* same as TK_TO_BLOB, in1 */ ** A NULL value is not changed by this routine. It remains NULL. */ case OP_ToNumeric: { /* same as TK_TO_NUMERIC, in1 */ - if( (pIn1->flags & (MEM_Null|MEM_Int|MEM_Real))==0 ){ - sqlite3VdbeMemNumerify(pIn1); - } + pIn1 = &aMem[pOp->p1]; + sqlite3VdbeMemNumerify(pIn1); break; } #endif /* SQLITE_OMIT_CAST */ /* Opcode: ToInt P1 * * * * ** -** Force the value in register P1 be an integer. If +** Force the value in register P1 to be an integer. If ** The value is currently a real number, drop its fractional part. ** If the value is text or blob, try to convert it to an integer using the ** equivalent of atoi() and store 0 if no such conversion is possible. @@ -53642,13 +61850,14 @@ case OP_ToNumeric: { /* same as TK_TO_NUMERIC, in1 */ ** A NULL value is not changed by this routine. It remains NULL. */ case OP_ToInt: { /* same as TK_TO_INT, in1 */ + pIn1 = &aMem[pOp->p1]; if( (pIn1->flags & MEM_Null)==0 ){ sqlite3VdbeMemIntegerify(pIn1); } break; } -#ifndef SQLITE_OMIT_CAST +#if !defined(SQLITE_OMIT_CAST) && !defined(SQLITE_OMIT_FLOATING_POINT) /* Opcode: ToReal P1 * * * * ** ** Force the value in register P1 to be a floating point number. @@ -53659,12 +61868,14 @@ case OP_ToInt: { /* same as TK_TO_INT, in1 */ ** A NULL value is not changed by this routine. It remains NULL. */ case OP_ToReal: { /* same as TK_TO_REAL, in1 */ + pIn1 = &aMem[pOp->p1]; + memAboutToChange(p, pIn1); if( (pIn1->flags & MEM_Null)==0 ){ sqlite3VdbeMemRealify(pIn1); } break; } -#endif /* SQLITE_OMIT_CAST */ +#endif /* !defined(SQLITE_OMIT_CAST) && !defined(SQLITE_OMIT_FLOATING_POINT) */ /* Opcode: Lt P1 P2 P3 P4 P5 ** @@ -53673,7 +61884,7 @@ case OP_ToReal: { /* same as TK_TO_REAL, in1 */ ** ** If the SQLITE_JUMPIFNULL bit of P5 is set and either reg(P1) or ** reg(P3) is NULL then take the jump. If the SQLITE_JUMPIFNULL -** bit is clear then fall thru if either operand is NULL. +** bit is clear then fall through if either operand is NULL. ** ** The SQLITE_AFF_MASK portion of P5 must be an affinity character - ** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made @@ -53747,8 +61958,14 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */ #if 0 /* local variables moved into u.ai */ int res; /* Result of the comparison of pIn1 against pIn3 */ char affinity; /* Affinity to use for comparison */ + u16 flags1; /* Copy of initial value of pIn1->flags */ + u16 flags3; /* Copy of initial value of pIn3->flags */ #endif /* local variables moved into u.ai */ + pIn1 = &aMem[pOp->p1]; + pIn3 = &aMem[pOp->p3]; + u.ai.flags1 = pIn1->flags; + u.ai.flags3 = pIn3->flags; if( (pIn1->flags | pIn3->flags)&MEM_Null ){ /* One or both operands are NULL */ if( pOp->p5 & SQLITE_NULLEQ ){ @@ -53764,7 +61981,7 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */ ** The jump is taken if the SQLITE_JUMPIFNULL bit is set. */ if( pOp->p5 & SQLITE_STOREP2 ){ - pOut = &p->aMem[pOp->p2]; + pOut = &aMem[pOp->p2]; MemSetTypeFlag(pOut, MEM_Null); REGISTER_TRACE(pOp->p2, pOut); }else if( pOp->p5 & SQLITE_JUMPIFNULL ){ @@ -53796,13 +62013,18 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */ } if( pOp->p5 & SQLITE_STOREP2 ){ - pOut = &p->aMem[pOp->p2]; + pOut = &aMem[pOp->p2]; + memAboutToChange(p, pOut); MemSetTypeFlag(pOut, MEM_Int); pOut->u.i = u.ai.res; REGISTER_TRACE(pOp->p2, pOut); }else if( u.ai.res ){ pc = pOp->p2-1; } + + /* Undo any changes made by applyAffinity() to the input registers. */ + pIn1->flags = (pIn1->flags&~MEM_TypeMask) | (u.ai.flags1&MEM_TypeMask); + pIn3->flags = (pIn3->flags&~MEM_TypeMask) | (u.ai.flags3&MEM_TypeMask); break; } @@ -53824,8 +62046,8 @@ case OP_Permutation: { /* Opcode: Compare P1 P2 P3 P4 * ** -** Compare to vectors of registers in reg(P1)..reg(P1+P3-1) (all this -** one "A") and in reg(P2)..reg(P2+P3-1) ("B"). Save the result of +** Compare two vectors of registers in reg(P1)..reg(P1+P3-1) (call this +** vector "A") and in reg(P2)..reg(P2+P3-1) ("B"). Save the result of ** the comparison for use by the next OP_Jump instruct. ** ** P4 is a KeyInfo structure that defines collating sequences and sort @@ -53867,12 +62089,14 @@ case OP_Compare: { #endif /* SQLITE_DEBUG */ for(u.aj.i=0; u.aj.iaMem[u.aj.p1+u.aj.idx]); - REGISTER_TRACE(u.aj.p2+u.aj.idx, &p->aMem[u.aj.p2+u.aj.idx]); + assert( memIsValid(&aMem[u.aj.p1+u.aj.idx]) ); + assert( memIsValid(&aMem[u.aj.p2+u.aj.idx]) ); + REGISTER_TRACE(u.aj.p1+u.aj.idx, &aMem[u.aj.p1+u.aj.idx]); + REGISTER_TRACE(u.aj.p2+u.aj.idx, &aMem[u.aj.p2+u.aj.idx]); assert( u.aj.inField ); u.aj.pColl = u.aj.pKeyInfo->aColl[u.aj.i]; u.aj.bRev = u.aj.pKeyInfo->aSortOrder[u.aj.i]; - iCompare = sqlite3MemCompare(&p->aMem[u.aj.p1+u.aj.idx], &p->aMem[u.aj.p2+u.aj.idx], u.aj.pColl); + iCompare = sqlite3MemCompare(&aMem[u.aj.p1+u.aj.idx], &aMem[u.aj.p2+u.aj.idx], u.aj.pColl); if( iCompare ){ if( u.aj.bRev ) iCompare = -iCompare; break; @@ -53924,11 +62148,13 @@ case OP_Or: { /* same as TK_OR, in1, in2, out3 */ int v2; /* Right operand: 0==FALSE, 1==TRUE, 2==UNKNOWN or NULL */ #endif /* local variables moved into u.ak */ + pIn1 = &aMem[pOp->p1]; if( pIn1->flags & MEM_Null ){ u.ak.v1 = 2; }else{ u.ak.v1 = sqlite3VdbeIntValue(pIn1)!=0; } + pIn2 = &aMem[pOp->p2]; if( pIn2->flags & MEM_Null ){ u.ak.v2 = 2; }else{ @@ -53941,6 +62167,7 @@ case OP_Or: { /* same as TK_OR, in1, in2, out3 */ static const unsigned char or_logic[] = { 0, 1, 2, 1, 1, 1, 2, 1, 2 }; u.ak.v1 = or_logic[u.ak.v1*3+u.ak.v2]; } + pOut = &aMem[pOp->p3]; if( u.ak.v1==2 ){ MemSetTypeFlag(pOut, MEM_Null); }else{ @@ -53956,8 +62183,9 @@ case OP_Or: { /* same as TK_OR, in1, in2, out3 */ ** boolean complement in register P2. If the value in register P1 is ** NULL, then a NULL is stored in P2. */ -case OP_Not: { /* same as TK_NOT, in1 */ - pOut = &p->aMem[pOp->p2]; +case OP_Not: { /* same as TK_NOT, in1, out2 */ + pIn1 = &aMem[pOp->p1]; + pOut = &aMem[pOp->p2]; if( pIn1->flags & MEM_Null ){ sqlite3VdbeMemSetNull(pOut); }else{ @@ -53972,8 +62200,9 @@ case OP_Not: { /* same as TK_NOT, in1 */ ** ones-complement of the P1 value into register P2. If P1 holds ** a NULL then store a NULL in P2. */ -case OP_BitNot: { /* same as TK_BITNOT, in1 */ - pOut = &p->aMem[pOp->p2]; +case OP_BitNot: { /* same as TK_BITNOT, in1, out2 */ + pIn1 = &aMem[pOp->p1]; + pOut = &aMem[pOp->p2]; if( pIn1->flags & MEM_Null ){ sqlite3VdbeMemSetNull(pOut); }else{ @@ -53999,6 +62228,7 @@ case OP_IfNot: { /* jump, in1 */ #if 0 /* local variables moved into u.al */ int c; #endif /* local variables moved into u.al */ + pIn1 = &aMem[pOp->p1]; if( pIn1->flags & MEM_Null ){ u.al.c = pOp->p3; }else{ @@ -54020,6 +62250,7 @@ case OP_IfNot: { /* jump, in1 */ ** Jump to P2 if the value in register P1 is NULL. */ case OP_IsNull: { /* same as TK_ISNULL, jump, in1 */ + pIn1 = &aMem[pOp->p1]; if( (pIn1->flags & MEM_Null)!=0 ){ pc = pOp->p2 - 1; } @@ -54031,6 +62262,7 @@ case OP_IsNull: { /* same as TK_ISNULL, jump, in1 */ ** Jump to P2 if the value in register P1 is not NULL. */ case OP_NotNull: { /* same as TK_NOTNULL, jump, in1 */ + pIn1 = &aMem[pOp->p1]; if( (pIn1->flags & MEM_Null)==0 ){ pc = pOp->p2 - 1; } @@ -54076,7 +62308,7 @@ case OP_Column: { u8 *zIdx; /* Index into header */ u8 *zEndHdr; /* Pointer to first byte after the header */ u32 offset; /* Offset into the data */ - u64 offset64; /* 64-bit offset. 64 bits needed to catch overflow */ + u32 szField; /* Number of bytes in the content of a field */ int szHdr; /* Size of the header size field at start of record */ int avail; /* Number of bytes of available data */ Mem *pReg; /* PseudoTable input register */ @@ -54089,7 +62321,8 @@ case OP_Column: { memset(&u.am.sMem, 0, sizeof(u.am.sMem)); assert( u.am.p1nCursor ); assert( pOp->p3>0 && pOp->p3<=p->nMem ); - u.am.pDest = &p->aMem[pOp->p3]; + u.am.pDest = &aMem[pOp->p3]; + memAboutToChange(p, u.am.pDest); MemSetTypeFlag(u.am.pDest, MEM_Null); u.am.zRec = 0; @@ -54135,8 +62368,9 @@ case OP_Column: { assert( rc==SQLITE_OK ); /* DataSize() cannot fail */ } }else if( u.am.pC->pseudoTableReg>0 ){ - u.am.pReg = &p->aMem[u.am.pC->pseudoTableReg]; + u.am.pReg = &aMem[u.am.pC->pseudoTableReg]; assert( u.am.pReg->flags & MEM_Blob ); + assert( memIsValid(u.am.pReg) ); u.am.payloadSize = u.am.pReg->n; u.am.zRec = u.am.pReg->z; u.am.pC->cacheStatus = (pOp->p5&OPFLAG_CLEARCACHE) ? CACHE_STALE : p->cacheCtr; @@ -54252,12 +62486,16 @@ case OP_Column: { ** column and u.am.aOffset[u.am.i] will contain the u.am.offset from the beginning ** of the record to the start of the data for the u.am.i-th column */ - u.am.offset64 = u.am.offset; for(u.am.i=0; u.am.i u.am.zEndHdr)|| (u.am.offset64 > u.am.payloadSize) - || (u.am.zIdx==u.am.zEndHdr && u.am.offset64!=(u64)u.am.payloadSize) ){ + if( (u.am.zIdx > u.am.zEndHdr) || (u.am.offset > u.am.payloadSize) + || (u.am.zIdx==u.am.zEndHdr && u.am.offset!=u.am.payloadSize) ){ rc = SQLITE_CORRUPT_BKPT; goto op_column_out; } @@ -54347,30 +62585,29 @@ op_column_out: */ case OP_Affinity: { #if 0 /* local variables moved into u.an */ - char *zAffinity; /* The affinity to be applied */ - Mem *pData0; /* First register to which to apply affinity */ - Mem *pLast; /* Last register to which to apply affinity */ - Mem *pRec; /* Current register */ + const char *zAffinity; /* The affinity to be applied */ + char cAff; /* A single character of affinity */ #endif /* local variables moved into u.an */ u.an.zAffinity = pOp->p4.z; - u.an.pData0 = &p->aMem[pOp->p1]; - u.an.pLast = &u.an.pData0[pOp->p2-1]; - for(u.an.pRec=u.an.pData0; u.an.pRec<=u.an.pLast; u.an.pRec++){ - ExpandBlob(u.an.pRec); - applyAffinity(u.an.pRec, u.an.zAffinity[u.an.pRec-u.an.pData0], encoding); + assert( u.an.zAffinity!=0 ); + assert( u.an.zAffinity[pOp->p2]==0 ); + pIn1 = &aMem[pOp->p1]; + while( (u.an.cAff = *(u.an.zAffinity++))!=0 ){ + assert( pIn1 <= &p->aMem[p->nMem] ); + assert( memIsValid(pIn1) ); + ExpandBlob(pIn1); + applyAffinity(pIn1, u.an.cAff, encoding); + pIn1++; } break; } /* Opcode: MakeRecord P1 P2 P3 P4 * ** -** Convert P2 registers beginning with P1 into a single entry -** suitable for use as a data record in a database table or as a key -** in an index. The details of the format are irrelevant as long as -** the OP_Column opcode can decode the record later. -** Refer to source code comments for the details of the record -** format. +** Convert P2 registers beginning with P1 into the [record format] +** use as a data record in a database table or as a key +** in an index. The OP_Column opcode can decode the record later. ** ** P4 may be a string that is P2 characters long. The nth character of the ** string indicates the column affinity that should be used for the nth @@ -54422,15 +62659,21 @@ case OP_MakeRecord: { u.ao.nField = pOp->p1; u.ao.zAffinity = pOp->p4.z; assert( u.ao.nField>0 && pOp->p2>0 && pOp->p2+u.ao.nField<=p->nMem+1 ); - u.ao.pData0 = &p->aMem[u.ao.nField]; + u.ao.pData0 = &aMem[u.ao.nField]; u.ao.nField = pOp->p2; u.ao.pLast = &u.ao.pData0[u.ao.nField-1]; u.ao.file_format = p->minWriteFileFormat; + /* Identify the output register */ + assert( pOp->p3p1 || pOp->p3>=pOp->p1+pOp->p2 ); + pOut = &aMem[pOp->p3]; + memAboutToChange(p, pOut); + /* Loop through the elements that will make up the record to figure ** out how much space is required for the new record. */ for(u.ao.pRec=u.ao.pData0; u.ao.pRec<=u.ao.pLast; u.ao.pRec++){ + assert( memIsValid(u.ao.pRec) ); if( u.ao.zAffinity ){ applyAffinity(u.ao.pRec, u.ao.zAffinity[u.ao.pRec-u.ao.pData0], encoding); } @@ -54465,8 +62708,6 @@ case OP_MakeRecord: { ** be one of the input registers (because the following call to ** sqlite3VdbeMemGrow() could clobber the value before it is used). */ - assert( pOp->p3p1 || pOp->p3>=pOp->p1+pOp->p2 ); - pOut = &p->aMem[pOp->p3]; if( sqlite3VdbeMemGrow(pOut, (int)u.ao.nByte, 0) ){ goto no_mem; } @@ -54515,7 +62756,6 @@ case OP_Count: { /* out2-prerelease */ }else{ u.ap.nEntry = 0; } - pOut->flags = MEM_Int; pOut->u.i = u.ap.nEntry; break; } @@ -54640,6 +62880,7 @@ case OP_Savepoint: { if( u.aq.p1==SAVEPOINT_ROLLBACK && (db->flags&SQLITE_InternChanges)!=0 ){ sqlite3ExpirePreparedStatements(db); sqlite3ResetInternalSchema(db, 0); + db->flags = (db->flags | SQLITE_InternChanges); } } @@ -54844,7 +63085,6 @@ case OP_ReadCookie: { /* out2-prerelease */ sqlite3BtreeGetMeta(db->aDb[u.at.iDb].pBt, u.at.iCookie, (u32 *)&u.at.iMeta); pOut->u.i = u.at.iMeta; - MemSetTypeFlag(pOut, MEM_Int); break; } @@ -54867,6 +63107,7 @@ case OP_SetCookie: { /* in3 */ assert( (p->btreeMask & (1<p1))!=0 ); u.au.pDb = &db->aDb[pOp->p1]; assert( u.au.pDb->pBt!=0 ); + pIn3 = &aMem[pOp->p3]; sqlite3VdbeMemIntegerify(pIn3); /* See note about index shifting on OP_ReadCookie */ rc = sqlite3BtreeUpdateMeta(u.au.pDb->pBt, pOp->p2, (int)pIn3->u.i); @@ -55029,7 +63270,9 @@ case OP_OpenWrite: { if( pOp->p5 ){ assert( u.aw.p2>0 ); assert( u.aw.p2<=p->nMem ); - pIn2 = &p->aMem[u.aw.p2]; + pIn2 = &aMem[u.aw.p2]; + assert( memIsValid(pIn2) ); + assert( (pIn2->flags & MEM_Int)!=0 ); sqlite3VdbeMemIntegerify(pIn2); u.aw.p2 = (int)pIn2->u.i; /* The u.aw.p2 value always comes from a prior OP_CreateTable opcode and @@ -55052,6 +63295,7 @@ case OP_OpenWrite: { u.aw.pCur = allocateCursor(p, pOp->p1, u.aw.nField, u.aw.iDb, 1); if( u.aw.pCur==0 ) goto no_mem; u.aw.pCur->nullRow = 1; + u.aw.pCur->isOrdered = 1; rc = sqlite3BtreeCursor(u.aw.pX, u.aw.p2, u.aw.wrFlag, u.aw.pKeyInfo, u.aw.pCur->pCursor); u.aw.pCur->pKeyInfo = u.aw.pKeyInfo; @@ -55078,10 +63322,10 @@ case OP_OpenWrite: { ** ** Open a new cursor P1 to a transient table. ** The cursor is always opened read/write even if -** the main database is read-only. The transient or virtual +** the main database is read-only. The ephemeral ** table is deleted automatically when the cursor is closed. ** -** P2 is the number of columns in the virtual table. +** P2 is the number of columns in the ephemeral table. ** The cursor points to a BTree table if P4==0 and to a BTree index ** if P4 is not 0. If P4 is not NULL, it points to a KeyInfo structure ** that defines the format of keys in the index. @@ -55092,11 +63336,19 @@ case OP_OpenWrite: { ** this opcode. Then this opcode was call OpenVirtual. But ** that created confusion with the whole virtual-table idea. */ +/* Opcode: OpenAutoindex P1 P2 * P4 * +** +** This opcode works the same as OP_OpenEphemeral. It has a +** different name to distinguish its use. Tables created using +** by this opcode will be used for automatically created transient +** indices in joins. +*/ +case OP_OpenAutoindex: case OP_OpenEphemeral: { #if 0 /* local variables moved into u.ax */ VdbeCursor *pCx; #endif /* local variables moved into u.ax */ - static const int openFlags = + static const int vfsFlags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | @@ -55107,21 +63359,21 @@ case OP_OpenEphemeral: { u.ax.pCx = allocateCursor(p, pOp->p1, pOp->p2, -1, 1); if( u.ax.pCx==0 ) goto no_mem; u.ax.pCx->nullRow = 1; - rc = sqlite3BtreeFactory(db, 0, 1, SQLITE_DEFAULT_TEMP_CACHE_SIZE, openFlags, - &u.ax.pCx->pBt); + rc = sqlite3BtreeOpen(0, db, &u.ax.pCx->pBt, + BTREE_OMIT_JOURNAL | BTREE_SINGLE | pOp->p5, vfsFlags); if( rc==SQLITE_OK ){ rc = sqlite3BtreeBeginTrans(u.ax.pCx->pBt, 1); } if( rc==SQLITE_OK ){ /* If a transient index is required, create it by calling - ** sqlite3BtreeCreateTable() with the BTREE_ZERODATA flag before + ** sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before ** opening it. If a transient table is required, just use the - ** automatically created table with root-page 1 (an INTKEY table). + ** automatically created table with root-page 1 (an BLOB_INTKEY table). */ if( pOp->p4.pKeyInfo ){ int pgno; assert( pOp->p4type==P4_KEYINFO ); - rc = sqlite3BtreeCreateTable(u.ax.pCx->pBt, &pgno, BTREE_ZERODATA); + rc = sqlite3BtreeCreateTable(u.ax.pCx->pBt, &pgno, BTREE_BLOBKEY); if( rc==SQLITE_OK ){ assert( pgno==MASTER_ROOT+1 ); rc = sqlite3BtreeCursor(u.ax.pCx->pBt, pgno, 1, @@ -55135,6 +63387,7 @@ case OP_OpenEphemeral: { u.ax.pCx->isTable = 1; } } + u.ax.pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED); u.ax.pCx->isIndex = !u.ax.pCx->isTable; break; } @@ -55146,7 +63399,7 @@ case OP_OpenEphemeral: { ** register P2. In other words, cursor P1 becomes an alias for the ** MEM_Blob content contained in register P2. ** -** A pseudo-table created by this opcode is used to hold the a single +** A pseudo-table created by this opcode is used to hold a single ** row output from the sorter so that the row can be decomposed into ** individual columns using the OP_Column opcode. The OP_Column opcode ** is the only cursor opcode that works with a pseudo-table. @@ -55251,6 +63504,10 @@ case OP_SeekGt: { /* jump, in3 */ u.az.pC = p->apCsr[pOp->p1]; assert( u.az.pC!=0 ); assert( u.az.pC->pseudoTableReg==0 ); + assert( OP_SeekLe == OP_SeekLt+1 ); + assert( OP_SeekGe == OP_SeekLt+2 ); + assert( OP_SeekGt == OP_SeekLt+3 ); + assert( u.az.pC->isOrdered ); if( u.az.pC->pCursor!=0 ){ u.az.oc = pOp->opcode; u.az.pC->nullRow = 0; @@ -55258,6 +63515,7 @@ case OP_SeekGt: { /* jump, in3 */ /* The input value in P3 might be of any type: integer, real, string, ** blob, or NULL. But it needs to be an integer before we can do ** the seek, so covert it. */ + pIn3 = &aMem[pOp->p3]; applyNumericAffinity(pIn3); u.az.iKey = sqlite3VdbeIntValue(pIn3); u.az.pC->rowidIsValid = 0; @@ -55280,12 +63538,12 @@ case OP_SeekGt: { /* jump, in3 */ ** integer. */ u.az.res = 1; if( pIn3->r<0 ){ - if( u.az.oc==OP_SeekGt || u.az.oc==OP_SeekGe ){ + if( u.az.oc>=OP_SeekGe ){ assert( u.az.oc==OP_SeekGe || u.az.oc==OP_SeekGt ); rc = sqlite3BtreeFirst(u.az.pC->pCursor, &u.az.res); if( rc!=SQLITE_OK ) goto abort_due_to_error; } }else{ - if( u.az.oc==OP_SeekLt || u.az.oc==OP_SeekLe ){ + if( u.az.oc<=OP_SeekLe ){ assert( u.az.oc==OP_SeekLt || u.az.oc==OP_SeekLe ); rc = sqlite3BtreeLast(u.az.pC->pCursor, &u.az.res); if( rc!=SQLITE_OK ) goto abort_due_to_error; } @@ -55317,12 +63575,25 @@ case OP_SeekGt: { /* jump, in3 */ assert( u.az.nField>0 ); u.az.r.pKeyInfo = u.az.pC->pKeyInfo; u.az.r.nField = (u16)u.az.nField; - if( u.az.oc==OP_SeekGt || u.az.oc==OP_SeekLe ){ - u.az.r.flags = UNPACKED_INCRKEY; - }else{ - u.az.r.flags = 0; - } - u.az.r.aMem = &p->aMem[pOp->p3]; + + /* The next line of code computes as follows, only faster: + ** if( u.az.oc==OP_SeekGt || u.az.oc==OP_SeekLe ){ + ** u.az.r.flags = UNPACKED_INCRKEY; + ** }else{ + ** u.az.r.flags = 0; + ** } + */ + u.az.r.flags = (u16)(UNPACKED_INCRKEY * (1 & (u.az.oc - OP_SeekLt))); + assert( u.az.oc!=OP_SeekGt || u.az.r.flags==UNPACKED_INCRKEY ); + assert( u.az.oc!=OP_SeekLe || u.az.r.flags==UNPACKED_INCRKEY ); + assert( u.az.oc!=OP_SeekGe || u.az.r.flags==0 ); + assert( u.az.oc!=OP_SeekLt || u.az.r.flags==0 ); + + u.az.r.aMem = &aMem[pOp->p3]; +#ifdef SQLITE_DEBUG + { int i; for(i=0; ipCursor, &u.az.r, 0, 0, &u.az.res); if( rc!=SQLITE_OK ){ goto abort_due_to_error; @@ -55334,7 +63605,7 @@ case OP_SeekGt: { /* jump, in3 */ #ifdef SQLITE_TEST sqlite3_search_count++; #endif - if( u.az.oc==OP_SeekGe || u.az.oc==OP_SeekGt ){ + if( u.az.oc>=OP_SeekGe ){ assert( u.az.oc==OP_SeekGe || u.az.oc==OP_SeekGt ); if( u.az.res<0 || (u.az.res==0 && u.az.oc==OP_SeekGt) ){ rc = sqlite3BtreeNext(u.az.pC->pCursor, &u.az.res); if( rc!=SQLITE_OK ) goto abort_due_to_error; @@ -55389,6 +63660,7 @@ case OP_Seek: { /* in2 */ if( ALWAYS(u.ba.pC->pCursor!=0) ){ assert( u.ba.pC->isTable ); u.ba.pC->nullRow = 0; + pIn2 = &aMem[pOp->p2]; u.ba.pC->movetoTarget = sqlite3VdbeIntValue(pIn2); u.ba.pC->rowidIsValid = 0; u.ba.pC->deferredMoveto = 1; @@ -55397,33 +63669,27 @@ case OP_Seek: { /* in2 */ } -/* Opcode: Found P1 P2 P3 * * +/* Opcode: Found P1 P2 P3 P4 * ** -** Register P3 holds a blob constructed by MakeRecord. P1 is an index. -** If an entry that matches the value in register p3 exists in P1 then -** jump to P2. If the P3 value does not match any entry in P1 -** then fall thru. The P1 cursor is left pointing at the matching entry -** if it exists. +** If P4==0 then register P3 holds a blob constructed by MakeRecord. If +** P4>0 then register P3 is the first of P4 registers that form an unpacked +** record. ** -** This instruction is used to implement the IN operator where the -** left-hand side is a SELECT statement. P1 may be a true index, or it -** may be a temporary index that holds the results of the SELECT -** statement. This instruction is also used to implement the -** DISTINCT keyword in SELECT statements. -** -** This instruction checks if index P1 contains a record for which -** the first N serialized values exactly match the N serialized values -** in the record in register P3, where N is the total number of values in -** the P3 record (the P3 record is a prefix of the P1 record). -** -** See also: NotFound, IsUnique, NotExists +** Cursor P1 is on an index btree. If the record identified by P3 and P4 +** is a prefix of any entry in P1 then a jump is made to P2 and +** P1 is left pointing at the matching entry. */ -/* Opcode: NotFound P1 P2 P3 * * +/* Opcode: NotFound P1 P2 P3 P4 * ** -** Register P3 holds a blob constructed by MakeRecord. P1 is -** an index. If no entry exists in P1 that matches the blob then jump -** to P2. If an entry does existing, fall through. The cursor is left -** pointing to the entry that matches. +** If P4==0 then register P3 holds a blob constructed by MakeRecord. If +** P4>0 then register P3 is the first of P4 registers that form an unpacked +** record. +** +** Cursor P1 is on an index btree. If the record identified by P3 and P4 +** is not the prefix of any entry in P1 then a jump is made to P2. If P1 +** does contain an entry whose prefix matches the P3/P4 record then control +** falls through to the next instruction and P1 is left pointing at the +** matching entry. ** ** See also: Found, NotExists, IsUnique */ @@ -55434,6 +63700,7 @@ case OP_Found: { /* jump, in3 */ VdbeCursor *pC; int res; UnpackedRecord *pIdxKey; + UnpackedRecord r; char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7]; #endif /* local variables moved into u.bb */ @@ -55443,23 +63710,36 @@ case OP_Found: { /* jump, in3 */ u.bb.alreadyExists = 0; assert( pOp->p1>=0 && pOp->p1nCursor ); + assert( pOp->p4type==P4_INT32 ); u.bb.pC = p->apCsr[pOp->p1]; assert( u.bb.pC!=0 ); + pIn3 = &aMem[pOp->p3]; if( ALWAYS(u.bb.pC->pCursor!=0) ){ assert( u.bb.pC->isTable==0 ); - assert( pIn3->flags & MEM_Blob ); - ExpandBlob(pIn3); - u.bb.pIdxKey = sqlite3VdbeRecordUnpack(u.bb.pC->pKeyInfo, pIn3->n, pIn3->z, - u.bb.aTempRec, sizeof(u.bb.aTempRec)); - if( u.bb.pIdxKey==0 ){ - goto no_mem; - } - if( pOp->opcode==OP_Found ){ + if( pOp->p4.i>0 ){ + u.bb.r.pKeyInfo = u.bb.pC->pKeyInfo; + u.bb.r.nField = (u16)pOp->p4.i; + u.bb.r.aMem = pIn3; +#ifdef SQLITE_DEBUG + { int i; for(i=0; iflags & MEM_Blob ); + assert( (pIn3->flags & MEM_Zero)==0 ); /* zeroblobs already expanded */ + u.bb.pIdxKey = sqlite3VdbeRecordUnpack(u.bb.pC->pKeyInfo, pIn3->n, pIn3->z, + u.bb.aTempRec, sizeof(u.bb.aTempRec)); + if( u.bb.pIdxKey==0 ){ + goto no_mem; + } u.bb.pIdxKey->flags |= UNPACKED_PREFIX_MATCH; } rc = sqlite3BtreeMovetoUnpacked(u.bb.pC->pCursor, u.bb.pIdxKey, 0, 0, &u.bb.res); - sqlite3VdbeDeleteUnpackedRecord(u.bb.pIdxKey); + if( pOp->p4.i==0 ){ + sqlite3VdbeDeleteUnpackedRecord(u.bb.pIdxKey); + } if( rc!=SQLITE_OK ){ break; } @@ -55477,9 +63757,10 @@ case OP_Found: { /* jump, in3 */ /* Opcode: IsUnique P1 P2 P3 P4 * ** -** Cursor P1 is open on an index. So it has no data and its key consists -** of a record generated by OP_MakeRecord where the last field is the -** rowid of the entry that the index refers to. +** Cursor P1 is open on an index b-tree - that is to say, a btree which +** no data and where the key are records generated by OP_MakeRecord with +** the list field being the integer ROWID of the entry that the index +** entry refers to. ** ** The P3 register contains an integer record number. Call this record ** number R. Register P4 is the first in a set of N contiguous registers @@ -55506,12 +63787,13 @@ case OP_IsUnique: { /* jump, in3 */ VdbeCursor *pCx; BtCursor *pCrsr; u16 nField; - Mem *aMem; + Mem *aMx; UnpackedRecord r; /* B-Tree index search key */ i64 R; /* Rowid stored in register P3 */ #endif /* local variables moved into u.bc */ - u.bc.aMem = &p->aMem[pOp->p4.i]; + pIn3 = &aMem[pOp->p3]; + u.bc.aMx = &aMem[pOp->p4.i]; /* Assert that the values of parameters P1 and P4 are in range. */ assert( pOp->p4type==P4_INT32 ); assert( pOp->p4.i>0 && pOp->p4.i<=p->nMem ); @@ -55527,20 +63809,23 @@ case OP_IsUnique: { /* jump, in3 */ /* If any of the values are NULL, take the jump. */ u.bc.nField = u.bc.pCx->pKeyInfo->nField; for(u.bc.ii=0; u.bc.iip2 - 1; u.bc.pCrsr = 0; break; } } - assert( (u.bc.aMem[u.bc.nField].flags & MEM_Null)==0 ); + assert( (u.bc.aMx[u.bc.nField].flags & MEM_Null)==0 ); if( u.bc.pCrsr!=0 ){ /* Populate the index search key. */ u.bc.r.pKeyInfo = u.bc.pCx->pKeyInfo; u.bc.r.nField = u.bc.nField + 1; u.bc.r.flags = UNPACKED_PREFIX_SEARCH; - u.bc.r.aMem = u.bc.aMem; + u.bc.r.aMem = u.bc.aMx; +#ifdef SQLITE_DEBUG + { int i; for(i=0; ip3]; assert( pIn3->flags & MEM_Int ); assert( pOp->p1>=0 && pOp->p1nCursor ); u.bd.pC = p->apCsr[pOp->p1]; @@ -55624,7 +63910,6 @@ case OP_Sequence: { /* out2-prerelease */ assert( pOp->p1>=0 && pOp->p1nCursor ); assert( p->apCsr[pOp->p1]!=0 ); pOut->u.i = p->apCsr[pOp->p1]->seqCount++; - MemSetTypeFlag(pOut, MEM_Int); break; } @@ -55695,7 +63980,7 @@ case OP_NewRowid: { /* out2-prerelease */ goto abort_due_to_error; } if( u.be.res ){ - u.be.v = 1; + u.be.v = 1; /* IMP: R-61914-48074 */ }else{ assert( sqlite3BtreeCursorIsValid(u.be.pC->pCursor) ); rc = sqlite3BtreeKeySize(u.be.pC->pCursor, &u.be.v); @@ -55703,7 +63988,7 @@ case OP_NewRowid: { /* out2-prerelease */ if( u.be.v==MAX_ROWID ){ u.be.pC->useRandomRowid = 1; }else{ - u.be.v++; + u.be.v++; /* IMP: R-29538-34987 */ } } } @@ -55720,14 +64005,16 @@ case OP_NewRowid: { /* out2-prerelease */ }else{ /* Assert that P3 is a valid memory cell. */ assert( pOp->p3<=p->nMem ); - u.be.pMem = &p->aMem[pOp->p3]; + u.be.pMem = &aMem[pOp->p3]; + memAboutToChange(p, u.be.pMem); } + assert( memIsValid(u.be.pMem) ); REGISTER_TRACE(pOp->p3, u.be.pMem); sqlite3VdbeMemIntegerify(u.be.pMem); assert( (u.be.pMem->flags & MEM_Int)!=0 ); /* mem(P3) holds an integer */ if( u.be.pMem->u.i==MAX_ROWID || u.be.pC->useRandomRowid ){ - rc = SQLITE_FULL; + rc = SQLITE_FULL; /* IMP: R-12275-61338 */ goto abort_due_to_error; } if( u.be.vu.i+1 ){ @@ -55740,30 +64027,41 @@ case OP_NewRowid: { /* out2-prerelease */ sqlite3BtreeSetCachedRowid(u.be.pC->pCursor, u.be.vuseRandomRowid ){ + /* IMPLEMENTATION-OF: R-07677-41881 If the largest ROWID is equal to the + ** largest possible integer (9223372036854775807) then the database + ** engine starts picking positive candidate ROWIDs at random until + ** it finds one that is not previously used. */ assert( pOp->p3==0 ); /* We cannot be in random rowid mode if this is ** an AUTOINCREMENT table. */ + /* on the first attempt, simply do one more than previous */ u.be.v = db->lastRowid; + u.be.v &= (MAX_ROWID>>1); /* ensure doesn't go negative */ + u.be.v++; /* ensure non-zero */ u.be.cnt = 0; - do{ - if( u.be.cnt==0 && (u.be.v&0xffffff)==u.be.v ){ - u.be.v++; + while( ((rc = sqlite3BtreeMovetoUnpacked(u.be.pC->pCursor, 0, (u64)u.be.v, + 0, &u.be.res))==SQLITE_OK) + && (u.be.res==0) + && (++u.be.cnt<100)){ + /* collision - try another random rowid */ + sqlite3_randomness(sizeof(u.be.v), &u.be.v); + if( u.be.cnt<5 ){ + /* try "small" random rowids for the initial attempts */ + u.be.v &= 0xffffff; }else{ - sqlite3_randomness(sizeof(u.be.v), &u.be.v); - if( u.be.cnt<5 ) u.be.v &= 0xffffff; + u.be.v &= (MAX_ROWID>>1); /* ensure doesn't go negative */ } - rc = sqlite3BtreeMovetoUnpacked(u.be.pC->pCursor, 0, (u64)u.be.v, 0, &u.be.res); - u.be.cnt++; - }while( u.be.cnt<100 && rc==SQLITE_OK && u.be.res==0 ); + u.be.v++; /* ensure non-zero */ + } if( rc==SQLITE_OK && u.be.res==0 ){ - rc = SQLITE_FULL; + rc = SQLITE_FULL; /* IMP: R-38219-53002 */ goto abort_due_to_error; } + assert( u.be.v>0 ); /* EV: R-40812-03570 */ } u.be.pC->rowidIsValid = 0; u.be.pC->deferredMoveto = 0; u.be.pC->cacheStatus = CACHE_STALE; } - MemSetTypeFlag(pOut, MEM_Int); pOut->u.i = u.be.v; break; } @@ -55826,8 +64124,9 @@ case OP_InsertInt: { int op; /* Opcode for update hook: SQLITE_UPDATE or SQLITE_INSERT */ #endif /* local variables moved into u.bf */ - u.bf.pData = &p->aMem[pOp->p2]; + u.bf.pData = &aMem[pOp->p2]; assert( pOp->p1>=0 && pOp->p1nCursor ); + assert( memIsValid(u.bf.pData) ); u.bf.pC = p->apCsr[pOp->p1]; assert( u.bf.pC!=0 ); assert( u.bf.pC->pCursor!=0 ); @@ -55836,8 +64135,9 @@ case OP_InsertInt: { REGISTER_TRACE(pOp->p2, u.bf.pData); if( pOp->opcode==OP_Insert ){ - u.bf.pKey = &p->aMem[pOp->p3]; + u.bf.pKey = &aMem[pOp->p3]; assert( u.bf.pKey->flags & MEM_Int ); + assert( memIsValid(u.bf.pKey) ); REGISTER_TRACE(pOp->p3, u.bf.pKey); u.bf.iKey = u.bf.pKey->u.i; }else{ @@ -55988,7 +64288,8 @@ case OP_RowData: { i64 n64; #endif /* local variables moved into u.bh */ - pOut = &p->aMem[pOp->p2]; + pOut = &aMem[pOp->p2]; + memAboutToChange(p, pOut); /* Note that RowKey and RowData are really exactly the same instruction */ assert( pOp->p1>=0 && pOp->p1nCursor ); @@ -56063,7 +64364,7 @@ case OP_Rowid: { /* out2-prerelease */ assert( u.bi.pC!=0 ); assert( u.bi.pC->pseudoTableReg==0 ); if( u.bi.pC->nullRow ){ - /* Do nothing so that reg[P2] remains NULL */ + pOut->flags = MEM_Null; break; }else if( u.bi.pC->deferredMoveto ){ u.bi.v = u.bi.pC->movetoTarget; @@ -56072,12 +64373,8 @@ case OP_Rowid: { /* out2-prerelease */ u.bi.pVtab = u.bi.pC->pVtabCursor->pVtab; u.bi.pModule = u.bi.pVtab->pModule; assert( u.bi.pModule->xRowid ); - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; rc = u.bi.pModule->xRowid(u.bi.pC->pVtabCursor, &u.bi.v); - sqlite3DbFree(db, p->zErrMsg); - p->zErrMsg = u.bi.pVtab->zErrMsg; - u.bi.pVtab->zErrMsg = 0; - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; + importVtabErrMsg(p, u.bi.pVtab); #endif /* SQLITE_OMIT_VIRTUALTABLE */ }else{ assert( u.bi.pC->pCursor!=0 ); @@ -56091,7 +64388,6 @@ case OP_Rowid: { /* out2-prerelease */ } } pOut->u.i = u.bi.v; - MemSetTypeFlag(pOut, MEM_Int); break; } @@ -56190,14 +64486,13 @@ case OP_Rewind: { /* jump */ assert( pOp->p1>=0 && pOp->p1nCursor ); u.bl.pC = p->apCsr[pOp->p1]; assert( u.bl.pC!=0 ); + u.bl.res = 1; if( (u.bl.pCrsr = u.bl.pC->pCursor)!=0 ){ rc = sqlite3BtreeFirst(u.bl.pCrsr, &u.bl.res); u.bl.pC->atFirst = u.bl.res==0 ?1:0; u.bl.pC->deferredMoveto = 0; u.bl.pC->cacheStatus = CACHE_STALE; u.bl.pC->rowidIsValid = 0; - }else{ - u.bl.res = 1; } u.bl.pC->nullRow = (u8)u.bl.res; assert( pOp->p2>0 && pOp->p2nOp ); @@ -56207,7 +64502,7 @@ case OP_Rewind: { /* jump */ break; } -/* Opcode: Next P1 P2 * * * +/* Opcode: Next P1 P2 * * P5 ** ** Advance cursor P1 so that it points to the next key/data pair in its ** table or index. If there are no more key/value pairs then fall through @@ -56216,9 +64511,12 @@ case OP_Rewind: { /* jump */ ** ** The P1 cursor must be for a real table, not a pseudo-table. ** +** If P5 is positive and the jump is taken, then event counter +** number P5-1 in the prepared statement is incremented. +** ** See also: Prev */ -/* Opcode: Prev P1 P2 * * * +/* Opcode: Prev P1 P2 * * P5 ** ** Back up cursor P1 so that it points to the previous key/data pair in its ** table or index. If there is no previous key/value pairs then fall through @@ -56226,6 +64524,9 @@ case OP_Rewind: { /* jump */ ** jump immediately to P2. ** ** The P1 cursor must be for a real table, not a pseudo-table. +** +** If P5 is positive and the jump is taken, then event counter +** number P5-1 in the prepared statement is incremented. */ case OP_Prev: /* jump */ case OP_Next: { /* jump */ @@ -56237,6 +64538,7 @@ case OP_Next: { /* jump */ CHECK_FOR_INTERRUPT; assert( pOp->p1>=0 && pOp->p1nCursor ); + assert( pOp->p5<=ArraySize(p->aCounter) ); u.bm.pC = p->apCsr[pOp->p1]; if( u.bm.pC==0 ){ break; /* See ticket #2273 */ @@ -56286,6 +64588,7 @@ case OP_IdxInsert: { /* in2 */ assert( pOp->p1>=0 && pOp->p1nCursor ); u.bn.pC = p->apCsr[pOp->p1]; assert( u.bn.pC!=0 ); + pIn2 = &aMem[pOp->p2]; assert( pIn2->flags & MEM_Blob ); u.bn.pCrsr = u.bn.pC->pCursor; if( ALWAYS(u.bn.pCrsr!=0) ){ @@ -56328,7 +64631,10 @@ case OP_IdxDelete: { u.bo.r.pKeyInfo = u.bo.pC->pKeyInfo; u.bo.r.nField = (u16)pOp->p3; u.bo.r.flags = 0; - u.bo.r.aMem = &p->aMem[pOp->p2]; + u.bo.r.aMem = &aMem[pOp->p2]; +#ifdef SQLITE_DEBUG + { int i; for(i=0; iapCsr[pOp->p1]; assert( u.bp.pC!=0 ); u.bp.pCrsr = u.bp.pC->pCursor; + pOut->flags = MEM_Null; if( ALWAYS(u.bp.pCrsr!=0) ){ rc = sqlite3VdbeCursorMoveto(u.bp.pC); if( NEVER(rc) ) goto abort_due_to_error; @@ -56368,8 +64675,8 @@ case OP_IdxRowid: { /* out2-prerelease */ if( rc!=SQLITE_OK ){ goto abort_due_to_error; } - MemSetTypeFlag(pOut, MEM_Int); pOut->u.i = u.bp.rowid; + pOut->flags = MEM_Int; } } break; @@ -56389,7 +64696,7 @@ case OP_IdxRowid: { /* out2-prerelease */ ** that if the key from register P3 is a prefix of the key in the cursor, ** the result is false whereas it would be true with IdxGT. */ -/* Opcode: IdxLT P1 P2 P3 * P5 +/* Opcode: IdxLT P1 P2 P3 P4 P5 ** ** The P4 register values beginning with P3 form an unpacked index ** key that omits the ROWID. Compare this key value against the index @@ -56401,8 +64708,8 @@ case OP_IdxRowid: { /* out2-prerelease */ ** If P5 is non-zero then the key value is increased by an epsilon prior ** to the comparison. This makes the opcode work like IdxLE. */ -case OP_IdxLT: /* jump, in3 */ -case OP_IdxGE: { /* jump, in3 */ +case OP_IdxLT: /* jump */ +case OP_IdxGE: { /* jump */ #if 0 /* local variables moved into u.bq */ VdbeCursor *pC; int res; @@ -56412,6 +64719,7 @@ case OP_IdxGE: { /* jump, in3 */ assert( pOp->p1>=0 && pOp->p1nCursor ); u.bq.pC = p->apCsr[pOp->p1]; assert( u.bq.pC!=0 ); + assert( u.bq.pC->isOrdered ); if( ALWAYS(u.bq.pC->pCursor!=0) ){ assert( u.bq.pC->deferredMoveto==0 ); assert( pOp->p5==0 || pOp->p5==1 ); @@ -56423,7 +64731,10 @@ case OP_IdxGE: { /* jump, in3 */ }else{ u.bq.r.flags = UNPACKED_IGNORE_ROWID; } - u.bq.r.aMem = &p->aMem[pOp->p3]; + u.bq.r.aMem = &aMem[pOp->p3]; +#ifdef SQLITE_DEBUG + { int i; for(i=0; iopcode==OP_IdxLT ){ u.bq.res = -u.bq.res; @@ -56475,6 +64786,7 @@ case OP_Destroy: { /* out2-prerelease */ #else u.br.iCnt = db->activeVdbeCnt; #endif + pOut->flags = MEM_Null; if( u.br.iCnt>1 ){ rc = SQLITE_LOCKED; p->errorAction = OE_Abort; @@ -56483,11 +64795,12 @@ case OP_Destroy: { /* out2-prerelease */ assert( u.br.iCnt==1 ); assert( (p->btreeMask & (1<aDb[u.br.iDb].pBt, pOp->p1, &u.br.iMoved); - MemSetTypeFlag(pOut, MEM_Int); + pOut->flags = MEM_Int; pOut->u.i = u.br.iMoved; #ifndef SQLITE_OMIT_AUTOVACUUM if( rc==SQLITE_OK && u.br.iMoved!=0 ){ sqlite3RootPageMoved(&db->aDb[u.br.iDb], u.br.iMoved, pOp->p1); + resetSchemaOnFault = 1; } #endif } @@ -56525,7 +64838,9 @@ case OP_Clear: { if( pOp->p3 ){ p->nChange += u.bs.nChange; if( pOp->p3>0 ){ - p->aMem[pOp->p3].u.i += u.bs.nChange; + assert( memIsValid(&aMem[pOp->p3]) ); + memAboutToChange(p, &aMem[pOp->p3]); + aMem[pOp->p3].u.i += u.bs.nChange; } } break; @@ -56568,13 +64883,12 @@ case OP_CreateTable: { /* out2-prerelease */ assert( u.bt.pDb->pBt!=0 ); if( pOp->opcode==OP_CreateTable ){ /* u.bt.flags = BTREE_INTKEY; */ - u.bt.flags = BTREE_LEAFDATA|BTREE_INTKEY; + u.bt.flags = BTREE_INTKEY; }else{ - u.bt.flags = BTREE_ZERODATA; + u.bt.flags = BTREE_BLOBKEY; } rc = sqlite3BtreeCreateTable(u.bt.pDb->pBt, &u.bt.pgno, u.bt.flags); pOut->u.i = u.bt.pgno; - MemSetTypeFlag(pOut, MEM_Int); break; } @@ -56618,7 +64932,7 @@ case OP_ParseSchema: { ** u.bu.iDb mutex may be temporarily released to avoid deadlock. If ** this happens, then some other thread may delete the in-memory ** schema of database u.bu.iDb before the SQL statement runs. The schema - ** will not be reloaded because the db->init.busy flag is set. This + ** will not be reloaded becuase the db->init.busy flag is set. This ** can result in a "no such table: sqlite_master" or "malformed ** database schema" error being returned to the user. */ @@ -56630,12 +64944,11 @@ case OP_ParseSchema: { u.bu.initData.iDb = pOp->p1; u.bu.initData.pzErrMsg = &p->zErrMsg; u.bu.zSql = sqlite3MPrintf(db, - "SELECT name, rootpage, sql FROM '%q'.%s WHERE %s", + "SELECT name, rootpage, sql FROM '%q'.%s WHERE %s ORDER BY rowid", db->aDb[u.bu.iDb].zName, u.bu.zMaster, pOp->p4.z); if( u.bu.zSql==0 ){ rc = SQLITE_NOMEM; }else{ - (void)sqlite3SafetyOff(db); assert( db->init.busy==0 ); db->init.busy = 1; u.bu.initData.rc = SQLITE_OK; @@ -56644,7 +64957,6 @@ case OP_ParseSchema: { if( rc==SQLITE_OK ) rc = u.bu.initData.rc; sqlite3DbFree(db, u.bu.zSql); db->init.busy = 0; - (void)sqlite3SafetyOn(db); } } sqlite3BtreeLeaveAll(db); @@ -56741,10 +65053,10 @@ case OP_IntegrityCk: { u.bv.aRoot = sqlite3DbMallocRaw(db, sizeof(int)*(u.bv.nRoot+1) ); if( u.bv.aRoot==0 ) goto no_mem; assert( pOp->p3>0 && pOp->p3<=p->nMem ); - u.bv.pnErr = &p->aMem[pOp->p3]; + u.bv.pnErr = &aMem[pOp->p3]; assert( (u.bv.pnErr->flags & MEM_Int)!=0 ); assert( (u.bv.pnErr->flags & (MEM_Str|MEM_Blob))==0 ); - pIn1 = &p->aMem[pOp->p1]; + pIn1 = &aMem[pOp->p1]; for(u.bv.j=0; u.bv.jp1>0 && pOp->p1<=p->nMem ); - u.bw.pIdx = &p->aMem[pOp->p1]; - assert( pOp->p2>0 && pOp->p2<=p->nMem ); - u.bw.pVal = &p->aMem[pOp->p2]; - assert( (u.bw.pVal->flags & MEM_Int)!=0 ); - if( (u.bw.pIdx->flags & MEM_RowSet)==0 ){ - sqlite3VdbeMemSetRowSet(u.bw.pIdx); - if( (u.bw.pIdx->flags & MEM_RowSet)==0 ) goto no_mem; +case OP_RowSetAdd: { /* in1, in2 */ + pIn1 = &aMem[pOp->p1]; + pIn2 = &aMem[pOp->p2]; + assert( (pIn2->flags & MEM_Int)!=0 ); + if( (pIn1->flags & MEM_RowSet)==0 ){ + sqlite3VdbeMemSetRowSet(pIn1); + if( (pIn1->flags & MEM_RowSet)==0 ) goto no_mem; } - sqlite3RowSetInsert(u.bw.pIdx->u.pRowSet, u.bw.pVal->u.i); + sqlite3RowSetInsert(pIn1->u.pRowSet, pIn2->u.i); break; } @@ -56800,25 +65106,21 @@ case OP_RowSetAdd: { /* in2 */ ** register P3. Or, if boolean index P1 is initially empty, leave P3 ** unchanged and jump to instruction P2. */ -case OP_RowSetRead: { /* jump, out3 */ -#if 0 /* local variables moved into u.bx */ - Mem *pIdx; +case OP_RowSetRead: { /* jump, in1, out3 */ +#if 0 /* local variables moved into u.bw */ i64 val; -#endif /* local variables moved into u.bx */ - assert( pOp->p1>0 && pOp->p1<=p->nMem ); +#endif /* local variables moved into u.bw */ CHECK_FOR_INTERRUPT; - u.bx.pIdx = &p->aMem[pOp->p1]; - pOut = &p->aMem[pOp->p3]; - if( (u.bx.pIdx->flags & MEM_RowSet)==0 - || sqlite3RowSetNext(u.bx.pIdx->u.pRowSet, &u.bx.val)==0 + pIn1 = &aMem[pOp->p1]; + if( (pIn1->flags & MEM_RowSet)==0 + || sqlite3RowSetNext(pIn1->u.pRowSet, &u.bw.val)==0 ){ /* The boolean index is empty */ - sqlite3VdbeMemSetNull(u.bx.pIdx); + sqlite3VdbeMemSetNull(pIn1); pc = pOp->p2 - 1; }else{ /* A value was pulled from the index */ - assert( pOp->p3>0 && pOp->p3<=p->nMem ); - sqlite3VdbeMemSetInt64(pOut, u.bx.val); + sqlite3VdbeMemSetInt64(&aMem[pOp->p3], u.bw.val); } break; } @@ -56847,12 +65149,14 @@ case OP_RowSetRead: { /* jump, out3 */ ** inserted as part of some other set). */ case OP_RowSetTest: { /* jump, in1, in3 */ -#if 0 /* local variables moved into u.by */ +#if 0 /* local variables moved into u.bx */ int iSet; int exists; -#endif /* local variables moved into u.by */ +#endif /* local variables moved into u.bx */ - u.by.iSet = pOp->p4.i; + pIn1 = &aMem[pOp->p1]; + pIn3 = &aMem[pOp->p3]; + u.bx.iSet = pOp->p4.i; assert( pIn3->flags&MEM_Int ); /* If there is anything other than a rowset object in memory cell P1, @@ -56864,17 +65168,17 @@ case OP_RowSetTest: { /* jump, in1, in3 */ } assert( pOp->p4type==P4_INT32 ); - assert( u.by.iSet==-1 || u.by.iSet>=0 ); - if( u.by.iSet ){ - u.by.exists = sqlite3RowSetTest(pIn1->u.pRowSet, - (u8)(u.by.iSet>=0 ? u.by.iSet & 0xf : 0xff), + assert( u.bx.iSet==-1 || u.bx.iSet>=0 ); + if( u.bx.iSet ){ + u.bx.exists = sqlite3RowSetTest(pIn1->u.pRowSet, + (u8)(u.bx.iSet>=0 ? u.bx.iSet & 0xf : 0xff), pIn3->u.i); - if( u.by.exists ){ + if( u.bx.exists ){ pc = pOp->p2 - 1; break; } } - if( u.by.iSet>=0 ){ + if( u.bx.iSet>=0 ){ sqlite3RowSetInsert(pIn1->u.pRowSet, pIn3->u.i); } break; @@ -56897,7 +65201,7 @@ case OP_RowSetTest: { /* jump, in1, in3 */ ** P4 is a pointer to the VM containing the trigger program. */ case OP_Program: { /* jump */ -#if 0 /* local variables moved into u.bz */ +#if 0 /* local variables moved into u.by */ int nMem; /* Number of memory registers for sub-program */ int nByte; /* Bytes of runtime space required for sub-program */ Mem *pRt; /* Register to allocate runtime space */ @@ -56906,11 +65210,12 @@ case OP_Program: { /* jump */ VdbeFrame *pFrame; /* New vdbe frame to execute in */ SubProgram *pProgram; /* Sub-program to execute */ void *t; /* Token identifying trigger */ -#endif /* local variables moved into u.bz */ +#endif /* local variables moved into u.by */ - u.bz.pProgram = pOp->p4.pProgram; - u.bz.pRt = &p->aMem[pOp->p3]; - assert( u.bz.pProgram->nOp>0 ); + u.by.pProgram = pOp->p4.pProgram; + u.by.pRt = &aMem[pOp->p3]; + assert( memIsValid(u.by.pRt) ); + assert( u.by.pProgram->nOp>0 ); /* If the p5 flag is clear, then recursive invocation of triggers is ** disabled for backwards compatibility (p5 is set if this sub-program @@ -56924,9 +65229,9 @@ case OP_Program: { /* jump */ ** single trigger all have the same value for the SubProgram.token ** variable. */ if( pOp->p5 ){ - u.bz.t = u.bz.pProgram->token; - for(u.bz.pFrame=p->pFrame; u.bz.pFrame && u.bz.pFrame->token!=u.bz.t; u.bz.pFrame=u.bz.pFrame->pParent); - if( u.bz.pFrame ) break; + u.by.t = u.by.pProgram->token; + for(u.by.pFrame=p->pFrame; u.by.pFrame && u.by.pFrame->token!=u.by.t; u.by.pFrame=u.by.pFrame->pParent); + if( u.by.pFrame ) break; } if( p->nFrame>=db->aLimit[SQLITE_LIMIT_TRIGGER_DEPTH] ){ @@ -56935,64 +65240,64 @@ case OP_Program: { /* jump */ break; } - /* Register u.bz.pRt is used to store the memory required to save the state + /* Register u.by.pRt is used to store the memory required to save the state ** of the current program, and the memory required at runtime to execute - ** the trigger program. If this trigger has been fired before, then u.bz.pRt + ** the trigger program. If this trigger has been fired before, then u.by.pRt ** is already allocated. Otherwise, it must be initialized. */ - if( (u.bz.pRt->flags&MEM_Frame)==0 ){ + if( (u.by.pRt->flags&MEM_Frame)==0 ){ /* SubProgram.nMem is set to the number of memory cells used by the ** program stored in SubProgram.aOp. As well as these, one memory ** cell is required for each cursor used by the program. Set local - ** variable u.bz.nMem (and later, VdbeFrame.nChildMem) to this value. + ** variable u.by.nMem (and later, VdbeFrame.nChildMem) to this value. */ - u.bz.nMem = u.bz.pProgram->nMem + u.bz.pProgram->nCsr; - u.bz.nByte = ROUND8(sizeof(VdbeFrame)) - + u.bz.nMem * sizeof(Mem) - + u.bz.pProgram->nCsr * sizeof(VdbeCursor *); - u.bz.pFrame = sqlite3DbMallocZero(db, u.bz.nByte); - if( !u.bz.pFrame ){ + u.by.nMem = u.by.pProgram->nMem + u.by.pProgram->nCsr; + u.by.nByte = ROUND8(sizeof(VdbeFrame)) + + u.by.nMem * sizeof(Mem) + + u.by.pProgram->nCsr * sizeof(VdbeCursor *); + u.by.pFrame = sqlite3DbMallocZero(db, u.by.nByte); + if( !u.by.pFrame ){ goto no_mem; } - sqlite3VdbeMemRelease(u.bz.pRt); - u.bz.pRt->flags = MEM_Frame; - u.bz.pRt->u.pFrame = u.bz.pFrame; + sqlite3VdbeMemRelease(u.by.pRt); + u.by.pRt->flags = MEM_Frame; + u.by.pRt->u.pFrame = u.by.pFrame; - u.bz.pFrame->v = p; - u.bz.pFrame->nChildMem = u.bz.nMem; - u.bz.pFrame->nChildCsr = u.bz.pProgram->nCsr; - u.bz.pFrame->pc = pc; - u.bz.pFrame->aMem = p->aMem; - u.bz.pFrame->nMem = p->nMem; - u.bz.pFrame->apCsr = p->apCsr; - u.bz.pFrame->nCursor = p->nCursor; - u.bz.pFrame->aOp = p->aOp; - u.bz.pFrame->nOp = p->nOp; - u.bz.pFrame->token = u.bz.pProgram->token; + u.by.pFrame->v = p; + u.by.pFrame->nChildMem = u.by.nMem; + u.by.pFrame->nChildCsr = u.by.pProgram->nCsr; + u.by.pFrame->pc = pc; + u.by.pFrame->aMem = p->aMem; + u.by.pFrame->nMem = p->nMem; + u.by.pFrame->apCsr = p->apCsr; + u.by.pFrame->nCursor = p->nCursor; + u.by.pFrame->aOp = p->aOp; + u.by.pFrame->nOp = p->nOp; + u.by.pFrame->token = u.by.pProgram->token; - u.bz.pEnd = &VdbeFrameMem(u.bz.pFrame)[u.bz.pFrame->nChildMem]; - for(u.bz.pMem=VdbeFrameMem(u.bz.pFrame); u.bz.pMem!=u.bz.pEnd; u.bz.pMem++){ - u.bz.pMem->flags = MEM_Null; - u.bz.pMem->db = db; + u.by.pEnd = &VdbeFrameMem(u.by.pFrame)[u.by.pFrame->nChildMem]; + for(u.by.pMem=VdbeFrameMem(u.by.pFrame); u.by.pMem!=u.by.pEnd; u.by.pMem++){ + u.by.pMem->flags = MEM_Null; + u.by.pMem->db = db; } }else{ - u.bz.pFrame = u.bz.pRt->u.pFrame; - assert( u.bz.pProgram->nMem+u.bz.pProgram->nCsr==u.bz.pFrame->nChildMem ); - assert( u.bz.pProgram->nCsr==u.bz.pFrame->nChildCsr ); - assert( pc==u.bz.pFrame->pc ); + u.by.pFrame = u.by.pRt->u.pFrame; + assert( u.by.pProgram->nMem+u.by.pProgram->nCsr==u.by.pFrame->nChildMem ); + assert( u.by.pProgram->nCsr==u.by.pFrame->nChildCsr ); + assert( pc==u.by.pFrame->pc ); } p->nFrame++; - u.bz.pFrame->pParent = p->pFrame; - u.bz.pFrame->lastRowid = db->lastRowid; - u.bz.pFrame->nChange = p->nChange; + u.by.pFrame->pParent = p->pFrame; + u.by.pFrame->lastRowid = db->lastRowid; + u.by.pFrame->nChange = p->nChange; p->nChange = 0; - p->pFrame = u.bz.pFrame; - p->aMem = &VdbeFrameMem(u.bz.pFrame)[-1]; - p->nMem = u.bz.pFrame->nChildMem; - p->nCursor = (u16)u.bz.pFrame->nChildCsr; - p->apCsr = (VdbeCursor **)&p->aMem[p->nMem+1]; - p->aOp = u.bz.pProgram->aOp; - p->nOp = u.bz.pProgram->nOp; + p->pFrame = u.by.pFrame; + p->aMem = aMem = &VdbeFrameMem(u.by.pFrame)[-1]; + p->nMem = u.by.pFrame->nChildMem; + p->nCursor = (u16)u.by.pFrame->nChildCsr; + p->apCsr = (VdbeCursor **)&aMem[p->nMem+1]; + p->aOp = aOp = u.by.pProgram->aOp; + p->nOp = u.by.pProgram->nOp; pc = -1; break; @@ -57011,13 +65316,13 @@ case OP_Program: { /* jump */ ** calling OP_Program instruction. */ case OP_Param: { /* out2-prerelease */ -#if 0 /* local variables moved into u.ca */ +#if 0 /* local variables moved into u.bz */ VdbeFrame *pFrame; Mem *pIn; -#endif /* local variables moved into u.ca */ - u.ca.pFrame = p->pFrame; - u.ca.pIn = &u.ca.pFrame->aMem[pOp->p1 + u.ca.pFrame->aOp[u.ca.pFrame->pc].p1]; - sqlite3VdbeMemShallowCopy(pOut, u.ca.pIn, MEM_Ephem); +#endif /* local variables moved into u.bz */ + u.bz.pFrame = p->pFrame; + u.bz.pIn = &u.bz.pFrame->aMem[pOp->p1 + u.bz.pFrame->aOp[u.bz.pFrame->pc].p1]; + sqlite3VdbeMemShallowCopy(pOut, u.bz.pIn, MEM_Ephem); break; } @@ -57073,20 +65378,22 @@ case OP_FkIfZero: { /* jump */ ** an integer. */ case OP_MemMax: { /* in2 */ -#if 0 /* local variables moved into u.cb */ +#if 0 /* local variables moved into u.ca */ Mem *pIn1; VdbeFrame *pFrame; -#endif /* local variables moved into u.cb */ +#endif /* local variables moved into u.ca */ if( p->pFrame ){ - for(u.cb.pFrame=p->pFrame; u.cb.pFrame->pParent; u.cb.pFrame=u.cb.pFrame->pParent); - u.cb.pIn1 = &u.cb.pFrame->aMem[pOp->p1]; + for(u.ca.pFrame=p->pFrame; u.ca.pFrame->pParent; u.ca.pFrame=u.ca.pFrame->pParent); + u.ca.pIn1 = &u.ca.pFrame->aMem[pOp->p1]; }else{ - u.cb.pIn1 = &p->aMem[pOp->p1]; + u.ca.pIn1 = &aMem[pOp->p1]; } - sqlite3VdbeMemIntegerify(u.cb.pIn1); + assert( memIsValid(u.ca.pIn1) ); + sqlite3VdbeMemIntegerify(u.ca.pIn1); + pIn2 = &aMem[pOp->p2]; sqlite3VdbeMemIntegerify(pIn2); - if( u.cb.pIn1->u.iu.i){ - u.cb.pIn1->u.i = pIn2->u.i; + if( u.ca.pIn1->u.iu.i){ + u.ca.pIn1->u.i = pIn2->u.i; } break; } @@ -57100,6 +65407,7 @@ case OP_MemMax: { /* in2 */ ** not contain an integer. An assertion fault will result if you try. */ case OP_IfPos: { /* jump, in1 */ + pIn1 = &aMem[pOp->p1]; assert( pIn1->flags&MEM_Int ); if( pIn1->u.i>0 ){ pc = pOp->p2 - 1; @@ -57115,6 +65423,7 @@ case OP_IfPos: { /* jump, in1 */ ** not contain an integer. An assertion fault will result if you try. */ case OP_IfNeg: { /* jump, in1 */ + pIn1 = &aMem[pOp->p1]; assert( pIn1->flags&MEM_Int ); if( pIn1->u.i<0 ){ pc = pOp->p2 - 1; @@ -57122,15 +65431,18 @@ case OP_IfNeg: { /* jump, in1 */ break; } -/* Opcode: IfZero P1 P2 * * * +/* Opcode: IfZero P1 P2 P3 * * ** -** If the value of register P1 is exactly 0, jump to P2. +** The register P1 must contain an integer. Add literal P3 to the +** value in register P1. If the result is exactly 0, jump to P2. ** ** It is illegal to use this instruction on a register that does ** not contain an integer. An assertion fault will result if you try. */ case OP_IfZero: { /* jump, in1 */ + pIn1 = &aMem[pOp->p1]; assert( pIn1->flags&MEM_Int ); + pIn1->u.i += pOp->p3; if( pIn1->u.i==0 ){ pc = pOp->p2 - 1; } @@ -57148,47 +65460,49 @@ case OP_IfZero: { /* jump, in1 */ ** successors. */ case OP_AggStep: { -#if 0 /* local variables moved into u.cc */ +#if 0 /* local variables moved into u.cb */ int n; int i; Mem *pMem; Mem *pRec; sqlite3_context ctx; sqlite3_value **apVal; -#endif /* local variables moved into u.cc */ +#endif /* local variables moved into u.cb */ - u.cc.n = pOp->p5; - assert( u.cc.n>=0 ); - u.cc.pRec = &p->aMem[pOp->p2]; - u.cc.apVal = p->apArg; - assert( u.cc.apVal || u.cc.n==0 ); - for(u.cc.i=0; u.cc.ip5; + assert( u.cb.n>=0 ); + u.cb.pRec = &aMem[pOp->p2]; + u.cb.apVal = p->apArg; + assert( u.cb.apVal || u.cb.n==0 ); + for(u.cb.i=0; u.cb.ip4.pFunc; + u.cb.ctx.pFunc = pOp->p4.pFunc; assert( pOp->p3>0 && pOp->p3<=p->nMem ); - u.cc.ctx.pMem = u.cc.pMem = &p->aMem[pOp->p3]; - u.cc.pMem->n++; - u.cc.ctx.s.flags = MEM_Null; - u.cc.ctx.s.z = 0; - u.cc.ctx.s.zMalloc = 0; - u.cc.ctx.s.xDel = 0; - u.cc.ctx.s.db = db; - u.cc.ctx.isError = 0; - u.cc.ctx.pColl = 0; - if( u.cc.ctx.pFunc->flags & SQLITE_FUNC_NEEDCOLL ){ + u.cb.ctx.pMem = u.cb.pMem = &aMem[pOp->p3]; + u.cb.pMem->n++; + u.cb.ctx.s.flags = MEM_Null; + u.cb.ctx.s.z = 0; + u.cb.ctx.s.zMalloc = 0; + u.cb.ctx.s.xDel = 0; + u.cb.ctx.s.db = db; + u.cb.ctx.isError = 0; + u.cb.ctx.pColl = 0; + if( u.cb.ctx.pFunc->flags & SQLITE_FUNC_NEEDCOLL ){ assert( pOp>p->aOp ); assert( pOp[-1].p4type==P4_COLLSEQ ); assert( pOp[-1].opcode==OP_CollSeq ); - u.cc.ctx.pColl = pOp[-1].p4.pColl; + u.cb.ctx.pColl = pOp[-1].p4.pColl; } - (u.cc.ctx.pFunc->xStep)(&u.cc.ctx, u.cc.n, u.cc.apVal); - if( u.cc.ctx.isError ){ - sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(&u.cc.ctx.s)); - rc = u.cc.ctx.isError; + (u.cb.ctx.pFunc->xStep)(&u.cb.ctx, u.cb.n, u.cb.apVal); /* IMP: R-24505-23230 */ + if( u.cb.ctx.isError ){ + sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(&u.cb.ctx.s)); + rc = u.cb.ctx.isError; } - sqlite3VdbeMemRelease(&u.cc.ctx.s); + sqlite3VdbeMemRelease(&u.cb.ctx.s); break; } @@ -57205,24 +65519,159 @@ case OP_AggStep: { ** the step function was not previously called. */ case OP_AggFinal: { -#if 0 /* local variables moved into u.cd */ +#if 0 /* local variables moved into u.cc */ Mem *pMem; -#endif /* local variables moved into u.cd */ +#endif /* local variables moved into u.cc */ assert( pOp->p1>0 && pOp->p1<=p->nMem ); - u.cd.pMem = &p->aMem[pOp->p1]; - assert( (u.cd.pMem->flags & ~(MEM_Null|MEM_Agg))==0 ); - rc = sqlite3VdbeMemFinalize(u.cd.pMem, pOp->p4.pFunc); + u.cc.pMem = &aMem[pOp->p1]; + assert( (u.cc.pMem->flags & ~(MEM_Null|MEM_Agg))==0 ); + rc = sqlite3VdbeMemFinalize(u.cc.pMem, pOp->p4.pFunc); if( rc ){ - sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(u.cd.pMem)); + sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(u.cc.pMem)); } - sqlite3VdbeChangeEncoding(u.cd.pMem, encoding); - UPDATE_MAX_BLOBSIZE(u.cd.pMem); - if( sqlite3VdbeMemTooBig(u.cd.pMem) ){ + sqlite3VdbeChangeEncoding(u.cc.pMem, encoding); + UPDATE_MAX_BLOBSIZE(u.cc.pMem); + if( sqlite3VdbeMemTooBig(u.cc.pMem) ){ goto too_big; } break; } +#ifndef SQLITE_OMIT_WAL +/* Opcode: Checkpoint P1 * * * * +** +** Checkpoint database P1. This is a no-op if P1 is not currently in +** WAL mode. +*/ +case OP_Checkpoint: { + rc = sqlite3Checkpoint(db, pOp->p1); + break; +}; +#endif + +#ifndef SQLITE_OMIT_PRAGMA +/* Opcode: JournalMode P1 P2 P3 * P5 +** +** Change the journal mode of database P1 to P3. P3 must be one of the +** PAGER_JOURNALMODE_XXX values. If changing between the various rollback +** modes (delete, truncate, persist, off and memory), this is a simple +** operation. No IO is required. +** +** If changing into or out of WAL mode the procedure is more complicated. +** +** Write a string containing the final journal-mode to register P2. +*/ +case OP_JournalMode: { /* out2-prerelease */ +#if 0 /* local variables moved into u.cd */ + Btree *pBt; /* Btree to change journal mode of */ + Pager *pPager; /* Pager associated with pBt */ + int eNew; /* New journal mode */ + int eOld; /* The old journal mode */ + const char *zFilename; /* Name of database file for pPager */ +#endif /* local variables moved into u.cd */ + + u.cd.eNew = pOp->p3; + assert( u.cd.eNew==PAGER_JOURNALMODE_DELETE + || u.cd.eNew==PAGER_JOURNALMODE_TRUNCATE + || u.cd.eNew==PAGER_JOURNALMODE_PERSIST + || u.cd.eNew==PAGER_JOURNALMODE_OFF + || u.cd.eNew==PAGER_JOURNALMODE_MEMORY + || u.cd.eNew==PAGER_JOURNALMODE_WAL + || u.cd.eNew==PAGER_JOURNALMODE_QUERY + ); + assert( pOp->p1>=0 && pOp->p1nDb ); + + /* This opcode is used in two places: PRAGMA journal_mode and ATTACH. + ** In PRAGMA journal_mode, the sqlite3VdbeUsesBtree() routine is called + ** when the statment is prepared and so p->aMutex.nMutex>0. All mutexes + ** are already acquired. But when used in ATTACH, sqlite3VdbeUsesBtree() + ** is not called when the statement is prepared because it requires the + ** iDb index of the database as a parameter, and the database has not + ** yet been attached so that index is unavailable. We have to wait + ** until runtime (now) to get the mutex on the newly attached database. + ** No other mutexes are required by the ATTACH command so this is safe + ** to do. + */ + assert( (p->btreeMask & (1<p1))!=0 || p->aMutex.nMutex==0 ); + if( p->aMutex.nMutex==0 ){ + /* This occurs right after ATTACH. Get a mutex on the newly ATTACHed + ** database. */ + sqlite3VdbeUsesBtree(p, pOp->p1); + sqlite3VdbeMutexArrayEnter(p); + } + + u.cd.pBt = db->aDb[pOp->p1].pBt; + u.cd.pPager = sqlite3BtreePager(u.cd.pBt); + u.cd.eOld = sqlite3PagerGetJournalMode(u.cd.pPager); + if( u.cd.eNew==PAGER_JOURNALMODE_QUERY ) u.cd.eNew = u.cd.eOld; + if( !sqlite3PagerOkToChangeJournalMode(u.cd.pPager) ) u.cd.eNew = u.cd.eOld; + +#ifndef SQLITE_OMIT_WAL + u.cd.zFilename = sqlite3PagerFilename(u.cd.pPager); + + /* Do not allow a transition to journal_mode=WAL for a database + ** in temporary storage or if the VFS does not support shared memory + */ + if( u.cd.eNew==PAGER_JOURNALMODE_WAL + && (u.cd.zFilename[0]==0 /* Temp file */ + || !sqlite3PagerWalSupported(u.cd.pPager)) /* No shared-memory support */ + ){ + u.cd.eNew = u.cd.eOld; + } + + if( (u.cd.eNew!=u.cd.eOld) + && (u.cd.eOld==PAGER_JOURNALMODE_WAL || u.cd.eNew==PAGER_JOURNALMODE_WAL) + ){ + if( !db->autoCommit || db->activeVdbeCnt>1 ){ + rc = SQLITE_ERROR; + sqlite3SetString(&p->zErrMsg, db, + "cannot change %s wal mode from within a transaction", + (u.cd.eNew==PAGER_JOURNALMODE_WAL ? "into" : "out of") + ); + break; + }else{ + + if( u.cd.eOld==PAGER_JOURNALMODE_WAL ){ + /* If leaving WAL mode, close the log file. If successful, the call + ** to PagerCloseWal() checkpoints and deletes the write-ahead-log + ** file. An EXCLUSIVE lock may still be held on the database file + ** after a successful return. + */ + rc = sqlite3PagerCloseWal(u.cd.pPager); + if( rc==SQLITE_OK ){ + sqlite3PagerSetJournalMode(u.cd.pPager, u.cd.eNew); + } + }else if( u.cd.eOld==PAGER_JOURNALMODE_MEMORY ){ + /* Cannot transition directly from MEMORY to WAL. Use mode OFF + ** as an intermediate */ + sqlite3PagerSetJournalMode(u.cd.pPager, PAGER_JOURNALMODE_OFF); + } + + /* Open a transaction on the database file. Regardless of the journal + ** mode, this transaction always uses a rollback journal. + */ + assert( sqlite3BtreeIsInTrans(u.cd.pBt)==0 ); + if( rc==SQLITE_OK ){ + rc = sqlite3BtreeSetVersion(u.cd.pBt, (u.cd.eNew==PAGER_JOURNALMODE_WAL ? 2 : 1)); + } + } + } +#endif /* ifndef SQLITE_OMIT_WAL */ + + if( rc ){ + u.cd.eNew = u.cd.eOld; + } + u.cd.eNew = sqlite3PagerSetJournalMode(u.cd.pPager, u.cd.eNew); + + pOut = &aMem[pOp->p2]; + pOut->flags = MEM_Str|MEM_Static|MEM_Term; + pOut->z = (char *)sqlite3JournalModename(u.cd.eNew); + pOut->n = sqlite3Strlen30(pOut->z); + pOut->enc = SQLITE_UTF8; + sqlite3VdbeChangeEncoding(pOut, encoding); + break; +}; +#endif /* SQLITE_OMIT_PRAGMA */ #if !defined(SQLITE_OMIT_VACUUM) && !defined(SQLITE_OMIT_ATTACH) /* Opcode: Vacuum * * * * * @@ -57232,9 +65681,7 @@ case OP_AggFinal: { ** a transaction. */ case OP_Vacuum: { - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; rc = sqlite3RunVacuum(&p->zErrMsg, db); - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; break; } #endif @@ -57329,11 +65776,7 @@ case OP_VBegin: { #endif /* local variables moved into u.cf */ u.cf.pVTab = pOp->p4.pVtab; rc = sqlite3VtabBegin(db, u.cf.pVTab); - if( u.cf.pVTab ){ - sqlite3DbFree(db, p->zErrMsg); - p->zErrMsg = u.cf.pVTab->pVtab->zErrMsg; - u.cf.pVTab->pVtab->zErrMsg = 0; - } + if( u.cf.pVTab ) importVtabErrMsg(p, u.cf.pVTab->pVtab); break; } #endif /* SQLITE_OMIT_VIRTUALTABLE */ @@ -57384,12 +65827,8 @@ case OP_VOpen: { u.cg.pVtab = pOp->p4.pVtab->pVtab; u.cg.pModule = (sqlite3_module *)u.cg.pVtab->pModule; assert(u.cg.pVtab && u.cg.pModule); - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; rc = u.cg.pModule->xOpen(u.cg.pVtab, &u.cg.pVtabCursor); - sqlite3DbFree(db, p->zErrMsg); - p->zErrMsg = u.cg.pVtab->zErrMsg; - u.cg.pVtab->zErrMsg = 0; - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; + importVtabErrMsg(p, u.cg.pVtab); if( SQLITE_OK==rc ){ /* Initialize sqlite3_vtab_cursor base class */ u.cg.pVtabCursor->pVtab = u.cg.pVtab; @@ -57442,9 +65881,10 @@ case OP_VFilter: { /* jump */ Mem **apArg; #endif /* local variables moved into u.ch */ - u.ch.pQuery = &p->aMem[pOp->p3]; + u.ch.pQuery = &aMem[pOp->p3]; u.ch.pArgc = &u.ch.pQuery[1]; u.ch.pCur = p->apCsr[pOp->p1]; + assert( memIsValid(u.ch.pQuery) ); REGISTER_TRACE(pOp->p3, u.ch.pQuery); assert( u.ch.pCur->pVtabCursor ); u.ch.pVtabCursor = u.ch.pCur->pVtabCursor; @@ -57465,17 +65905,13 @@ case OP_VFilter: { /* jump */ sqlite3VdbeMemStoreType(u.ch.apArg[u.ch.i]); } - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; p->inVtabMethod = 1; rc = u.ch.pModule->xFilter(u.ch.pVtabCursor, u.ch.iQuery, pOp->p4.z, u.ch.nArg, u.ch.apArg); p->inVtabMethod = 0; - sqlite3DbFree(db, p->zErrMsg); - p->zErrMsg = u.ch.pVtab->zErrMsg; - u.ch.pVtab->zErrMsg = 0; + importVtabErrMsg(p, u.ch.pVtab); if( rc==SQLITE_OK ){ u.ch.res = u.ch.pModule->xEof(u.ch.pVtabCursor); } - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; if( u.ch.res ){ pc = pOp->p2 - 1; @@ -57505,7 +65941,8 @@ case OP_VColumn: { VdbeCursor *pCur = p->apCsr[pOp->p1]; assert( pCur->pVtabCursor ); assert( pOp->p3>0 && pOp->p3<=p->nMem ); - u.ci.pDest = &p->aMem[pOp->p3]; + u.ci.pDest = &aMem[pOp->p3]; + memAboutToChange(p, u.ci.pDest); if( pCur->nullRow ){ sqlite3VdbeMemSetNull(u.ci.pDest); break; @@ -57523,11 +65960,8 @@ case OP_VColumn: { sqlite3VdbeMemMove(&u.ci.sContext.s, u.ci.pDest); MemSetTypeFlag(&u.ci.sContext.s, MEM_Null); - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; rc = u.ci.pModule->xColumn(pCur->pVtabCursor, &u.ci.sContext, pOp->p2); - sqlite3DbFree(db, p->zErrMsg); - p->zErrMsg = u.ci.pVtab->zErrMsg; - u.ci.pVtab->zErrMsg = 0; + importVtabErrMsg(p, u.ci.pVtab); if( u.ci.sContext.isError ){ rc = u.ci.sContext.isError; } @@ -57537,13 +65971,10 @@ case OP_VColumn: { ** dynamic allocation in u.ci.sContext.s (a Mem struct) is released. */ sqlite3VdbeChangeEncoding(&u.ci.sContext.s, encoding); - REGISTER_TRACE(pOp->p3, u.ci.pDest); sqlite3VdbeMemMove(u.ci.pDest, &u.ci.sContext.s); + REGISTER_TRACE(pOp->p3, u.ci.pDest); UPDATE_MAX_BLOBSIZE(u.ci.pDest); - if( sqlite3SafetyOn(db) ){ - goto abort_due_to_misuse; - } if( sqlite3VdbeMemTooBig(u.ci.pDest) ){ goto too_big; } @@ -57582,17 +66013,13 @@ case OP_VNext: { /* jump */ ** data is available) and the error code returned when xColumn or ** some other method is next invoked on the save virtual table cursor. */ - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; p->inVtabMethod = 1; rc = u.cj.pModule->xNext(u.cj.pCur->pVtabCursor); p->inVtabMethod = 0; - sqlite3DbFree(db, p->zErrMsg); - p->zErrMsg = u.cj.pVtab->zErrMsg; - u.cj.pVtab->zErrMsg = 0; + importVtabErrMsg(p, u.cj.pVtab); if( rc==SQLITE_OK ){ u.cj.res = u.cj.pModule->xEof(u.cj.pCur->pVtabCursor); } - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; if( !u.cj.res ){ /* If there is data, jump to P2 */ @@ -57616,16 +66043,14 @@ case OP_VRename: { #endif /* local variables moved into u.ck */ u.ck.pVtab = pOp->p4.pVtab->pVtab; - u.ck.pName = &p->aMem[pOp->p1]; + u.ck.pName = &aMem[pOp->p1]; assert( u.ck.pVtab->pModule->xRename ); + assert( memIsValid(u.ck.pName) ); REGISTER_TRACE(pOp->p1, u.ck.pName); assert( u.ck.pName->flags & MEM_Str ); - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; rc = u.ck.pVtab->pModule->xRename(u.ck.pVtab, u.ck.pName->z); - sqlite3DbFree(db, p->zErrMsg); - p->zErrMsg = u.ck.pVtab->zErrMsg; - u.ck.pVtab->zErrMsg = 0; - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; + importVtabErrMsg(p, u.ck.pVtab); + p->expired = 0; break; } @@ -57672,18 +66097,16 @@ case OP_VUpdate: { assert( pOp->p4type==P4_VTAB ); if( ALWAYS(u.cl.pModule->xUpdate) ){ u.cl.apArg = p->apArg; - u.cl.pX = &p->aMem[pOp->p3]; + u.cl.pX = &aMem[pOp->p3]; for(u.cl.i=0; u.cl.ixUpdate(u.cl.pVtab, u.cl.nArg, u.cl.apArg, &u.cl.rowid); - sqlite3DbFree(db, p->zErrMsg); - p->zErrMsg = u.cl.pVtab->zErrMsg; - u.cl.pVtab->zErrMsg = 0; - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; + importVtabErrMsg(p, u.cl.pVtab); if( rc==SQLITE_OK && pOp->p1 ){ assert( u.cl.nArg>1 && u.cl.apArg[0] && (u.cl.apArg[0]->flags&MEM_Null) ); db->lastRowid = u.cl.rowid; @@ -57700,22 +66123,7 @@ case OP_VUpdate: { ** Write the current number of pages in database P1 to memory cell P2. */ case OP_Pagecount: { /* out2-prerelease */ -#if 0 /* local variables moved into u.cm */ - int p1; - int nPage; - Pager *pPager; -#endif /* local variables moved into u.cm */ - - u.cm.p1 = pOp->p1; - u.cm.pPager = sqlite3BtreePager(db->aDb[u.cm.p1].pBt); - rc = sqlite3PagerPagecount(u.cm.pPager, &u.cm.nPage); - /* OP_Pagecount is always called from within a read transaction. The - ** page count has already been successfully read and cached. So the - ** sqlite3PagerPagecount() call above cannot fail. */ - if( ALWAYS(rc==SQLITE_OK) ){ - pOut->flags = MEM_Int; - pOut->u.i = u.cm.nPage; - } + pOut->u.i = sqlite3BtreeLastPage(db->aDb[pOp->p1].pBt); break; } #endif @@ -57727,18 +66135,20 @@ case OP_Pagecount: { /* out2-prerelease */ ** the UTF-8 string contained in P4 is emitted on the trace callback. */ case OP_Trace: { -#if 0 /* local variables moved into u.cn */ +#if 0 /* local variables moved into u.cm */ char *zTrace; -#endif /* local variables moved into u.cn */ +#endif /* local variables moved into u.cm */ - u.cn.zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql); - if( u.cn.zTrace ){ + u.cm.zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql); + if( u.cm.zTrace ){ if( db->xTrace ){ - db->xTrace(db->pTraceArg, u.cn.zTrace); + char *z = sqlite3VdbeExpandSql(p, u.cm.zTrace); + db->xTrace(db->pTraceArg, z); + sqlite3DbFree(db, z); } #ifdef SQLITE_DEBUG if( (db->flags & SQLITE_SqlTrace)!=0 ){ - sqlite3DebugPrintf("SQL-trace: %s\n", u.cn.zTrace); + sqlite3DebugPrintf("SQL-trace: %s\n", u.cm.zTrace); } #endif /* SQLITE_DEBUG */ } @@ -57759,6 +66169,7 @@ case OP_Trace: { ** the same as a no-op. This opcodesnever appears in a real VM program. */ default: { /* This is really OP_Noop and OP_Explain */ + assert( pOp->opcode==OP_Noop || pOp->opcode==OP_Explain ); break; } @@ -57777,7 +66188,7 @@ default: { /* This is really OP_Noop and OP_Explain */ pOp->cnt++; #if 0 fprintf(stdout, "%10llu ", elapsed); - sqlite3VdbePrintOp(stdout, origPc, &p->aOp[origPc]); + sqlite3VdbePrintOp(stdout, origPc, &aOp[origPc]); #endif } #endif @@ -57793,11 +66204,11 @@ default: { /* This is really OP_Noop and OP_Explain */ #ifdef SQLITE_DEBUG if( p->trace ){ if( rc!=0 ) fprintf(p->trace,"rc=%d\n",rc); - if( opProperty & OPFLG_OUT2_PRERELEASE ){ - registerTrace(p->trace, pOp->p2, pOut); + if( pOp->opflags & (OPFLG_OUT2_PRERELEASE|OPFLG_OUT2) ){ + registerTrace(p->trace, pOp->p2, &aMem[pOp->p2]); } - if( opProperty & OPFLG_OUT3 ){ - registerTrace(p->trace, pOp->p3, pOut); + if( pOp->opflags & OPFLG_OUT3 ){ + registerTrace(p->trace, pOp->p3, &aMem[pOp->p3]); } } #endif /* SQLITE_DEBUG */ @@ -57810,9 +66221,13 @@ default: { /* This is really OP_Noop and OP_Explain */ vdbe_error_halt: assert( rc ); p->rc = rc; + testcase( sqlite3GlobalConfig.xLog!=0 ); + sqlite3_log(rc, "statement aborts at %d: [%s] %s", + pc, p->zSql, p->zErrMsg); sqlite3VdbeHalt(p); if( rc==SQLITE_IOERR_NOMEM ) db->mallocFailed = 1; rc = SQLITE_ERROR; + if( resetSchemaOnFault ) sqlite3ResetInternalSchema(db, 0); /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the @@ -57837,12 +66252,6 @@ no_mem: rc = SQLITE_NOMEM; goto vdbe_error_halt; - /* Jump to here for an SQLITE_MISUSE error. - */ -abort_due_to_misuse: - rc = SQLITE_MISUSE; - /* Fall thru into abort_due_to_error */ - /* Jump to here for any other kind of fatal error. The "rc" variable ** should hold the error number. */ @@ -57880,8 +66289,6 @@ abort_due_to_interrupt: ************************************************************************* ** ** This file contains code used to implement incremental BLOB I/O. -** -** $Id: vdbeblob.c,v 1.35 2009/07/02 07:47:33 danielk1977 Exp $ */ @@ -57964,13 +66371,6 @@ SQLITE_API int sqlite3_blob_open( memset(pParse, 0, sizeof(Parse)); pParse->db = db; - if( sqlite3SafetyOn(db) ){ - sqlite3DbFree(db, zErr); - sqlite3StackFree(db, pParse); - sqlite3_mutex_leave(db->mutex); - return SQLITE_MISUSE; - } - sqlite3BtreeEnterAll(db); pTab = sqlite3LocateTable(pParse, 0, zTable, zDb); if( pTab && IsVirtual(pTab) ){ @@ -57990,7 +66390,6 @@ SQLITE_API int sqlite3_blob_open( pParse->zErrMsg = 0; } rc = SQLITE_ERROR; - (void)sqlite3SafetyOff(db); sqlite3BtreeLeaveAll(db); goto blob_open_out; } @@ -58005,7 +66404,6 @@ SQLITE_API int sqlite3_blob_open( sqlite3DbFree(db, zErr); zErr = sqlite3MPrintf(db, "no such column: \"%s\"", zColumn); rc = SQLITE_ERROR; - (void)sqlite3SafetyOff(db); sqlite3BtreeLeaveAll(db); goto blob_open_out; } @@ -58046,7 +66444,6 @@ SQLITE_API int sqlite3_blob_open( sqlite3DbFree(db, zErr); zErr = sqlite3MPrintf(db, "cannot open %s column for writing", zFault); rc = SQLITE_ERROR; - (void)sqlite3SafetyOff(db); sqlite3BtreeLeaveAll(db); goto blob_open_out; } @@ -58070,10 +66467,14 @@ SQLITE_API int sqlite3_blob_open( sqlite3VdbeUsesBtree(v, iDb); /* Configure the OP_TableLock instruction */ +#ifdef SQLITE_OMIT_SHARED_CACHE + sqlite3VdbeChangeToNoop(v, 2, 1); +#else sqlite3VdbeChangeP1(v, 2, iDb); sqlite3VdbeChangeP2(v, 2, pTab->tnum); sqlite3VdbeChangeP3(v, 2, flags); sqlite3VdbeChangeP4(v, 2, pTab->zName, P4_TRANSIENT); +#endif /* Remove either the OP_OpenWrite or OpenRead. Set the P2 ** parameter of the other to pTab->tnum. */ @@ -58096,8 +66497,7 @@ SQLITE_API int sqlite3_blob_open( } sqlite3BtreeLeaveAll(db); - rc = sqlite3SafetyOff(db); - if( NEVER(rc!=SQLITE_OK) || db->mallocFailed ){ + if( db->mallocFailed ){ goto blob_open_out; } @@ -58198,7 +66598,7 @@ static int blobReadWrite( Vdbe *v; sqlite3 *db; - if( p==0 ) return SQLITE_MISUSE; + if( p==0 ) return SQLITE_MISUSE_BKPT; db = p->db; sqlite3_mutex_enter(db->mutex); v = (Vdbe*)p->pStmt; @@ -58274,12 +66674,6 @@ SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *pBlob){ ** ************************************************************************* ** -** @(#) $Id: journal.c,v 1.9 2009/01/20 17:06:27 danielk1977 Exp $ -*/ - -#ifdef SQLITE_ENABLE_ATOMIC_WRITE - -/* ** This file implements a special kind of sqlite3_file object used ** by SQLite to create journal files if the atomic-write optimization ** is enabled. @@ -58294,7 +66688,7 @@ SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *pBlob){ ** buffer, or ** 2) The sqlite3JournalCreate() function is called. */ - +#ifdef SQLITE_ENABLE_ATOMIC_WRITE /* @@ -58451,7 +66845,11 @@ static struct sqlite3_io_methods JournalFileMethods = { 0, /* xCheckReservedLock */ 0, /* xFileControl */ 0, /* xSectorSize */ - 0 /* xDeviceCharacteristics */ + 0, /* xDeviceCharacteristics */ + 0, /* xShmMap */ + 0, /* xShmLock */ + 0, /* xShmBarrier */ + 0 /* xShmUnmap */ }; /* @@ -58519,8 +66917,6 @@ SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *pVfs){ ** This file contains code use to implement an in-memory rollback journal. ** The in-memory rollback journal is used to journal transactions for ** ":memory:" databases and when the journal_mode=MEMORY pragma is used. -** -** @(#) $Id: memjournal.c,v 1.12 2009/05/04 11:42:30 danielk1977 Exp $ */ /* Forward references to internal structures */ @@ -58703,11 +67099,10 @@ static int memjrnlClose(sqlite3_file *pJfd){ ** exists purely as a contingency, in case some malfunction in some other ** part of SQLite causes Sync to be called by mistake. */ -static int memjrnlSync(sqlite3_file *NotUsed, int NotUsed2){ /*NO_TEST*/ - UNUSED_PARAMETER2(NotUsed, NotUsed2); /*NO_TEST*/ - assert( 0 ); /*NO_TEST*/ - return SQLITE_OK; /*NO_TEST*/ -} /*NO_TEST*/ +static int memjrnlSync(sqlite3_file *NotUsed, int NotUsed2){ + UNUSED_PARAMETER2(NotUsed, NotUsed2); + return SQLITE_OK; +} /* ** Query the size of the file in bytes. @@ -58721,7 +67116,7 @@ static int memjrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){ /* ** Table of methods for MemJournal sqlite3_file object. */ -static struct sqlite3_io_methods MemJournalMethods = { +static const struct sqlite3_io_methods MemJournalMethods = { 1, /* iVersion */ memjrnlClose, /* xClose */ memjrnlRead, /* xRead */ @@ -58734,7 +67129,11 @@ static struct sqlite3_io_methods MemJournalMethods = { 0, /* xCheckReservedLock */ 0, /* xFileControl */ 0, /* xSectorSize */ - 0 /* xDeviceCharacteristics */ + 0, /* xDeviceCharacteristics */ + 0, /* xShmMap */ + 0, /* xShmLock */ + 0, /* xShmBarrier */ + 0 /* xShmUnlock */ }; /* @@ -58744,7 +67143,7 @@ SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *pJfd){ MemJournal *p = (MemJournal *)pJfd; assert( EIGHT_BYTE_ALIGNMENT(p) ); memset(p, 0, sqlite3MemJournalSize()); - p->pMethod = &MemJournalMethods; + p->pMethod = (sqlite3_io_methods*)&MemJournalMethods; } /* @@ -58756,8 +67155,7 @@ SQLITE_PRIVATE int sqlite3IsMemJournal(sqlite3_file *pJfd){ } /* -** Return the number of bytes required to store a MemJournal that uses vfs -** pVfs to create the underlying on-disk files. +** Return the number of bytes required to store a MemJournal file descriptor. */ SQLITE_PRIVATE int sqlite3MemJournalSize(void){ return sizeof(MemJournal); @@ -58778,8 +67176,6 @@ SQLITE_PRIVATE int sqlite3MemJournalSize(void){ ************************************************************************* ** This file contains routines used for walking the parser tree for ** an SQL statement. -** -** $Id: walker.c,v 1.7 2009/06/15 23:15:59 drh Exp $ */ @@ -58918,8 +67314,6 @@ SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){ ** This file contains routines used for walking the parser tree and ** resolve all identifiers by associating them with a particular ** table and column. -** -** $Id: resolve.c,v 1.30 2009/06/15 23:15:59 drh Exp $ */ /* @@ -58991,7 +67385,13 @@ static void resolveAlias( pDup->pColl = pExpr->pColl; pDup->flags |= EP_ExpCollate; } - sqlite3ExprClear(db, pExpr); + + /* Before calling sqlite3ExprDelete(), set the EP_Static flag. This + ** prevents ExprDelete() from deleting the Expr structure itself, + ** allowing it to be repopulated by the memcpy() on the following line. + */ + ExprSetProperty(pExpr, EP_Static); + sqlite3ExprDelete(db, pExpr); memcpy(pExpr, pDup, sizeof(*pExpr)); sqlite3DbFree(db, pDup); } @@ -59141,19 +67541,18 @@ static int lookupName( int iCol; pSchema = pTab->pSchema; cntTab++; - if( sqlite3IsRowid(zCol) ){ - iCol = -1; - }else{ - for(iCol=0; iColnCol; iCol++){ - Column *pCol = &pTab->aCol[iCol]; - if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ - if( iCol==pTab->iPKey ){ - iCol = -1; - } - break; + for(iCol=0; iColnCol; iCol++){ + Column *pCol = &pTab->aCol[iCol]; + if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ + if( iCol==pTab->iPKey ){ + iCol = -1; } + break; } } + if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) ){ + iCol = -1; /* IMP: R-44911-55124 */ + } if( iColnCol ){ cnt++; if( iCol<0 ){ @@ -59162,6 +67561,10 @@ static int lookupName( testcase( iCol==31 ); testcase( iCol==32 ); pParse->oldmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<newmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<iColumn = (i16)iCol; pExpr->pTab = pTab; @@ -59176,7 +67579,7 @@ static int lookupName( */ if( cnt==0 && cntTab==1 && sqlite3IsRowid(zCol) ){ cnt = 1; - pExpr->iColumn = -1; + pExpr->iColumn = -1; /* IMP: R-44911-55124 */ pExpr->affinity = SQLITE_AFF_INTEGER; } @@ -59252,6 +67655,7 @@ static int lookupName( }else{ sqlite3ErrorMsg(pParse, "%s: %s", zErr, zCol); } + pParse->checkSchema = 1; pTopNC->nErr++; } @@ -59298,7 +67702,7 @@ lookupname_end: /* ** Allocate and return a pointer to an expression to load the column iCol -** from datasource iSrc datasource in SrcList pSrc. +** from datasource iSrc in SrcList pSrc. */ SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){ Expr *p = sqlite3ExprAlloc(db, TK_COLUMN, 0, 0); @@ -59310,6 +67714,8 @@ SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSr p->iColumn = -1; }else{ p->iColumn = (ynVar)iCol; + testcase( iCol==BMS ); + testcase( iCol==BMS-1 ); pItem->colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol); } ExprSetProperty(p, EP_Resolved); @@ -59559,6 +67965,9 @@ static int resolveOrderByTermToExprList( int i; /* Loop counter */ ExprList *pEList; /* The columns of the result set */ NameContext nc; /* Name context for resolving pE */ + sqlite3 *db; /* Database connection */ + int rc; /* Return code from subprocedures */ + u8 savedSuppErr; /* Saved value of db->suppressErr */ assert( sqlite3ExprIsInteger(pE, &i)==0 ); pEList = pSelect->pEList; @@ -59571,17 +67980,19 @@ static int resolveOrderByTermToExprList( nc.pEList = pEList; nc.allowAgg = 1; nc.nErr = 0; - if( sqlite3ResolveExprNames(&nc, pE) ){ - sqlite3ErrorClear(pParse); - return 0; - } + db = pParse->db; + savedSuppErr = db->suppressErr; + db->suppressErr = 1; + rc = sqlite3ResolveExprNames(&nc, pE); + db->suppressErr = savedSuppErr; + if( rc ) return 0; /* Try to match the ORDER BY expression against an expression ** in the result set. Return an 1-based index of the matching ** result-set entry. */ for(i=0; inExpr; i++){ - if( sqlite3ExprCompare(pEList->a[i].pExpr, pE) ){ + if( sqlite3ExprCompare(pEList->a[i].pExpr, pE)<2 ){ return i+1; } } @@ -60148,6 +68559,18 @@ SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){ return pExpr->affinity; } +/* +** Set the explicit collating sequence for an expression to the +** collating sequence supplied in the second argument. +*/ +SQLITE_PRIVATE Expr *sqlite3ExprSetColl(Expr *pExpr, CollSeq *pColl){ + if( pExpr && pColl ){ + pExpr->pColl = pColl; + pExpr->flags |= EP_ExpCollate; + } + return pExpr; +} + /* ** Set the collating sequence for expression pExpr to be the collating ** sequence named by pToken. Return a pointer to the revised expression. @@ -60155,18 +68578,13 @@ SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){ ** flag. An explicit collating sequence will override implicit ** collating sequences. */ -SQLITE_PRIVATE Expr *sqlite3ExprSetColl(Parse *pParse, Expr *pExpr, Token *pCollName){ +SQLITE_PRIVATE Expr *sqlite3ExprSetCollByToken(Parse *pParse, Expr *pExpr, Token *pCollName){ char *zColl = 0; /* Dequoted name of collation sequence */ CollSeq *pColl; sqlite3 *db = pParse->db; zColl = sqlite3NameFromToken(db, pCollName); - if( pExpr && zColl ){ - pColl = sqlite3LocateCollSeq(pParse, zColl); - if( pColl ){ - pExpr->pColl = pColl; - pExpr->flags |= EP_ExpCollate; - } - } + pColl = sqlite3LocateCollSeq(pParse, zColl); + sqlite3ExprSetColl(pExpr, pColl); sqlite3DbFree(db, zColl); return pExpr; } @@ -60320,30 +68738,6 @@ SQLITE_PRIVATE CollSeq *sqlite3BinaryCompareCollSeq( return pColl; } -/* -** Generate the operands for a comparison operation. Before -** generating the code for each operand, set the EP_AnyAff -** flag on the expression so that it will be able to used a -** cached column value that has previously undergone an -** affinity change. -*/ -static void codeCompareOperands( - Parse *pParse, /* Parsing and code generating context */ - Expr *pLeft, /* The left operand */ - int *pRegLeft, /* Register where left operand is stored */ - int *pFreeLeft, /* Free this register when done */ - Expr *pRight, /* The right operand */ - int *pRegRight, /* Register where right operand is stored */ - int *pFreeRight /* Write temp register for right operand there */ -){ - while( pLeft->op==TK_UPLUS ) pLeft = pLeft->pLeft; - pLeft->flags |= EP_AnyAff; - *pRegLeft = sqlite3ExprCodeTemp(pParse, pLeft, pFreeLeft); - while( pRight->op==TK_UPLUS ) pRight = pRight->pLeft; - pRight->flags |= EP_AnyAff; - *pRegRight = sqlite3ExprCodeTemp(pParse, pRight, pFreeRight); -} - /* ** Generate code for a comparison operator. */ @@ -60365,10 +68759,6 @@ static int codeCompare( addr = sqlite3VdbeAddOp4(pParse->pVdbe, opcode, in2, dest, in1, (void*)p4, P4_COLLSEQ); sqlite3VdbeChangeP5(pParse->pVdbe, (u8)p5); - if( (p5 & SQLITE_AFF_MASK)!=SQLITE_AFF_NONE ){ - sqlite3ExprCacheAffinityChange(pParse, in1, 1); - sqlite3ExprCacheAffinityChange(pParse, in2, 1); - } return addr; } @@ -60668,18 +69058,19 @@ SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){ }else if( z[0]=='?' ){ /* Wildcard of the form "?nnn". Convert "nnn" to an integer and ** use it as the variable number */ - int i = atoi((char*)&z[1]); + i64 i; + int bOk = 0==sqlite3Atoi64(&z[1], &i, sqlite3Strlen30(&z[1]), SQLITE_UTF8); pExpr->iColumn = (ynVar)i; testcase( i==0 ); testcase( i==1 ); testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 ); testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ); - if( i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){ + if( bOk==0 || i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){ sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d", db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]); } if( i>pParse->nVar ){ - pParse->nVar = i; + pParse->nVar = (int)i; } }else{ /* Wildcards like ":aaa", "$aaa" or "@aaa". Reuse the same variable @@ -60720,11 +69111,10 @@ SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){ } /* -** Clear an expression structure without deleting the structure itself. -** Substructure is deleted. +** Recursively delete an expression tree. */ -SQLITE_PRIVATE void sqlite3ExprClear(sqlite3 *db, Expr *p){ - assert( p!=0 ); +SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){ + if( p==0 ) return; if( !ExprHasAnyProperty(p, EP_TokenOnly) ){ sqlite3ExprDelete(db, p->pLeft); sqlite3ExprDelete(db, p->pRight); @@ -60737,14 +69127,6 @@ SQLITE_PRIVATE void sqlite3ExprClear(sqlite3 *db, Expr *p){ sqlite3ExprListDelete(db, p->x.pList); } } -} - -/* -** Recursively delete an expression tree. -*/ -SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){ - if( p==0 ) return; - sqlite3ExprClear(db, p); if( !ExprHasProperty(p, EP_Static) ){ sqlite3DbFree(db, p); } @@ -61351,6 +69733,94 @@ SQLITE_PRIVATE int sqlite3ExprIsInteger(Expr *p, int *pValue){ return rc; } +/* +** Return FALSE if there is no chance that the expression can be NULL. +** +** If the expression might be NULL or if the expression is too complex +** to tell return TRUE. +** +** This routine is used as an optimization, to skip OP_IsNull opcodes +** when we know that a value cannot be NULL. Hence, a false positive +** (returning TRUE when in fact the expression can never be NULL) might +** be a small performance hit but is otherwise harmless. On the other +** hand, a false negative (returning FALSE when the result could be NULL) +** will likely result in an incorrect answer. So when in doubt, return +** TRUE. +*/ +SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr *p){ + u8 op; + while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ p = p->pLeft; } + op = p->op; + if( op==TK_REGISTER ) op = p->op2; + switch( op ){ + case TK_INTEGER: + case TK_STRING: + case TK_FLOAT: + case TK_BLOB: + return 0; + default: + return 1; + } +} + +/* +** Generate an OP_IsNull instruction that tests register iReg and jumps +** to location iDest if the value in iReg is NULL. The value in iReg +** was computed by pExpr. If we can look at pExpr at compile-time and +** determine that it can never generate a NULL, then the OP_IsNull operation +** can be omitted. +*/ +SQLITE_PRIVATE void sqlite3ExprCodeIsNullJump( + Vdbe *v, /* The VDBE under construction */ + const Expr *pExpr, /* Only generate OP_IsNull if this expr can be NULL */ + int iReg, /* Test the value in this register for NULL */ + int iDest /* Jump here if the value is null */ +){ + if( sqlite3ExprCanBeNull(pExpr) ){ + sqlite3VdbeAddOp2(v, OP_IsNull, iReg, iDest); + } +} + +/* +** Return TRUE if the given expression is a constant which would be +** unchanged by OP_Affinity with the affinity given in the second +** argument. +** +** This routine is used to determine if the OP_Affinity operation +** can be omitted. When in doubt return FALSE. A false negative +** is harmless. A false positive, however, can result in the wrong +** answer. +*/ +SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr *p, char aff){ + u8 op; + if( aff==SQLITE_AFF_NONE ) return 1; + while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ p = p->pLeft; } + op = p->op; + if( op==TK_REGISTER ) op = p->op2; + switch( op ){ + case TK_INTEGER: { + return aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC; + } + case TK_FLOAT: { + return aff==SQLITE_AFF_REAL || aff==SQLITE_AFF_NUMERIC; + } + case TK_STRING: { + return aff==SQLITE_AFF_TEXT; + } + case TK_BLOB: { + return 1; + } + case TK_COLUMN: { + assert( p->iTable>=0 ); /* p cannot be part of a CHECK constraint */ + return p->iColumn<0 + && (aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC); + } + default: { + return 0; + } + } +} + /* ** Return TRUE if the given string is a row-id column name. */ @@ -61438,16 +69908,16 @@ static int isCandidateForInOpt(Select *p){ ** When the b-tree is being used for membership tests, the calling function ** needs to know whether or not the structure contains an SQL NULL ** value in order to correctly evaluate expressions like "X IN (Y, Z)". -** If there is a chance that the b-tree might contain a NULL value at +** If there is any chance that the (...) might contain a NULL value at ** runtime, then a register is allocated and the register number written -** to *prNotFound. If there is no chance that the b-tree contains a +** to *prNotFound. If there is no chance that the (...) contains a ** NULL value, then *prNotFound is left unchanged. ** ** If a register is allocated and its location stored in *prNotFound, then -** its initial value is NULL. If the b-tree does not remain constant -** for the duration of the query (i.e. the SELECT that generates the b-tree +** its initial value is NULL. If the (...) does not remain constant +** for the duration of the query (i.e. the SELECT within the (...) ** is a correlated subquery) then the value of the allocated register is -** reset to NULL each time the b-tree is repopulated. This allows the +** reset to NULL each time the subquery is rerun. This allows the ** caller to use vdbe code equivalent to the following: ** ** if( register==NULL ){ @@ -61547,14 +70017,20 @@ SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ /* Could not found an existing table or index to use as the RHS b-tree. ** We will have to generate an ephemeral table to do the job. */ + double savedNQueryLoop = pParse->nQueryLoop; int rMayHaveNull = 0; eType = IN_INDEX_EPH; if( prNotFound ){ *prNotFound = rMayHaveNull = ++pParse->nMem; - }else if( pX->pLeft->iColumn<0 && !ExprHasAnyProperty(pX, EP_xIsSelect) ){ - eType = IN_INDEX_ROWID; + }else{ + testcase( pParse->nQueryLoop>(double)1 ); + pParse->nQueryLoop = (double)1; + if( pX->pLeft->iColumn<0 && !ExprHasAnyProperty(pX, EP_xIsSelect) ){ + eType = IN_INDEX_ROWID; + } } sqlite3CodeSubselect(pParse, pX, rMayHaveNull, eType==IN_INDEX_ROWID); + pParse->nQueryLoop = savedNQueryLoop; }else{ pX->iTable = iTab; } @@ -61563,8 +70039,8 @@ SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ #endif /* -** Generate code for scalar subqueries used as an expression -** and IN operators. Examples: +** Generate code for scalar subqueries used as a subquery expression, EXISTS, +** or IN operators. Examples: ** ** (SELECT a FROM b) -- subquery ** EXISTS (SELECT a FROM b) -- EXISTS subquery @@ -61627,10 +70103,10 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( switch( pExpr->op ){ case TK_IN: { - char affinity; - KeyInfo keyInfo; - int addr; /* Address of OP_OpenEphemeral instruction */ - Expr *pLeft = pExpr->pLeft; + char affinity; /* Affinity of the LHS of the IN */ + KeyInfo keyInfo; /* Keyinfo for the generated table */ + int addr; /* Address of OP_OpenEphemeral instruction */ + Expr *pLeft = pExpr->pLeft; /* the LHS of the IN operator */ if( rMayHaveNull ){ sqlite3VdbeAddOp2(v, OP_Null, 0, rMayHaveNull); @@ -61639,7 +70115,7 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( affinity = sqlite3ExprAffinity(pLeft); /* Whether this is an 'x IN(SELECT...)' or an 'x IN()' - ** expression it is handled the same way. A virtual table is + ** expression it is handled the same way. An ephemeral table is ** filled with single-field index keys representing the results ** from the SELECT or the . ** @@ -61653,6 +70129,7 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( */ pExpr->iTable = pParse->nTab++; addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, !isRowid); + if( rMayHaveNull==0 ) sqlite3VdbeChangeP5(v, BTREE_UNORDERED); memset(&keyInfo, 0, sizeof(keyInfo)); keyInfo.nField = 1; @@ -61677,7 +70154,7 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( keyInfo.aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, pEList->a[0].pExpr); } - }else if( pExpr->x.pList!=0 ){ + }else if( ALWAYS(pExpr->x.pList!=0) ){ /* Case 2: expr IN (exprlist) ** ** For each expression, build an index key from the evaluation and @@ -61747,7 +70224,6 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( ** an integer 0 (not exists) or 1 (exists) into a memory cell ** and record that memory cell in iColumn. */ - static const Token one = { "1", 1 }; /* Token for literal value 1 */ Select *pSel; /* SELECT statement to encode */ SelectDest dest; /* How to deal with SELECt result */ @@ -61768,7 +70244,8 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( VdbeComment((v, "Init EXISTS result")); } sqlite3ExprDelete(pParse->db, pSel->pLimit); - pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &one); + pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, + &sqlite3IntTokens[1]); if( sqlite3Select(pParse, pSel, &dest) ){ return 0; } @@ -61787,6 +70264,140 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( } #endif /* SQLITE_OMIT_SUBQUERY */ +#ifndef SQLITE_OMIT_SUBQUERY +/* +** Generate code for an IN expression. +** +** x IN (SELECT ...) +** x IN (value, value, ...) +** +** The left-hand side (LHS) is a scalar expression. The right-hand side (RHS) +** is an array of zero or more values. The expression is true if the LHS is +** contained within the RHS. The value of the expression is unknown (NULL) +** if the LHS is NULL or if the LHS is not contained within the RHS and the +** RHS contains one or more NULL values. +** +** This routine generates code will jump to destIfFalse if the LHS is not +** contained within the RHS. If due to NULLs we cannot determine if the LHS +** is contained in the RHS then jump to destIfNull. If the LHS is contained +** within the RHS then fall through. +*/ +static void sqlite3ExprCodeIN( + Parse *pParse, /* Parsing and code generating context */ + Expr *pExpr, /* The IN expression */ + int destIfFalse, /* Jump here if LHS is not contained in the RHS */ + int destIfNull /* Jump here if the results are unknown due to NULLs */ +){ + int rRhsHasNull = 0; /* Register that is true if RHS contains NULL values */ + char affinity; /* Comparison affinity to use */ + int eType; /* Type of the RHS */ + int r1; /* Temporary use register */ + Vdbe *v; /* Statement under construction */ + + /* Compute the RHS. After this step, the table with cursor + ** pExpr->iTable will contains the values that make up the RHS. + */ + v = pParse->pVdbe; + assert( v!=0 ); /* OOM detected prior to this routine */ + VdbeNoopComment((v, "begin IN expr")); + eType = sqlite3FindInIndex(pParse, pExpr, &rRhsHasNull); + + /* Figure out the affinity to use to create a key from the results + ** of the expression. affinityStr stores a static string suitable for + ** P4 of OP_MakeRecord. + */ + affinity = comparisonAffinity(pExpr); + + /* Code the LHS, the from " IN (...)". + */ + sqlite3ExprCachePush(pParse); + r1 = sqlite3GetTempReg(pParse); + sqlite3ExprCode(pParse, pExpr->pLeft, r1); + + /* If the LHS is NULL, then the result is either false or NULL depending + ** on whether the RHS is empty or not, respectively. + */ + if( destIfNull==destIfFalse ){ + /* Shortcut for the common case where the false and NULL outcomes are + ** the same. */ + sqlite3VdbeAddOp2(v, OP_IsNull, r1, destIfNull); + }else{ + int addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, r1); + sqlite3VdbeAddOp2(v, OP_Rewind, pExpr->iTable, destIfFalse); + sqlite3VdbeAddOp2(v, OP_Goto, 0, destIfNull); + sqlite3VdbeJumpHere(v, addr1); + } + + if( eType==IN_INDEX_ROWID ){ + /* In this case, the RHS is the ROWID of table b-tree + */ + sqlite3VdbeAddOp2(v, OP_MustBeInt, r1, destIfFalse); + sqlite3VdbeAddOp3(v, OP_NotExists, pExpr->iTable, destIfFalse, r1); + }else{ + /* In this case, the RHS is an index b-tree. + */ + sqlite3VdbeAddOp4(v, OP_Affinity, r1, 1, 0, &affinity, 1); + + /* If the set membership test fails, then the result of the + ** "x IN (...)" expression must be either 0 or NULL. If the set + ** contains no NULL values, then the result is 0. If the set + ** contains one or more NULL values, then the result of the + ** expression is also NULL. + */ + if( rRhsHasNull==0 || destIfFalse==destIfNull ){ + /* This branch runs if it is known at compile time that the RHS + ** cannot contain NULL values. This happens as the result + ** of a "NOT NULL" constraint in the database schema. + ** + ** Also run this branch if NULL is equivalent to FALSE + ** for this particular IN operator. + */ + sqlite3VdbeAddOp4Int(v, OP_NotFound, pExpr->iTable, destIfFalse, r1, 1); + + }else{ + /* In this branch, the RHS of the IN might contain a NULL and + ** the presence of a NULL on the RHS makes a difference in the + ** outcome. + */ + int j1, j2, j3; + + /* First check to see if the LHS is contained in the RHS. If so, + ** then the presence of NULLs in the RHS does not matter, so jump + ** over all of the code that follows. + */ + j1 = sqlite3VdbeAddOp4Int(v, OP_Found, pExpr->iTable, 0, r1, 1); + + /* Here we begin generating code that runs if the LHS is not + ** contained within the RHS. Generate additional code that + ** tests the RHS for NULLs. If the RHS contains a NULL then + ** jump to destIfNull. If there are no NULLs in the RHS then + ** jump to destIfFalse. + */ + j2 = sqlite3VdbeAddOp1(v, OP_NotNull, rRhsHasNull); + j3 = sqlite3VdbeAddOp4Int(v, OP_Found, pExpr->iTable, 0, rRhsHasNull, 1); + sqlite3VdbeAddOp2(v, OP_Integer, -1, rRhsHasNull); + sqlite3VdbeJumpHere(v, j3); + sqlite3VdbeAddOp2(v, OP_AddImm, rRhsHasNull, 1); + sqlite3VdbeJumpHere(v, j2); + + /* Jump to the appropriate target depending on whether or not + ** the RHS contains a NULL + */ + sqlite3VdbeAddOp2(v, OP_If, rRhsHasNull, destIfNull); + sqlite3VdbeAddOp2(v, OP_Goto, 0, destIfFalse); + + /* The OP_Found at the top of this branch jumps here when true, + ** causing the overall IN expression evaluation to fall through. + */ + sqlite3VdbeJumpHere(v, j1); + } + } + sqlite3ReleaseTempReg(pParse, r1); + sqlite3ExprCachePop(pParse, 1); + VdbeComment((v, "end IN expr")); +} +#endif /* SQLITE_OMIT_SUBQUERY */ + /* ** Duplicate an 8-byte value */ @@ -61798,6 +70409,7 @@ static char *dup8bytes(Vdbe *v, const char *in){ return out; } +#ifndef SQLITE_OMIT_FLOATING_POINT /* ** Generate an instruction that will put the floating point ** value described by z[0..n-1] into register iMem. @@ -61810,40 +70422,45 @@ static void codeReal(Vdbe *v, const char *z, int negateFlag, int iMem){ if( ALWAYS(z!=0) ){ double value; char *zV; - sqlite3AtoF(z, &value); + sqlite3AtoF(z, &value, sqlite3Strlen30(z), SQLITE_UTF8); assert( !sqlite3IsNaN(value) ); /* The new AtoF never returns NaN */ if( negateFlag ) value = -value; zV = dup8bytes(v, (char*)&value); sqlite3VdbeAddOp4(v, OP_Real, 0, iMem, 0, zV, P4_REAL); } } +#endif /* ** Generate an instruction that will put the integer describe by ** text z[0..n-1] into register iMem. ** -** The z[] string will probably not be zero-terminated. But the -** z[n] character is guaranteed to be something that does not look -** like the continuation of the number. +** Expr.u.zToken is always UTF8 and zero-terminated. */ -static void codeInteger(Vdbe *v, Expr *pExpr, int negFlag, int iMem){ +static void codeInteger(Parse *pParse, Expr *pExpr, int negFlag, int iMem){ + Vdbe *v = pParse->pVdbe; if( pExpr->flags & EP_IntValue ){ int i = pExpr->u.iValue; if( negFlag ) i = -i; sqlite3VdbeAddOp2(v, OP_Integer, i, iMem); }else{ + int c; + i64 value; const char *z = pExpr->u.zToken; assert( z!=0 ); - if( sqlite3FitsIn64Bits(z, negFlag) ){ - i64 value; + c = sqlite3Atoi64(z, &value, sqlite3Strlen30(z), SQLITE_UTF8); + if( c==0 || (c==2 && negFlag) ){ char *zV; - sqlite3Atoi64(z, &value); - if( negFlag ) value = -value; + if( negFlag ){ value = -value; } zV = dup8bytes(v, (char*)&value); sqlite3VdbeAddOp4(v, OP_Int64, 0, iMem, 0, zV, P4_INT64); }else{ +#ifdef SQLITE_OMIT_FLOATING_POINT + sqlite3ErrorMsg(pParse, "oversized integer: %s%s", negFlag ? "-" : "", z); +#else codeReal(v, z, negFlag, iMem); +#endif } } } @@ -61874,17 +70491,31 @@ SQLITE_PRIVATE void sqlite3ExprCacheStore(Parse *pParse, int iTab, int iCol, int assert( iReg>0 ); /* Register numbers are always positive */ assert( iCol>=-1 && iCol<32768 ); /* Finite column numbers */ - /* First replace any existing entry */ + /* The SQLITE_ColumnCache flag disables the column cache. This is used + ** for testing only - to verify that SQLite always gets the same answer + ** with and without the column cache. + */ + if( pParse->db->flags & SQLITE_ColumnCache ) return; + + /* First replace any existing entry. + ** + ** Actually, the way the column cache is currently used, we are guaranteed + ** that the object will never already be in cache. Verify this guarantee. + */ +#ifndef NDEBUG for(i=0, p=pParse->aColCache; iiReg && p->iTable==iTab && p->iColumn==iCol ){ cacheEntryClear(pParse, p); p->iLevel = pParse->iCacheLevel; p->iReg = iReg; - p->affChange = 0; p->lru = pParse->iCacheCnt++; return; } +#endif + assert( p->iReg==0 || p->iTable!=iTab || p->iColumn!=iCol ); } +#endif /* Find an empty slot and replace it */ for(i=0, p=pParse->aColCache; iiTable = iTab; p->iColumn = iCol; p->iReg = iReg; - p->affChange = 0; p->tempReg = 0; p->lru = pParse->iCacheCnt++; return; @@ -61915,7 +70545,6 @@ SQLITE_PRIVATE void sqlite3ExprCacheStore(Parse *pParse, int iTab, int iCol, int p->iTable = iTab; p->iColumn = iCol; p->iReg = iReg; - p->affChange = 0; p->tempReg = 0; p->lru = pParse->iCacheCnt++; return; @@ -61923,14 +70552,16 @@ SQLITE_PRIVATE void sqlite3ExprCacheStore(Parse *pParse, int iTab, int iCol, int } /* -** Indicate that a register is being overwritten. Purge the register -** from the column cache. +** Indicate that registers between iReg..iReg+nReg-1 are being overwritten. +** Purge the range of registers from the column cache. */ -SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse *pParse, int iReg){ +SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse *pParse, int iReg, int nReg){ int i; + int iLast = iReg + nReg - 1; struct yColCache *p; for(i=0, p=pParse->aColCache; iiReg==iReg ){ + int r = p->iReg; + if( r>=iReg && r<=iLast ){ cacheEntryClear(pParse, p); p->iReg = 0; } @@ -61981,6 +70612,27 @@ static void sqlite3ExprCachePinRegister(Parse *pParse, int iReg){ } } +/* +** Generate code to extract the value of the iCol-th column of a table. +*/ +SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable( + Vdbe *v, /* The VDBE under construction */ + Table *pTab, /* The table containing the value */ + int iTabCur, /* The cursor for this table */ + int iCol, /* Index of the column to extract */ + int regOut /* Extract the valud into this register */ +){ + if( iCol<0 || iCol==pTab->iPKey ){ + sqlite3VdbeAddOp2(v, OP_Rowid, iTabCur, regOut); + }else{ + int op = IsVirtual(pTab) ? OP_VColumn : OP_Column; + sqlite3VdbeAddOp3(v, op, iTabCur, iCol, regOut); + } + if( iCol>=0 ){ + sqlite3ColumnDefault(v, pTab, iCol, regOut); + } +} + /* ** Generate code that will extract the iColumn-th column from ** table pTab and store the column value in a register. An effort @@ -61989,41 +70641,27 @@ static void sqlite3ExprCachePinRegister(Parse *pParse, int iReg){ ** ** There must be an open cursor to pTab in iTable when this routine ** is called. If iColumn<0 then code is generated that extracts the rowid. -** -** This routine might attempt to reuse the value of the column that -** has already been loaded into a register. The value will always -** be used if it has not undergone any affinity changes. But if -** an affinity change has occurred, then the cached value will only be -** used if allowAffChng is true. */ SQLITE_PRIVATE int sqlite3ExprCodeGetColumn( Parse *pParse, /* Parsing and code generating context */ Table *pTab, /* Description of the table we are reading from */ int iColumn, /* Index of the table column */ int iTable, /* The cursor pointing to the table */ - int iReg, /* Store results here */ - int allowAffChng /* True if prior affinity changes are OK */ + int iReg /* Store results here */ ){ Vdbe *v = pParse->pVdbe; int i; struct yColCache *p; for(i=0, p=pParse->aColCache; iiReg>0 && p->iTable==iTable && p->iColumn==iColumn - && (!p->affChange || allowAffChng) ){ + if( p->iReg>0 && p->iTable==iTable && p->iColumn==iColumn ){ p->lru = pParse->iCacheCnt++; sqlite3ExprCachePinRegister(pParse, p->iReg); return p->iReg; } } assert( v!=0 ); - if( iColumn<0 ){ - sqlite3VdbeAddOp2(v, OP_Rowid, iTable, iReg); - }else if( ALWAYS(pTab!=0) ){ - int op = IsVirtual(pTab) ? OP_VColumn : OP_Column; - sqlite3VdbeAddOp3(v, op, iTable, iColumn, iReg); - sqlite3ColumnDefault(v, pTab, iColumn, iReg); - } + sqlite3ExprCodeGetColumnOfTable(v, pTab, iTable, iColumn, iReg); sqlite3ExprCacheStore(pParse, iTable, iColumn, iReg); return iReg; } @@ -62048,15 +70686,7 @@ SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse *pParse){ ** registers starting with iStart. */ SQLITE_PRIVATE void sqlite3ExprCacheAffinityChange(Parse *pParse, int iStart, int iCount){ - int iEnd = iStart + iCount - 1; - int i; - struct yColCache *p; - for(i=0, p=pParse->aColCache; iiReg; - if( r>=iStart && r<=iEnd ){ - p->affChange = 1; - } - } + sqlite3ExprCacheRemove(pParse, iStart, iCount); } /* @@ -62088,86 +70718,24 @@ SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse *pParse, int iFrom, int iTo, int n } } +#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) /* ** Return true if any register in the range iFrom..iTo (inclusive) ** is used as part of the column cache. +** +** This routine is used within assert() and testcase() macros only +** and does not appear in a normal build. */ static int usedAsColumnCache(Parse *pParse, int iFrom, int iTo){ int i; struct yColCache *p; for(i=0, p=pParse->aColCache; iiReg; - if( r>=iFrom && r<=iTo ) return 1; + if( r>=iFrom && r<=iTo ) return 1; /*NO_TEST*/ } return 0; } - -/* -** If the last instruction coded is an ephemeral copy of any of -** the registers in the nReg registers beginning with iReg, then -** convert the last instruction from OP_SCopy to OP_Copy. -*/ -SQLITE_PRIVATE void sqlite3ExprHardCopy(Parse *pParse, int iReg, int nReg){ - VdbeOp *pOp; - Vdbe *v; - - assert( pParse->db->mallocFailed==0 ); - v = pParse->pVdbe; - assert( v!=0 ); - pOp = sqlite3VdbeGetOp(v, -1); - assert( pOp!=0 ); - if( pOp->opcode==OP_SCopy && pOp->p1>=iReg && pOp->p1opcode = OP_Copy; - } -} - -/* -** Generate code to store the value of the iAlias-th alias in register -** target. The first time this is called, pExpr is evaluated to compute -** the value of the alias. The value is stored in an auxiliary register -** and the number of that register is returned. On subsequent calls, -** the register number is returned without generating any code. -** -** Note that in order for this to work, code must be generated in the -** same order that it is executed. -** -** Aliases are numbered starting with 1. So iAlias is in the range -** of 1 to pParse->nAlias inclusive. -** -** pParse->aAlias[iAlias-1] records the register number where the value -** of the iAlias-th alias is stored. If zero, that means that the -** alias has not yet been computed. -*/ -static int codeAlias(Parse *pParse, int iAlias, Expr *pExpr, int target){ -#if 0 - sqlite3 *db = pParse->db; - int iReg; - if( pParse->nAliasAllocnAlias ){ - pParse->aAlias = sqlite3DbReallocOrFree(db, pParse->aAlias, - sizeof(pParse->aAlias[0])*pParse->nAlias ); - testcase( db->mallocFailed && pParse->nAliasAlloc>0 ); - if( db->mallocFailed ) return 0; - memset(&pParse->aAlias[pParse->nAliasAlloc], 0, - (pParse->nAlias-pParse->nAliasAlloc)*sizeof(pParse->aAlias[0])); - pParse->nAliasAlloc = pParse->nAlias; - } - assert( iAlias>0 && iAlias<=pParse->nAlias ); - iReg = pParse->aAlias[iAlias-1]; - if( iReg==0 ){ - if( pParse->iCacheLevel>0 ){ - iReg = sqlite3ExprCodeTarget(pParse, pExpr, target); - }else{ - iReg = ++pParse->nMem; - sqlite3ExprCode(pParse, pExpr, iReg); - pParse->aAlias[iAlias-1] = iReg; - } - } - return iReg; -#else - UNUSED_PARAMETER(iAlias); - return sqlite3ExprCodeTarget(pParse, pExpr, target); -#endif -} +#endif /* SQLITE_DEBUG || SQLITE_COVERAGE_TEST */ /* ** Generate code into the current Vdbe to evaluate the given @@ -62221,22 +70789,22 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) assert( pParse->ckBase>0 ); inReg = pExpr->iColumn + pParse->ckBase; }else{ - testcase( (pExpr->flags & EP_AnyAff)!=0 ); inReg = sqlite3ExprCodeGetColumn(pParse, pExpr->pTab, - pExpr->iColumn, pExpr->iTable, target, - pExpr->flags & EP_AnyAff); + pExpr->iColumn, pExpr->iTable, target); } break; } case TK_INTEGER: { - codeInteger(v, pExpr, 0, target); + codeInteger(pParse, pExpr, 0, target); break; } +#ifndef SQLITE_OMIT_FLOATING_POINT case TK_FLOAT: { assert( !ExprHasProperty(pExpr, EP_IntValue) ); codeReal(v, pExpr->u.zToken, 0, target); break; } +#endif case TK_STRING: { assert( !ExprHasProperty(pExpr, EP_IntValue) ); sqlite3VdbeAddOp4(v, OP_String8, 0, target, 0, pExpr->u.zToken, 0); @@ -62263,27 +70831,12 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) } #endif case TK_VARIABLE: { - VdbeOp *pOp; assert( !ExprHasProperty(pExpr, EP_IntValue) ); assert( pExpr->u.zToken!=0 ); assert( pExpr->u.zToken[0]!=0 ); - if( pExpr->u.zToken[1]==0 - && (pOp = sqlite3VdbeGetOp(v, -1))->opcode==OP_Variable - && pOp->p1+pOp->p3==pExpr->iColumn - && pOp->p2+pOp->p3==target - && pOp->p4.z==0 - ){ - /* If the previous instruction was a copy of the previous unnamed - ** parameter into the previous register, then simply increment the - ** repeat count on the prior instruction rather than making a new - ** instruction. - */ - pOp->p3++; - }else{ - sqlite3VdbeAddOp3(v, OP_Variable, pExpr->iColumn, target, 1); - if( pExpr->u.zToken[1]!=0 ){ - sqlite3VdbeChangeP4(v, -1, pExpr->u.zToken, 0); - } + sqlite3VdbeAddOp2(v, OP_Variable, pExpr->iColumn, target); + if( pExpr->u.zToken[1]!=0 ){ + sqlite3VdbeChangeP4(v, -1, pExpr->u.zToken, 0); } break; } @@ -62292,7 +70845,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) break; } case TK_AS: { - inReg = codeAlias(pParse, pExpr->iTable, pExpr->pLeft, target); + inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); break; } #ifndef SQLITE_OMIT_CAST @@ -62341,8 +70894,8 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) testcase( op==TK_GE ); testcase( op==TK_EQ ); testcase( op==TK_NE ); - codeCompareOperands(pParse, pExpr->pLeft, &r1, ®Free1, - pExpr->pRight, &r2, ®Free2); + r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); + r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, ®Free2); codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, r1, r2, inReg, SQLITE_STOREP2); testcase( regFree1==0 ); @@ -62353,8 +70906,8 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) case TK_ISNOT: { testcase( op==TK_IS ); testcase( op==TK_ISNOT ); - codeCompareOperands(pParse, pExpr->pLeft, &r1, ®Free1, - pExpr->pRight, &r2, ®Free2); + r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); + r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, ®Free2); op = (op==TK_IS) ? TK_EQ : TK_NE; codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, r1, r2, inReg, SQLITE_STOREP2 | SQLITE_NULLEQ); @@ -62406,11 +70959,13 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) case TK_UMINUS: { Expr *pLeft = pExpr->pLeft; assert( pLeft ); - if( pLeft->op==TK_FLOAT ){ + if( pLeft->op==TK_INTEGER ){ + codeInteger(pParse, pLeft, 1, target); +#ifndef SQLITE_OMIT_FLOATING_POINT + }else if( pLeft->op==TK_FLOAT ){ assert( !ExprHasProperty(pExpr, EP_IntValue) ); codeReal(v, pLeft->u.zToken, 1, target); - }else if( pLeft->op==TK_INTEGER ){ - codeInteger(v, pLeft, 1, target); +#endif }else{ regFree1 = r1 = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp2(v, OP_Integer, 0, r1); @@ -62487,6 +71042,27 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) sqlite3ErrorMsg(pParse, "unknown function: %.*s()", nId, zId); break; } + + /* Attempt a direct implementation of the built-in COALESCE() and + ** IFNULL() functions. This avoids unnecessary evalation of + ** arguments past the first non-NULL argument. + */ + if( pDef->flags & SQLITE_FUNC_COALESCE ){ + int endCoalesce = sqlite3VdbeMakeLabel(v); + assert( nFarg>=2 ); + sqlite3ExprCode(pParse, pFarg->a[0].pExpr, target); + for(i=1; ia[i].pExpr, target); + sqlite3ExprCachePop(pParse, 1); + } + sqlite3VdbeResolveLabel(v, endCoalesce); + break; + } + + if( pFarg ){ r1 = sqlite3GetTempRange(pParse, nFarg); sqlite3ExprCachePush(pParse); /* Ticket 2ea2425d34be */ @@ -62532,7 +71108,6 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) if( nFarg ){ sqlite3ReleaseTempRange(pParse, r1, nFarg); } - sqlite3ExprCacheAffinityChange(pParse, r1, nFarg); break; } #ifndef SQLITE_OMIT_SUBQUERY @@ -62544,95 +71119,19 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) break; } case TK_IN: { - int rNotFound = 0; - int rMayHaveNull = 0; - int j2, j3, j4, j5; - char affinity; - int eType; - - VdbeNoopComment((v, "begin IN expr r%d", target)); - eType = sqlite3FindInIndex(pParse, pExpr, &rMayHaveNull); - if( rMayHaveNull ){ - rNotFound = ++pParse->nMem; - } - - /* Figure out the affinity to use to create a key from the results - ** of the expression. affinityStr stores a static string suitable for - ** P4 of OP_MakeRecord. - */ - affinity = comparisonAffinity(pExpr); - - - /* Code the from " IN (...)". The temporary table - ** pExpr->iTable contains the values that make up the (...) set. - */ - sqlite3ExprCachePush(pParse); - sqlite3ExprCode(pParse, pExpr->pLeft, target); - j2 = sqlite3VdbeAddOp1(v, OP_IsNull, target); - if( eType==IN_INDEX_ROWID ){ - j3 = sqlite3VdbeAddOp1(v, OP_MustBeInt, target); - j4 = sqlite3VdbeAddOp3(v, OP_NotExists, pExpr->iTable, 0, target); - sqlite3VdbeAddOp2(v, OP_Integer, 1, target); - j5 = sqlite3VdbeAddOp0(v, OP_Goto); - sqlite3VdbeJumpHere(v, j3); - sqlite3VdbeJumpHere(v, j4); - sqlite3VdbeAddOp2(v, OP_Integer, 0, target); - }else{ - r2 = regFree2 = sqlite3GetTempReg(pParse); - - /* Create a record and test for set membership. If the set contains - ** the value, then jump to the end of the test code. The target - ** register still contains the true (1) value written to it earlier. - */ - sqlite3VdbeAddOp4(v, OP_MakeRecord, target, 1, r2, &affinity, 1); - sqlite3VdbeAddOp2(v, OP_Integer, 1, target); - j5 = sqlite3VdbeAddOp3(v, OP_Found, pExpr->iTable, 0, r2); - - /* If the set membership test fails, then the result of the - ** "x IN (...)" expression must be either 0 or NULL. If the set - ** contains no NULL values, then the result is 0. If the set - ** contains one or more NULL values, then the result of the - ** expression is also NULL. - */ - if( rNotFound==0 ){ - /* This branch runs if it is known at compile time (now) that - ** the set contains no NULL values. This happens as the result - ** of a "NOT NULL" constraint in the database schema. No need - ** to test the data structure at runtime in this case. - */ - sqlite3VdbeAddOp2(v, OP_Integer, 0, target); - }else{ - /* This block populates the rNotFound register with either NULL - ** or 0 (an integer value). If the data structure contains one - ** or more NULLs, then set rNotFound to NULL. Otherwise, set it - ** to 0. If register rMayHaveNull is already set to some value - ** other than NULL, then the test has already been run and - ** rNotFound is already populated. - */ - static const char nullRecord[] = { 0x02, 0x00 }; - j3 = sqlite3VdbeAddOp1(v, OP_NotNull, rMayHaveNull); - sqlite3VdbeAddOp2(v, OP_Null, 0, rNotFound); - sqlite3VdbeAddOp4(v, OP_Blob, 2, rMayHaveNull, 0, - nullRecord, P4_STATIC); - j4 = sqlite3VdbeAddOp3(v, OP_Found, pExpr->iTable, 0, rMayHaveNull); - sqlite3VdbeAddOp2(v, OP_Integer, 0, rNotFound); - sqlite3VdbeJumpHere(v, j4); - sqlite3VdbeJumpHere(v, j3); - - /* Copy the value of register rNotFound (which is either NULL or 0) - ** into the target register. This will be the result of the - ** expression. - */ - sqlite3VdbeAddOp2(v, OP_Copy, rNotFound, target); - } - } - sqlite3VdbeJumpHere(v, j2); - sqlite3VdbeJumpHere(v, j5); - sqlite3ExprCachePop(pParse, 1); - VdbeComment((v, "end IN expr r%d", target)); + int destIfFalse = sqlite3VdbeMakeLabel(v); + int destIfNull = sqlite3VdbeMakeLabel(v); + sqlite3VdbeAddOp2(v, OP_Null, 0, target); + sqlite3ExprCodeIN(pParse, pExpr, destIfFalse, destIfNull); + sqlite3VdbeAddOp2(v, OP_Integer, 1, target); + sqlite3VdbeResolveLabel(v, destIfFalse); + sqlite3VdbeAddOp2(v, OP_AddImm, target, 0); + sqlite3VdbeResolveLabel(v, destIfNull); break; } -#endif +#endif /* SQLITE_OMIT_SUBQUERY */ + + /* ** x BETWEEN y AND z ** @@ -62649,8 +71148,8 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) struct ExprList_item *pLItem = pExpr->x.pList->a; Expr *pRight = pLItem->pExpr; - codeCompareOperands(pParse, pLeft, &r1, ®Free1, - pRight, &r2, ®Free2); + r1 = sqlite3ExprCodeTemp(pParse, pLeft, ®Free1); + r2 = sqlite3ExprCodeTemp(pParse, pRight, ®Free2); testcase( regFree1==0 ); testcase( regFree2==0 ); r3 = sqlite3GetTempReg(pParse); @@ -62714,6 +71213,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) target )); +#ifndef SQLITE_OMIT_FLOATING_POINT /* If the column has REAL affinity, it may currently be stored as an ** integer. Use OP_RealAffinity to make sure it is really real. */ if( pExpr->iColumn>=0 @@ -62721,6 +71221,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) ){ sqlite3VdbeAddOp1(v, OP_RealAffinity, target); } +#endif break; } @@ -62776,6 +71277,11 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) opCompare.op = TK_EQ; opCompare.pLeft = &cacheX; pTest = &opCompare; + /* Ticket b351d95f9cd5ef17e9d9dbae18f5ca8611190001: + ** The value in regFree1 might get SCopy-ed into the file result. + ** So make sure that the regFree1 register is not reused for other + ** purposes and possibly overwritten. */ + regFree1 = 0; } for(i=0; i0 && target<=pParse->nMem ); - inReg = sqlite3ExprCodeTarget(pParse, pExpr, target); - assert( pParse->pVdbe || pParse->db->mallocFailed ); - if( inReg!=target && pParse->pVdbe ){ - sqlite3VdbeAddOp2(pParse->pVdbe, OP_SCopy, inReg, target); + if( pExpr && pExpr->op==TK_REGISTER ){ + sqlite3VdbeAddOp2(pParse->pVdbe, OP_Copy, pExpr->iTable, target); + }else{ + inReg = sqlite3ExprCodeTarget(pParse, pExpr, target); + assert( pParse->pVdbe || pParse->db->mallocFailed ); + if( inReg!=target && pParse->pVdbe ){ + sqlite3VdbeAddOp2(pParse->pVdbe, OP_SCopy, inReg, target); + } } return target; } @@ -63045,24 +71555,75 @@ SQLITE_PRIVATE int sqlite3ExprCodeExprList( int i, n; assert( pList!=0 ); assert( target>0 ); + assert( pParse->pVdbe!=0 ); /* Never gets this far otherwise */ n = pList->nExpr; for(pItem=pList->a, i=0; iiAlias ){ - int iReg = codeAlias(pParse, pItem->iAlias, pItem->pExpr, target+i); - Vdbe *v = sqlite3GetVdbe(pParse); - if( iReg!=target+i ){ - sqlite3VdbeAddOp2(v, OP_SCopy, iReg, target+i); - } - }else{ - sqlite3ExprCode(pParse, pItem->pExpr, target+i); - } - if( doHardCopy && !pParse->db->mallocFailed ){ - sqlite3ExprHardCopy(pParse, target, n); + Expr *pExpr = pItem->pExpr; + int inReg = sqlite3ExprCodeTarget(pParse, pExpr, target+i); + if( inReg!=target+i ){ + sqlite3VdbeAddOp2(pParse->pVdbe, doHardCopy ? OP_Copy : OP_SCopy, + inReg, target+i); } } return n; } +/* +** Generate code for a BETWEEN operator. +** +** x BETWEEN y AND z +** +** The above is equivalent to +** +** x>=y AND x<=z +** +** Code it as such, taking care to do the common subexpression +** elementation of x. +*/ +static void exprCodeBetween( + Parse *pParse, /* Parsing and code generating context */ + Expr *pExpr, /* The BETWEEN expression */ + int dest, /* Jump here if the jump is taken */ + int jumpIfTrue, /* Take the jump if the BETWEEN is true */ + int jumpIfNull /* Take the jump if the BETWEEN is NULL */ +){ + Expr exprAnd; /* The AND operator in x>=y AND x<=z */ + Expr compLeft; /* The x>=y term */ + Expr compRight; /* The x<=z term */ + Expr exprX; /* The x subexpression */ + int regFree1 = 0; /* Temporary use register */ + + assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); + exprX = *pExpr->pLeft; + exprAnd.op = TK_AND; + exprAnd.pLeft = &compLeft; + exprAnd.pRight = &compRight; + compLeft.op = TK_GE; + compLeft.pLeft = &exprX; + compLeft.pRight = pExpr->x.pList->a[0].pExpr; + compRight.op = TK_LE; + compRight.pLeft = &exprX; + compRight.pRight = pExpr->x.pList->a[1].pExpr; + exprX.iTable = sqlite3ExprCodeTemp(pParse, &exprX, ®Free1); + exprX.op = TK_REGISTER; + if( jumpIfTrue ){ + sqlite3ExprIfTrue(pParse, &exprAnd, dest, jumpIfNull); + }else{ + sqlite3ExprIfFalse(pParse, &exprAnd, dest, jumpIfNull); + } + sqlite3ReleaseTempReg(pParse, regFree1); + + /* Ensure adequate test coverage */ + testcase( jumpIfTrue==0 && jumpIfNull==0 && regFree1==0 ); + testcase( jumpIfTrue==0 && jumpIfNull==0 && regFree1!=0 ); + testcase( jumpIfTrue==0 && jumpIfNull!=0 && regFree1==0 ); + testcase( jumpIfTrue==0 && jumpIfNull!=0 && regFree1!=0 ); + testcase( jumpIfTrue!=0 && jumpIfNull==0 && regFree1==0 ); + testcase( jumpIfTrue!=0 && jumpIfNull==0 && regFree1!=0 ); + testcase( jumpIfTrue!=0 && jumpIfNull!=0 && regFree1==0 ); + testcase( jumpIfTrue!=0 && jumpIfNull!=0 && regFree1!=0 ); +} + /* ** Generate code for a boolean expression such that a jump is made ** to the label "dest" if the expression is true but execution @@ -63129,8 +71690,8 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int testcase( op==TK_EQ ); testcase( op==TK_NE ); testcase( jumpIfNull==0 ); - codeCompareOperands(pParse, pExpr->pLeft, &r1, ®Free1, - pExpr->pRight, &r2, ®Free2); + r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); + r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, ®Free2); codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, r1, r2, dest, jumpIfNull); testcase( regFree1==0 ); @@ -63141,8 +71702,8 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int case TK_ISNOT: { testcase( op==TK_IS ); testcase( op==TK_ISNOT ); - codeCompareOperands(pParse, pExpr->pLeft, &r1, ®Free1, - pExpr->pRight, &r2, ®Free2); + r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); + r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, ®Free2); op = (op==TK_IS) ? TK_EQ : TK_NE; codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, r1, r2, dest, SQLITE_NULLEQ); @@ -63162,36 +71723,16 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int break; } case TK_BETWEEN: { - /* x BETWEEN y AND z - ** - ** Is equivalent to - ** - ** x>=y AND x<=z - ** - ** Code it as such, taking care to do the common subexpression - ** elementation of x. - */ - Expr exprAnd; - Expr compLeft; - Expr compRight; - Expr exprX; - - assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); - exprX = *pExpr->pLeft; - exprAnd.op = TK_AND; - exprAnd.pLeft = &compLeft; - exprAnd.pRight = &compRight; - compLeft.op = TK_GE; - compLeft.pLeft = &exprX; - compLeft.pRight = pExpr->x.pList->a[0].pExpr; - compRight.op = TK_LE; - compRight.pLeft = &exprX; - compRight.pRight = pExpr->x.pList->a[1].pExpr; - exprX.iTable = sqlite3ExprCodeTemp(pParse, &exprX, ®Free1); - testcase( regFree1==0 ); - exprX.op = TK_REGISTER; testcase( jumpIfNull==0 ); - sqlite3ExprIfTrue(pParse, &exprAnd, dest, jumpIfNull); + exprCodeBetween(pParse, pExpr, dest, 1, jumpIfNull); + break; + } + case TK_IN: { + int destIfFalse = sqlite3VdbeMakeLabel(v); + int destIfNull = jumpIfNull ? dest : destIfFalse; + sqlite3ExprCodeIN(pParse, pExpr, destIfFalse, destIfNull); + sqlite3VdbeAddOp2(v, OP_Goto, 0, dest); + sqlite3VdbeResolveLabel(v, destIfFalse); break; } default: { @@ -63275,6 +71816,7 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int break; } case TK_NOT: { + testcase( jumpIfNull==0 ); sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); break; } @@ -63291,8 +71833,8 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int testcase( op==TK_EQ ); testcase( op==TK_NE ); testcase( jumpIfNull==0 ); - codeCompareOperands(pParse, pExpr->pLeft, &r1, ®Free1, - pExpr->pRight, &r2, ®Free2); + r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); + r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, ®Free2); codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, r1, r2, dest, jumpIfNull); testcase( regFree1==0 ); @@ -63303,8 +71845,8 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int case TK_ISNOT: { testcase( pExpr->op==TK_IS ); testcase( pExpr->op==TK_ISNOT ); - codeCompareOperands(pParse, pExpr->pLeft, &r1, ®Free1, - pExpr->pRight, &r2, ®Free2); + r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); + r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, ®Free2); op = (pExpr->op==TK_IS) ? TK_NE : TK_EQ; codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, r1, r2, dest, SQLITE_NULLEQ); @@ -63322,36 +71864,18 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int break; } case TK_BETWEEN: { - /* x BETWEEN y AND z - ** - ** Is equivalent to - ** - ** x>=y AND x<=z - ** - ** Code it as such, taking care to do the common subexpression - ** elementation of x. - */ - Expr exprAnd; - Expr compLeft; - Expr compRight; - Expr exprX; - - assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); - exprX = *pExpr->pLeft; - exprAnd.op = TK_AND; - exprAnd.pLeft = &compLeft; - exprAnd.pRight = &compRight; - compLeft.op = TK_GE; - compLeft.pLeft = &exprX; - compLeft.pRight = pExpr->x.pList->a[0].pExpr; - compRight.op = TK_LE; - compRight.pLeft = &exprX; - compRight.pRight = pExpr->x.pList->a[1].pExpr; - exprX.iTable = sqlite3ExprCodeTemp(pParse, &exprX, ®Free1); - testcase( regFree1==0 ); - exprX.op = TK_REGISTER; testcase( jumpIfNull==0 ); - sqlite3ExprIfFalse(pParse, &exprAnd, dest, jumpIfNull); + exprCodeBetween(pParse, pExpr, dest, 0, jumpIfNull); + break; + } + case TK_IN: { + if( jumpIfNull ){ + sqlite3ExprCodeIN(pParse, pExpr, dest, dest); + }else{ + int destIfNull = sqlite3VdbeMakeLabel(v); + sqlite3ExprCodeIN(pParse, pExpr, dest, destIfNull); + sqlite3VdbeResolveLabel(v, destIfNull); + } break; } default: { @@ -63367,59 +71891,76 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int } /* -** Do a deep comparison of two expression trees. Return TRUE (non-zero) -** if they are identical and return FALSE if they differ in any way. +** Do a deep comparison of two expression trees. Return 0 if the two +** expressions are completely identical. Return 1 if they differ only +** by a COLLATE operator at the top level. Return 2 if there are differences +** other than the top-level COLLATE operator. ** -** Sometimes this routine will return FALSE even if the two expressions +** Sometimes this routine will return 2 even if the two expressions ** really are equivalent. If we cannot prove that the expressions are -** identical, we return FALSE just to be safe. So if this routine -** returns false, then you do not really know for certain if the two -** expressions are the same. But if you get a TRUE return, then you +** identical, we return 2 just to be safe. So if this routine +** returns 2, then you do not really know for certain if the two +** expressions are the same. But if you get a 0 or 1 return, then you ** can be sure the expressions are the same. In the places where -** this routine is used, it does not hurt to get an extra FALSE - that +** this routine is used, it does not hurt to get an extra 2 - that ** just might result in some slightly slower code. But returning -** an incorrect TRUE could lead to a malfunction. +** an incorrect 0 or 1 could lead to a malfunction. */ SQLITE_PRIVATE int sqlite3ExprCompare(Expr *pA, Expr *pB){ - int i; if( pA==0||pB==0 ){ - return pB==pA; + return pB==pA ? 0 : 2; } assert( !ExprHasAnyProperty(pA, EP_TokenOnly|EP_Reduced) ); assert( !ExprHasAnyProperty(pB, EP_TokenOnly|EP_Reduced) ); if( ExprHasProperty(pA, EP_xIsSelect) || ExprHasProperty(pB, EP_xIsSelect) ){ - return 0; + return 2; } - if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 0; - if( pA->op!=pB->op ) return 0; - if( !sqlite3ExprCompare(pA->pLeft, pB->pLeft) ) return 0; - if( !sqlite3ExprCompare(pA->pRight, pB->pRight) ) return 0; - - if( pA->x.pList && pB->x.pList ){ - if( pA->x.pList->nExpr!=pB->x.pList->nExpr ) return 0; - for(i=0; ix.pList->nExpr; i++){ - Expr *pExprA = pA->x.pList->a[i].pExpr; - Expr *pExprB = pB->x.pList->a[i].pExpr; - if( !sqlite3ExprCompare(pExprA, pExprB) ) return 0; - } - }else if( pA->x.pList || pB->x.pList ){ - return 0; - } - - if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 0; + if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 2; + if( pA->op!=pB->op ) return 2; + if( sqlite3ExprCompare(pA->pLeft, pB->pLeft) ) return 2; + if( sqlite3ExprCompare(pA->pRight, pB->pRight) ) return 2; + if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList) ) return 2; + if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 2; if( ExprHasProperty(pA, EP_IntValue) ){ if( !ExprHasProperty(pB, EP_IntValue) || pA->u.iValue!=pB->u.iValue ){ - return 0; + return 2; } }else if( pA->op!=TK_COLUMN && pA->u.zToken ){ - if( ExprHasProperty(pB, EP_IntValue) || NEVER(pB->u.zToken==0) ) return 0; + if( ExprHasProperty(pB, EP_IntValue) || NEVER(pB->u.zToken==0) ) return 2; if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ){ - return 0; + return 2; } } - return 1; + if( (pA->flags & EP_ExpCollate)!=(pB->flags & EP_ExpCollate) ) return 1; + if( (pA->flags & EP_ExpCollate)!=0 && pA->pColl!=pB->pColl ) return 2; + return 0; } +/* +** Compare two ExprList objects. Return 0 if they are identical and +** non-zero if they differ in any way. +** +** This routine might return non-zero for equivalent ExprLists. The +** only consequence will be disabled optimizations. But this routine +** must never return 0 if the two ExprList objects are different, or +** a malfunction will result. +** +** Two NULL pointers are considered to be the same. But a NULL pointer +** always differs from a non-NULL pointer. +*/ +SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList *pA, ExprList *pB){ + int i; + if( pA==0 && pB==0 ) return 0; + if( pA==0 || pB==0 ) return 1; + if( pA->nExpr!=pB->nExpr ) return 1; + for(i=0; inExpr; i++){ + Expr *pExprA = pA->a[i].pExpr; + Expr *pExprB = pB->a[i].pExpr; + if( pA->a[i].sortOrder!=pB->a[i].sortOrder ) return 1; + if( sqlite3ExprCompare(pExprA, pExprB) ) return 1; + } + return 0; +} /* ** Add a new element to the pAggInfo->aCol[] array. Return the index of @@ -63548,7 +72089,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ */ struct AggInfo_func *pItem = pAggInfo->aFunc; for(i=0; inFunc; i++, pItem++){ - if( sqlite3ExprCompare(pItem->pExpr, pExpr) ){ + if( sqlite3ExprCompare(pItem->pExpr, pExpr)==0 ){ break; } } @@ -63669,7 +72210,8 @@ SQLITE_PRIVATE int sqlite3GetTempRange(Parse *pParse, int nReg){ int i, n; i = pParse->iRangeReg; n = pParse->nRangeReg; - if( nReg<=n && !usedAsColumnCache(pParse, i, i+n-1) ){ + if( nReg<=n ){ + assert( !usedAsColumnCache(pParse, i, i+n-1) ); pParse->iRangeReg += nReg; pParse->nRangeReg -= nReg; }else{ @@ -63679,6 +72221,7 @@ SQLITE_PRIVATE int sqlite3GetTempRange(Parse *pParse, int nReg){ return i; } SQLITE_PRIVATE void sqlite3ReleaseTempRange(Parse *pParse, int iReg, int nReg){ + sqlite3ExprCacheRemove(pParse, iReg, nReg); if( nReg>pParse->nRangeReg ){ pParse->nRangeReg = nReg; pParse->iRangeReg = iReg; @@ -63700,8 +72243,6 @@ SQLITE_PRIVATE void sqlite3ReleaseTempRange(Parse *pParse, int iReg, int nReg){ ************************************************************************* ** This file contains C code routines that used to generate VDBE code ** that implements the ALTER TABLE command. -** -** $Id: alter.c,v 1.62 2009/07/24 17:58:53 danielk1977 Exp $ */ /* @@ -63916,17 +72457,23 @@ static void renameTriggerFunc( /* ** Register built-in functions used to help implement ALTER TABLE */ -SQLITE_PRIVATE void sqlite3AlterFunctions(sqlite3 *db){ - sqlite3CreateFunc(db, "sqlite_rename_table", 2, SQLITE_UTF8, 0, - renameTableFunc, 0, 0); +SQLITE_PRIVATE void sqlite3AlterFunctions(void){ + static SQLITE_WSD FuncDef aAlterTableFuncs[] = { + FUNCTION(sqlite_rename_table, 2, 0, 0, renameTableFunc), #ifndef SQLITE_OMIT_TRIGGER - sqlite3CreateFunc(db, "sqlite_rename_trigger", 2, SQLITE_UTF8, 0, - renameTriggerFunc, 0, 0); + FUNCTION(sqlite_rename_trigger, 2, 0, 0, renameTriggerFunc), #endif #ifndef SQLITE_OMIT_FOREIGN_KEY - sqlite3CreateFunc(db, "sqlite_rename_parent", 3, SQLITE_UTF8, 0, - renameParentFunc, 0, 0); + FUNCTION(sqlite_rename_parent, 3, 0, 0, renameParentFunc), #endif + }; + int i; + FuncDefHash *pHash = &GLOBAL(FuncDefHash, sqlite3GlobalFunctions); + FuncDef *aFunc = (FuncDef*)&GLOBAL(FuncDef, aAlterTableFuncs); + + for(i=0; idb, "type='trigger' AND (%s)", zWhere); + sqlite3DbFree(pParse->db, zWhere); + zWhere = zNew; + } return zWhere; } @@ -64070,7 +72622,9 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( char *zWhere = 0; /* Where clause to locate temp triggers */ #endif VTable *pVTab = 0; /* Non-zero if this is a v-tab with an xRename() */ - + int savedDbFlags; /* Saved value of db->flags */ + + savedDbFlags = db->flags; if( NEVER(db->mallocFailed) ) goto exit_rename_table; assert( pSrc->nSrc==1 ); assert( sqlite3BtreeHoldsAllMutexes(pParse->db) ); @@ -64079,6 +72633,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( if( !pTab ) goto exit_rename_table; iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); zDb = db->aDb[iDb].zName; + db->flags |= SQLITE_PreferBuiltin; /* Get a NULL terminated version of the new table name. */ zName = sqlite3NameFromToken(db, pName); @@ -64169,9 +72724,9 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( ** for which the renamed table is the parent table. */ if( (zWhere=whereForeignKeys(pParse, pTab))!=0 ){ sqlite3NestedParse(pParse, - "UPDATE sqlite_master SET " + "UPDATE \"%w\".%s SET " "sql = sqlite_rename_parent(sql, %Q, %Q) " - "WHERE %s;", zTabName, zName, zWhere); + "WHERE %s;", zDb, SCHEMA_TABLE(iDb), zTabName, zName, zWhere); sqlite3DbFree(db, zWhere); } } @@ -64246,6 +72801,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( exit_rename_table: sqlite3SrcListDelete(db, pSrc); sqlite3DbFree(db, zName); + db->flags = savedDbFlags; } @@ -64365,9 +72921,11 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ zCol = sqlite3DbStrNDup(db, (char*)pColDef->z, pColDef->n); if( zCol ){ char *zEnd = &zCol[pColDef->n-1]; + int savedDbFlags = db->flags; while( zEnd>zCol && (*zEnd==';' || sqlite3Isspace(*zEnd)) ){ *zEnd-- = '\0'; } + db->flags |= SQLITE_PreferBuiltin; sqlite3NestedParse(pParse, "UPDATE \"%w\".%s SET " "sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d) " @@ -64376,6 +72934,7 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ zTab ); sqlite3DbFree(db, zCol); + db->flags = savedDbFlags; } /* If the default value of the new column is NULL, then set the file @@ -64446,7 +73005,6 @@ SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){ if( !pNew ) goto exit_begin_add_column; pParse->pNewTable = pNew; pNew->nRef = 1; - pNew->dbMem = pTab->dbMem; pNew->nCol = pTab->nCol; assert( pNew->nCol>0 ); nAlloc = (((pNew->nCol-1)/8)*8)+8; @@ -64496,8 +73054,6 @@ exit_begin_add_column: ** ************************************************************************* ** This file contains code associated with the ANALYZE command. -** -** @(#) $Id: analyze.c,v 1.52 2009/04/16 17:45:48 drh Exp $ */ #ifndef SQLITE_OMIT_ANALYZE @@ -64523,7 +73079,7 @@ static void openStatTable( int iStatCur, /* Open the sqlite_stat1 table on this cursor */ const char *zWhere /* Delete entries associated with this table */ ){ - static struct { + static const struct { const char *zName; const char *zCols; } aTable[] = { @@ -64600,7 +73156,8 @@ static void analyzeOneTable( int i; /* Loop counter */ int topOfLoop; /* The top of the loop */ int endOfLoop; /* The end of the loop */ - int addr; /* The address of an instruction */ + int addr = 0; /* The address of an instruction */ + int jZeroRows = 0; /* Jump from here if number of rows is zero */ int iDb; /* Index of database containing pTab */ int regTabname = iMem++; /* Register containing table name */ int regIdxname = iMem++; /* Register containing index name */ @@ -64619,8 +73176,15 @@ static void analyzeOneTable( #endif v = sqlite3GetVdbe(pParse); - if( v==0 || NEVER(pTab==0) || pTab->pIndex==0 ){ - /* Do no analysis for tables that have no indices */ + if( v==0 || NEVER(pTab==0) ){ + return; + } + if( pTab->tnum==0 ){ + /* Do not gather statistics on views or virtual tables */ + return; + } + if( memcmp(pTab->zName, "sqlite_", 7)==0 ){ + /* Do not gather statistics on system tables */ return; } assert( sqlite3BtreeHoldsAllMutexes(db) ); @@ -64637,6 +73201,7 @@ static void analyzeOneTable( sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName); iIdxCur = pParse->nTab++; + sqlite3VdbeAddOp4(v, OP_String8, 0, regTabname, 0, pTab->zName, 0); for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ int nCol = pIdx->nColumn; KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx); @@ -64651,10 +73216,7 @@ static void analyzeOneTable( (char *)pKey, P4_KEYINFO_HANDOFF); VdbeComment((v, "%s", pIdx->zName)); - /* Populate the registers containing the table and index names. */ - if( pTab->pIndex==pIdx ){ - sqlite3VdbeAddOp4(v, OP_String8, 0, regTabname, 0, pTab->zName, 0); - } + /* Populate the register containing the index name. */ sqlite3VdbeAddOp4(v, OP_String8, 0, regIdxname, 0, pIdx->zName, 0); #ifdef SQLITE_ENABLE_STAT2 @@ -64789,8 +73351,10 @@ static void analyzeOneTable( ** If K>0 then it is always the case the D>0 so division by zero ** is never possible. */ - addr = sqlite3VdbeAddOp1(v, OP_IfNot, iMem); sqlite3VdbeAddOp2(v, OP_SCopy, iMem, regSampleno); + if( jZeroRows==0 ){ + jZeroRows = sqlite3VdbeAddOp1(v, OP_IfNot, iMem); + } for(i=0; ipIndex==0 ){ + sqlite3VdbeAddOp3(v, OP_OpenRead, iIdxCur, pTab->tnum, iDb); + VdbeComment((v, "%s", pTab->zName)); + sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regSampleno); + sqlite3VdbeAddOp1(v, OP_Close, iIdxCur); + }else{ + assert( jZeroRows>0 ); + addr = sqlite3VdbeAddOp0(v, OP_Goto); + sqlite3VdbeJumpHere(v, jZeroRows); + } + sqlite3VdbeAddOp2(v, OP_Null, 0, regIdxname); + sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 3, regRec, "aaa", 0); + sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur, regRowid); + sqlite3VdbeAddOp3(v, OP_Insert, iStatCur, regRec, regRowid); + sqlite3VdbeChangeP5(v, OPFLAG_APPEND); + if( pParse->nMemnMem = regRec; + if( jZeroRows ){ sqlite3VdbeJumpHere(v, addr); } } /* ** Generate code that will cause the most recent index analysis to -** be laoded into internal hash tables where is can be used. +** be loaded into internal hash tables where is can be used. */ static void loadAnalysis(Parse *pParse, int iDb){ Vdbe *v = sqlite3GetVdbe(pParse); @@ -64940,33 +73526,46 @@ struct analysisInfo { ** This callback is invoked once for each index when reading the ** sqlite_stat1 table. ** -** argv[0] = name of the index -** argv[1] = results of analysis - on integer for each column +** argv[0] = name of the table +** argv[1] = name of the index (might be NULL) +** argv[2] = results of analysis - on integer for each column +** +** Entries for which argv[1]==NULL simply record the number of rows in +** the table. */ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){ analysisInfo *pInfo = (analysisInfo*)pData; Index *pIndex; - int i, c; + Table *pTable; + int i, c, n; unsigned int v; const char *z; - assert( argc==2 ); + assert( argc==3 ); UNUSED_PARAMETER2(NotUsed, argc); - if( argv==0 || argv[0]==0 || argv[1]==0 ){ + if( argv==0 || argv[0]==0 || argv[2]==0 ){ return 0; } - pIndex = sqlite3FindIndex(pInfo->db, argv[0], pInfo->zDatabase); - if( pIndex==0 ){ + pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase); + if( pTable==0 ){ return 0; } - z = argv[1]; - for(i=0; *z && i<=pIndex->nColumn; i++){ + if( argv[1] ){ + pIndex = sqlite3FindIndex(pInfo->db, argv[1], pInfo->zDatabase); + }else{ + pIndex = 0; + } + n = pIndex ? pIndex->nColumn : 0; + z = argv[2]; + for(i=0; *z && i<=n; i++){ v = 0; while( (c=z[0])>='0' && c<='9' ){ v = v*10 + c - '0'; z++; } + if( i==0 ) pTable->nRowEst = v; + if( pIndex==0 ) break; pIndex->aiRowEst[i] = v; if( *z==' ' ) z++; } @@ -64977,21 +73576,20 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){ ** If the Index.aSample variable is not NULL, delete the aSample[] array ** and its contents. */ -SQLITE_PRIVATE void sqlite3DeleteIndexSamples(Index *pIdx){ +SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3 *db, Index *pIdx){ #ifdef SQLITE_ENABLE_STAT2 if( pIdx->aSample ){ int j; - sqlite3 *dbMem = pIdx->pTable->dbMem; for(j=0; jaSample[j]; if( p->eType==SQLITE_TEXT || p->eType==SQLITE_BLOB ){ - sqlite3DbFree(pIdx->pTable->dbMem, p->u.z); + sqlite3DbFree(db, p->u.z); } } - sqlite3DbFree(dbMem, pIdx->aSample); - pIdx->aSample = 0; + sqlite3DbFree(db, pIdx->aSample); } #else + UNUSED_PARAMETER(db); UNUSED_PARAMETER(pIdx); #endif } @@ -65030,7 +73628,8 @@ SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){ for(i=sqliteHashFirst(&db->aDb[iDb].pSchema->idxHash);i;i=sqliteHashNext(i)){ Index *pIdx = sqliteHashData(i); sqlite3DefaultRowEst(pIdx); - sqlite3DeleteIndexSamples(pIdx); + sqlite3DeleteIndexSamples(db, pIdx); + pIdx->aSample = 0; } /* Check to make sure the sqlite_stat1 table exists */ @@ -65042,13 +73641,11 @@ SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){ /* Load new statistics out of the sqlite_stat1 table */ zSql = sqlite3MPrintf(db, - "SELECT idx, stat FROM %Q.sqlite_stat1", sInfo.zDatabase); + "SELECT tbl, idx, stat FROM %Q.sqlite_stat1", sInfo.zDatabase); if( zSql==0 ){ rc = SQLITE_NOMEM; }else{ - (void)sqlite3SafetyOff(db); rc = sqlite3_exec(db, zSql, analysisLoader, &sInfo, 0); - (void)sqlite3SafetyOn(db); sqlite3DbFree(db, zSql); } @@ -65066,31 +73663,27 @@ SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){ if( !zSql ){ rc = SQLITE_NOMEM; }else{ - (void)sqlite3SafetyOff(db); rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0); - (void)sqlite3SafetyOn(db); sqlite3DbFree(db, zSql); } if( rc==SQLITE_OK ){ - (void)sqlite3SafetyOff(db); while( sqlite3_step(pStmt)==SQLITE_ROW ){ char *zIndex = (char *)sqlite3_column_text(pStmt, 0); Index *pIdx = sqlite3FindIndex(db, zIndex, sInfo.zDatabase); if( pIdx ){ int iSample = sqlite3_column_int(pStmt, 1); - sqlite3 *dbMem = pIdx->pTable->dbMem; - assert( dbMem==db || dbMem==0 ); if( iSample=0 ){ int eType = sqlite3_column_type(pStmt, 2); if( pIdx->aSample==0 ){ static const int sz = sizeof(IndexSample)*SQLITE_INDEX_SAMPLES; - pIdx->aSample = (IndexSample *)sqlite3DbMallocZero(dbMem, sz); + pIdx->aSample = (IndexSample *)sqlite3DbMallocRaw(0, sz); if( pIdx->aSample==0 ){ db->mallocFailed = 1; break; } + memset(pIdx->aSample, 0, sz); } assert( pIdx->aSample ); @@ -65110,12 +73703,14 @@ SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){ n = 24; } pSample->nByte = (u8)n; - pSample->u.z = sqlite3DbMallocRaw(dbMem, n); - if( pSample->u.z ){ - memcpy(pSample->u.z, z, n); + if( n < 1){ + pSample->u.z = 0; }else{ - db->mallocFailed = 1; - break; + pSample->u.z = sqlite3DbStrNDup(0, z, n); + if( pSample->u.z==0 ){ + db->mallocFailed = 1; + break; + } } } } @@ -65123,7 +73718,6 @@ SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){ } } rc = sqlite3_finalize(pStmt); - (void)sqlite3SafetyOn(db); } } #endif @@ -65151,8 +73745,6 @@ SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){ ** ************************************************************************* ** This file contains code used to implement the ATTACH and DETACH commands. -** -** $Id: attach.c,v 1.93 2009/05/31 21:21:41 drh Exp $ */ #ifndef SQLITE_OMIT_ATTACH @@ -65266,9 +73858,8 @@ static void attachFunc( ** it to obtain the database schema. At this point the schema may ** or may not be initialised. */ - rc = sqlite3BtreeFactory(db, zFile, 0, SQLITE_DEFAULT_CACHE_SIZE, - db->openFlags | SQLITE_OPEN_MAIN_DB, - &aNew->pBt); + rc = sqlite3BtreeOpen(zFile, db, &aNew->pBt, 0, + db->openFlags | SQLITE_OPEN_MAIN_DB); db->nDb++; if( rc==SQLITE_CONSTRAINT ){ rc = SQLITE_ERROR; @@ -65285,12 +73876,17 @@ static void attachFunc( } pPager = sqlite3BtreePager(aNew->pBt); sqlite3PagerLockingMode(pPager, db->dfltLockMode); - sqlite3PagerJournalMode(pPager, db->dfltJournalMode); + sqlite3BtreeSecureDelete(aNew->pBt, + sqlite3BtreeSecureDelete(db->aDb[0].pBt,-1) ); } - aNew->zName = sqlite3DbStrDup(db, zName); aNew->safety_level = 3; + aNew->zName = sqlite3DbStrDup(db, zName); + if( rc==SQLITE_OK && aNew->zName==0 ){ + rc = SQLITE_NOMEM; + } -#if SQLITE_HAS_CODEC + +#ifdef SQLITE_HAS_CODEC if( rc==SQLITE_OK ){ extern int sqlite3CodecAttach(sqlite3*, int, const void*, int); extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*); @@ -65326,11 +73922,9 @@ static void attachFunc( ** we found it. */ if( rc==SQLITE_OK ){ - (void)sqlite3SafetyOn(db); sqlite3BtreeEnterAll(db); rc = sqlite3Init(db, &zErrDyn); sqlite3BtreeLeaveAll(db); - (void)sqlite3SafetyOff(db); } if( rc ){ int iDb = db->nDb - 1; @@ -65426,7 +74020,7 @@ detach_error: static void codeAttach( Parse *pParse, /* The parser context */ int type, /* Either SQLITE_ATTACH or SQLITE_DETACH */ - FuncDef *pFunc, /* FuncDef wrapper for detachFunc() or attachFunc() */ + FuncDef const *pFunc,/* FuncDef wrapper for detachFunc() or attachFunc() */ Expr *pAuthArg, /* Expression to pass to authorization callback */ Expr *pFilename, /* Name of database file */ Expr *pDbname, /* Name of the database to use internally */ @@ -65496,7 +74090,7 @@ attach_end: ** DETACH pDbname */ SQLITE_PRIVATE void sqlite3Detach(Parse *pParse, Expr *pDbname){ - static FuncDef detach_func = { + static const FuncDef detach_func = { 1, /* nArg */ SQLITE_UTF8, /* iPrefEnc */ 0, /* flags */ @@ -65506,7 +74100,8 @@ SQLITE_PRIVATE void sqlite3Detach(Parse *pParse, Expr *pDbname){ 0, /* xStep */ 0, /* xFinalize */ "sqlite_detach", /* zName */ - 0 /* pHash */ + 0, /* pHash */ + 0 /* pDestructor */ }; codeAttach(pParse, SQLITE_DETACH, &detach_func, pDbname, 0, 0, pDbname); } @@ -65517,7 +74112,7 @@ SQLITE_PRIVATE void sqlite3Detach(Parse *pParse, Expr *pDbname){ ** ATTACH p AS pDbname KEY pKey */ SQLITE_PRIVATE void sqlite3Attach(Parse *pParse, Expr *p, Expr *pDbname, Expr *pKey){ - static FuncDef attach_func = { + static const FuncDef attach_func = { 3, /* nArg */ SQLITE_UTF8, /* iPrefEnc */ 0, /* flags */ @@ -65527,7 +74122,8 @@ SQLITE_PRIVATE void sqlite3Attach(Parse *pParse, Expr *p, Expr *pDbname, Expr *p 0, /* xStep */ 0, /* xFinalize */ "sqlite_attach", /* zName */ - 0 /* pHash */ + 0, /* pHash */ + 0 /* pDestructor */ }; codeAttach(pParse, SQLITE_ATTACH, &attach_func, p, p, pDbname, pKey); } @@ -65693,8 +74289,6 @@ SQLITE_PRIVATE int sqlite3FixTriggerStep( ** API. This facility is an optional feature of the library. Embedded ** systems that do not need this facility may omit it by recompiling ** the library with -DSQLITE_OMIT_AUTHORIZATION=1 -** -** $Id: auth.c,v 1.32 2009/07/02 18:40:35 danielk1977 Exp $ */ /* @@ -65954,8 +74548,6 @@ SQLITE_PRIVATE void sqlite3AuthContextPop(AuthContext *pContext){ ** BEGIN TRANSACTION ** COMMIT ** ROLLBACK -** -** $Id: build.c,v 1.557 2009/07/24 17:58:53 danielk1977 Exp $ */ /* @@ -66136,7 +74728,7 @@ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){ pParse->isMultiWrite && pParse->mayAbort); pParse->rc = SQLITE_DONE; pParse->colNamesSet = 0; - }else if( pParse->rc==SQLITE_OK ){ + }else{ pParse->rc = SQLITE_ERROR; } pParse->nTab = 0; @@ -66279,33 +74871,14 @@ SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const cha /* ** Reclaim the memory used by an index */ -static void freeIndex(Index *p){ - sqlite3 *db = p->pTable->dbMem; +static void freeIndex(sqlite3 *db, Index *p){ #ifndef SQLITE_OMIT_ANALYZE - sqlite3DeleteIndexSamples(p); + sqlite3DeleteIndexSamples(db, p); #endif sqlite3DbFree(db, p->zColAff); sqlite3DbFree(db, p); } -/* -** Remove the given index from the index hash table, and free -** its memory structures. -** -** The index is removed from the database hash tables but -** it is not unlinked from the Table that it indexes. -** Unlinking from the Table must be done by the calling function. -*/ -static void sqlite3DeleteIndex(Index *p){ - Index *pOld; - const char *zName = p->zName; - - pOld = sqlite3HashInsert(&p->pSchema->idxHash, zName, - sqlite3Strlen30(zName), 0); - assert( pOld==0 || pOld==p ); - freeIndex(p); -} - /* ** For the index called zIdxName which is found in the database iDb, ** unlike that index from its Table then remove the index from @@ -66332,7 +74905,7 @@ SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char p->pNext = pIndex->pNext; } } - freeIndex(pIndex); + freeIndex(db, pIndex); } db->flags |= SQLITE_InternChanges; } @@ -66403,13 +74976,12 @@ SQLITE_PRIVATE void sqlite3CommitInternalChanges(sqlite3 *db){ } /* -** Clear the column names from a table or view. +** Delete memory allocated for the column names of a table or view (the +** Table.aCol[] array). */ -static void sqliteResetColumnNames(Table *pTable){ +static void sqliteDeleteColumnNames(sqlite3 *db, Table *pTable){ int i; Column *pCol; - sqlite3 *db = pTable->dbMem; - testcase( db==0 ); assert( pTable!=0 ); if( (pCol = pTable->aCol)!=0 ){ for(i=0; inCol; i++, pCol++){ @@ -66421,8 +74993,6 @@ static void sqliteResetColumnNames(Table *pTable){ } sqlite3DbFree(db, pTable->aCol); } - pTable->aCol = 0; - pTable->nCol = 0; } /* @@ -66434,42 +75004,44 @@ static void sqliteResetColumnNames(Table *pTable){ ** memory structures of the indices and foreign keys associated with ** the table. */ -SQLITE_PRIVATE void sqlite3DeleteTable(Table *pTable){ +SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *db, Table *pTable){ Index *pIndex, *pNext; - sqlite3 *db; - if( pTable==0 ) return; - db = pTable->dbMem; - testcase( db==0 ); + assert( !pTable || pTable->nRef>0 ); /* Do not delete the table until the reference count reaches zero. */ - pTable->nRef--; - if( pTable->nRef>0 ){ - return; - } - assert( pTable->nRef==0 ); + if( !pTable ) return; + if( ((!db || db->pnBytesFreed==0) && (--pTable->nRef)>0) ) return; - /* Delete all indices associated with this table - */ + /* Delete all indices associated with this table. */ for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){ pNext = pIndex->pNext; assert( pIndex->pSchema==pTable->pSchema ); - sqlite3DeleteIndex(pIndex); + if( !db || db->pnBytesFreed==0 ){ + char *zName = pIndex->zName; + TESTONLY ( Index *pOld = ) sqlite3HashInsert( + &pIndex->pSchema->idxHash, zName, sqlite3Strlen30(zName), 0 + ); + assert( pOld==pIndex || pOld==0 ); + } + freeIndex(db, pIndex); } /* Delete any foreign keys attached to this table. */ - sqlite3FkDelete(pTable); + sqlite3FkDelete(db, pTable); /* Delete the Table structure itself. */ - sqliteResetColumnNames(pTable); + sqliteDeleteColumnNames(db, pTable); sqlite3DbFree(db, pTable->zName); sqlite3DbFree(db, pTable->zColAff); sqlite3SelectDelete(db, pTable->pSelect); #ifndef SQLITE_OMIT_CHECK sqlite3ExprDelete(db, pTable->pCheck); #endif - sqlite3VtabClear(pTable); +#ifndef SQLITE_OMIT_VIRTUALTABLE + sqlite3VtabClear(db, pTable); +#endif sqlite3DbFree(db, pTable); } @@ -66483,11 +75055,12 @@ SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char assert( db!=0 ); assert( iDb>=0 && iDbnDb ); - assert( zTabName && zTabName[0] ); + assert( zTabName ); + testcase( zTabName[0]==0 ); /* Zero-length table names are allowed */ pDb = &db->aDb[iDb]; p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, sqlite3Strlen30(zTabName),0); - sqlite3DeleteTable(p); + sqlite3DeleteTable(db, p); db->flags |= SQLITE_InternChanges; } @@ -66679,8 +75252,9 @@ SQLITE_PRIVATE void sqlite3StartTable( */ iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); if( iDb<0 ) return; - if( !OMIT_TEMPDB && isTemp && iDb>1 ){ - /* If creating a temp table, the name may not be qualified */ + if( !OMIT_TEMPDB && isTemp && pName2->n>0 && iDb!=1 ){ + /* If creating a temp table, the name may not be qualified. Unless + ** the database name is "temp" anyway. */ sqlite3ErrorMsg(pParse, "temporary table name must be unqualified"); return; } @@ -66728,17 +75302,18 @@ SQLITE_PRIVATE void sqlite3StartTable( ** collisions. */ if( !IN_DECLARE_VTAB ){ + char *zDb = db->aDb[iDb].zName; if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ goto begin_table_error; } - pTable = sqlite3FindTable(db, zName, db->aDb[iDb].zName); + pTable = sqlite3FindTable(db, zName, zDb); if( pTable ){ if( !noErr ){ sqlite3ErrorMsg(pParse, "table %T already exists", pName); } goto begin_table_error; } - if( sqlite3FindIndex(db, zName, 0)!=0 && (iDb==0 || !db->init.busy) ){ + if( sqlite3FindIndex(db, zName, zDb)!=0 ){ sqlite3ErrorMsg(pParse, "there is already an index named %s", zName); goto begin_table_error; } @@ -66755,7 +75330,7 @@ SQLITE_PRIVATE void sqlite3StartTable( pTable->iPKey = -1; pTable->pSchema = db->aDb[iDb].pSchema; pTable->nRef = 1; - pTable->dbMem = 0; + pTable->nRowEst = 1000000; assert( pParse->pNewTable==0 ); pParse->pNewTable = pTable; @@ -67307,7 +75882,7 @@ static char *createTableStmt(sqlite3 *db, Table *p){ zEnd = "\n)"; } n += 35 + 6*p->nCol; - zStmt = sqlite3Malloc( n ); + zStmt = sqlite3DbMallocRaw(0, n); if( zStmt==0 ){ db->mallocFailed = 1; return 0; @@ -67488,7 +76063,7 @@ SQLITE_PRIVATE void sqlite3EndTable( p->aCol = pSelTab->aCol; pSelTab->nCol = 0; pSelTab->aCol = 0; - sqlite3DeleteTable(pSelTab); + sqlite3DeleteTable(db, pSelTab); } } @@ -67602,12 +76177,10 @@ SQLITE_PRIVATE void sqlite3CreateView( } sqlite3StartTable(pParse, pName1, pName2, isTemp, 1, 0, noErr); p = pParse->pNewTable; - if( p==0 ){ + if( p==0 || pParse->nErr ){ sqlite3SelectDelete(db, pSelect); return; } - assert( pParse->nErr==0 ); /* If sqlite3StartTable return non-NULL then - ** there could not have been an error */ sqlite3TwoPartName(pParse, pName1, pName2, &pName); iDb = sqlite3SchemaToIndex(db, p->pSchema); if( sqlite3FixInit(&sFix, pParse, iDb, "view", pName) @@ -67732,7 +76305,7 @@ SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ pTable->aCol = pSelTab->aCol; pSelTab->nCol = 0; pSelTab->aCol = 0; - sqlite3DeleteTable(pSelTab); + sqlite3DeleteTable(db, pSelTab); pTable->pSchema->flags |= DB_UnresetViews; }else{ pTable->nCol = 0; @@ -67757,7 +76330,9 @@ static void sqliteViewResetAll(sqlite3 *db, int idx){ for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){ Table *pTab = sqliteHashData(i); if( pTab->pSelect ){ - sqliteResetColumnNames(pTab); + sqliteDeleteColumnNames(db, pTab); + pTab->aCol = 0; + pTab->nCol = 0; } } DbClearProperty(db, idx, DB_UnresetViews); @@ -67907,13 +76482,12 @@ SQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, } assert( pParse->nErr==0 ); assert( pName->nSrc==1 ); + if( noErr ) db->suppressErr++; pTab = sqlite3LocateTable(pParse, isView, pName->a[0].zName, pName->a[0].zDatabase); + if( noErr ) db->suppressErr--; if( pTab==0 ){ - if( noErr ){ - sqlite3ErrorClear(pParse); - } goto exit_drop_table; } iDb = sqlite3SchemaToIndex(db, pTab->pSchema); @@ -68024,7 +76598,7 @@ SQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, /* Drop all SQLITE_MASTER table and index entries that refer to the ** table. The program name loops through the master table and deletes ** every row that refers to a table of the same name as the one being - ** dropped. Triggers are handled separately because a trigger can be + ** dropped. Triggers are handled seperately because a trigger can be ** created in the temp database that refers to a table in another ** database. */ @@ -68548,6 +77122,7 @@ SQLITE_PRIVATE Index *sqlite3CreateIndex( if( j>=pTab->nCol ){ sqlite3ErrorMsg(pParse, "table %s has no column named %s", pTab->zName, zColName); + pParse->checkSchema = 1; goto exit_create_index; } pIndex->aiColumn[i] = j; @@ -68723,7 +77298,8 @@ SQLITE_PRIVATE Index *sqlite3CreateIndex( sqlite3RefillIndex(pParse, pIndex, iMem); sqlite3ChangeCookie(pParse, iDb); sqlite3VdbeAddOp4(v, OP_ParseSchema, iDb, 0, 0, - sqlite3MPrintf(db, "name='%q'", pIndex->zName), P4_DYNAMIC); + sqlite3MPrintf(db, "name='%q' AND type='index'", pIndex->zName), + P4_DYNAMIC); sqlite3VdbeAddOp1(v, OP_Expire, 0); } } @@ -68754,7 +77330,7 @@ SQLITE_PRIVATE Index *sqlite3CreateIndex( /* Clean up before exiting */ exit_create_index: if( pIndex ){ - sqlite3_free(pIndex->zColAff); + sqlite3DbFree(db, pIndex->zColAff); sqlite3DbFree(db, pIndex); } sqlite3ExprListDelete(db, pList); @@ -68784,14 +77360,14 @@ exit_create_index: SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){ unsigned *a = pIdx->aiRowEst; int i; + unsigned n; assert( a!=0 ); - a[0] = 1000000; - for(i=pIdx->nColumn; i>=5; i--){ - a[i] = 5; - } - while( i>=1 ){ - a[i] = 11 - i; - i--; + a[0] = pIdx->pTable->nRowEst; + if( a[0]<10 ) a[0] = 10; + n = 10; + for(i=1; i<=pIdx->nColumn; i++){ + a[i] = n; + if( n>5 ) n--; } if( pIdx->onError!=OE_None ){ a[pIdx->nColumn] = 1; @@ -68851,7 +77427,7 @@ SQLITE_PRIVATE void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExists if( v ){ sqlite3BeginWriteOperation(pParse, 1, iDb); sqlite3NestedParse(pParse, - "DELETE FROM %Q.%s WHERE name=%Q", + "DELETE FROM %Q.%s WHERE name=%Q AND type='index'", db->aDb[iDb].zName, SCHEMA_TABLE(iDb), pIndex->zName ); @@ -69133,7 +77709,7 @@ SQLITE_PRIVATE void sqlite3SrcListDelete(sqlite3 *db, SrcList *pList){ sqlite3DbFree(db, pItem->zName); sqlite3DbFree(db, pItem->zAlias); sqlite3DbFree(db, pItem->zIndex); - sqlite3DeleteTable(pItem->pTab); + sqlite3DeleteTable(db, pItem->pTab); sqlite3SelectDelete(db, pItem->pSelect); sqlite3ExprDelete(db, pItem->pOn); sqlite3IdListDelete(db, pItem->pUsing); @@ -69316,7 +77892,7 @@ SQLITE_PRIVATE void sqlite3Savepoint(Parse *pParse, int op, Token *pName){ if( zName ){ Vdbe *v = sqlite3GetVdbe(pParse); #ifndef SQLITE_OMIT_AUTHORIZATION - static const char *az[] = { "BEGIN", "RELEASE", "ROLLBACK" }; + static const char * const az[] = { "BEGIN", "RELEASE", "ROLLBACK" }; assert( !SAVEPOINT_BEGIN && SAVEPOINT_RELEASE==1 && SAVEPOINT_ROLLBACK==2 ); #endif if( !v || sqlite3AuthCheck(pParse, SQLITE_SAVEPOINT, az[op], zName, 0) ){ @@ -69335,6 +77911,7 @@ SQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *pParse){ sqlite3 *db = pParse->db; if( db->aDb[1].pBt==0 && !pParse->explain ){ int rc; + Btree *pBt; static const int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | @@ -69342,18 +77919,19 @@ SQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *pParse){ SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_TEMP_DB; - rc = sqlite3BtreeFactory(db, 0, 0, SQLITE_DEFAULT_CACHE_SIZE, flags, - &db->aDb[1].pBt); + rc = sqlite3BtreeOpen(0, db, &pBt, 0, flags); if( rc!=SQLITE_OK ){ sqlite3ErrorMsg(pParse, "unable to open a temporary database " "file for storing temporary tables"); pParse->rc = rc; return 1; } - assert( (db->flags & SQLITE_InTrans)==0 || db->autoCommit ); + db->aDb[1].pBt = pBt; assert( db->aDb[1].pSchema ); - sqlite3PagerJournalMode(sqlite3BtreePager(db->aDb[1].pBt), - db->dfltJournalMode); + if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize, -1, 0) ){ + db->mallocFailed = 1; + return 1; + } } return 0; } @@ -69653,8 +78231,6 @@ SQLITE_PRIVATE KeyInfo *sqlite3IndexKeyinfo(Parse *pParse, Index *pIdx){ ** ** This file contains functions used to access the internal hash tables ** of user defined functions and collation sequences. -** -** $Id: callback.c,v 1.42 2009/06/17 00:35:31 drh Exp $ */ @@ -69995,14 +78571,19 @@ SQLITE_PRIVATE FuncDef *sqlite3FindFunction( /* If no match is found, search the built-in functions. ** + ** If the SQLITE_PreferBuiltin flag is set, then search the built-in + ** functions even if a prior app-defined function was found. And give + ** priority to built-in functions. + ** ** Except, if createFlag is true, that means that we are trying to - ** install a new function. Whatever FuncDef structure is returned will + ** install a new function. Whatever FuncDef structure is returned it will ** have fields overwritten with new information appropriate for the ** new function. But the FuncDefs for built-in functions are read-only. ** So we must not search for built-ins when creating a new function. */ - if( !createFlag && !pBest ){ + if( !createFlag && (pBest==0 || (db->flags & SQLITE_PreferBuiltin)!=0) ){ FuncDefHash *pHash = &GLOBAL(FuncDefHash, sqlite3GlobalFunctions); + bestScore = 0; p = functionSearch(pHash, h, zName, nName); while( p ){ int score = matchQuality(p, nArg, enc); @@ -70059,8 +78640,7 @@ SQLITE_PRIVATE void sqlite3SchemaFree(void *p){ sqlite3HashInit(&pSchema->tblHash); for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){ Table *pTab = sqliteHashData(pElem); - assert( pTab->dbMem==0 ); - sqlite3DeleteTable(pTab); + sqlite3DeleteTable(0, pTab); } sqlite3HashClear(&temp1); sqlite3HashClear(&pSchema->fkeyHash); @@ -70077,7 +78657,7 @@ SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *db, Btree *pBt){ if( pBt ){ p = (Schema *)sqlite3BtreeSchema(pBt, sizeof(Schema), sqlite3SchemaFree); }else{ - p = (Schema *)sqlite3MallocZero(sizeof(Schema)); + p = (Schema *)sqlite3DbMallocZero(0, sizeof(Schema)); } if( !p ){ db->mallocFailed = 1; @@ -70106,8 +78686,6 @@ SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *db, Btree *pBt){ ************************************************************************* ** This file contains C code routines that are called by the parser ** in order to generate code for DELETE FROM statements. -** -** $Id: delete.c,v 1.207 2009/08/08 18:01:08 drh Exp $ */ /* @@ -70120,7 +78698,7 @@ SQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){ Table *pTab; assert( pItem && pSrc->nSrc==1 ); pTab = sqlite3LocateTable(pParse, 0, pItem->zName, pItem->zDatabase); - sqlite3DeleteTable(pItem->pTab); + sqlite3DeleteTable(pParse->db, pItem->pTab); pItem->pTab = pTab; if( pTab ){ pTab->nRef++; @@ -70460,7 +79038,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet); pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere,0,WHERE_DUPLICATES_OK); if( pWInfo==0 ) goto delete_from_cleanup; - regRowid = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, iRowid, 0); + regRowid = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, iRowid); sqlite3VdbeAddOp2(v, OP_RowSetAdd, iRowSet, regRowid); if( db->flags & SQLITE_CountRows ){ sqlite3VdbeAddOp2(v, OP_AddImm, memCnt, 1); @@ -70592,7 +79170,9 @@ SQLITE_PRIVATE void sqlite3GenerateRowDelete( /* TODO: Could use temporary registers here. Also could attempt to ** avoid copying the contents of the rowid register. */ - mask = sqlite3TriggerOldmask(pParse, pTrigger, 0, pTab, onconf); + mask = sqlite3TriggerColmask( + pParse, pTrigger, 0, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onconf + ); mask |= sqlite3FkOldmask(pParse, pTab); iOld = pParse->nMem+1; pParse->nMem += (1 + pTab->nCol); @@ -70602,9 +79182,7 @@ SQLITE_PRIVATE void sqlite3GenerateRowDelete( sqlite3VdbeAddOp2(v, OP_Copy, iRowid, iOld); for(iCol=0; iColnCol; iCol++){ if( mask==0xffffffff || mask&(1<=0 && p2>=0 ); - if( p1+p2>len ){ - p2 = len-p1; - if( p2<0 ) p2 = 0; - } if( p0type!=SQLITE_BLOB ){ while( *z && p1 ){ SQLITE_SKIP_UTF8(z); @@ -70965,6 +79553,10 @@ static void substrFunc( } sqlite3_result_text(context, (char*)z, (int)(z2-z), SQLITE_TRANSIENT); }else{ + if( p1+p2>len ){ + p2 = len-p1; + if( p2<0 ) p2 = 0; + } sqlite3_result_blob(context, (char*)&z[p1], (int)p2, SQLITE_TRANSIENT); } } @@ -70986,14 +79578,24 @@ static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ } if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; r = sqlite3_value_double(argv[0]); - zBuf = sqlite3_mprintf("%.*f",n,r); - if( zBuf==0 ){ - sqlite3_result_error_nomem(context); + /* If Y==0 and X will fit in a 64-bit int, + ** handle the rounding directly, + ** otherwise use printf. + */ + if( n==0 && r>=0 && rdb->aLimit[SQLITE_LIMIT_LENGTH] ){ sqlite3_result_error_toobig(context); }else{ - sqlite3_result_zeroblob(context, (int)n); + sqlite3_result_zeroblob(context, (int)n); /* IMP: R-00293-64994 */ } } @@ -71650,14 +80320,14 @@ static void replaceFunc( testcase( nOut-2==db->aLimit[SQLITE_LIMIT_LENGTH] ); if( nOut-1>db->aLimit[SQLITE_LIMIT_LENGTH] ){ sqlite3_result_error_toobig(context); - sqlite3DbFree(db, zOut); + sqlite3_free(zOut); return; } zOld = zOut; zOut = sqlite3_realloc(zOut, (int)nOut); if( zOut==0 ){ sqlite3_result_error_nomem(context); - sqlite3DbFree(db, zOld); + sqlite3_free(zOld); return; } memcpy(&zOut[j], zRep, nRep); @@ -71758,9 +80428,16 @@ static void trimFunc( } +/* IMP: R-25361-16150 This function is omitted from SQLite by default. It +** is only available if the SQLITE_SOUNDEX compile-time option is used +** when SQLite is built. +*/ #ifdef SQLITE_SOUNDEX /* ** Compute the soundex encoding of a word. +** +** IMP: R-59782-00072 The soundex(X) function returns a string that is the +** soundex encoding of the string X. */ static void soundexFunc( sqlite3_context *context, @@ -71804,10 +80481,12 @@ static void soundexFunc( zResult[j] = 0; sqlite3_result_text(context, zResult, 4, SQLITE_TRANSIENT); }else{ + /* IMP: R-64894-50321 The string "?000" is returned if the argument + ** is NULL or contains no ASCII alphabetic characters. */ sqlite3_result_text(context, "?000", 4, SQLITE_STATIC); } } -#endif +#endif /* SQLITE_SOUNDEX */ #ifndef SQLITE_OMIT_LOAD_EXTENSION /* @@ -72009,7 +80688,7 @@ static void groupConcatStep( if( pAccum ){ sqlite3 *db = sqlite3_context_db_handle(context); int firstTerm = pAccum->useMalloc==0; - pAccum->useMalloc = 1; + pAccum->useMalloc = 2; pAccum->mxAlloc = db->aLimit[SQLITE_LIMIT_LENGTH]; if( !firstTerm ){ if( argc==2 ){ @@ -72042,20 +80721,15 @@ static void groupConcatFinalize(sqlite3_context *context){ } /* -** This function registered all of the above C functions as SQL -** functions. This should be the only routine in this file with -** external linkage. +** This routine does per-connection function registration. Most +** of the built-in functions above are part of the global function set. +** This routine only deals with those that are not global. */ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3 *db){ -#ifndef SQLITE_OMIT_ALTERTABLE - sqlite3AlterFunctions(db); -#endif - if( !db->mallocFailed ){ - int rc = sqlite3_overload_function(db, "MATCH", 2); - assert( rc==SQLITE_NOMEM || rc==SQLITE_OK ); - if( rc==SQLITE_NOMEM ){ - db->mallocFailed = 1; - } + int rc = sqlite3_overload_function(db, "MATCH", 2); + assert( rc==SQLITE_NOMEM || rc==SQLITE_OK ); + if( rc==SQLITE_NOMEM ){ + db->mallocFailed = 1; } } @@ -72083,10 +80757,10 @@ SQLITE_PRIVATE void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive) }else{ pInfo = (struct compareInfo*)&likeInfoNorm; } - sqlite3CreateFunc(db, "like", 2, SQLITE_ANY, pInfo, likeFunc, 0, 0); - sqlite3CreateFunc(db, "like", 3, SQLITE_ANY, pInfo, likeFunc, 0, 0); + sqlite3CreateFunc(db, "like", 2, SQLITE_ANY, pInfo, likeFunc, 0, 0, 0); + sqlite3CreateFunc(db, "like", 3, SQLITE_ANY, pInfo, likeFunc, 0, 0, 0); sqlite3CreateFunc(db, "glob", 2, SQLITE_ANY, - (struct compareInfo*)&globInfo, likeFunc, 0,0); + (struct compareInfo*)&globInfo, likeFunc, 0, 0, 0); setLikeOptFlag(db, "glob", SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE); setLikeOptFlag(db, "like", caseSensitive ? (SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE) : SQLITE_FUNC_LIKE); @@ -72168,15 +80842,21 @@ SQLITE_PRIVATE void sqlite3RegisterGlobalFunctions(void){ FUNCTION(upper, 1, 0, 0, upperFunc ), FUNCTION(lower, 1, 0, 0, lowerFunc ), FUNCTION(coalesce, 1, 0, 0, 0 ), - FUNCTION(coalesce, -1, 0, 0, ifnullFunc ), FUNCTION(coalesce, 0, 0, 0, 0 ), +/* FUNCTION(coalesce, -1, 0, 0, ifnullFunc ), */ + {-1,SQLITE_UTF8,SQLITE_FUNC_COALESCE,0,0,ifnullFunc,0,0,"coalesce",0,0}, FUNCTION(hex, 1, 0, 0, hexFunc ), - FUNCTION(ifnull, 2, 0, 1, ifnullFunc ), +/* FUNCTION(ifnull, 2, 0, 0, ifnullFunc ), */ + {2,SQLITE_UTF8,SQLITE_FUNC_COALESCE,0,0,ifnullFunc,0,0,"ifnull",0,0}, FUNCTION(random, 0, 0, 0, randomFunc ), FUNCTION(randomblob, 1, 0, 0, randomBlob ), FUNCTION(nullif, 2, 0, 1, nullifFunc ), FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS + FUNCTION(sqlite_compileoption_used,1, 0, 0, compileoptionusedFunc ), + FUNCTION(sqlite_compileoption_get, 1, 0, 0, compileoptiongetFunc ), +#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ FUNCTION(quote, 1, 0, 0, quoteFunc ), FUNCTION(last_insert_rowid, 0, 0, 0, last_insert_rowid), FUNCTION(changes, 0, 0, 0, changes ), @@ -72194,7 +80874,7 @@ SQLITE_PRIVATE void sqlite3RegisterGlobalFunctions(void){ AGGREGATE(total, 1, 0, 0, sumStep, totalFinalize ), AGGREGATE(avg, 1, 0, 0, sumStep, avgFinalize ), /* AGGREGATE(count, 0, 0, 0, countStep, countFinalize ), */ - {0,SQLITE_UTF8,SQLITE_FUNC_COUNT,0,0,0,countStep,countFinalize,"count",0}, + {0,SQLITE_UTF8,SQLITE_FUNC_COUNT,0,0,0,countStep,countFinalize,"count",0,0}, AGGREGATE(count, 1, 0, 0, countStep, countFinalize ), AGGREGATE(group_concat, 1, 0, 0, groupConcatStep, groupConcatFinalize), AGGREGATE(group_concat, 2, 0, 0, groupConcatStep, groupConcatFinalize), @@ -72217,6 +80897,9 @@ SQLITE_PRIVATE void sqlite3RegisterGlobalFunctions(void){ sqlite3FuncDefInsert(pHash, &aFunc[i]); } sqlite3RegisterDateTimeFunctions(); +#ifndef SQLITE_OMIT_ALTERTABLE + sqlite3AlterFunctions(); +#endif } /************** End of func.c ************************************************/ @@ -72602,7 +81285,7 @@ static void fkLookupParent( sqlite3VdbeAddOp3(v, OP_OpenRead, iCur, pIdx->tnum, iDb); sqlite3VdbeChangeP4(v, -1, (char*)pKey, P4_KEYINFO_HANDOFF); for(i=0; iaiColumn[i]; - pCol = &pIdx->pTable->aCol[iCol]; + pCol = &pTab->aCol[iCol]; + if( pTab->iPKey==iCol ) iCol = -1; pLeft->iTable = regData+iCol+1; pLeft->affinity = pCol->affinity; pLeft->pColl = sqlite3LocateCollSeq(pParse, pCol->zColl); @@ -73283,11 +81967,7 @@ static Trigger *fkActionTrigger( pWhere = 0; } - /* In the current implementation, pTab->dbMem==0 for all tables except - ** for temporary tables used to describe subqueries. And temporary - ** tables do not have foreign key constraints. Hence, pTab->dbMem - ** should always be 0 there. - */ + /* Disable lookaside memory allocation */ enableLookaside = db->lookaside.bEnabled; db->lookaside.bEnabled = 0; @@ -73377,37 +82057,39 @@ SQLITE_PRIVATE void sqlite3FkActions( ** table pTab. Remove the deleted foreign keys from the Schema.fkeyHash ** hash table. */ -SQLITE_PRIVATE void sqlite3FkDelete(Table *pTab){ +SQLITE_PRIVATE void sqlite3FkDelete(sqlite3 *db, Table *pTab){ FKey *pFKey; /* Iterator variable */ FKey *pNext; /* Copy of pFKey->pNextFrom */ for(pFKey=pTab->pFKey; pFKey; pFKey=pNext){ /* Remove the FK from the fkeyHash hash table. */ - if( pFKey->pPrevTo ){ - pFKey->pPrevTo->pNextTo = pFKey->pNextTo; - }else{ - void *data = (void *)pFKey->pNextTo; - const char *z = (data ? pFKey->pNextTo->zTo : pFKey->zTo); - sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, sqlite3Strlen30(z), data); + if( !db || db->pnBytesFreed==0 ){ + if( pFKey->pPrevTo ){ + pFKey->pPrevTo->pNextTo = pFKey->pNextTo; + }else{ + void *p = (void *)pFKey->pNextTo; + const char *z = (p ? pFKey->pNextTo->zTo : pFKey->zTo); + sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, sqlite3Strlen30(z), p); + } + if( pFKey->pNextTo ){ + pFKey->pNextTo->pPrevTo = pFKey->pPrevTo; + } } - if( pFKey->pNextTo ){ - pFKey->pNextTo->pPrevTo = pFKey->pPrevTo; - } - - /* Delete any triggers created to implement actions for this FK. */ -#ifndef SQLITE_OMIT_TRIGGER - fkTriggerDelete(pTab->dbMem, pFKey->apTrigger[0]); - fkTriggerDelete(pTab->dbMem, pFKey->apTrigger[1]); -#endif /* EV: R-30323-21917 Each foreign key constraint in SQLite is ** classified as either immediate or deferred. */ assert( pFKey->isDeferred==0 || pFKey->isDeferred==1 ); + /* Delete any triggers created to implement actions for this FK. */ +#ifndef SQLITE_OMIT_TRIGGER + fkTriggerDelete(db, pFKey->apTrigger[0]); + fkTriggerDelete(db, pFKey->apTrigger[1]); +#endif + pNext = pFKey->pNextFrom; - sqlite3DbFree(pTab->dbMem, pFKey); + sqlite3DbFree(db, pFKey); } } #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */ @@ -73427,8 +82109,6 @@ SQLITE_PRIVATE void sqlite3FkDelete(Table *pTab){ ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle INSERT statements in SQLite. -** -** $Id: insert.c,v 1.270 2009/07/24 17:58:53 danielk1977 Exp $ */ /* @@ -73484,7 +82164,7 @@ SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){ int n; Table *pTab = pIdx->pTable; sqlite3 *db = sqlite3VdbeDb(v); - pIdx->zColAff = (char *)sqlite3Malloc(pIdx->nColumn+2); + pIdx->zColAff = (char *)sqlite3DbMallocRaw(0, pIdx->nColumn+2); if( !pIdx->zColAff ){ db->mallocFailed = 1; return 0; @@ -73526,7 +82206,7 @@ SQLITE_PRIVATE void sqlite3TableAffinityStr(Vdbe *v, Table *pTab){ int i; sqlite3 *db = sqlite3VdbeDb(v); - zColAff = (char *)sqlite3Malloc(pTab->nCol+1); + zColAff = (char *)sqlite3DbMallocRaw(0, pTab->nCol+1); if( !zColAff ){ db->mallocFailed = 1; return; @@ -73546,7 +82226,7 @@ SQLITE_PRIVATE void sqlite3TableAffinityStr(Vdbe *v, Table *pTab){ /* ** Return non-zero if the table pTab in database iDb or any of its indices ** have been opened at any point in the VDBE program beginning at location -** iStartAddr through the end of the program. This is used to see if +** iStartAddr throught the end of the program. This is used to see if ** a statement of the form "INSERT INTO SELECT ..." can ** run without using temporary table for the results of the SELECT. */ @@ -74144,7 +82824,7 @@ SQLITE_PRIVATE void sqlite3Insert( }else{ sqlite3ErrorMsg(pParse, "table %S has no column named %s", pTabList, 0, pColumn->a[i].zName); - pParse->nErr++; + pParse->checkSchema = 1; goto insert_cleanup; } } @@ -74263,7 +82943,7 @@ SQLITE_PRIVATE void sqlite3Insert( if( pColumn->a[j].idx==i ) break; } } - if( pColumn && j>=pColumn->nId ){ + if( (!useTempTable && !pList) || (pColumn && j>=pColumn->nId) ){ sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regCols+i+1); }else if( useTempTable ){ sqlite3VdbeAddOp3(v, OP_Column, srcTab, j, regCols+i+1); @@ -74637,6 +83317,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( if( onError==OE_Ignore ){ sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest); }else{ + if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */ sqlite3HaltConstraint(pParse, onError, 0, 0); } sqlite3VdbeResolveLabel(v, allOk); @@ -74678,19 +83359,33 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( ** the triggers and remove both the table and index b-tree entries. ** ** Otherwise, if there are no triggers or the recursive-triggers - ** flag is not set, call GenerateRowIndexDelete(). This removes - ** the index b-tree entries only. The table b-tree entry will be - ** replaced by the new entry when it is inserted. */ + ** flag is not set, but the table has one or more indexes, call + ** GenerateRowIndexDelete(). This removes the index b-tree entries + ** only. The table b-tree entry will be replaced by the new entry + ** when it is inserted. + ** + ** If either GenerateRowDelete() or GenerateRowIndexDelete() is called, + ** also invoke MultiWrite() to indicate that this VDBE may require + ** statement rollback (if the statement is aborted after the delete + ** takes place). Earlier versions called sqlite3MultiWrite() regardless, + ** but being more selective here allows statements like: + ** + ** REPLACE INTO t(rowid) VALUES($newrowid) + ** + ** to run without a statement journal if there are no indexes on the + ** table. + */ Trigger *pTrigger = 0; if( pParse->db->flags&SQLITE_RecTriggers ){ pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0); } - sqlite3MultiWrite(pParse); if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){ + sqlite3MultiWrite(pParse); sqlite3GenerateRowDelete( pParse, pTab, baseCur, regRowid, 0, pTrigger, OE_Replace ); - }else{ + }else if( pTab->pIndex ){ + sqlite3MultiWrite(pParse); sqlite3GenerateRowIndexDelete(pParse, pTab, baseCur, 0); } seenReplace = 1; @@ -75132,7 +83827,7 @@ static int xferOptimization( } } #ifndef SQLITE_OMIT_CHECK - if( pDest->pCheck && !sqlite3ExprCompare(pSrc->pCheck, pDest->pCheck) ){ + if( pDest->pCheck && sqlite3ExprCompare(pSrc->pCheck, pDest->pCheck) ){ return 0; /* Tables have different CHECK constraints. Ticket #2252 */ } #endif @@ -75248,8 +83943,6 @@ static int xferOptimization( ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. -** -** $Id: legacy.c,v 1.35 2009/08/07 16:56:00 danielk1977 Exp $ */ @@ -75277,6 +83970,7 @@ SQLITE_API int sqlite3_exec( int nRetry = 0; /* Number of retry attempts */ int callbackIsInit; /* True if callback data is initialized */ + if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; if( zSql==0 ) zSql = ""; sqlite3_mutex_enter(db->mutex); @@ -75394,8 +84088,6 @@ exec_out: ************************************************************************* ** This file contains code used to dynamically load extensions into ** the SQLite library. -** -** $Id: loadext.c,v 1.60 2009/06/03 01:24:54 drh Exp $ */ #ifndef SQLITE_CORE @@ -75419,8 +84111,6 @@ exec_out: ** an SQLite instance. Shared libraries that intend to be loaded ** as extensions by SQLite should #include this file instead of ** sqlite3.h. -** -** @(#) $Id: sqlite3ext.h,v 1.25 2008/10/12 00:27:54 shane Exp $ */ #ifndef _SQLITE3EXT_H_ #define _SQLITE3EXT_H_ @@ -75601,7 +84291,7 @@ struct sqlite3_api_routines { /* ** The following macros redefine the API routines so that they are -** redirected through the global sqlite3_api structure. +** redirected throught the global sqlite3_api structure. ** ** This header file is also used by the loadext.c source file ** (part of the main SQLite library - not an extension) so that @@ -76142,13 +84832,11 @@ static int sqlite3LoadExtension( handle = sqlite3OsDlOpen(pVfs, zFile); if( handle==0 ){ if( pzErrMsg ){ - zErrmsg = sqlite3StackAllocZero(db, nMsg); + *pzErrMsg = zErrmsg = sqlite3_malloc(nMsg); if( zErrmsg ){ sqlite3_snprintf(nMsg, zErrmsg, "unable to open shared library [%s]", zFile); sqlite3OsDlError(pVfs, nMsg-1, zErrmsg); - *pzErrMsg = sqlite3DbStrDup(0, zErrmsg); - sqlite3StackFree(db, zErrmsg); } } return SQLITE_ERROR; @@ -76157,13 +84845,11 @@ static int sqlite3LoadExtension( sqlite3OsDlSym(pVfs, handle, zProc); if( xInit==0 ){ if( pzErrMsg ){ - zErrmsg = sqlite3StackAllocZero(db, nMsg); + *pzErrMsg = zErrmsg = sqlite3_malloc(nMsg); if( zErrmsg ){ sqlite3_snprintf(nMsg, zErrmsg, "no entry point [%s] in shared library [%s]", zProc,zFile); sqlite3OsDlError(pVfs, nMsg-1, zErrmsg); - *pzErrMsg = sqlite3DbStrDup(0, zErrmsg); - sqlite3StackFree(db, zErrmsg); } sqlite3OsDlClose(pVfs, handle); } @@ -76388,8 +85074,6 @@ SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){ ** ************************************************************************* ** This file contains code used to implement the PRAGMA command. -** -** $Id: pragma.c,v 1.214 2009/07/02 07:47:33 danielk1977 Exp $ */ /* Ignore this whole file if pragmas are disabled @@ -76552,6 +85236,9 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){ { "legacy_file_format", SQLITE_LegacyFileFmt }, { "fullfsync", SQLITE_FullFSync }, { "reverse_unordered_selects", SQLITE_ReverseOrder }, +#ifndef SQLITE_OMIT_AUTOMATIC_INDEX + { "automatic_index", SQLITE_AutoIndex }, +#endif #ifdef SQLITE_DEBUG { "sql_trace", SQLITE_SqlTrace }, { "vdbe_listing", SQLITE_VdbeListing }, @@ -76633,6 +85320,31 @@ static const char *actionName(u8 action){ } #endif + +/* +** Parameter eMode must be one of the PAGER_JOURNALMODE_XXX constants +** defined in pager.h. This function returns the associated lowercase +** journal-mode name. +*/ +SQLITE_PRIVATE const char *sqlite3JournalModename(int eMode){ + static char * const azModeName[] = { + "delete", "persist", "off", "truncate", "memory" +#ifndef SQLITE_OMIT_WAL + , "wal" +#endif + }; + assert( PAGER_JOURNALMODE_DELETE==0 ); + assert( PAGER_JOURNALMODE_PERSIST==1 ); + assert( PAGER_JOURNALMODE_OFF==2 ); + assert( PAGER_JOURNALMODE_TRUNCATE==3 ); + assert( PAGER_JOURNALMODE_MEMORY==4 ); + assert( PAGER_JOURNALMODE_WAL==5 ); + assert( eMode>=0 && eMode<=ArraySize(azModeName) ); + + if( eMode==ArraySize(azModeName) ) return 0; + return azModeName[eMode]; +} + /* ** Process a pragma statement. ** @@ -76664,6 +85376,7 @@ SQLITE_PRIVATE void sqlite3Pragma( Db *pDb; Vdbe *v = pParse->pVdbe = sqlite3VdbeCreate(db); if( v==0 ) return; + sqlite3VdbeRunOnlyOnce(v); pParse->nMem = 2; /* Interpret the [database.] part of the pragma statement. iDb is the @@ -76704,11 +85417,11 @@ SQLITE_PRIVATE void sqlite3Pragma( ** page cache size value and the persistent page cache size value ** stored in the database file. ** - ** The default cache size is stored in meta-value 2 of page 1 of the - ** database file. The cache size is actually the absolute value of - ** this memory location. The sign of meta-value 2 determines the - ** synchronous setting. A negative value means synchronous is off - ** and a positive value means synchronous is on. + ** Older versions of SQLite would set the default cache size to a + ** negative number to indicate synchronous=OFF. These days, synchronous + ** is always on by default regardless of the sign of the default cache + ** size. But continue to take the absolute value of the default cache + ** size of historical compatibility. */ if( sqlite3StrICmp(zLeft,"default_cache_size")==0 ){ static const VdbeOpList getCacheSize[] = { @@ -76737,10 +85450,6 @@ SQLITE_PRIVATE void sqlite3Pragma( if( size<0 ) size = -size; sqlite3BeginWriteOperation(pParse, 0, iDb); sqlite3VdbeAddOp2(v, OP_Integer, size, 1); - sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, 2, BTREE_DEFAULT_CACHE_SIZE); - addr = sqlite3VdbeAddOp2(v, OP_IfPos, 2, 0); - sqlite3VdbeAddOp2(v, OP_Integer, -size, 1); - sqlite3VdbeJumpHere(v, addr); sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_DEFAULT_CACHE_SIZE, 1); pDb->pSchema->cache_size = size; sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size); @@ -76795,6 +85504,31 @@ SQLITE_PRIVATE void sqlite3Pragma( returnSingleInt(pParse, "max_page_count", newMax); }else + /* + ** PRAGMA [database.]secure_delete + ** PRAGMA [database.]secure_delete=ON/OFF + ** + ** The first form reports the current setting for the + ** secure_delete flag. The second form changes the secure_delete + ** flag setting and reports thenew value. + */ + if( sqlite3StrICmp(zLeft,"secure_delete")==0 ){ + Btree *pBt = pDb->pBt; + int b = -1; + assert( pBt!=0 ); + if( zRight ){ + b = getBoolean(zRight); + } + if( pId2->n==0 && b>=0 ){ + int ii; + for(ii=0; iinDb; ii++){ + sqlite3BtreeSecureDelete(db->aDb[ii].pBt, b); + } + } + b = sqlite3BtreeSecureDelete(pBt, b); + returnSingleInt(pParse, "secure_delete", b); + }else + /* ** PRAGMA [database.]page_count ** @@ -76860,62 +85594,49 @@ SQLITE_PRIVATE void sqlite3Pragma( /* ** PRAGMA [database.]journal_mode - ** PRAGMA [database.]journal_mode = (delete|persist|off|truncate|memory) + ** PRAGMA [database.]journal_mode = + ** (delete|persist|off|truncate|memory|wal|off) */ if( sqlite3StrICmp(zLeft,"journal_mode")==0 ){ - int eMode; - static char * const azModeName[] = { - "delete", "persist", "off", "truncate", "memory" - }; + int eMode; /* One of the PAGER_JOURNALMODE_XXX symbols */ + int ii; /* Loop counter */ - if( zRight==0 ){ - eMode = PAGER_JOURNALMODE_QUERY; - }else{ - int n = sqlite3Strlen30(zRight); - eMode = sizeof(azModeName)/sizeof(azModeName[0]) - 1; - while( eMode>=0 && sqlite3StrNICmp(zRight, azModeName[eMode], n)!=0 ){ - eMode--; - } + /* Force the schema to be loaded on all databases. This cases all + ** database files to be opened and the journal_modes set. */ + if( sqlite3ReadSchema(pParse) ){ + goto pragma_out; } - if( pId2->n==0 && eMode==PAGER_JOURNALMODE_QUERY ){ - /* Simple "PRAGMA journal_mode;" statement. This is a query for - ** the current default journal mode (which may be different to - ** the journal-mode of the main database). - */ - eMode = db->dfltJournalMode; - }else{ - Pager *pPager; - if( pId2->n==0 ){ - /* This indicates that no database name was specified as part - ** of the PRAGMA command. In this case the journal-mode must be - ** set on all attached databases, as well as the main db file. - ** - ** Also, the sqlite3.dfltJournalMode variable is set so that - ** any subsequently attached databases also use the specified - ** journal mode. - */ - int ii; - assert(pDb==&db->aDb[0]); - for(ii=1; iinDb; ii++){ - if( db->aDb[ii].pBt ){ - pPager = sqlite3BtreePager(db->aDb[ii].pBt); - sqlite3PagerJournalMode(pPager, eMode); - } - } - db->dfltJournalMode = (u8)eMode; - } - pPager = sqlite3BtreePager(pDb->pBt); - eMode = sqlite3PagerJournalMode(pPager, eMode); - } - assert( eMode==PAGER_JOURNALMODE_DELETE - || eMode==PAGER_JOURNALMODE_TRUNCATE - || eMode==PAGER_JOURNALMODE_PERSIST - || eMode==PAGER_JOURNALMODE_OFF - || eMode==PAGER_JOURNALMODE_MEMORY ); + sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "journal_mode", SQLITE_STATIC); - sqlite3VdbeAddOp4(v, OP_String8, 0, 1, 0, - azModeName[eMode], P4_STATIC); + + if( zRight==0 ){ + /* If there is no "=MODE" part of the pragma, do a query for the + ** current mode */ + eMode = PAGER_JOURNALMODE_QUERY; + }else{ + const char *zMode; + int n = sqlite3Strlen30(zRight); + for(eMode=0; (zMode = sqlite3JournalModename(eMode))!=0; eMode++){ + if( sqlite3StrNICmp(zRight, zMode, n)==0 ) break; + } + if( !zMode ){ + /* If the "=MODE" part does not match any known journal mode, + ** then do a query */ + eMode = PAGER_JOURNALMODE_QUERY; + } + } + if( eMode==PAGER_JOURNALMODE_QUERY && pId2->n==0 ){ + /* Convert "PRAGMA journal_mode" into "PRAGMA main.journal_mode" */ + iDb = 0; + pId2->n = 1; + } + for(ii=db->nDb-1; ii>=0; ii--){ + if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){ + sqlite3VdbeUsesBtree(v, ii); + sqlite3VdbeAddOp3(v, OP_JournalMode, ii, 1, eMode); + } + } sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); }else @@ -76929,7 +85650,7 @@ SQLITE_PRIVATE void sqlite3Pragma( Pager *pPager = sqlite3BtreePager(pDb->pBt); i64 iLimit = -2; if( zRight ){ - sqlite3Atoi64(zRight, &iLimit); + sqlite3Atoi64(zRight, &iLimit, 1000000, SQLITE_UTF8); if( iLimit<-1 ) iLimit = -1; } iLimit = sqlite3PagerJournalSizeLimit(pPager, iLimit); @@ -77107,7 +85828,7 @@ SQLITE_PRIVATE void sqlite3Pragma( } sqlite3_free(sqlite3_temp_directory); if( zRight[0] ){ - sqlite3_temp_directory = sqlite3DbStrDup(0, zRight); + sqlite3_temp_directory = sqlite3_mprintf("%s", zRight); }else{ sqlite3_temp_directory = 0; } @@ -77507,6 +86228,7 @@ SQLITE_PRIVATE void sqlite3Pragma( sqlite3VdbeAddOp2(v, OP_AddImm, 2, 1); /* increment entry count */ for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ int jmp2; + int r1; static const VdbeOpList idxErr[] = { { OP_AddImm, 1, -1, 0}, { OP_String8, 0, 3, 0}, /* 1 */ @@ -77520,8 +86242,8 @@ SQLITE_PRIVATE void sqlite3Pragma( { OP_IfPos, 1, 0, 0}, /* 9 */ { OP_Halt, 0, 0, 0}, }; - sqlite3GenerateIndexKey(pParse, pIdx, 1, 3, 1); - jmp2 = sqlite3VdbeAddOp3(v, OP_Found, j+2, 0, 3); + r1 = sqlite3GenerateIndexKey(pParse, pIdx, 1, 3, 0); + jmp2 = sqlite3VdbeAddOp4Int(v, OP_Found, j+2, 0, r1, pIdx->nColumn+1); addr = sqlite3VdbeAddOpList(v, ArraySize(idxErr), idxErr); sqlite3VdbeChangeP4(v, addr+1, "rowid ", P4_STATIC); sqlite3VdbeChangeP4(v, addr+3, " missing from index ", P4_STATIC); @@ -77712,6 +86434,56 @@ SQLITE_PRIVATE void sqlite3Pragma( }else #endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */ +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS + /* + ** PRAGMA compile_options + ** + ** Return the names of all compile-time options used in this build, + ** one option per row. + */ + if( sqlite3StrICmp(zLeft, "compile_options")==0 ){ + int i = 0; + const char *zOpt; + sqlite3VdbeSetNumCols(v, 1); + pParse->nMem = 1; + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "compile_option", SQLITE_STATIC); + while( (zOpt = sqlite3_compileoption_get(i++))!=0 ){ + sqlite3VdbeAddOp4(v, OP_String8, 0, 1, 0, zOpt, 0); + sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); + } + }else +#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ + +#ifndef SQLITE_OMIT_WAL + /* + ** PRAGMA [database.]wal_checkpoint + ** + ** Checkpoint the database. + */ + if( sqlite3StrICmp(zLeft, "wal_checkpoint")==0 ){ + if( sqlite3ReadSchema(pParse) ) goto pragma_out; + sqlite3VdbeAddOp3(v, OP_Checkpoint, pId2->z?iDb:SQLITE_MAX_ATTACHED, 0, 0); + }else + + /* + ** PRAGMA wal_autocheckpoint + ** PRAGMA wal_autocheckpoint = N + ** + ** Configure a database connection to automatically checkpoint a database + ** after accumulating N frames in the log. Or query for the current value + ** of N. + */ + if( sqlite3StrICmp(zLeft, "wal_autocheckpoint")==0 ){ + if( zRight ){ + int nAuto = atoi(zRight); + sqlite3_wal_autocheckpoint(db, nAuto); + } + returnSingleInt(pParse, "wal_autocheckpoint", + db->xWalCallback==sqlite3WalDefaultHook ? + SQLITE_PTR_TO_INT(db->pWalArg) : 0); + }else +#endif + #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) /* ** Report the current state of file logs for all databases @@ -77746,7 +86518,7 @@ SQLITE_PRIVATE void sqlite3Pragma( }else #endif -#if SQLITE_HAS_CODEC +#ifdef SQLITE_HAS_CODEC if( sqlite3StrICmp(zLeft, "key")==0 && zRight ){ sqlite3_key(db, zRight, sqlite3Strlen30(zRight)); }else @@ -77769,17 +86541,15 @@ SQLITE_PRIVATE void sqlite3Pragma( } }else #endif -#if SQLITE_HAS_CODEC || defined(SQLITE_ENABLE_CEROD) +#if defined(SQLITE_HAS_CODEC) || defined(SQLITE_ENABLE_CEROD) if( sqlite3StrICmp(zLeft, "activate_extensions")==0 ){ -#if SQLITE_HAS_CODEC +#ifdef SQLITE_HAS_CODEC if( sqlite3StrNICmp(zRight, "see-", 4)==0 ){ - extern void sqlite3_activate_see(const char*); sqlite3_activate_see(&zRight[4]); } #endif #ifdef SQLITE_ENABLE_CEROD if( sqlite3StrNICmp(zRight, "cerod-", 6)==0 ){ - extern void sqlite3_activate_cerod(const char*); sqlite3_activate_cerod(&zRight[6]); } #endif @@ -77789,12 +86559,6 @@ SQLITE_PRIVATE void sqlite3Pragma( {/* Empty ELSE clause */} - /* Code an OP_Expire at the end of each PRAGMA program to cause - ** the VDBE implementing the pragma to expire. Most (all?) pragmas - ** are only valid for a single execution. - */ - sqlite3VdbeAddOp2(v, OP_Expire, 1, 0); - /* ** Reset the safety level, in case the fullfsync flag or synchronous ** setting changed. @@ -77828,8 +86592,6 @@ pragma_out: ** This file contains the implementation of the sqlite3_prepare() ** interface, and routines that contribute to loading the database schema ** from disk. -** -** $Id: prepare.c,v 1.131 2009/08/06 17:43:31 drh Exp $ */ /* @@ -77890,15 +86652,18 @@ SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char ** or executed. All the parser does is build the internal data ** structures that describe the table, index, or view. */ - char *zErr; int rc; + sqlite3_stmt *pStmt; + TESTONLY(int rcp); /* Return code from sqlite3_prepare() */ + assert( db->init.busy ); db->init.iDb = iDb; db->init.newTnum = atoi(argv[1]); db->init.orphanTrigger = 0; - rc = sqlite3_exec(db, argv[2], 0, 0, &zErr); + TESTONLY(rcp = ) sqlite3_prepare(db, argv[2], -1, &pStmt, 0); + rc = db->errCode; + assert( (rc&0xFF)==(rcp&0xFF) ); db->init.iDb = 0; - assert( rc!=SQLITE_OK || zErr==0 ); if( SQLITE_OK!=rc ){ if( db->init.orphanTrigger ){ assert( iDb==1 ); @@ -77906,12 +86671,12 @@ SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char pData->rc = rc; if( rc==SQLITE_NOMEM ){ db->mallocFailed = 1; - }else if( rc!=SQLITE_INTERRUPT && rc!=SQLITE_LOCKED ){ - corruptSchema(pData, argv[0], zErr); + }else if( rc!=SQLITE_INTERRUPT && (rc&0xFF)!=SQLITE_LOCKED ){ + corruptSchema(pData, argv[0], sqlite3_errmsg(db)); } } - sqlite3DbFree(db, zErr); } + sqlite3_finalize(pStmt); }else if( argv[0]==0 ){ corruptSchema(pData, 0, 0); }else{ @@ -78009,9 +86774,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ initData.iDb = iDb; initData.rc = SQLITE_OK; initData.pzErrMsg = pzErrMsg; - (void)sqlite3SafetyOff(db); sqlite3InitCallback(&initData, 3, (char **)azArg, 0); - (void)sqlite3SafetyOn(db); if( initData.rc ){ rc = initData.rc; goto error_out; @@ -78132,9 +86895,8 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ { char *zSql; zSql = sqlite3MPrintf(db, - "SELECT name, rootpage, sql FROM '%q'.%s", + "SELECT name, rootpage, sql FROM '%q'.%s ORDER BY rowid", db->aDb[iDb].zName, zMasterName); - (void)sqlite3SafetyOff(db); #ifndef SQLITE_OMIT_AUTHORIZATION { int (*xAuth)(void*,int,const char*,const char*,const char*,const char*); @@ -78147,7 +86909,6 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ } #endif if( rc==SQLITE_OK ) rc = initData.rc; - (void)sqlite3SafetyOn(db); sqlite3DbFree(db, zSql); #ifndef SQLITE_OMIT_ANALYZE if( rc==SQLITE_OK ){ @@ -78286,7 +87047,7 @@ static void schemaIsValid(Parse *pParse){ } /* Read the schema cookie from the database. If it does not match the - ** value stored as part of the in the in-memory schema representation, + ** value stored as part of the in-memory schema representation, ** set Parse.rc to SQLITE_SCHEMA. */ sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&cookie); if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){ @@ -78356,11 +87117,6 @@ static int sqlite3Prepare( goto end_prepare; } pParse->pReprepare = pReprepare; - - if( sqlite3SafetyOn(db) ){ - rc = SQLITE_MISUSE; - goto end_prepare; - } assert( ppStmt && *ppStmt==0 ); assert( !db->mallocFailed ); assert( sqlite3_mutex_held(db->mutex) ); @@ -78396,7 +87152,6 @@ static int sqlite3Prepare( if( rc ){ const char *zDb = db->aDb[i].zName; sqlite3Error(db, rc, "database schema is locked: %s", zDb); - (void)sqlite3SafetyOff(db); testcase( db->flags & SQLITE_ReadUncommitted ); goto end_prepare; } @@ -78406,6 +87161,7 @@ static int sqlite3Prepare( sqlite3VtabUnlockList(db); pParse->db = db; + pParse->nQueryLoop = (double)1; if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){ char *zSqlCopy; int mxLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH]; @@ -78413,7 +87169,6 @@ static int sqlite3Prepare( testcase( nBytes==mxLen+1 ); if( nBytes>mxLen ){ sqlite3Error(db, SQLITE_TOOBIG, "statement too long"); - (void)sqlite3SafetyOff(db); rc = sqlite3ApiExit(db, SQLITE_TOOBIG); goto end_prepare; } @@ -78428,6 +87183,7 @@ static int sqlite3Prepare( }else{ sqlite3RunParser(pParse, zSql, &zErrMsg); } + assert( 1==(int)pParse->nQueryLoop ); if( db->mallocFailed ){ pParse->rc = SQLITE_NOMEM; @@ -78470,10 +87226,6 @@ static int sqlite3Prepare( } #endif - if( sqlite3SafetyOff(db) ){ - rc = SQLITE_MISUSE; - } - assert( db->init.busy==0 || saveSqlFlag==0 ); if( db->init.busy==0 ){ Vdbe *pVdbe = pParse->pVdbe; @@ -78497,7 +87249,6 @@ static int sqlite3Prepare( while( pParse->pTriggerPrg ){ TriggerPrg *pT = pParse->pTriggerPrg; pParse->pTriggerPrg = pT->pNext; - sqlite3VdbeProgramDelete(db, pT->pProgram, 0); sqlite3DbFree(db, pT); } @@ -78521,7 +87272,7 @@ static int sqlite3LockAndPrepare( assert( ppStmt!=0 ); *ppStmt = 0; if( !sqlite3SafetyCheckOk(db) ){ - return SQLITE_MISUSE; + return SQLITE_MISUSE_BKPT; } sqlite3_mutex_enter(db->mutex); sqlite3BtreeEnterAll(db); @@ -78560,7 +87311,7 @@ SQLITE_PRIVATE int sqlite3Reprepare(Vdbe *p){ db->mallocFailed = 1; } assert( pNew==0 ); - return (rc==SQLITE_LOCKED) ? SQLITE_LOCKED : SQLITE_SCHEMA; + return rc; }else{ assert( pNew!=0 ); } @@ -78629,10 +87380,10 @@ static int sqlite3Prepare16( assert( ppStmt ); *ppStmt = 0; if( !sqlite3SafetyCheckOk(db) ){ - return SQLITE_MISUSE; + return SQLITE_MISUSE_BKPT; } sqlite3_mutex_enter(db->mutex); - zSql8 = sqlite3Utf16to8(db, zSql, nBytes); + zSql8 = sqlite3Utf16to8(db, zSql, nBytes, SQLITE_UTF16NATIVE); if( zSql8 ){ rc = sqlite3LockAndPrepare(db, zSql8, -1, saveSqlFlag, 0, ppStmt, &zTail8); } @@ -78702,8 +87453,6 @@ SQLITE_API int sqlite3_prepare16_v2( ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. -** -** $Id: select.c,v 1.526 2009/08/01 15:09:58 drh Exp $ */ @@ -78796,7 +87545,7 @@ SQLITE_PRIVATE void sqlite3SelectDelete(sqlite3 *db, Select *p){ } /* -** Given 1 to 3 identifiers preceding the JOIN keyword, determine the +** Given 1 to 3 identifiers preceeding the JOIN keyword, determine the ** type of join. Return an integer constant that expresses that type ** in terms of the following bit values: ** @@ -78881,6 +87630,39 @@ static int columnIndex(Table *pTab, const char *zCol){ return -1; } +/* +** Search the first N tables in pSrc, from left to right, looking for a +** table that has a column named zCol. +** +** When found, set *piTab and *piCol to the table index and column index +** of the matching column and return TRUE. +** +** If not found, return FALSE. +*/ +static int tableAndColumnIndex( + SrcList *pSrc, /* Array of tables to search */ + int N, /* Number of tables in pSrc->a[] to search */ + const char *zCol, /* Name of the column we are looking for */ + int *piTab, /* Write index of pSrc->a[] here */ + int *piCol /* Write index of pSrc->a[*piTab].pTab->aCol[] here */ +){ + int i; /* For looping over tables in pSrc */ + int iCol; /* Index of column matching zCol */ + + assert( (piTab==0)==(piCol==0) ); /* Both or neither are NULL */ + for(i=0; ia[i].pTab, zCol); + if( iCol>=0 ){ + if( piTab ){ + *piTab = i; + *piCol = iCol; + } + return 1; + } + } + return 0; +} + /* ** This function is used to add terms implied by JOIN syntax to the ** WHERE clause expression of a SELECT statement. The new term, which @@ -78895,8 +87677,9 @@ static int columnIndex(Table *pTab, const char *zCol){ static void addWhereTerm( Parse *pParse, /* Parsing context */ SrcList *pSrc, /* List of tables in FROM clause */ - int iSrc, /* Index of first table to join in pSrc */ + int iLeft, /* Index of first table to join in pSrc */ int iColLeft, /* Index of column in first table */ + int iRight, /* Index of second table in pSrc */ int iColRight, /* Index of column in second table */ int isOuterJoin, /* True if this is an OUTER join */ Expr **ppWhere /* IN/OUT: The WHERE clause to add to */ @@ -78906,12 +87689,13 @@ static void addWhereTerm( Expr *pE2; Expr *pEq; - assert( pSrc->nSrc>(iSrc+1) ); - assert( pSrc->a[iSrc].pTab ); - assert( pSrc->a[iSrc+1].pTab ); + assert( iLeftnSrc>iRight ); + assert( pSrc->a[iLeft].pTab ); + assert( pSrc->a[iRight].pTab ); - pE1 = sqlite3CreateColumnExpr(db, pSrc, iSrc, iColLeft); - pE2 = sqlite3CreateColumnExpr(db, pSrc, iSrc+1, iColRight); + pE1 = sqlite3CreateColumnExpr(db, pSrc, iLeft, iColLeft); + pE2 = sqlite3CreateColumnExpr(db, pSrc, iRight, iColRight); pEq = sqlite3PExpr(pParse, TK_EQ, pE1, pE2, 0); if( pEq && isOuterJoin ){ @@ -79000,11 +87784,15 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){ "an ON or USING clause", 0); return 1; } - for(j=0; jnCol; j++){ - char *zName = pLeftTab->aCol[j].zName; - int iRightCol = columnIndex(pRightTab, zName); - if( iRightCol>=0 ){ - addWhereTerm(pParse, pSrc, i, j, iRightCol, isOuter, &p->pWhere); + for(j=0; jnCol; j++){ + char *zName; /* Name of column in the right table */ + int iLeft; /* Matching left table */ + int iLeftCol; /* Matching column in the left table */ + + zName = pRightTab->aCol[j].zName; + if( tableAndColumnIndex(pSrc, i+1, zName, &iLeft, &iLeftCol) ){ + addWhereTerm(pParse, pSrc, iLeft, iLeftCol, i+1, j, + isOuter, &p->pWhere); } } } @@ -79036,15 +87824,22 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){ if( pRight->pUsing ){ IdList *pList = pRight->pUsing; for(j=0; jnId; j++){ - char *zName = pList->a[j].zName; - int iLeftCol = columnIndex(pLeftTab, zName); - int iRightCol = columnIndex(pRightTab, zName); - if( iLeftCol<0 || iRightCol<0 ){ + char *zName; /* Name of the term in the USING clause */ + int iLeft; /* Table on the left with matching column name */ + int iLeftCol; /* Column number of matching column on the left */ + int iRightCol; /* Column number of matching column on the right */ + + zName = pList->a[j].zName; + iRightCol = columnIndex(pRightTab, zName); + if( iRightCol<0 + || !tableAndColumnIndex(pSrc, i+1, zName, &iLeft, &iLeftCol) + ){ sqlite3ErrorMsg(pParse, "cannot join using column %s - column " "not present in both tables", zName); return 1; } - addWhereTerm(pParse, pSrc, i, iLeftCol, iRightCol, isOuter, &p->pWhere); + addWhereTerm(pParse, pSrc, iLeft, iLeftCol, i+1, iRightCol, + isOuter, &p->pWhere); } } } @@ -79088,7 +87883,6 @@ static void pushOntoSorter( sqlite3VdbeAddOp1(v, OP_Last, pOrderBy->iECursor); sqlite3VdbeAddOp1(v, OP_Delete, pOrderBy->iECursor); sqlite3VdbeJumpHere(v, addr2); - pSelect->iLimit = 0; } } @@ -79131,17 +87925,19 @@ static void codeDistinct( v = pParse->pVdbe; r1 = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp4Int(v, OP_Found, iTab, addrRepeat, iMem, N); sqlite3VdbeAddOp3(v, OP_MakeRecord, iMem, N, r1); - sqlite3VdbeAddOp3(v, OP_Found, iTab, addrRepeat, r1); sqlite3VdbeAddOp2(v, OP_IdxInsert, iTab, r1); sqlite3ReleaseTempReg(pParse, r1); } +#ifndef SQLITE_OMIT_SUBQUERY /* ** Generate an error message when a SELECT is used within a subexpression ** (example: "a IN (SELECT * FROM table)") but it has more than 1 result -** column. We do this in a subroutine because the error occurs in multiple -** places. +** column. We do this in a subroutine because the error used to occur +** in multiple places. (The error only occurs in one place now, but we +** retain the subroutine to minimize code disruption.) */ static int checkForMultiColumnSelectError( Parse *pParse, /* Parse context. */ @@ -79157,6 +87953,7 @@ static int checkForMultiColumnSelectError( return 0; } } +#endif /* ** This routine generates the code for the inside of the inner loop @@ -79236,10 +88033,6 @@ static void selectInnerLoop( } } - if( checkForMultiColumnSelectError(pParse, pDest, pEList->nExpr) ){ - return; - } - switch( eDest ){ /* In this mode, write each query result to the key of the temporary ** table iParm. @@ -79368,13 +88161,12 @@ static void selectInnerLoop( #endif } - /* Jump to the end of the loop if the LIMIT is reached. + /* Jump to the end of the loop if the LIMIT is reached. Except, if + ** there is a sorter, in which case the sorter has already limited + ** the output for us. */ - if( p->iLimit ){ - assert( pOrderBy==0 ); /* If there is an ORDER BY, the call to - ** pushOntoSorter() would have cleared p->iLimit */ - sqlite3VdbeAddOp2(v, OP_AddImm, p->iLimit, -1); - sqlite3VdbeAddOp2(v, OP_IfZero, p->iLimit, iBreak); + if( pOrderBy==0 && p->iLimit ){ + sqlite3VdbeAddOp3(v, OP_IfZero, p->iLimit, iBreak, -1); } } @@ -79508,10 +88300,6 @@ static void generateSortTail( sqlite3ReleaseTempReg(pParse, regRow); sqlite3ReleaseTempReg(pParse, regRowid); - /* LIMIT has been implemented by the pushOntoSorter() routine. - */ - assert( p->iLimit==0 ); - /* The bottom of the loop */ sqlite3VdbeResolveLabel(v, addrContinue); @@ -79604,7 +88392,7 @@ static const char *columnType( ** of the SELECT statement. Return the declaration type and origin ** data for the result-set column of the sub-select. */ - if( ALWAYS(iCol>=0 && iColpEList->nExpr) ){ + if( iCol>=0 && ALWAYS(iColpEList->nExpr) ){ /* If iCol is less than zero, then the expression requests the ** rowid of the sub-select or view. This expression is legal (see ** test case misc2.2.2) - it always evaluates to NULL. @@ -79945,16 +88733,15 @@ SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect){ return 0; } /* The sqlite3ResultSetOfSelect() is only used n contexts where lookaside - ** is disabled, so we might as well hard-code pTab->dbMem to NULL. */ + ** is disabled */ assert( db->lookaside.bEnabled==0 ); - pTab->dbMem = 0; pTab->nRef = 1; pTab->zName = 0; selectColumnsFromExprList(pParse, pSelect->pEList, &pTab->nCol, &pTab->aCol); selectAddColumnTypeAndCollation(pParse, pTab->nCol, pTab->aCol, pSelect); pTab->iPKey = -1; if( db->mallocFailed ){ - sqlite3DeleteTable(pTab); + sqlite3DeleteTable(db, pTab); return 0; } return pTab; @@ -80000,7 +88787,7 @@ static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){ Vdbe *v = 0; int iLimit = 0; int iOffset; - int addr1; + int addr1, n; if( p->iLimit ) return; /* @@ -80015,10 +88802,18 @@ static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){ p->iLimit = iLimit = ++pParse->nMem; v = sqlite3GetVdbe(pParse); if( NEVER(v==0) ) return; /* VDBE should have already been allocated */ - sqlite3ExprCode(pParse, p->pLimit, iLimit); - sqlite3VdbeAddOp1(v, OP_MustBeInt, iLimit); - VdbeComment((v, "LIMIT counter")); - sqlite3VdbeAddOp2(v, OP_IfZero, iLimit, iBreak); + if( sqlite3ExprIsInteger(p->pLimit, &n) ){ + sqlite3VdbeAddOp2(v, OP_Integer, n, iLimit); + VdbeComment((v, "LIMIT counter")); + if( n==0 ){ + sqlite3VdbeAddOp2(v, OP_Goto, 0, iBreak); + } + }else{ + sqlite3ExprCode(pParse, p->pLimit, iLimit); + sqlite3VdbeAddOp1(v, OP_MustBeInt, iLimit); + VdbeComment((v, "LIMIT counter")); + sqlite3VdbeAddOp2(v, OP_IfZero, iLimit, iBreak); + } if( p->pOffset ){ p->iOffset = iOffset = ++pParse->nMem; pParse->nMem++; /* Allocate an extra register for limit+offset */ @@ -80143,6 +88938,7 @@ static int multiSelect( if( dest.eDest==SRT_EphemTab ){ assert( p->pEList ); sqlite3VdbeAddOp2(v, OP_OpenEphemeral, dest.iParm, p->pEList->nExpr); + sqlite3VdbeChangeP5(v, BTREE_UNORDERED); dest.eDest = SRT_Table; } @@ -80354,7 +89150,7 @@ static int multiSelect( sqlite3VdbeAddOp2(v, OP_Rewind, tab1, iBreak); r1 = sqlite3GetTempReg(pParse); iStart = sqlite3VdbeAddOp2(v, OP_RowKey, tab1, r1); - sqlite3VdbeAddOp3(v, OP_NotFound, tab2, iCont, r1); + sqlite3VdbeAddOp4Int(v, OP_NotFound, tab2, iCont, r1, 0); sqlite3ReleaseTempReg(pParse, r1); selectInnerLoop(pParse, p, p->pEList, tab1, p->pEList->nExpr, 0, -1, &dest, iCont, iBreak); @@ -80438,7 +89234,7 @@ multi_select_end: ** regReturn is the number of the register holding the subroutine ** return address. ** -** If regPrev>0 then it is a the first register in a vector that +** If regPrev>0 then it is the first register in a vector that ** records the previous output. mem[regPrev] is a flag that is false ** if there has been no previous output. If regPrev>0 then code is ** generated to suppress duplicates. pKeyInfo is used for comparing @@ -80573,8 +89369,7 @@ static int generateOutputSubroutine( /* Jump to the end of the loop if the LIMIT is reached. */ if( p->iLimit ){ - sqlite3VdbeAddOp2(v, OP_AddImm, p->iLimit, -1); - sqlite3VdbeAddOp2(v, OP_IfZero, p->iLimit, iBreak); + sqlite3VdbeAddOp3(v, OP_IfZero, p->iLimit, iBreak, -1); } /* Generate the subroutine return @@ -80822,7 +89617,6 @@ static int multiSelectOrderBy( /* Separate the left and the right query from one another */ p->pPrior = 0; - pPrior->pRightmost = 0; sqlite3ResolveOrderGroupBy(pParse, p, p->pOrderBy, "ORDER"); if( pPrior->pPrior==0 ){ sqlite3ResolveOrderGroupBy(pParse, pPrior, pPrior->pOrderBy, "ORDER"); @@ -81136,12 +89930,13 @@ static void substSelect( ** (2) The subquery is not an aggregate or the outer query is not a join. ** ** (3) The subquery is not the right operand of a left outer join -** (Originally ticket #306. Strenghtened by ticket #3300) +** (Originally ticket #306. Strengthened by ticket #3300) ** -** (4) The subquery is not DISTINCT or the outer query is not a join. +** (4) The subquery is not DISTINCT. ** -** (5) The subquery is not DISTINCT or the outer query does not use -** aggregates. +** (**) At one point restrictions (4) and (5) defined a subset of DISTINCT +** sub-queries that were excluded from this optimization. Restriction +** (4) has since been expanded to exclude all DISTINCT subqueries. ** ** (6) The subquery does not use aggregates or the outer query is not ** DISTINCT. @@ -81158,16 +89953,16 @@ static void substSelect( ** ** (11) The subquery and the outer query do not both have ORDER BY clauses. ** -** (12) Not implemented. Subsumed into restriction (3). Was previously +** (**) Not implemented. Subsumed into restriction (3). Was previously ** a separate restriction deriving from ticket #350. ** -** (13) The subquery and outer query do not both use LIMIT +** (13) The subquery and outer query do not both use LIMIT. ** -** (14) The subquery does not use OFFSET +** (14) The subquery does not use OFFSET. ** ** (15) The outer query is not part of a compound select or the -** subquery does not have both an ORDER BY and a LIMIT clause. -** (See ticket #2339) +** subquery does not have a LIMIT clause. +** (See ticket #2339 and ticket [02a8e81d44]). ** ** (16) The outer query is not an aggregate or the subquery does ** not contain ORDER BY. (Ticket #2942) This used to not matter @@ -81232,6 +90027,7 @@ static int flattenSubquery( */ assert( p!=0 ); assert( p->pPrior==0 ); /* Unable to flatten compound queries */ + if( db->flags & SQLITE_QueryFlattener ) return 0; pSrc = p->pSrc; assert( pSrc && iFrom>=0 && iFromnSrc ); pSubitem = &pSrc->a[iFrom]; @@ -81249,13 +90045,13 @@ static int flattenSubquery( ** and (14). */ if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */ if( pSub->pOffset ) return 0; /* Restriction (14) */ - if( p->pRightmost && pSub->pLimit && pSub->pOrderBy ){ + if( p->pRightmost && pSub->pLimit ){ return 0; /* Restriction (15) */ } if( pSubSrc->nSrc==0 ) return 0; /* Restriction (7) */ - if( ((pSub->selFlags & SF_Distinct)!=0 || pSub->pLimit) - && (pSrc->nSrc>1 || isAgg) ){ /* Restrictions (4)(5)(8)(9) */ - return 0; + if( pSub->selFlags & SF_Distinct ) return 0; /* Restriction (5) */ + if( pSub->pLimit && (pSrc->nSrc>1 || isAgg) ){ + return 0; /* Restrictions (8)(9) */ } if( (p->selFlags & SF_Distinct)!=0 && subqueryIsAgg ){ return 0; /* Restriction (6) */ @@ -81659,6 +90455,7 @@ SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pF ); if( !pIdx ){ sqlite3ErrorMsg(pParse, "no such index: %s", zIndex, 0); + pParse->checkSchema = 1; return SQLITE_ERROR; } pFrom->pIndex = pIdx; @@ -81681,7 +90478,7 @@ SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pF ** without worrying about messing up the presistent representation ** of the view. ** -** (3) Add terms to the WHERE clause to accommodate the NATURAL keyword +** (3) Add terms to the WHERE clause to accomodate the NATURAL keyword ** on joins and the ON and USING clause of joins. ** ** (4) Scan the list of columns in the result set (pEList) looking @@ -81734,7 +90531,6 @@ static int selectExpander(Walker *pWalker, Select *p){ sqlite3WalkSelect(pWalker, pSel); pFrom->pTab = pTab = sqlite3DbMallocZero(db, sizeof(Table)); if( pTab==0 ) return WRC_Abort; - pTab->dbMem = db->lookaside.bEnabled ? db : 0; pTab->nRef = 1; pTab->zName = sqlite3MPrintf(db, "sqlite_subquery_%p_", (void*)pTab); while( pSel->pPrior ){ pSel = pSel->pPrior; } @@ -81855,14 +90651,14 @@ static int selectExpander(Walker *pWalker, Select *p){ } if( i>0 && zTName==0 ){ - struct SrcList_item *pLeft = &pTabList->a[i-1]; - if( (pLeft[1].jointype & JT_NATURAL)!=0 && - columnIndex(pLeft->pTab, zName)>=0 ){ + if( (pFrom->jointype & JT_NATURAL)!=0 + && tableAndColumnIndex(pTabList, i, zName, 0, 0) + ){ /* In a NATURAL join, omit the join columns from the - ** table on the right */ + ** table to the right of the join */ continue; } - if( sqlite3IdListIndex(pLeft[1].pUsing, zName)>=0 ){ + if( sqlite3IdListIndex(pFrom->pUsing, zName)>=0 ){ /* In a join with a USING clause, omit columns in the ** using clause from the table on the right. */ continue; @@ -81966,18 +90762,19 @@ static int selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){ struct SrcList_item *pFrom; assert( p->selFlags & SF_Resolved ); - assert( (p->selFlags & SF_HasTypeInfo)==0 ); - p->selFlags |= SF_HasTypeInfo; - pParse = pWalker->pParse; - pTabList = p->pSrc; - for(i=0, pFrom=pTabList->a; inSrc; i++, pFrom++){ - Table *pTab = pFrom->pTab; - if( ALWAYS(pTab!=0) && (pTab->tabFlags & TF_Ephemeral)!=0 ){ - /* A sub-query in the FROM clause of a SELECT */ - Select *pSel = pFrom->pSelect; - assert( pSel ); - while( pSel->pPrior ) pSel = pSel->pPrior; - selectAddColumnTypeAndCollation(pParse, pTab->nCol, pTab->aCol, pSel); + if( (p->selFlags & SF_HasTypeInfo)==0 ){ + p->selFlags |= SF_HasTypeInfo; + pParse = pWalker->pParse; + pTabList = p->pSrc; + for(i=0, pFrom=pTabList->a; inSrc; i++, pFrom++){ + Table *pTab = pFrom->pTab; + if( ALWAYS(pTab!=0) && (pTab->tabFlags & TF_Ephemeral)!=0 ){ + /* A sub-query in the FROM clause of a SELECT */ + Select *pSel = pFrom->pSelect; + assert( pSel ); + while( pSel->pPrior ) pSel = pSel->pPrior; + selectAddColumnTypeAndCollation(pParse, pTab->nCol, pTab->aCol, pSel); + } } } return WRC_Continue; @@ -82103,7 +90900,7 @@ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ if( pList ){ nArg = pList->nExpr; regAgg = sqlite3GetTempRange(pParse, nArg); - sqlite3ExprCodeExprList(pParse, pList, regAgg, 0); + sqlite3ExprCodeExprList(pParse, pList, regAgg, 1); }else{ nArg = 0; regAgg = 0; @@ -82129,13 +90926,25 @@ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ sqlite3VdbeAddOp4(v, OP_AggStep, 0, regAgg, pF->iMem, (void*)pF->pFunc, P4_FUNCDEF); sqlite3VdbeChangeP5(v, (u8)nArg); - sqlite3ReleaseTempRange(pParse, regAgg, nArg); sqlite3ExprCacheAffinityChange(pParse, regAgg, nArg); + sqlite3ReleaseTempRange(pParse, regAgg, nArg); if( addrNext ){ sqlite3VdbeResolveLabel(v, addrNext); sqlite3ExprCacheClear(pParse); } } + + /* Before populating the accumulator registers, clear the column cache. + ** Otherwise, if any of the required column values are already present + ** in registers, sqlite3ExprCode() may use OP_SCopy to copy the value + ** to pC->iMem. But by the time the value is used, the original register + ** may have been used, invalidating the underlying buffer holding the + ** text or blob value. See ticket [883034dcb5]. + ** + ** Another solution would be to change the OP_SCopy used to copy cached + ** values to an OP_Copy. + */ + sqlite3ExprCacheClear(pParse); for(i=0, pC=pAggInfo->aCol; inAccumulator; i++, pC++){ sqlite3ExprCode(pParse, pC->pExpr, pC->iMem); } @@ -82251,6 +91060,15 @@ SQLITE_PRIVATE int sqlite3Select( v = sqlite3GetVdbe(pParse); if( v==0 ) goto select_end; + /* If writing to memory or generating a set + ** only a single column may be output. + */ +#ifndef SQLITE_OMIT_SUBQUERY + if( checkForMultiColumnSelectError(pParse, pDest, pEList->nExpr) ){ + goto select_end; + } +#endif + /* Generate code for all sub-queries in the FROM clause */ #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) @@ -82324,15 +91142,6 @@ SQLITE_PRIVATE int sqlite3Select( } #endif - /* If writing to memory or generating a set - ** only a single column may be output. - */ -#ifndef SQLITE_OMIT_SUBQUERY - if( checkForMultiColumnSelectError(pParse, pDest, pEList->nExpr) ){ - goto select_end; - } -#endif - /* If possible, rewrite the query to use GROUP BY instead of DISTINCT. ** GROUP BY might use an index, DISTINCT never does. */ @@ -82344,6 +91153,18 @@ SQLITE_PRIVATE int sqlite3Select( isDistinct = 0; } + /* If there is both a GROUP BY and an ORDER BY clause and they are + ** identical, then disable the ORDER BY clause since the GROUP BY + ** will cause elements to come out in the correct order. This is + ** an optimization - the correct answer should result regardless. + ** Use the SQLITE_GroupByOrder flag with SQLITE_TESTCTRL_OPTIMIZER + ** to disable this optimization for testing purposes. + */ + if( sqlite3ExprListCompare(p->pGroupBy, pOrderBy)==0 + && (db->flags & SQLITE_GroupByOrder)==0 ){ + pOrderBy = 0; + } + /* If there is an ORDER BY clause, then this sorting ** index might end up being unused if the data can be ** extracted in pre-sorted order. If that is the case, then the @@ -82383,6 +91204,7 @@ SQLITE_PRIVATE int sqlite3Select( pKeyInfo = keyInfoFromExprList(pParse, p->pEList); sqlite3VdbeAddOp4(v, OP_OpenEphemeral, distinct, 0, 0, (char*)pKeyInfo, P4_KEYINFO_HANDOFF); + sqlite3VdbeChangeP5(v, BTREE_UNORDERED); }else{ distinct = -1; } @@ -82556,7 +91378,7 @@ SQLITE_PRIVATE int sqlite3Select( int r2; r2 = sqlite3ExprCodeGetColumn(pParse, - pCol->pTab, pCol->iColumn, pCol->iTable, r1, 0); + pCol->pTab, pCol->iColumn, pCol->iTable, r1); if( r1!=r2 ){ sqlite3VdbeAddOp2(v, OP_SCopy, r2, r1); } @@ -82942,8 +91764,6 @@ SQLITE_PRIVATE void sqlite3PrintSelect(Select *p, int indent){ ** ** These routines are in a separate files so that they will not be linked ** if they are not used. -** -** $Id: table.c,v 1.40 2009/04/10 14:28:00 drh Exp $ */ #ifndef SQLITE_OMIT_GET_TABLE @@ -83134,9 +91954,7 @@ SQLITE_API void sqlite3_free_table( ** May you share freely, never taking more than you give. ** ************************************************************************* -** -** -** $Id: trigger.c,v 1.143 2009/08/10 03:57:58 shane Exp $ +** This file contains the implementation for TRIGGERs */ #ifndef SQLITE_OMIT_TRIGGER @@ -83253,7 +92071,8 @@ SQLITE_PRIVATE void sqlite3BeginTrigger( goto trigger_cleanup; } pTab = sqlite3SrcListLookup(pParse, pTableName); - if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){ + if( db->init.busy==0 && pName2->n==0 && pTab + && pTab->pSchema==db->aDb[1].pSchema ){ iDb = 1; } @@ -83381,12 +92200,12 @@ SQLITE_PRIVATE void sqlite3FinishTrigger( TriggerStep *pStepList, /* The triggered program */ Token *pAll /* Token that describes the complete CREATE TRIGGER */ ){ - Trigger *pTrig = pParse->pNewTrigger; /* Trigger being finished */ - char *zName; /* Name of trigger */ - sqlite3 *db = pParse->db; /* The database */ - DbFixer sFix; - int iDb; /* Database containing the trigger */ - Token nameToken; /* Trigger name for error reporting */ + Trigger *pTrig = pParse->pNewTrigger; /* Trigger being finished */ + char *zName; /* Name of trigger */ + sqlite3 *db = pParse->db; /* The database */ + DbFixer sFix; /* Fixer object */ + int iDb; /* Database containing the trigger */ + Token nameToken; /* Trigger name for error reporting */ pTrig = pParse->pNewTrigger; pParse->pNewTrigger = 0; @@ -83405,7 +92224,7 @@ SQLITE_PRIVATE void sqlite3FinishTrigger( goto triggerfinish_cleanup; } - /* if we are not initializing, and this trigger is not on a TEMP table, + /* if we are not initializing, ** build the sqlite_master entry */ if( !db->init.busy ){ @@ -83622,6 +92441,7 @@ SQLITE_PRIVATE void sqlite3DropTrigger(Parse *pParse, SrcList *pName, int noErr) if( !noErr ){ sqlite3ErrorMsg(pParse, "no such trigger: %S", pName, 0); } + pParse->checkSchema = 1; goto drop_trigger_cleanup; } sqlite3DropTriggerPtr(pParse, pTrigger); @@ -83925,6 +92745,7 @@ static TriggerPrg *codeRowTrigger( int iEndTrigger = 0; /* Label to jump to if WHEN is false */ assert( pTrigger->zName==0 || pTab==tableOfTrigger(pTrigger) ); + assert( pTop->pVdbe ); /* Allocate the TriggerPrg and SubProgram objects. To ensure that they ** are freed if an error occurs, link them into the Parse.pTriggerPrg @@ -83935,10 +92756,11 @@ static TriggerPrg *codeRowTrigger( pTop->pTriggerPrg = pPrg; pPrg->pProgram = pProgram = sqlite3DbMallocZero(db, sizeof(SubProgram)); if( !pProgram ) return 0; - pProgram->nRef = 1; + sqlite3VdbeLinkSubProgram(pTop->pVdbe, pProgram); pPrg->pTrigger = pTrigger; pPrg->orconf = orconf; - pPrg->oldmask = 0xffffffff; + pPrg->aColmask[0] = 0xffffffff; + pPrg->aColmask[1] = 0xffffffff; /* Allocate and populate a new Parse context to use for coding the ** trigger sub-program. */ @@ -83951,6 +92773,7 @@ static TriggerPrg *codeRowTrigger( pSubParse->pToplevel = pTop; pSubParse->zAuthContext = pTrigger->zName; pSubParse->eTriggerOp = pTrigger->op; + pSubParse->nQueryLoop = pParse->nQueryLoop; v = sqlite3GetVdbe(pSubParse); if( v ){ @@ -83999,7 +92822,8 @@ static TriggerPrg *codeRowTrigger( pProgram->nMem = pSubParse->nMem; pProgram->nCsr = pSubParse->nTab; pProgram->token = (void *)pTrigger; - pPrg->oldmask = pSubParse->oldmask; + pPrg->aColmask[0] = pSubParse->oldmask; + pPrg->aColmask[1] = pSubParse->newmask; sqlite3VdbeDelete(v); } @@ -84066,8 +92890,9 @@ SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect( /* Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program ** is a pointer to the sub-vdbe containing the trigger program. */ if( pPrg ){ + int bRecursive = (p->zName && 0==(pParse->db->flags&SQLITE_RecTriggers)); + sqlite3VdbeAddOp3(v, OP_Program, reg, ignoreJump, ++pParse->nMem); - pPrg->pProgram->nRef++; sqlite3VdbeChangeP4(v, -1, (const char *)pPrg->pProgram, P4_SUBPROGRAM); VdbeComment( (v, "Call: %s.%s", (p->zName?p->zName:"fkey"), onErrorText(orconf))); @@ -84077,7 +92902,7 @@ SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect( ** invocation is disallowed if (a) the sub-program is really a trigger, ** not a foreign key action, and (b) the flag to enable recursive triggers ** is clear. */ - sqlite3VdbeChangeP5(v, (u8)(p->zName && !(pParse->db->flags&SQLITE_RecTriggers))); + sqlite3VdbeChangeP5(v, (u8)bRecursive); } } @@ -84159,28 +92984,36 @@ SQLITE_PRIVATE void sqlite3CodeRowTrigger( } /* -** Triggers fired by UPDATE or DELETE statements may access values stored -** in the old.* pseudo-table. This function returns a 32-bit bitmask -** indicating which columns of the old.* table actually are used by -** triggers. This information may be used by the caller to avoid having -** to load the entire old.* record into memory when executing an UPDATE -** or DELETE command. +** Triggers may access values stored in the old.* or new.* pseudo-table. +** This function returns a 32-bit bitmask indicating which columns of the +** old.* or new.* tables actually are used by triggers. This information +** may be used by the caller, for example, to avoid having to load the entire +** old.* record into memory when executing an UPDATE or DELETE command. ** ** Bit 0 of the returned mask is set if the left-most column of the -** table may be accessed using an old. reference. Bit 1 is set if +** table may be accessed using an [old|new]. reference. Bit 1 is set if ** the second leftmost column value is required, and so on. If there ** are more than 32 columns in the table, and at least one of the columns ** with an index greater than 32 may be accessed, 0xffffffff is returned. ** -** It is not possible to determine if the old.rowid column is accessed -** by triggers. The caller must always assume that it is. +** It is not possible to determine if the old.rowid or new.rowid column is +** accessed by triggers. The caller must always assume that it is. ** -** There is no equivalent function for new.* references. +** Parameter isNew must be either 1 or 0. If it is 0, then the mask returned +** applies to the old.* table. If 1, the new.* table. +** +** Parameter tr_tm must be a mask with one or both of the TRIGGER_BEFORE +** and TRIGGER_AFTER bits set. Values accessed by BEFORE triggers are only +** included in the returned mask if the TRIGGER_BEFORE bit is set in the +** tr_tm parameter. Similarly, values accessed by AFTER triggers are only +** included in the returned mask if the TRIGGER_AFTER bit is set in tr_tm. */ -SQLITE_PRIVATE u32 sqlite3TriggerOldmask( +SQLITE_PRIVATE u32 sqlite3TriggerColmask( Parse *pParse, /* Parse context */ Trigger *pTrigger, /* List of triggers on table pTab */ ExprList *pChanges, /* Changes list for any UPDATE OF triggers */ + int isNew, /* 1 for new.* ref mask, 0 for old.* ref mask */ + int tr_tm, /* Mask of TRIGGER_BEFORE|TRIGGER_AFTER */ Table *pTab, /* The table to code triggers from */ int orconf /* Default ON CONFLICT policy for trigger steps */ ){ @@ -84188,12 +93021,15 @@ SQLITE_PRIVATE u32 sqlite3TriggerOldmask( u32 mask = 0; Trigger *p; + assert( isNew==1 || isNew==0 ); for(p=pTrigger; p; p=p->pNext){ - if( p->op==op && checkColumnOverlap(p->pColumns,pChanges) ){ + if( p->op==op && (tr_tm&p->tr_tm) + && checkColumnOverlap(p->pColumns,pChanges) + ){ TriggerPrg *pPrg; pPrg = getRowTrigger(pParse, p, pTab, orconf); if( pPrg ){ - mask |= pPrg->oldmask; + mask |= pPrg->aColmask[isNew]; } } } @@ -84218,8 +93054,6 @@ SQLITE_PRIVATE u32 sqlite3TriggerOldmask( ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. -** -** $Id: update.c,v 1.207 2009/08/08 18:01:08 drh Exp $ */ #ifndef SQLITE_OMIT_VIRTUALTABLE @@ -84319,14 +93153,15 @@ SQLITE_PRIVATE void sqlite3Update( AuthContext sContext; /* The authorization context */ NameContext sNC; /* The name-context to resolve expressions in */ int iDb; /* Database containing the table being updated */ - int j1; /* Addresses of jump instructions */ int okOnePass; /* True for one-pass algorithm without the FIFO */ int hasFK; /* True if foreign key processing is required */ #ifndef SQLITE_OMIT_TRIGGER - int isView; /* Trying to update a view */ - Trigger *pTrigger; /* List of triggers on pTab, if required */ + int isView; /* True when updating a view (INSTEAD OF trigger) */ + Trigger *pTrigger; /* List of triggers on pTab, if required */ + int tmask; /* Mask of TRIGGER_BEFORE|TRIGGER_AFTER */ #endif + int newmask; /* Mask of NEW.* columns accessed by BEFORE triggers */ /* Register Allocations */ int regRowCount = 0; /* A count of rows changed */ @@ -84354,11 +93189,13 @@ SQLITE_PRIVATE void sqlite3Update( ** updated is a view. */ #ifndef SQLITE_OMIT_TRIGGER - pTrigger = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges, 0); + pTrigger = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges, &tmask); isView = pTab->pSelect!=0; + assert( pTrigger || tmask==0 ); #else # define pTrigger 0 # define isView 0 +# define tmask 0 #endif #ifdef SQLITE_OMIT_VIEW # undef isView @@ -84368,7 +93205,7 @@ SQLITE_PRIVATE void sqlite3Update( if( sqlite3ViewGetColumnNames(pParse, pTab) ){ goto update_cleanup; } - if( sqlite3IsReadOnly(pParse, pTab, (pTrigger?1:0)) ){ + if( sqlite3IsReadOnly(pParse, pTab, tmask) ){ goto update_cleanup; } aXRef = sqlite3DbMallocRaw(db, sizeof(int) * pTab->nCol ); @@ -84417,6 +93254,7 @@ SQLITE_PRIVATE void sqlite3Update( pRowidExpr = pChanges->a[i].pExpr; }else{ sqlite3ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName); + pParse->checkSchema = 1; goto update_cleanup; } } @@ -84596,11 +93434,12 @@ SQLITE_PRIVATE void sqlite3Update( ** with the required old.* column data. */ if( hasFK || pTrigger ){ u32 oldmask = (hasFK ? sqlite3FkOldmask(pParse, pTab) : 0); - oldmask |= sqlite3TriggerOldmask(pParse, pTrigger, pChanges, pTab, onError); + oldmask |= sqlite3TriggerColmask(pParse, + pTrigger, pChanges, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onError + ); for(i=0; inCol; i++){ if( aXRef[i]<0 || oldmask==0xffffffff || (oldmask & (1<nCol; i++){ if( i==pTab->iPKey ){ sqlite3VdbeAddOp2(v, OP_Null, 0, regNew+i); }else{ j = aXRef[i]; - if( j<0 ){ + if( j>=0 ){ + sqlite3ExprCode(pParse, pChanges->a[j].pExpr, regNew+i); + }else if( 0==(tmask&TRIGGER_BEFORE) || i>31 || (newmask&(1<a[j].pExpr, regNew+i); } } } /* Fire any BEFORE UPDATE triggers. This happens before constraints are - ** verified. One could argue that this is wrong. */ - if( pTrigger ){ + ** verified. One could argue that this is wrong. + */ + if( tmask&TRIGGER_BEFORE ){ sqlite3VdbeAddOp2(v, OP_Affinity, regNew, pTab->nCol); sqlite3TableAffinityStr(v, pTab); sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges, @@ -84640,11 +93499,25 @@ SQLITE_PRIVATE void sqlite3Update( ** case, jump to the next row. No updates or AFTER triggers are ** required. This behaviour - what happens when the row being updated ** is deleted or renamed by a BEFORE trigger - is left undefined in the - ** documentation. */ + ** documentation. + */ sqlite3VdbeAddOp3(v, OP_NotExists, iCur, addr, regOldRowid); + + /* If it did not delete it, the row-trigger may still have modified + ** some of the columns of the row being updated. Load the values for + ** all columns not modified by the update statement into their + ** registers in case this has happened. + */ + for(i=0; inCol; i++){ + if( aXRef[i]<0 && i!=pTab->iPKey ){ + sqlite3VdbeAddOp3(v, OP_Column, iCur, i, regNew+i); + sqlite3ColumnDefault(v, pTab, i, regNew+i); + } + } } if( !isView ){ + int j1; /* Address of jump instruction */ /* Do constraint checks. */ sqlite3GenerateConstraintChecks(pParse, pTab, iCur, regNewRowid, @@ -84807,6 +93680,7 @@ static void updateVirtualTable( assert( v ); ephemTab = pParse->nTab++; sqlite3VdbeAddOp2(v, OP_OpenEphemeral, ephemTab, pTab->nCol+1+(pRowid!=0)); + sqlite3VdbeChangeP5(v, BTREE_UNORDERED); /* fill the ephemeral table */ @@ -84851,33 +93725,45 @@ static void updateVirtualTable( ** ** Most of the code in this file may be omitted by defining the ** SQLITE_OMIT_VACUUM macro. -** -** $Id: vacuum.c,v 1.91 2009/07/02 07:47:33 danielk1977 Exp $ */ #if !defined(SQLITE_OMIT_VACUUM) && !defined(SQLITE_OMIT_ATTACH) +/* +** Finalize a prepared statement. If there was an error, store the +** text of the error message in *pzErrMsg. Return the result code. +*/ +static int vacuumFinalize(sqlite3 *db, sqlite3_stmt *pStmt, char **pzErrMsg){ + int rc; + rc = sqlite3VdbeFinalize((Vdbe*)pStmt); + if( rc ){ + sqlite3SetString(pzErrMsg, db, sqlite3_errmsg(db)); + } + return rc; +} + /* ** Execute zSql on database db. Return an error code. */ -static int execSql(sqlite3 *db, const char *zSql){ +static int execSql(sqlite3 *db, char **pzErrMsg, const char *zSql){ sqlite3_stmt *pStmt; VVA_ONLY( int rc; ) if( !zSql ){ return SQLITE_NOMEM; } if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){ + sqlite3SetString(pzErrMsg, db, sqlite3_errmsg(db)); return sqlite3_errcode(db); } VVA_ONLY( rc = ) sqlite3_step(pStmt); assert( rc!=SQLITE_ROW ); - return sqlite3_finalize(pStmt); + return vacuumFinalize(db, pStmt, pzErrMsg); } /* ** Execute zSql on database db. The statement returns exactly ** one column. Execute this as SQL on the same database. */ -static int execExecSql(sqlite3 *db, const char *zSql){ +static int execExecSql(sqlite3 *db, char **pzErrMsg, const char *zSql){ sqlite3_stmt *pStmt; int rc; @@ -84885,14 +93771,14 @@ static int execExecSql(sqlite3 *db, const char *zSql){ if( rc!=SQLITE_OK ) return rc; while( SQLITE_ROW==sqlite3_step(pStmt) ){ - rc = execSql(db, (char*)sqlite3_column_text(pStmt, 0)); + rc = execSql(db, pzErrMsg, (char*)sqlite3_column_text(pStmt, 0)); if( rc!=SQLITE_OK ){ - sqlite3_finalize(pStmt); + vacuumFinalize(db, pStmt, pzErrMsg); return rc; } } - return sqlite3_finalize(pStmt); + return vacuumFinalize(db, pStmt, pzErrMsg); } /* @@ -84924,14 +93810,20 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ int saved_flags; /* Saved value of the db->flags */ int saved_nChange; /* Saved value of db->nChange */ int saved_nTotalChange; /* Saved value of db->nTotalChange */ + void (*saved_xTrace)(void*,const char*); /* Saved db->xTrace */ Db *pDb = 0; /* Database to detach at end of vacuum */ int isMemDb; /* True if vacuuming a :memory: database */ - int nRes; + int nRes; /* Bytes of reserved space at the end of each page */ + int nDb; /* Number of attached databases */ if( !db->autoCommit ){ sqlite3SetString(pzErrMsg, db, "cannot VACUUM from within a transaction"); return SQLITE_ERROR; } + if( db->activeVdbeCnt>1 ){ + sqlite3SetString(pzErrMsg, db,"cannot VACUUM - SQL statements in progress"); + return SQLITE_ERROR; + } /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and @@ -84939,8 +93831,10 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ saved_flags = db->flags; saved_nChange = db->nChange; saved_nTotalChange = db->nTotalChange; - db->flags |= SQLITE_WriteSchema | SQLITE_IgnoreChecks; - db->flags &= ~SQLITE_ForeignKeys; + saved_xTrace = db->xTrace; + db->flags |= SQLITE_WriteSchema | SQLITE_IgnoreChecks | SQLITE_PreferBuiltin; + db->flags &= ~(SQLITE_ForeignKeys | SQLITE_ReverseOrder); + db->xTrace = 0; pMain = db->aDb[0].pBt; isMemDb = sqlite3PagerIsMemdb(sqlite3BtreePager(pMain)); @@ -84959,11 +93853,18 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ ** time to parse and run the PRAGMA to turn journalling off than it does ** to write the journal header file. */ - zSql = "ATTACH '' AS vacuum_db;"; - rc = execSql(db, zSql); + nDb = db->nDb; + if( sqlite3TempInMemory(db) ){ + zSql = "ATTACH ':memory:' AS vacuum_db;"; + }else{ + zSql = "ATTACH '' AS vacuum_db;"; + } + rc = execSql(db, pzErrMsg, zSql); + if( db->nDb>nDb ){ + pDb = &db->aDb[db->nDb-1]; + assert( strcmp(pDb->zName,"vacuum_db")==0 ); + } if( rc!=SQLITE_OK ) goto end_of_vacuum; - pDb = &db->aDb[db->nDb-1]; - assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 ); pTemp = db->aDb[db->nDb-1].pBt; /* The call to execSql() to attach the temp database has left the file @@ -84985,6 +93886,12 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ } #endif + /* Do not attempt to change the page size for a WAL database */ + if( sqlite3PagerGetJournalMode(sqlite3BtreePager(pMain)) + ==PAGER_JOURNALMODE_WAL ){ + db->nextPagesize = 0; + } + if( sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain), nRes, 0) || (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0)) || NEVER(db->mallocFailed) @@ -84992,7 +93899,7 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ rc = SQLITE_NOMEM; goto end_of_vacuum; } - rc = execSql(db, "PRAGMA vacuum_db.synchronous=OFF"); + rc = execSql(db, pzErrMsg, "PRAGMA vacuum_db.synchronous=OFF"); if( rc!=SQLITE_OK ){ goto end_of_vacuum; } @@ -85003,23 +93910,23 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ #endif /* Begin a transaction */ - rc = execSql(db, "BEGIN EXCLUSIVE;"); + rc = execSql(db, pzErrMsg, "BEGIN EXCLUSIVE;"); if( rc!=SQLITE_OK ) goto end_of_vacuum; /* Query the schema of the main database. Create a mirror schema ** in the temporary database. */ - rc = execExecSql(db, + rc = execExecSql(db, pzErrMsg, "SELECT 'CREATE TABLE vacuum_db.' || substr(sql,14) " " FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence'" " AND rootpage>0" ); if( rc!=SQLITE_OK ) goto end_of_vacuum; - rc = execExecSql(db, + rc = execExecSql(db, pzErrMsg, "SELECT 'CREATE INDEX vacuum_db.' || substr(sql,14)" " FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' "); if( rc!=SQLITE_OK ) goto end_of_vacuum; - rc = execExecSql(db, + rc = execExecSql(db, pzErrMsg, "SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21) " " FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'"); if( rc!=SQLITE_OK ) goto end_of_vacuum; @@ -85028,24 +93935,23 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = execExecSql(db, + rc = execExecSql(db, pzErrMsg, "SELECT 'INSERT INTO vacuum_db.' || quote(name) " "|| ' SELECT * FROM main.' || quote(name) || ';'" "FROM main.sqlite_master " "WHERE type = 'table' AND name!='sqlite_sequence' " " AND rootpage>0" - ); if( rc!=SQLITE_OK ) goto end_of_vacuum; /* Copy over the sequence table */ - rc = execExecSql(db, + rc = execExecSql(db, pzErrMsg, "SELECT 'DELETE FROM vacuum_db.' || quote(name) || ';' " "FROM vacuum_db.sqlite_master WHERE name='sqlite_sequence' " ); if( rc!=SQLITE_OK ) goto end_of_vacuum; - rc = execExecSql(db, + rc = execExecSql(db, pzErrMsg, "SELECT 'INSERT INTO vacuum_db.' || quote(name) " "|| ' SELECT * FROM main.' || quote(name) || ';' " "FROM vacuum_db.sqlite_master WHERE name=='sqlite_sequence';" @@ -85058,7 +93964,7 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ ** associated storage, so all we have to do is copy their entries ** from the SQLITE_MASTER table. */ - rc = execSql(db, + rc = execSql(db, pzErrMsg, "INSERT INTO vacuum_db.sqlite_master " " SELECT type, name, tbl_name, rootpage, sql" " FROM main.sqlite_master" @@ -85121,6 +94027,8 @@ end_of_vacuum: db->flags = saved_flags; db->nChange = saved_nChange; db->nTotalChange = saved_nTotalChange; + db->xTrace = saved_xTrace; + sqlite3BtreeSetPageSize(pMain, -1, -1, 1); /* Currently there is an SQL level transaction open on the vacuum ** database. No locks are held on any other files (since the main file @@ -85157,8 +94065,6 @@ end_of_vacuum: ** ************************************************************************* ** This file contains code used to help implement virtual tables. -** -** $Id: vtab.c,v 1.94 2009/08/08 18:01:08 drh Exp $ */ #ifndef SQLITE_OMIT_VIRTUALTABLE @@ -85271,16 +94177,7 @@ SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *pVTab){ if( pVTab->nRef==0 ){ sqlite3_vtab *p = pVTab->pVtab; if( p ){ -#ifdef SQLITE_DEBUG - if( pVTab->db->magic==SQLITE_MAGIC_BUSY ){ - (void)sqlite3SafetyOff(db); - p->pModule->xDisconnect(p); - (void)sqlite3SafetyOn(db); - } else -#endif - { - p->pModule->xDisconnect(p); - } + p->pModule->xDisconnect(p); } sqlite3DbFree(db, pVTab); } @@ -85378,14 +94275,14 @@ SQLITE_PRIVATE void sqlite3VtabUnlockList(sqlite3 *db){ ** in the list are moved to the sqlite3.pDisconnect list of the associated ** database connection. */ -SQLITE_PRIVATE void sqlite3VtabClear(Table *p){ - vtabDisconnectAll(0, p); +SQLITE_PRIVATE void sqlite3VtabClear(sqlite3 *db, Table *p){ + if( !db || db->pnBytesFreed==0 ) vtabDisconnectAll(0, p); if( p->azModuleArg ){ int i; for(i=0; inModuleArg; i++){ - sqlite3DbFree(p->dbMem, p->azModuleArg[i]); + sqlite3DbFree(db, p->azModuleArg[i]); } - sqlite3DbFree(p->dbMem, p->azModuleArg); + sqlite3DbFree(db, p->azModuleArg); } } @@ -85528,7 +94425,7 @@ SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){ sqlite3ChangeCookie(pParse, iDb); sqlite3VdbeAddOp2(v, OP_Expire, 0, 0); - zWhere = sqlite3MPrintf(db, "name='%q'", pTab->zName); + zWhere = sqlite3MPrintf(db, "name='%q' AND type='table'", pTab->zName); sqlite3VdbeAddOp4(v, OP_ParseSchema, iDb, 1, 0, zWhere, P4_DYNAMIC); sqlite3VdbeAddOp4(v, OP_VCreate, iDb, 0, 0, pTab->zName, sqlite3Strlen30(pTab->zName) + 1); @@ -85550,7 +94447,6 @@ SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){ assert( pTab==pOld ); /* Malloc must have failed inside HashInsert() */ return; } - pSchema->db = pParse->db; pParse->pNewTable = 0; } } @@ -85616,9 +94512,7 @@ static int vtabCallConstructor( db->pVTab = pTab; /* Invoke the virtual table constructor */ - (void)sqlite3SafetyOff(db); rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); - (void)sqlite3SafetyOn(db); if( rc==SQLITE_NOMEM ) db->mallocFailed = 1; if( SQLITE_OK!=rc ){ @@ -85626,7 +94520,7 @@ static int vtabCallConstructor( *pzErr = sqlite3MPrintf(db, "vtable constructor failed: %s", zModuleName); }else { *pzErr = sqlite3MPrintf(db, "%s", zErr); - sqlite3DbFree(db, zErr); + sqlite3_free(zErr); } sqlite3DbFree(db, pVTable); }else if( ALWAYS(pVTable->pVtab) ){ @@ -85806,7 +94700,7 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ if( !pTab ){ sqlite3Error(db, SQLITE_MISUSE, 0); sqlite3_mutex_leave(db->mutex); - return SQLITE_MISUSE; + return SQLITE_MISUSE_BKPT; } assert( (pTab->tabFlags & TF_Virtual)!=0 ); @@ -85816,12 +94710,13 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ }else{ pParse->declareVtab = 1; pParse->db = db; + pParse->nQueryLoop = 1; - if( - SQLITE_OK == sqlite3RunParser(pParse, zCreateTable, &zErr) && - pParse->pNewTable && - !pParse->pNewTable->pSelect && - (pParse->pNewTable->tabFlags & TF_Virtual)==0 + if( SQLITE_OK==sqlite3RunParser(pParse, zCreateTable, &zErr) + && pParse->pNewTable + && !db->mallocFailed + && !pParse->pNewTable->pSelect + && (pParse->pNewTable->tabFlags & TF_Virtual)==0 ){ if( !pTab->aCol ){ pTab->aCol = pParse->pNewTable->aCol; @@ -85830,7 +94725,7 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ pParse->pNewTable->aCol = 0; } db->pVTab = 0; - } else { + }else{ sqlite3Error(db, SQLITE_ERROR, zErr); sqlite3DbFree(db, zErr); rc = SQLITE_ERROR; @@ -85840,7 +94735,7 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ if( pParse->pVdbe ){ sqlite3VdbeFinalize(pParse->pVdbe); } - sqlite3DeleteTable(pParse->pNewTable); + sqlite3DeleteTable(db, pParse->pNewTable); sqlite3StackFree(db, pParse); } @@ -85865,10 +94760,8 @@ SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab if( ALWAYS(pTab!=0 && pTab->pVTable!=0) ){ VTable *p = vtabDisconnectAll(db, pTab); - rc = sqlite3SafetyOff(db); assert( rc==SQLITE_OK ); rc = p->pMod->pModule->xDestroy(p->pVtab); - (void)sqlite3SafetyOn(db); /* Remove the sqlite3_vtab* from the aVTrans[] array, if applicable */ if( rc==SQLITE_OK ){ @@ -85920,10 +94813,8 @@ static void callFinaliser(sqlite3 *db, int offset){ SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, char **pzErrmsg){ int i; int rc = SQLITE_OK; - int rcsafety; VTable **aVTrans = db->aVTrans; - rc = sqlite3SafetyOff(db); db->aVTrans = 0; for(i=0; rc==SQLITE_OK && inVTrans; i++){ int (*x)(sqlite3_vtab *); @@ -85931,16 +94822,11 @@ SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, char **pzErrmsg){ if( pVtab && (x = pVtab->pModule->xSync)!=0 ){ rc = x(pVtab); sqlite3DbFree(db, *pzErrmsg); - *pzErrmsg = pVtab->zErrMsg; - pVtab->zErrMsg = 0; + *pzErrmsg = sqlite3DbStrDup(db, pVtab->zErrMsg); + sqlite3_free(pVtab->zErrMsg); } } db->aVTrans = aVTrans; - rcsafety = sqlite3SafetyOn(db); - - if( rc==SQLITE_OK ){ - rc = rcsafety; - } return rc; } @@ -86126,8 +95012,6 @@ SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse *pParse, Table *pTab){ ** rows. Indices are selected and used to speed the search when doing ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". -** -** $Id: where.c,v 1.411 2009/07/31 06:14:52 danielk1977 Exp $ */ /* @@ -86347,6 +95231,7 @@ struct WhereCost { #define WHERE_COLUMN_IN 0x00040000 /* x IN (...) */ #define WHERE_COLUMN_NULL 0x00080000 /* x IS NULL */ #define WHERE_INDEXED 0x000f0000 /* Anything that uses an index */ +#define WHERE_NOT_FULLSCAN 0x000f3000 /* Does not do a full table scan */ #define WHERE_IN_ABLE 0x000f1000 /* Able to support an IN operator */ #define WHERE_TOP_LIMIT 0x00100000 /* xEXPR or x>=EXPR constraint */ @@ -86356,6 +95241,7 @@ struct WhereCost { #define WHERE_UNIQUE 0x04000000 /* Selects no more than one row */ #define WHERE_VIRTUALTABLE 0x08000000 /* Use virtual-table processing */ #define WHERE_MULTI_OR 0x10000000 /* OR using multiple indices */ +#define WHERE_TEMP_INDEX 0x20000000 /* Uses an ephemeral index */ /* ** Initialize a preallocated WhereClause structure. @@ -86437,6 +95323,7 @@ static void whereClauseClear(WhereClause *pWC){ static int whereClauseInsert(WhereClause *pWC, Expr *p, u8 wtFlags){ WhereTerm *pTerm; int idx; + testcase( wtFlags & TERM_VIRTUAL ); /* EV: R-00211-15100 */ if( pWC->nTerm>=pWC->nSlot ){ WhereTerm *pOld = pWC->a; sqlite3 *db = pWC->pParse->db; @@ -86582,6 +95469,13 @@ static Bitmask exprSelectTableUsage(WhereMaskSet *pMaskSet, Select *pS){ ** Return TRUE if the given operator is one of the operators that is ** allowed for an indexable WHERE clause term. The allowed operators are ** "=", "<", ">", "<=", ">=", and "IN". +** +** IMPLEMENTATION-OF: R-59926-26393 To be usable by an index a term must be +** of one of the following forms: column = expression column > expression +** column >= expression column < expression column <= expression +** expression = column expression > column expression >= column +** expression < column expression <= column column IN +** (expression-list) column IN (subquery) column IS NULL */ static int allowedOp(int op){ assert( TK_GT>TK_EQ && TK_GTdb; /* Database connection */ sqlite3_value *pVal = 0; int op; /* Opcode of pRight */ @@ -86764,19 +95657,6 @@ static int isLikeOrGlob( return 0; } assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */ - pColl = sqlite3ExprCollSeq(pParse, pLeft); - assert( pColl!=0 ); /* Every non-IPK column has a collating sequence */ - if( (pColl->type!=SQLITE_COLL_BINARY || *pnoCase) && - (pColl->type!=SQLITE_COLL_NOCASE || !*pnoCase) ){ - /* IMP: R-09003-32046 For the GLOB operator, the column must use the - ** default BINARY collating sequence. - ** IMP: R-41408-28306 For the LIKE operator, if case_sensitive_like mode - ** is enabled then the column must use the default BINARY collating - ** sequence, or if case_sensitive_like mode is disabled then the column - ** must use the built-in NOCASE collating sequence. - */ - return 0; - } pRight = pList->a[0].pExpr; op = pRight->op; @@ -86785,11 +95665,12 @@ static int isLikeOrGlob( } if( op==TK_VARIABLE ){ Vdbe *pReprepare = pParse->pReprepare; - pVal = sqlite3VdbeGetValue(pReprepare, pRight->iColumn, SQLITE_AFF_NONE); + int iCol = pRight->iColumn; + pVal = sqlite3VdbeGetValue(pReprepare, iCol, SQLITE_AFF_NONE); if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){ z = (char *)sqlite3_value_text(pVal); } - sqlite3VdbeSetVarmask(pParse->pVdbe, pRight->iColumn); + sqlite3VdbeSetVarmask(pParse->pVdbe, iCol); /* IMP: R-23257-02778 */ assert( pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER ); }else if( op==TK_STRING ){ z = pRight->u.zToken; @@ -86799,15 +95680,15 @@ static int isLikeOrGlob( while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){ cnt++; } - if( cnt!=0 && c!=0 && 255!=(u8)z[cnt-1] ){ + if( cnt!=0 && 255!=(u8)z[cnt-1] ){ Expr *pPrefix; - *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0; + *pisComplete = c==wc[0] && z[cnt+1]==0; pPrefix = sqlite3Expr(db, TK_STRING, z); if( pPrefix ) pPrefix->u.zToken[cnt] = 0; *ppPrefix = pPrefix; if( op==TK_VARIABLE ){ Vdbe *v = pParse->pVdbe; - sqlite3VdbeSetVarmask(v, pRight->iColumn); + sqlite3VdbeSetVarmask(v, pRight->iColumn); /* IMP: R-23257-02778 */ if( *pisComplete && pRight->u.zToken[1] ){ /* If the rhs of the LIKE expression is a variable, and the current ** value of the variable means there is no need to invoke the LIKE @@ -87089,7 +95970,7 @@ static void exprAnalyzeOrTerm( } if( (chngToIN & getMask(pMaskSet, pOrTerm->leftCursor))==0 ){ /* This term must be of the form t1.a==t2.b where t2 is in the - ** chngToIN set but t1 is not. This term will be either preceded + ** chngToIN set but t1 is not. This term will be either preceeded ** or follwed by an inverted copy (t2.b==t1.a). Skip this term ** and use its inversion. */ testcase( pOrTerm->wtFlags & TERM_COPIED ); @@ -87140,6 +96021,8 @@ static void exprAnalyzeOrTerm( /* At this point, okToChngToIN is true if original pTerm satisfies ** case 1. In that case, construct a new virtual term that is ** pTerm converted into an IN operator. + ** + ** EV: R-00211-15100 */ if( okToChngToIN ){ Expr *pDup; /* A transient duplicate expression */ @@ -87208,7 +96091,7 @@ static void exprAnalyze( Expr *pExpr; /* The expression to be analyzed */ Bitmask prereqLeft; /* Prerequesites of the pExpr->pLeft */ Bitmask prereqAll; /* Prerequesites of pExpr */ - Bitmask extraRight = 0; /* */ + Bitmask extraRight = 0; /* Extra dependencies on LEFT JOIN */ Expr *pStr1 = 0; /* RHS of LIKE/GLOB operator */ int isComplete = 0; /* RHS of LIKE/GLOB ends with wildcard */ int noCase = 0; /* LIKE/GLOB distinguishes case */ @@ -87280,7 +96163,8 @@ static void exprAnalyze( pLeft = pDup->pLeft; pNew->leftCursor = pLeft->iTable; pNew->u.leftColumn = pLeft->iColumn; - pNew->prereqRight = prereqLeft; + testcase( (prereqLeft | extraRight) != prereqLeft ); + pNew->prereqRight = prereqLeft | extraRight; pNew->prereqAll = prereqAll; pNew->eOperator = operatorMask(pDup->op); } @@ -87355,6 +96239,7 @@ static void exprAnalyze( Expr *pNewExpr2; int idxNew1; int idxNew2; + CollSeq *pColl; /* Collating sequence to use */ pLeft = pExpr->x.pList->a[1].pExpr; pStr2 = sqlite3ExprDup(db, pStr1, 0); @@ -87369,17 +96254,23 @@ static void exprAnalyze( ** inequality. To avoid this, make sure to also run the full ** LIKE on all candidate expressions by clearing the isComplete flag */ - if( c=='A'-1 ) isComplete = 0; + if( c=='A'-1 ) isComplete = 0; /* EV: R-64339-08207 */ + c = sqlite3UpperToLower[c]; } *pC = c + 1; } - pNewExpr1 = sqlite3PExpr(pParse, TK_GE, sqlite3ExprDup(db,pLeft,0),pStr1,0); + pColl = sqlite3FindCollSeq(db, SQLITE_UTF8, noCase ? "NOCASE" : "BINARY",0); + pNewExpr1 = sqlite3PExpr(pParse, TK_GE, + sqlite3ExprSetColl(sqlite3ExprDup(db,pLeft,0), pColl), + pStr1, 0); idxNew1 = whereClauseInsert(pWC, pNewExpr1, TERM_VIRTUAL|TERM_DYNAMIC); testcase( idxNew1==0 ); exprAnalyze(pSrc, pWC, idxNew1); - pNewExpr2 = sqlite3PExpr(pParse, TK_LT, sqlite3ExprDup(db,pLeft,0),pStr2,0); + pNewExpr2 = sqlite3PExpr(pParse, TK_LT, + sqlite3ExprSetColl(sqlite3ExprDup(db,pLeft,0), pColl), + pStr2, 0); idxNew2 = whereClauseInsert(pWC, pNewExpr2, TERM_VIRTUAL|TERM_DYNAMIC); testcase( idxNew2==0 ); exprAnalyze(pSrc, pWC, idxNew2); @@ -87661,7 +96552,8 @@ static void TRACE_IDX_OUTPUTS(sqlite3_index_info *p){ ** Required because bestIndex() is called by bestOrClauseIndex() */ static void bestIndex( - Parse*, WhereClause*, struct SrcList_item*, Bitmask, ExprList*, WhereCost*); + Parse*, WhereClause*, struct SrcList_item*, + Bitmask, Bitmask, ExprList*, WhereCost*); /* ** This routine attempts to find an scanning strategy that can be used @@ -87674,7 +96566,8 @@ static void bestOrClauseIndex( Parse *pParse, /* The parsing context */ WhereClause *pWC, /* The WHERE clause */ struct SrcList_item *pSrc, /* The FROM clause term to search */ - Bitmask notReady, /* Mask of cursors that are not available */ + Bitmask notReady, /* Mask of cursors not available for indexing */ + Bitmask notValid, /* Cursors not available for any purpose */ ExprList *pOrderBy, /* The ORDER BY clause */ WhereCost *pCost /* Lowest cost query plan */ ){ @@ -87684,6 +96577,11 @@ static void bestOrClauseIndex( WhereTerm * const pWCEnd = &pWC->a[pWC->nTerm]; /* End of pWC->a[] */ WhereTerm *pTerm; /* A single term of the WHERE clause */ + /* No OR-clause optimization allowed if the NOT INDEXED clause is used */ + if( pSrc->notIndexed ){ + return; + } + /* Search the WHERE clause terms for a usable WO_OR term. */ for(pTerm=pWC->a; pTermeOperator==WO_OR @@ -87705,7 +96603,7 @@ static void bestOrClauseIndex( )); if( pOrTerm->eOperator==WO_AND ){ WhereClause *pAndWC = &pOrTerm->u.pAndInfo->wc; - bestIndex(pParse, pAndWC, pSrc, notReady, 0, &sTermCost); + bestIndex(pParse, pAndWC, pSrc, notReady, notValid, 0, &sTermCost); }else if( pOrTerm->leftCursor==iCur ){ WhereClause tempWC; tempWC.pParse = pWC->pParse; @@ -87713,7 +96611,7 @@ static void bestOrClauseIndex( tempWC.op = TK_AND; tempWC.a = pOrTerm; tempWC.nTerm = 1; - bestIndex(pParse, &tempWC, pSrc, notReady, 0, &sTermCost); + bestIndex(pParse, &tempWC, pSrc, notReady, notValid, 0, &sTermCost); }else{ continue; } @@ -87726,8 +96624,9 @@ static void bestOrClauseIndex( /* If there is an ORDER BY clause, increase the scan cost to account ** for the cost of the sort. */ if( pOrderBy!=0 ){ + WHERETRACE(("... sorting increases OR cost %.9g to %.9g\n", + rTotal, rTotal+nRow*estLog(nRow))); rTotal += nRow*estLog(nRow); - WHERETRACE(("... sorting increases OR cost to %.9g\n", rTotal)); } /* If the cost of scanning using this OR term for optimization is @@ -87746,6 +96645,247 @@ static void bestOrClauseIndex( #endif /* SQLITE_OMIT_OR_OPTIMIZATION */ } +#ifndef SQLITE_OMIT_AUTOMATIC_INDEX +/* +** Return TRUE if the WHERE clause term pTerm is of a form where it +** could be used with an index to access pSrc, assuming an appropriate +** index existed. +*/ +static int termCanDriveIndex( + WhereTerm *pTerm, /* WHERE clause term to check */ + struct SrcList_item *pSrc, /* Table we are trying to access */ + Bitmask notReady /* Tables in outer loops of the join */ +){ + char aff; + if( pTerm->leftCursor!=pSrc->iCursor ) return 0; + if( pTerm->eOperator!=WO_EQ ) return 0; + if( (pTerm->prereqRight & notReady)!=0 ) return 0; + aff = pSrc->pTab->aCol[pTerm->u.leftColumn].affinity; + if( !sqlite3IndexAffinityOk(pTerm->pExpr, aff) ) return 0; + return 1; +} +#endif + +#ifndef SQLITE_OMIT_AUTOMATIC_INDEX +/* +** If the query plan for pSrc specified in pCost is a full table scan +** and indexing is allows (if there is no NOT INDEXED clause) and it +** possible to construct a transient index that would perform better +** than a full table scan even when the cost of constructing the index +** is taken into account, then alter the query plan to use the +** transient index. +*/ +static void bestAutomaticIndex( + Parse *pParse, /* The parsing context */ + WhereClause *pWC, /* The WHERE clause */ + struct SrcList_item *pSrc, /* The FROM clause term to search */ + Bitmask notReady, /* Mask of cursors that are not available */ + WhereCost *pCost /* Lowest cost query plan */ +){ + double nTableRow; /* Rows in the input table */ + double logN; /* log(nTableRow) */ + double costTempIdx; /* per-query cost of the transient index */ + WhereTerm *pTerm; /* A single term of the WHERE clause */ + WhereTerm *pWCEnd; /* End of pWC->a[] */ + Table *pTable; /* Table tht might be indexed */ + + if( (pParse->db->flags & SQLITE_AutoIndex)==0 ){ + /* Automatic indices are disabled at run-time */ + return; + } + if( (pCost->plan.wsFlags & WHERE_NOT_FULLSCAN)!=0 ){ + /* We already have some kind of index in use for this query. */ + return; + } + if( pSrc->notIndexed ){ + /* The NOT INDEXED clause appears in the SQL. */ + return; + } + + assert( pParse->nQueryLoop >= (double)1 ); + pTable = pSrc->pTab; + nTableRow = pTable->nRowEst; + logN = estLog(nTableRow); + costTempIdx = 2*logN*(nTableRow/pParse->nQueryLoop + 1); + if( costTempIdx>=pCost->rCost ){ + /* The cost of creating the transient table would be greater than + ** doing the full table scan */ + return; + } + + /* Search for any equality comparison term */ + pWCEnd = &pWC->a[pWC->nTerm]; + for(pTerm=pWC->a; pTermrCost, costTempIdx)); + pCost->rCost = costTempIdx; + pCost->nRow = logN + 1; + pCost->plan.wsFlags = WHERE_TEMP_INDEX; + pCost->used = pTerm->prereqRight; + break; + } + } +} +#else +# define bestAutomaticIndex(A,B,C,D,E) /* no-op */ +#endif /* SQLITE_OMIT_AUTOMATIC_INDEX */ + + +#ifndef SQLITE_OMIT_AUTOMATIC_INDEX +/* +** Generate code to construct the Index object for an automatic index +** and to set up the WhereLevel object pLevel so that the code generator +** makes use of the automatic index. +*/ +static void constructAutomaticIndex( + Parse *pParse, /* The parsing context */ + WhereClause *pWC, /* The WHERE clause */ + struct SrcList_item *pSrc, /* The FROM clause term to get the next index */ + Bitmask notReady, /* Mask of cursors that are not available */ + WhereLevel *pLevel /* Write new index here */ +){ + int nColumn; /* Number of columns in the constructed index */ + WhereTerm *pTerm; /* A single term of the WHERE clause */ + WhereTerm *pWCEnd; /* End of pWC->a[] */ + int nByte; /* Byte of memory needed for pIdx */ + Index *pIdx; /* Object describing the transient index */ + Vdbe *v; /* Prepared statement under construction */ + int regIsInit; /* Register set by initialization */ + int addrInit; /* Address of the initialization bypass jump */ + Table *pTable; /* The table being indexed */ + KeyInfo *pKeyinfo; /* Key information for the index */ + int addrTop; /* Top of the index fill loop */ + int regRecord; /* Register holding an index record */ + int n; /* Column counter */ + int i; /* Loop counter */ + int mxBitCol; /* Maximum column in pSrc->colUsed */ + CollSeq *pColl; /* Collating sequence to on a column */ + Bitmask idxCols; /* Bitmap of columns used for indexing */ + Bitmask extraCols; /* Bitmap of additional columns */ + + /* Generate code to skip over the creation and initialization of the + ** transient index on 2nd and subsequent iterations of the loop. */ + v = pParse->pVdbe; + assert( v!=0 ); + regIsInit = ++pParse->nMem; + addrInit = sqlite3VdbeAddOp1(v, OP_If, regIsInit); + sqlite3VdbeAddOp2(v, OP_Integer, 1, regIsInit); + + /* Count the number of columns that will be added to the index + ** and used to match WHERE clause constraints */ + nColumn = 0; + pTable = pSrc->pTab; + pWCEnd = &pWC->a[pWC->nTerm]; + idxCols = 0; + for(pTerm=pWC->a; pTermu.leftColumn; + Bitmask cMask = iCol>=BMS ? ((Bitmask)1)<<(BMS-1) : ((Bitmask)1)<0 ); + pLevel->plan.nEq = nColumn; + + /* Count the number of additional columns needed to create a + ** covering index. A "covering index" is an index that contains all + ** columns that are needed by the query. With a covering index, the + ** original table never needs to be accessed. Automatic indices must + ** be a covering index because the index will not be updated if the + ** original table changes and the index and table cannot both be used + ** if they go out of sync. + */ + extraCols = pSrc->colUsed & (~idxCols | (((Bitmask)1)<<(BMS-1))); + mxBitCol = (pTable->nCol >= BMS-1) ? BMS-1 : pTable->nCol; + testcase( pTable->nCol==BMS-1 ); + testcase( pTable->nCol==BMS-2 ); + for(i=0; icolUsed & (((Bitmask)1)<<(BMS-1)) ){ + nColumn += pTable->nCol - BMS + 1; + } + pLevel->plan.wsFlags |= WHERE_COLUMN_EQ | WHERE_IDX_ONLY | WO_EQ; + + /* Construct the Index object to describe this index */ + nByte = sizeof(Index); + nByte += nColumn*sizeof(int); /* Index.aiColumn */ + nByte += nColumn*sizeof(char*); /* Index.azColl */ + nByte += nColumn; /* Index.aSortOrder */ + pIdx = sqlite3DbMallocZero(pParse->db, nByte); + if( pIdx==0 ) return; + pLevel->plan.u.pIdx = pIdx; + pIdx->azColl = (char**)&pIdx[1]; + pIdx->aiColumn = (int*)&pIdx->azColl[nColumn]; + pIdx->aSortOrder = (u8*)&pIdx->aiColumn[nColumn]; + pIdx->zName = "auto-index"; + pIdx->nColumn = nColumn; + pIdx->pTable = pTable; + n = 0; + idxCols = 0; + for(pTerm=pWC->a; pTermu.leftColumn; + Bitmask cMask = iCol>=BMS ? ((Bitmask)1)<<(BMS-1) : ((Bitmask)1)<pExpr; + idxCols |= cMask; + pIdx->aiColumn[n] = pTerm->u.leftColumn; + pColl = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pX->pRight); + pIdx->azColl[n] = pColl->zName; + n++; + } + } + } + assert( (u32)n==pLevel->plan.nEq ); + + /* Add additional columns needed to make the automatic index into + ** a covering index */ + for(i=0; iaiColumn[n] = i; + pIdx->azColl[n] = "BINARY"; + n++; + } + } + if( pSrc->colUsed & (((Bitmask)1)<<(BMS-1)) ){ + for(i=BMS-1; inCol; i++){ + pIdx->aiColumn[n] = i; + pIdx->azColl[n] = "BINARY"; + n++; + } + } + assert( n==nColumn ); + + /* Create the automatic index */ + pKeyinfo = sqlite3IndexKeyinfo(pParse, pIdx); + assert( pLevel->iIdxCur>=0 ); + sqlite3VdbeAddOp4(v, OP_OpenAutoindex, pLevel->iIdxCur, nColumn+1, 0, + (char*)pKeyinfo, P4_KEYINFO_HANDOFF); + VdbeComment((v, "for %s", pTable->zName)); + + /* Fill the automatic index with content */ + addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur); + regRecord = sqlite3GetTempReg(pParse); + sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 1); + sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord); + sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT); + sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1); + sqlite3VdbeChangeP5(v, SQLITE_STMTSTATUS_AUTOINDEX); + sqlite3VdbeJumpHere(v, addrTop); + sqlite3ReleaseTempReg(pParse, regRecord); + + /* Jump here when skipping the initialization */ + sqlite3VdbeJumpHere(v, addrInit); +} +#endif /* SQLITE_OMIT_AUTOMATIC_INDEX */ + #ifndef SQLITE_OMIT_VIRTUALTABLE /* ** Allocate and populate an sqlite3_index_info structure. It is the @@ -87870,12 +97010,10 @@ static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){ int i; int rc; - (void)sqlite3SafetyOff(pParse->db); WHERETRACE(("xBestIndex for %s\n", pTab->zName)); TRACE_IDX_INPUTS(p); rc = pVtab->pModule->xBestIndex(pVtab, p); TRACE_IDX_OUTPUTS(p); - (void)sqlite3SafetyOn(pParse->db); if( rc!=SQLITE_OK ){ if( rc==SQLITE_NOMEM ){ @@ -87886,7 +97024,7 @@ static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){ sqlite3ErrorMsg(pParse, "%s", pVtab->zErrMsg); } } - sqlite3DbFree(pParse->db, pVtab->zErrMsg); + sqlite3_free(pVtab->zErrMsg); pVtab->zErrMsg = 0; for(i=0; inConstraint; i++){ @@ -87920,7 +97058,8 @@ static void bestVirtualIndex( Parse *pParse, /* The parsing context */ WhereClause *pWC, /* The WHERE clause */ struct SrcList_item *pSrc, /* The FROM clause term to search */ - Bitmask notReady, /* Mask of cursors that are not available */ + Bitmask notReady, /* Mask of cursors not available for index */ + Bitmask notValid, /* Cursors not valid for any purpose */ ExprList *pOrderBy, /* The order by clause */ WhereCost *pCost, /* Lowest cost query plan */ sqlite3_index_info **ppIdxInfo /* Index information passed to xBestIndex */ @@ -87932,6 +97071,7 @@ static void bestVirtualIndex( WhereTerm *pTerm; int i, j; int nOrderBy; + double rCost; /* Make sure wsFlags is initialized to some sane value. Otherwise, if the ** malloc in allocateIndexInfo() fails and this function returns leaving @@ -88018,6 +97158,15 @@ static void bestVirtualIndex( } } + /* If there is an ORDER BY clause, and the selected virtual table index + ** does not satisfy it, increase the cost of the scan accordingly. This + ** matches the processing for non-virtual tables in bestBtreeIndex(). + */ + rCost = pIdxInfo->estimatedCost; + if( pOrderBy && pIdxInfo->orderByConsumed==0 ){ + rCost += estLog(rCost)*rCost; + } + /* The cost is not allowed to be larger than SQLITE_BIG_DBL (the ** inital value of lowestCost in this loop. If it is, then the ** (costestimatedCost ){ + if( (SQLITE_BIG_DBL/((double)2))rCost = (SQLITE_BIG_DBL/((double)2)); }else{ - pCost->rCost = pIdxInfo->estimatedCost; + pCost->rCost = rCost; } pCost->plan.u.pVtabIdx = pIdxInfo; if( pIdxInfo->orderByConsumed ){ @@ -88040,7 +97189,7 @@ static void bestVirtualIndex( /* Try to find a more efficient access pattern by using multiple indexes ** to optimize an OR expression within the WHERE clause. */ - bestOrClauseIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost); + bestOrClauseIndex(pParse, pWC, pSrc, notReady, notValid, pOrderBy, pCost); } #endif /* SQLITE_OMIT_VIRTUALTABLE */ @@ -88166,7 +97315,7 @@ static int valueFromExpr( assert( pExpr->op!=TK_VARIABLE ); if( pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE ){ int iVar = pExpr->iColumn; - sqlite3VdbeSetVarmask(pParse->pVdbe, iVar); + sqlite3VdbeSetVarmask(pParse->pVdbe, iVar); /* IMP: R-23257-02778 */ *pp = sqlite3VdbeGetValue(pParse->pReprepare, iVar, aff); return SQLITE_OK; } @@ -88321,7 +97470,8 @@ static void bestBtreeIndex( Parse *pParse, /* The parsing context */ WhereClause *pWC, /* The WHERE clause */ struct SrcList_item *pSrc, /* The FROM clause term to search */ - Bitmask notReady, /* Mask of cursors that are not available */ + Bitmask notReady, /* Mask of cursors not available for indexing */ + Bitmask notValid, /* Cursors not available for any purpose */ ExprList *pOrderBy, /* The ORDER BY clause */ WhereCost *pCost /* Lowest cost query plan */ ){ @@ -88363,23 +97513,14 @@ static void bestBtreeIndex( sPk.nColumn = 1; sPk.aiColumn = &aiColumnPk; sPk.aiRowEst = aiRowEstPk; - aiRowEstPk[1] = 1; sPk.onError = OE_Replace; sPk.pTable = pSrc->pTab; + aiRowEstPk[0] = pSrc->pTab->nRowEst; + aiRowEstPk[1] = 1; pFirst = pSrc->pTab->pIndex; if( pSrc->notIndexed==0 ){ sPk.pNext = pFirst; } - /* The aiRowEstPk[0] is an estimate of the total number of rows in the - ** table. Get this information from the ANALYZE information if it is - ** available. If not available, assume the table 1 million rows in size. - */ - if( pFirst ){ - assert( pFirst->aiRowEst!=0 ); /* Allocated together with pFirst */ - aiRowEstPk[0] = pFirst->aiRowEst[0]; - }else{ - aiRowEstPk[0] = 1000000; - } pProbe = &sPk; wsFlagMask = ~( WHERE_COLUMN_IN|WHERE_COLUMN_EQ|WHERE_COLUMN_NULL|WHERE_COLUMN_RANGE @@ -88429,14 +97570,14 @@ static void bestBtreeIndex( ** Set to true if there was at least one "x IN (SELECT ...)" term used ** in determining the value of nInMul. ** - ** nBound: + ** estBound: ** An estimate on the amount of the table that must be searched. A ** value of 100 means the entire table is searched. Range constraints ** might reduce this to a value less than 100 to indicate that only ** a fraction of the table needs searching. In the absence of ** sqlite_stat2 ANALYZE data, a single inequality reduces the search ** space to 1/3rd its original size. So an x>? constraint reduces - ** nBound to 33. Two constraints (x>? AND x? AND xnColumn; nEq++){ - WhereTerm *pTerm; /* A single term of the WHERE clause */ int j = pProbe->aiColumn[nEq]; pTerm = findTerm(pWC, iCur, j, notReady, eqTermMask, pIdx); if( pTerm==0 ) break; @@ -88475,7 +97617,7 @@ static void bestBtreeIndex( if( ExprHasProperty(pExpr, EP_xIsSelect) ){ nInMul *= 25; bInEst = 1; - }else if( pExpr->x.pList ){ + }else if( ALWAYS(pExpr->x.pList) ){ nInMul *= pExpr->x.pList->nExpr + 1; } }else if( pTerm->eOperator & WO_ISNULL ){ @@ -88484,18 +97626,20 @@ static void bestBtreeIndex( used |= pTerm->prereqRight; } - /* Determine the value of nBound. */ + /* Determine the value of estBound. */ if( nEqnColumn ){ int j = pProbe->aiColumn[nEq]; if( findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE|WO_GT|WO_GE, pIdx) ){ WhereTerm *pTop = findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE, pIdx); WhereTerm *pBtm = findTerm(pWC, iCur, j, notReady, WO_GT|WO_GE, pIdx); - whereRangeScanEst(pParse, pProbe, nEq, pBtm, pTop, &nBound); + whereRangeScanEst(pParse, pProbe, nEq, pBtm, pTop, &estBound); if( pTop ){ + nBound = 1; wsFlags |= WHERE_TOP_LIMIT; used |= pTop->prereqRight; } if( pBtm ){ + nBound++; wsFlags |= WHERE_BTM_LIMIT; used |= pBtm->prereqRight; } @@ -88526,7 +97670,7 @@ static void bestBtreeIndex( /* If currently calculating the cost of using an index (not the IPK ** index), determine if all required column data may be obtained without - ** seeking to entries in the main table (i.e. if the index is a covering + ** using the main table (i.e. if the index is a covering ** index for this query). If it is, set the WHERE_IDX_ONLY flag in ** wsFlags. Otherwise, set the bLookup variable to true. */ if( pIdx && wsFlags ){ @@ -88545,8 +97689,7 @@ static void bestBtreeIndex( } } - /**** Begin adding up the cost of using this index (Needs improvements) - ** + /* ** Estimate the number of rows of output. For an IN operator, ** do not let the estimate exceed half the rows in the table. */ @@ -88565,8 +97708,8 @@ static void bestBtreeIndex( /* Adjust the number of rows and the cost downward to reflect rows ** that are excluded by range constraints. */ - nRow = (nRow * (double)nBound) / (double)100; - cost = (cost * (double)nBound) / (double)100; + nRow = (nRow * (double)estBound) / (double)100; + cost = (cost * (double)estBound) / (double)100; /* Add in the estimated cost of sorting the result */ @@ -88583,17 +97726,75 @@ static void bestBtreeIndex( } /**** Cost of using this index has now been computed ****/ + /* If there are additional constraints on this table that cannot + ** be used with the current index, but which might lower the number + ** of output rows, adjust the nRow value accordingly. This only + ** matters if the current index is the least costly, so do not bother + ** with this step if we already know this index will not be chosen. + ** Also, never reduce the output row count below 2 using this step. + ** + ** It is critical that the notValid mask be used here instead of + ** the notReady mask. When computing an "optimal" index, the notReady + ** mask will only have one bit set - the bit for the current table. + ** The notValid mask, on the other hand, always has all bits set for + ** tables that are not in outer loops. If notReady is used here instead + ** of notValid, then a optimal index that depends on inner joins loops + ** might be selected even when there exists an optimal index that has + ** no such dependency. + */ + if( nRow>2 && cost<=pCost->rCost ){ + int k; /* Loop counter */ + int nSkipEq = nEq; /* Number of == constraints to skip */ + int nSkipRange = nBound; /* Number of < constraints to skip */ + Bitmask thisTab; /* Bitmap for pSrc */ + + thisTab = getMask(pWC->pMaskSet, iCur); + for(pTerm=pWC->a, k=pWC->nTerm; nRow>2 && k; k--, pTerm++){ + if( pTerm->wtFlags & TERM_VIRTUAL ) continue; + if( (pTerm->prereqAll & notValid)!=thisTab ) continue; + if( pTerm->eOperator & (WO_EQ|WO_IN|WO_ISNULL) ){ + if( nSkipEq ){ + /* Ignore the first nEq equality matches since the index + ** has already accounted for these */ + nSkipEq--; + }else{ + /* Assume each additional equality match reduces the result + ** set size by a factor of 10 */ + nRow /= 10; + } + }else if( pTerm->eOperator & (WO_LT|WO_LE|WO_GT|WO_GE) ){ + if( nSkipRange ){ + /* Ignore the first nBound range constraints since the index + ** has already accounted for these */ + nSkipRange--; + }else{ + /* Assume each additional range constraint reduces the result + ** set size by a factor of 3 */ + nRow /= 3; + } + }else{ + /* Any other expression lowers the output row count by half */ + nRow /= 2; + } + } + if( nRow<2 ) nRow = 2; + } + + WHERETRACE(( - "tbl=%s idx=%s nEq=%d nInMul=%d nBound=%d bSort=%d bLookup=%d" - " wsFlags=%d (nRow=%.2f cost=%.2f)\n", + "%s(%s): nEq=%d nInMul=%d estBound=%d bSort=%d bLookup=%d wsFlags=0x%x\n" + " notReady=0x%llx nRow=%.2f cost=%.2f used=0x%llx\n", pSrc->pTab->zName, (pIdx ? pIdx->zName : "ipk"), - nEq, nInMul, nBound, bSort, bLookup, wsFlags, nRow, cost + nEq, nInMul, estBound, bSort, bLookup, wsFlags, + notReady, nRow, cost, used )); /* If this index is the best we have seen so far, then record this ** index and its cost in the pCost structure. */ - if( (!pIdx || wsFlags) && costrCost ){ + if( (!pIdx || wsFlags) + && (costrCost || (cost<=pCost->rCost && nRownRow)) + ){ pCost->rCost = cost; pCost->nRow = nRow; pCost->used = used; @@ -88628,10 +97829,12 @@ static void bestBtreeIndex( ); WHERETRACE(("best index is: %s\n", - (pCost->plan.u.pIdx ? pCost->plan.u.pIdx->zName : "ipk") + ((pCost->plan.wsFlags & WHERE_NOT_FULLSCAN)==0 ? "none" : + pCost->plan.u.pIdx ? pCost->plan.u.pIdx->zName : "ipk") )); - bestOrClauseIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost); + bestOrClauseIndex(pParse, pWC, pSrc, notReady, notValid, pOrderBy, pCost); + bestAutomaticIndex(pParse, pWC, pSrc, notReady, pCost); pCost->plan.wsFlags |= eqTermMask; } @@ -88645,14 +97848,15 @@ static void bestIndex( Parse *pParse, /* The parsing context */ WhereClause *pWC, /* The WHERE clause */ struct SrcList_item *pSrc, /* The FROM clause term to search */ - Bitmask notReady, /* Mask of cursors that are not available */ + Bitmask notReady, /* Mask of cursors not available for indexing */ + Bitmask notValid, /* Cursors not available for any purpose */ ExprList *pOrderBy, /* The ORDER BY clause */ WhereCost *pCost /* Lowest cost query plan */ ){ #ifndef SQLITE_OMIT_VIRTUALTABLE if( IsVirtual(pSrc->pTab) ){ sqlite3_index_info *p = 0; - bestVirtualIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost, &p); + bestVirtualIndex(pParse, pWC, pSrc, notReady, notValid, pOrderBy, pCost,&p); if( p->needToFreeIdxStr ){ sqlite3_free(p->idxStr); } @@ -88660,7 +97864,7 @@ static void bestIndex( }else #endif { - bestBtreeIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost); + bestBtreeIndex(pParse, pWC, pSrc, notReady, notValid, pOrderBy, pCost); } } @@ -88679,6 +97883,9 @@ static void bestIndex( ** in the ON clause. The term is disabled in (3) because it is not part ** of a LEFT OUTER JOIN. In (1), the term is not disabled. ** +** IMPLEMENTATION-OF: R-24597-58655 No tests are done for terms that are +** completely satisfied by indices. +** ** Disabling a term causes that term to not be tested in the inner loop ** of the join. Disabling is an optimization. When terms are satisfied ** by indices, we disable them to prevent redundant tests in the inner @@ -88689,7 +97896,7 @@ static void bestIndex( */ static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){ if( pTerm - && ALWAYS((pTerm->wtFlags & TERM_CODED)==0) + && (pTerm->wtFlags & TERM_CODED)==0 && (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin)) ){ pTerm->wtFlags |= TERM_CODED; @@ -88706,16 +97913,39 @@ static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){ ** Code an OP_Affinity opcode to apply the column affinity string zAff ** to the n registers starting at base. ** -** Buffer zAff was allocated using sqlite3DbMalloc(). It is the -** responsibility of this function to arrange for it to be eventually -** freed using sqlite3DbFree(). +** As an optimization, SQLITE_AFF_NONE entries (which are no-ops) at the +** beginning and end of zAff are ignored. If all entries in zAff are +** SQLITE_AFF_NONE, then no code gets generated. +** +** This routine makes its own copy of zAff so that the caller is free +** to modify zAff after this routine returns. */ static void codeApplyAffinity(Parse *pParse, int base, int n, char *zAff){ Vdbe *v = pParse->pVdbe; + if( zAff==0 ){ + assert( pParse->db->mallocFailed ); + return; + } assert( v!=0 ); - sqlite3VdbeAddOp2(v, OP_Affinity, base, n); - sqlite3VdbeChangeP4(v, -1, zAff, P4_DYNAMIC); - sqlite3ExprCacheAffinityChange(pParse, base, n); + + /* Adjust base and n to skip over SQLITE_AFF_NONE entries at the beginning + ** and end of the affinity string. + */ + while( n>0 && zAff[0]==SQLITE_AFF_NONE ){ + n--; + base++; + zAff++; + } + while( n>1 && zAff[n-1]==SQLITE_AFF_NONE ){ + n--; + } + + /* Code the OP_Affinity opcode if there is anything left to do. */ + if( n>0 ){ + sqlite3VdbeAddOp2(v, OP_Affinity, base, n); + sqlite3VdbeChangeP4(v, -1, zAff, n); + sqlite3ExprCacheAffinityChange(pParse, base, n); + } } @@ -88786,7 +98016,7 @@ static int codeEqualityTerm( /* ** Generate code that will evaluate all == and IN constraints for an -** index. The values for all constraints are left on the stack. +** index. ** ** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c). ** Suppose the WHERE clause is this: a==5 AND b IN (1,2,3) AND c>5 AND c<10 @@ -88798,7 +98028,8 @@ static int codeEqualityTerm( ** ** In the example above nEq==2. But this subroutine works for any value ** of nEq including 0. If nEq==0, this routine is nearly a no-op. -** The only thing it does is allocate the pLevel->iMem memory cell. +** The only thing it does is allocate the pLevel->iMem memory cell and +** compute the affinity string. ** ** This routine always allocates at least one memory cell and returns ** the index of that memory cell. The code that @@ -88863,7 +98094,10 @@ static int codeAllEqualityTerms( int k = pIdx->aiColumn[j]; pTerm = findTerm(pWC, iCur, k, notReady, pLevel->plan.wsFlags, pIdx); if( NEVER(pTerm==0) ) break; - assert( (pTerm->wtFlags & TERM_CODED)==0 ); + /* The following true for indices with redundant columns. + ** Ex: CREATE INDEX i1 ON t1(a,b,a); SELECT * FROM t1 WHERE a=0 AND b=0; */ + testcase( (pTerm->wtFlags & TERM_CODED)!=0 ); + testcase( pTerm->wtFlags & TERM_VIRTUAL ); /* EV: R-30575-11662 */ r1 = codeEqualityTerm(pParse, pTerm, pLevel, regBase+j); if( r1!=regBase+j ){ if( nReg==1 ){ @@ -88876,11 +98110,15 @@ static int codeAllEqualityTerms( testcase( pTerm->eOperator & WO_ISNULL ); testcase( pTerm->eOperator & WO_IN ); if( (pTerm->eOperator & (WO_ISNULL|WO_IN))==0 ){ - sqlite3VdbeAddOp2(v, OP_IsNull, regBase+j, pLevel->addrBrk); - if( zAff - && sqlite3CompareAffinity(pTerm->pExpr->pRight, zAff[j])==SQLITE_AFF_NONE - ){ - zAff[j] = SQLITE_AFF_NONE; + Expr *pRight = pTerm->pExpr->pRight; + sqlite3ExprCodeIsNullJump(v, pRight, regBase+j, pLevel->addrBrk); + if( zAff ){ + if( sqlite3CompareAffinity(pRight, zAff[j])==SQLITE_AFF_NONE ){ + zAff[j] = SQLITE_AFF_NONE; + } + if( sqlite3ExprNeedsNoAffinityChange(pRight, zAff[j]) ){ + zAff[j] = SQLITE_AFF_NONE; + } } } } @@ -88960,6 +98198,7 @@ static Bitmask codeOneLoopStart( const struct sqlite3_index_constraint *aConstraint = pVtabIdx->aConstraint; + sqlite3ExprCachePush(pParse); iReg = sqlite3GetTempRange(pParse, nConstraint+2); for(j=1; j<=nConstraint; j++){ for(k=0; kp1 = iCur; pLevel->p2 = sqlite3VdbeCurrentAddr(v); sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); + sqlite3ExprCachePop(pParse, 1); }else #endif /* SQLITE_OMIT_VIRTUALTABLE */ @@ -89001,6 +98241,7 @@ static Bitmask codeOneLoopStart( assert( pTerm->pExpr!=0 ); assert( pTerm->leftCursor==iCur ); assert( omitTable==0 ); + testcase( pTerm->wtFlags & TERM_VIRTUAL ); /* EV: R-30575-11662 */ iRowidReg = codeEqualityTerm(pParse, pTerm, pLevel, iReleaseReg); addrNxt = pLevel->addrNxt; sqlite3VdbeAddOp2(v, OP_MustBeInt, iRowidReg, addrNxt); @@ -89041,6 +98282,7 @@ static Bitmask codeOneLoopStart( assert( TK_LT==TK_GT+2 ); /* ... of the TK_xx values... */ assert( TK_GE==TK_GT+3 ); /* ... is correcct. */ + testcase( pStart->wtFlags & TERM_VIRTUAL ); /* EV: R-30575-11662 */ pX = pStart->pExpr; assert( pX!=0 ); assert( pStart->leftCursor==iCur ); @@ -89058,6 +98300,7 @@ static Bitmask codeOneLoopStart( pX = pEnd->pExpr; assert( pX!=0 ); assert( pEnd->leftCursor==iCur ); + testcase( pEnd->wtFlags & TERM_VIRTUAL ); /* EV: R-30575-11662 */ memEndValue = ++pParse->nMem; sqlite3ExprCode(pParse, pX->pRight, memEndValue); if( pX->op==TK_LT || pX->op==TK_GT ){ @@ -89071,7 +98314,11 @@ static Bitmask codeOneLoopStart( pLevel->op = bRev ? OP_Prev : OP_Next; pLevel->p1 = iCur; pLevel->p2 = start; - pLevel->p5 = (pStart==0 && pEnd==0) ?1:0; + if( pStart==0 && pEnd==0 ){ + pLevel->p5 = SQLITE_STMTSTATUS_FULLSCAN_STEP; + }else{ + assert( pLevel->p5==0 ); + } if( testOp!=OP_Noop ){ iRowidReg = iReleaseReg = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp2(v, OP_Rowid, iCur, iRowidReg); @@ -89111,7 +98358,7 @@ static Bitmask codeOneLoopStart( ** constraints but an index is selected anyway, in order ** to force the output order to conform to an ORDER BY. */ - int aStartOp[] = { + static const u8 aStartOp[] = { 0, 0, OP_Rewind, /* 2: (!start_constraints && startEq && !bRev) */ @@ -89121,12 +98368,12 @@ static Bitmask codeOneLoopStart( OP_SeekGe, /* 6: (start_constraints && startEq && !bRev) */ OP_SeekLe /* 7: (start_constraints && startEq && bRev) */ }; - int aEndOp[] = { + static const u8 aEndOp[] = { OP_Noop, /* 0: (!end_constraints) */ OP_IdxGE, /* 1: (end_constraints && !bRev) */ OP_IdxLT /* 2: (end_constraints && bRev) */ }; - int nEq = pLevel->plan.nEq; + int nEq = pLevel->plan.nEq; /* Number of == or IN terms */ int isMinQuery = 0; /* If this is an optimized SELECT min(x).. */ int regBase; /* Base register holding constraint values */ int r1; /* Temp register */ @@ -89136,11 +98383,12 @@ static Bitmask codeOneLoopStart( int endEq; /* True if range end uses ==, >= or <= */ int start_constraints; /* Start of range is constrained */ int nConstraint; /* Number of constraint terms */ - Index *pIdx; /* The index we will be using */ - int iIdxCur; /* The VDBE cursor for the index */ - int nExtraReg = 0; /* Number of extra registers needed */ - int op; /* Instruction opcode */ - char *zAff; + Index *pIdx; /* The index we will be using */ + int iIdxCur; /* The VDBE cursor for the index */ + int nExtraReg = 0; /* Number of extra registers needed */ + int op; /* Instruction opcode */ + char *zStartAff; /* Affinity for start of range constraint */ + char *zEndAff; /* Affinity for end of range constraint */ pIdx = pLevel->plan.u.pIdx; iIdxCur = pLevel->iIdxCur; @@ -89181,15 +98429,16 @@ static Bitmask codeOneLoopStart( ** starting at regBase. */ regBase = codeAllEqualityTerms( - pParse, pLevel, pWC, notReady, nExtraReg, &zAff + pParse, pLevel, pWC, notReady, nExtraReg, &zStartAff ); + zEndAff = sqlite3DbStrDup(pParse->db, zStartAff); addrNxt = pLevel->addrNxt; /* If we are doing a reverse order scan on an ascending index, or ** a forward order scan on a descending index, interchange the ** start and end terms (pRangeStart and pRangeEnd). */ - if( bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC) ){ + if( nEqnColumn && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC) ){ SWAP(WhereTerm *, pRangeEnd, pRangeStart); } @@ -89206,23 +98455,27 @@ static Bitmask codeOneLoopStart( if( pRangeStart ){ Expr *pRight = pRangeStart->pExpr->pRight; sqlite3ExprCode(pParse, pRight, regBase+nEq); - sqlite3VdbeAddOp2(v, OP_IsNull, regBase+nEq, addrNxt); - if( zAff - && sqlite3CompareAffinity(pRight, zAff[nConstraint])==SQLITE_AFF_NONE - ){ - /* Since the comparison is to be performed with no conversions applied - ** to the operands, set the affinity to apply to pRight to - ** SQLITE_AFF_NONE. */ - zAff[nConstraint] = SQLITE_AFF_NONE; - } + sqlite3ExprCodeIsNullJump(v, pRight, regBase+nEq, addrNxt); + if( zStartAff ){ + if( sqlite3CompareAffinity(pRight, zStartAff[nEq])==SQLITE_AFF_NONE){ + /* Since the comparison is to be performed with no conversions + ** applied to the operands, set the affinity to apply to pRight to + ** SQLITE_AFF_NONE. */ + zStartAff[nEq] = SQLITE_AFF_NONE; + } + if( sqlite3ExprNeedsNoAffinityChange(pRight, zStartAff[nEq]) ){ + zStartAff[nEq] = SQLITE_AFF_NONE; + } + } nConstraint++; + testcase( pRangeStart->wtFlags & TERM_VIRTUAL ); /* EV: R-30575-11662 */ }else if( isMinQuery ){ sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq); nConstraint++; startEq = 0; start_constraints = 1; } - codeApplyAffinity(pParse, regBase, nConstraint, zAff); + codeApplyAffinity(pParse, regBase, nConstraint, zStartAff); op = aStartOp[(start_constraints<<2) + (startEq<<1) + bRev]; assert( op!=0 ); testcase( op==OP_Rewind ); @@ -89231,8 +98484,7 @@ static Bitmask codeOneLoopStart( testcase( op==OP_SeekGe ); testcase( op==OP_SeekLe ); testcase( op==OP_SeekLt ); - sqlite3VdbeAddOp4(v, op, iIdxCur, addrNxt, regBase, - SQLITE_INT_TO_PTR(nConstraint), P4_INT32); + sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint); /* Load the value for the inequality constraint at the end of the ** range (if any). @@ -89240,21 +98492,26 @@ static Bitmask codeOneLoopStart( nConstraint = nEq; if( pRangeEnd ){ Expr *pRight = pRangeEnd->pExpr->pRight; - sqlite3ExprCacheRemove(pParse, regBase+nEq); + sqlite3ExprCacheRemove(pParse, regBase+nEq, 1); sqlite3ExprCode(pParse, pRight, regBase+nEq); - sqlite3VdbeAddOp2(v, OP_IsNull, regBase+nEq, addrNxt); - zAff = sqlite3DbStrDup(pParse->db, zAff); - if( zAff - && sqlite3CompareAffinity(pRight, zAff[nConstraint])==SQLITE_AFF_NONE - ){ - /* Since the comparison is to be performed with no conversions applied - ** to the operands, set the affinity to apply to pRight to - ** SQLITE_AFF_NONE. */ - zAff[nConstraint] = SQLITE_AFF_NONE; - } - codeApplyAffinity(pParse, regBase, nEq+1, zAff); + sqlite3ExprCodeIsNullJump(v, pRight, regBase+nEq, addrNxt); + if( zEndAff ){ + if( sqlite3CompareAffinity(pRight, zEndAff[nEq])==SQLITE_AFF_NONE){ + /* Since the comparison is to be performed with no conversions + ** applied to the operands, set the affinity to apply to pRight to + ** SQLITE_AFF_NONE. */ + zEndAff[nEq] = SQLITE_AFF_NONE; + } + if( sqlite3ExprNeedsNoAffinityChange(pRight, zEndAff[nEq]) ){ + zEndAff[nEq] = SQLITE_AFF_NONE; + } + } + codeApplyAffinity(pParse, regBase, nEq+1, zEndAff); nConstraint++; + testcase( pRangeEnd->wtFlags & TERM_VIRTUAL ); /* EV: R-30575-11662 */ } + sqlite3DbFree(pParse->db, zStartAff); + sqlite3DbFree(pParse->db, zEndAff); /* Top of the loop body */ pLevel->p2 = sqlite3VdbeCurrentAddr(v); @@ -89265,8 +98522,7 @@ static Bitmask codeOneLoopStart( testcase( op==OP_IdxGE ); testcase( op==OP_IdxLT ); if( op!=OP_Noop ){ - sqlite3VdbeAddOp4(v, op, iIdxCur, addrNxt, regBase, - SQLITE_INT_TO_PTR(nConstraint), P4_INT32); + sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint); sqlite3VdbeChangeP5(v, endEq!=bRev ?1:0); } @@ -89343,13 +98599,14 @@ static Bitmask codeOneLoopStart( */ WhereClause *pOrWc; /* The OR-clause broken out into subterms */ WhereTerm *pFinal; /* Final subterm within the OR-clause. */ - SrcList oneTab; /* Shortened table list */ + SrcList *pOrTab; /* Shortened table list or OR-clause generation */ int regReturn = ++pParse->nMem; /* Register used with OP_Gosub */ int regRowset = 0; /* Register for RowSet object */ int regRowid = 0; /* Register holding rowid */ int iLoopBody = sqlite3VdbeMakeLabel(v); /* Start of loop body */ int iRetInit; /* Address of regReturn init */ + int untestedTerms = 0; /* Some terms not completely tested */ int ii; pTerm = pLevel->plan.u.pTerm; @@ -89358,11 +98615,30 @@ static Bitmask codeOneLoopStart( assert( (pTerm->wtFlags & TERM_ORINFO)!=0 ); pOrWc = &pTerm->u.pOrInfo->wc; pFinal = &pOrWc->a[pOrWc->nTerm-1]; + pLevel->op = OP_Return; + pLevel->p1 = regReturn; - /* Set up a SrcList containing just the table being scanned by this loop. */ - oneTab.nSrc = 1; - oneTab.nAlloc = 1; - oneTab.a[0] = *pTabItem; + /* Set up a new SrcList ni pOrTab containing the table being scanned + ** by this loop in the a[0] slot and all notReady tables in a[1..] slots. + ** This becomes the SrcList in the recursive call to sqlite3WhereBegin(). + */ + if( pWInfo->nLevel>1 ){ + int nNotReady; /* The number of notReady tables */ + struct SrcList_item *origSrc; /* Original list of tables */ + nNotReady = pWInfo->nLevel - iLevel - 1; + pOrTab = sqlite3StackAllocRaw(pParse->db, + sizeof(*pOrTab)+ nNotReady*sizeof(pOrTab->a[0])); + if( pOrTab==0 ) return notReady; + pOrTab->nAlloc = (i16)(nNotReady + 1); + pOrTab->nSrc = pOrTab->nAlloc; + memcpy(pOrTab->a, pTabItem, sizeof(*pTabItem)); + origSrc = pWInfo->pTabList->a; + for(k=1; k<=nNotReady; k++){ + memcpy(&pOrTab->a[k], &origSrc[pLevel[k].iFrom], sizeof(pOrTab->a[k])); + } + }else{ + pOrTab = pWInfo->pTabList; + } /* Initialize the rowset register to contain NULL. An SQL NULL is ** equivalent to an empty rowset. @@ -89387,33 +98663,38 @@ static Bitmask codeOneLoopStart( if( pOrTerm->leftCursor==iCur || pOrTerm->eOperator==WO_AND ){ WhereInfo *pSubWInfo; /* Info for single OR-term scan */ /* Loop through table entries that match term pOrTerm. */ - pSubWInfo = sqlite3WhereBegin(pParse, &oneTab, pOrTerm->pExpr, 0, - WHERE_OMIT_OPEN | WHERE_OMIT_CLOSE | WHERE_FORCE_TABLE); + pSubWInfo = sqlite3WhereBegin(pParse, pOrTab, pOrTerm->pExpr, 0, + WHERE_OMIT_OPEN | WHERE_OMIT_CLOSE | + WHERE_FORCE_TABLE | WHERE_ONETABLE_ONLY); if( pSubWInfo ){ if( (wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); int r; r = sqlite3ExprCodeGetColumn(pParse, pTabItem->pTab, -1, iCur, - regRowid, 0); - sqlite3VdbeAddOp4(v, OP_RowSetTest, regRowset, - sqlite3VdbeCurrentAddr(v)+2, - r, SQLITE_INT_TO_PTR(iSet), P4_INT32); + regRowid); + sqlite3VdbeAddOp4Int(v, OP_RowSetTest, regRowset, + sqlite3VdbeCurrentAddr(v)+2, r, iSet); } sqlite3VdbeAddOp2(v, OP_Gosub, regReturn, iLoopBody); + /* The pSubWInfo->untestedTerms flag means that this OR term + ** contained one or more AND term from a notReady table. The + ** terms from the notReady table could not be tested and will + ** need to be tested later. + */ + if( pSubWInfo->untestedTerms ) untestedTerms = 1; + /* Finish the loop through table entries that match term pOrTerm. */ sqlite3WhereEnd(pSubWInfo); } } } sqlite3VdbeChangeP1(v, iRetInit, sqlite3VdbeCurrentAddr(v)); - /* sqlite3VdbeAddOp2(v, OP_Null, 0, regRowset); */ sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrBrk); sqlite3VdbeResolveLabel(v, iLoopBody); - pLevel->op = OP_Return; - pLevel->p1 = regReturn; - disableTerm(pLevel, pTerm); + if( pWInfo->nLevel>1 ) sqlite3StackFree(pParse->db, pOrTab); + if( !untestedTerms ) disableTerm(pLevel, pTerm); }else #endif /* SQLITE_OMIT_OR_OPTIMIZATION */ @@ -89434,14 +98715,23 @@ static Bitmask codeOneLoopStart( /* Insert code to test every subexpression that can be completely ** computed using the current set of tables. + ** + ** IMPLEMENTATION-OF: R-49525-50935 Terms that cannot be satisfied through + ** the use of indices become tests that are evaluated against each row of + ** the relevant input tables. */ k = 0; for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){ Expr *pE; - testcase( pTerm->wtFlags & TERM_VIRTUAL ); + testcase( pTerm->wtFlags & TERM_VIRTUAL ); /* IMP: R-30575-11662 */ testcase( pTerm->wtFlags & TERM_CODED ); if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; - if( (pTerm->prereqAll & notReady)!=0 ) continue; + if( (pTerm->prereqAll & notReady)!=0 ){ + testcase( pWInfo->untestedTerms==0 + && (pWInfo->wctrlFlags & WHERE_ONETABLE_ONLY)!=0 ); + pWInfo->untestedTerms = 1; + continue; + } pE = pTerm->pExpr; assert( pE!=0 ); if( pLevel->iLeftJoin && !ExprHasProperty(pE, EP_FromJoin) ){ @@ -89461,10 +98751,13 @@ static Bitmask codeOneLoopStart( VdbeComment((v, "record LEFT JOIN hit")); sqlite3ExprCacheClear(pParse); for(pTerm=pWC->a, j=0; jnTerm; j++, pTerm++){ - testcase( pTerm->wtFlags & TERM_VIRTUAL ); + testcase( pTerm->wtFlags & TERM_VIRTUAL ); /* IMP: R-30575-11662 */ testcase( pTerm->wtFlags & TERM_CODED ); if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; - if( (pTerm->prereqAll & notReady)!=0 ) continue; + if( (pTerm->prereqAll & notReady)!=0 ){ + assert( pWInfo->untestedTerms ); + continue; + } assert( pTerm->pExpr ); sqlite3ExprIfFalse(pParse, pTerm->pExpr, addrCont, SQLITE_JUMPIFNULL); pTerm->wtFlags |= TERM_CODED; @@ -89492,7 +98785,7 @@ static int nQPlan = 0; /* Next free slow in _query_plan[] */ ** Free a WhereInfo structure */ static void whereInfoFree(sqlite3 *db, WhereInfo *pWInfo){ - if( pWInfo ){ + if( ALWAYS(pWInfo) ){ int i; for(i=0; inLevel; i++){ sqlite3_index_info *pInfo = pWInfo->a[i].pIdxInfo; @@ -89503,6 +98796,13 @@ static void whereInfoFree(sqlite3 *db, WhereInfo *pWInfo){ } sqlite3DbFree(db, pInfo); } + if( pWInfo->a[i].plan.wsFlags & WHERE_TEMP_INDEX ){ + Index *pIdx = pWInfo->a[i].plan.u.pIdx; + if( pIdx ){ + sqlite3DbFree(db, pIdx->zColAff); + sqlite3DbFree(db, pIdx); + } + } } whereClauseClear(pWInfo->pWC); sqlite3DbFree(db, pWInfo); @@ -89607,6 +98907,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( ){ int i; /* Loop counter */ int nByteWInfo; /* Num. bytes allocated for WhereInfo struct */ + int nTabList; /* Number of elements in pTabList */ WhereInfo *pWInfo; /* Will become the return value of this function */ Vdbe *v = pParse->pVdbe; /* The virtual database engine */ Bitmask notReady; /* Cursors that are not yet positioned */ @@ -89621,11 +98922,19 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( /* The number of tables in the FROM clause is limited by the number of ** bits in a Bitmask */ + testcase( pTabList->nSrc==BMS ); if( pTabList->nSrc>BMS ){ sqlite3ErrorMsg(pParse, "at most %d tables in a join", BMS); return 0; } + /* This function normally generates a nested loop for all tables in + ** pTabList. But if the WHERE_ONETABLE_ONLY flag is set, then we should + ** only generate code for the first table in pTabList and assume that + ** any cursors associated with subsequent tables are uninitialized. + */ + nTabList = (wctrlFlags & WHERE_ONETABLE_ONLY) ? 1 : pTabList->nSrc; + /* Allocate and initialize the WhereInfo structure that will become the ** return value. A single allocation is used to store the WhereInfo ** struct, the contents of WhereInfo.a[], the WhereClause structure @@ -89634,21 +98943,24 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( ** some architectures. Hence the ROUND8() below. */ db = pParse->db; - nByteWInfo = ROUND8(sizeof(WhereInfo)+(pTabList->nSrc-1)*sizeof(WhereLevel)); + nByteWInfo = ROUND8(sizeof(WhereInfo)+(nTabList-1)*sizeof(WhereLevel)); pWInfo = sqlite3DbMallocZero(db, nByteWInfo + sizeof(WhereClause) + sizeof(WhereMaskSet) ); if( db->mallocFailed ){ + sqlite3DbFree(db, pWInfo); + pWInfo = 0; goto whereBeginError; } - pWInfo->nLevel = pTabList->nSrc; + pWInfo->nLevel = nTabList; pWInfo->pParse = pParse; pWInfo->pTabList = pTabList; pWInfo->iBreak = sqlite3VdbeMakeLabel(v); pWInfo->pWC = pWC = (WhereClause *)&((u8 *)pWInfo)[nByteWInfo]; pWInfo->wctrlFlags = wctrlFlags; + pWInfo->savedNQueryLoop = pParse->nQueryLoop; pMaskSet = (WhereMaskSet*)&pWC[1]; /* Split the WHERE clause into separate subexpressions where each @@ -89657,12 +98969,12 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( initMaskSet(pMaskSet); whereClauseInit(pWC, pParse, pMaskSet); sqlite3ExprCodeConstants(pParse, pWhere); - whereSplit(pWC, pWhere, TK_AND); + whereSplit(pWC, pWhere, TK_AND); /* IMP: R-15842-53296 */ /* Special case: a WHERE clause that is constant. Evaluate the ** expression and either jump over all of the code or fall thru. */ - if( pWhere && (pTabList->nSrc==0 || sqlite3ExprIsConstantNotJoin(pWhere)) ){ + if( pWhere && (nTabList==0 || sqlite3ExprIsConstantNotJoin(pWhere)) ){ sqlite3ExprIfFalse(pParse, pWhere, pWInfo->iBreak, SQLITE_JUMPIFNULL); pWhere = 0; } @@ -89682,6 +98994,11 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( ** to virtual table cursors are set. This is used to selectively disable ** the OR-to-IN transformation in exprAnalyzeOrTerm(). It is not helpful ** with virtual tables. + ** + ** Note that bitmasks are created for all pTabList->nSrc tables in + ** pTabList, not just the first nTabList tables. nTabList is normally + ** equal to pTabList->nSrc but might be shortened to 1 if the + ** WHERE_ONETABLE_ONLY flag is set. */ assert( pWC->vmask==0 && pMaskSet->n==0 ); for(i=0; inSrc; i++){ @@ -89733,32 +99050,45 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( pLevel = pWInfo->a; andFlags = ~0; WHERETRACE(("*** Optimizer Start ***\n")); - for(i=iFrom=0, pLevel=pWInfo->a; inSrc; i++, pLevel++){ + for(i=iFrom=0, pLevel=pWInfo->a; i=0 && bestJ<0; isOptimal--){ - Bitmask mask = (isOptimal ? 0 : notReady); - assert( (pTabList->nSrc-iFrom)>1 || isOptimal ); - for(j=iFrom, pTabItem=&pTabList->a[j]; jnSrc; j++, pTabItem++){ + nUnconstrained = 0; + notIndexed = 0; + for(isOptimal=(iFrom=0 && bestJ<0; isOptimal--){ + Bitmask mask; /* Mask of tables not yet ready */ + for(j=iFrom, pTabItem=&pTabList->a[j]; jpIndex==0 ) nUnconstrained++; assert( pTabItem->pTab ); #ifndef SQLITE_OMIT_VIRTUALTABLE if( IsVirtual(pTabItem->pTab) ){ sqlite3_index_info **pp = &pWInfo->a[j].pIdxInfo; - bestVirtualIndex(pParse, pWC, pTabItem, mask, pOrderBy, &sCost, pp); + bestVirtualIndex(pParse, pWC, pTabItem, mask, notReady, pOrderBy, + &sCost, pp); }else #endif { - bestBtreeIndex(pParse, pWC, pTabItem, mask, pOrderBy, &sCost); + bestBtreeIndex(pParse, pWC, pTabItem, mask, notReady, pOrderBy, + &sCost); } assert( isOptimal || (sCost.used¬Ready)==0 ); - if( (sCost.used¬Ready)==0 - && (j==iFrom || sCost.rCostpIndex==0 + || (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)==0 + || sCost.plan.u.pIdx==pTabItem->pIndex ); + + if( isOptimal && (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)==0 ){ + notIndexed |= m; + } + + /* Conditions under which this table becomes the best so far: + ** + ** (1) The table must not depend on other tables that have not + ** yet run. + ** + ** (2) A full-table-scan plan cannot supercede another plan unless + ** it is an "optimal" plan as defined above. + ** + ** (3) All tables have an INDEXED BY clause or this table lacks an + ** INDEXED BY clause or this table uses the specific + ** index specified by its INDEXED BY clause. This rule ensures + ** that a best-so-far is always selected even if an impossible + ** combination of INDEXED BY clauses are given. The error + ** will be detected and relayed back to the application later. + ** The NEVER() comes about because rule (2) above prevents + ** An indexable full-table-scan from reaching rule (3). + ** + ** (4) The plan cost must be lower than prior plans or else the + ** cost must be the same and the number of rows must be lower. + */ + if( (sCost.used¬Ready)==0 /* (1) */ + && (bestJ<0 || (notIndexed&m)!=0 /* (2) */ + || (sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)!=0) + && (nUnconstrained==0 || pTabItem->pIndex==0 /* (3) */ + || NEVER((sCost.plan.wsFlags & WHERE_NOT_FULLSCAN)!=0)) + && (bestJ<0 || sCost.rCostplan = bestPlan.plan; - if( bestPlan.plan.wsFlags & WHERE_INDEXED ){ + testcase( bestPlan.plan.wsFlags & WHERE_INDEXED ); + testcase( bestPlan.plan.wsFlags & WHERE_TEMP_INDEX ); + if( bestPlan.plan.wsFlags & (WHERE_INDEXED|WHERE_TEMP_INDEX) ){ pLevel->iIdxCur = pParse->nTab++; }else{ pLevel->iIdxCur = -1; } notReady &= ~getMask(pMaskSet, pTabList->a[bestJ].iCursor); pLevel->iFrom = (u8)bestJ; + if( bestPlan.nRow>=(double)1 ) pParse->nQueryLoop *= bestPlan.nRow; /* Check that if the table scanned by this loop iteration had an ** INDEXED BY clause attached to it, that the named index is being @@ -89876,7 +99251,8 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( ** searching those tables. */ sqlite3CodeVerifySchema(pParse, -1); /* Insert the cookie verifier Goto */ - for(i=0, pLevel=pWInfo->a; inSrc; i++, pLevel++){ + notReady = ~(Bitmask)0; + for(i=0, pLevel=pWInfo->a; izAlias ){ zMsg = sqlite3MAppendf(db, zMsg, "%s AS %s", zMsg, pItem->zAlias); } - if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ + if( (pLevel->plan.wsFlags & WHERE_TEMP_INDEX)!=0 ){ + zMsg = sqlite3MAppendf(db, zMsg, "%s WITH AUTOMATIC INDEX", zMsg); + }else if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ zMsg = sqlite3MAppendf(db, zMsg, "%s WITH INDEX %s", zMsg, pLevel->plan.u.pIdx->zName); }else if( pLevel->plan.wsFlags & WHERE_MULTI_OR ){ @@ -89911,8 +99289,11 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( #endif /* SQLITE_OMIT_EXPLAIN */ pTabItem = &pTabList->a[pLevel->iFrom]; pTab = pTabItem->pTab; + pLevel->iTabCur = pTabItem->iCursor; iDb = sqlite3SchemaToIndex(db, pTab->pSchema); - if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ) continue; + if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ){ + /* Do nothing */ + }else #ifndef SQLITE_OMIT_VIRTUALTABLE if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){ const char *pVTab = (const char *)sqlite3GetVTable(db, pTab); @@ -89924,17 +99305,24 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( && (wctrlFlags & WHERE_OMIT_OPEN)==0 ){ int op = pWInfo->okOnePass ? OP_OpenWrite : OP_OpenRead; sqlite3OpenTable(pParse, pTabItem->iCursor, iDb, pTab, op); + testcase( pTab->nCol==BMS-1 ); + testcase( pTab->nCol==BMS ); if( !pWInfo->okOnePass && pTab->nColcolUsed; int n = 0; for(; b; b=b>>1, n++){} - sqlite3VdbeChangeP4(v, sqlite3VdbeCurrentAddr(v)-1, SQLITE_INT_TO_PTR(n), P4_INT32); + sqlite3VdbeChangeP4(v, sqlite3VdbeCurrentAddr(v)-1, + SQLITE_INT_TO_PTR(n), P4_INT32); assert( n<=pTab->nCol ); } }else{ sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName); } - pLevel->iTabCur = pTabItem->iCursor; +#ifndef SQLITE_OMIT_AUTOMATIC_INDEX + if( (pLevel->plan.wsFlags & WHERE_TEMP_INDEX)!=0 ){ + constructAutomaticIndex(pParse, pWC, pTabItem, notReady, pLevel); + }else +#endif if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ Index *pIx = pLevel->plan.u.pIdx; KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx); @@ -89946,15 +99334,17 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( VdbeComment((v, "%s", pIx->zName)); } sqlite3CodeVerifySchema(pParse, iDb); + notReady &= ~getMask(pWC->pMaskSet, pTabItem->iCursor); } pWInfo->iTop = sqlite3VdbeCurrentAddr(v); + if( db->mallocFailed ) goto whereBeginError; /* Generate the code to do the search. Each iteration of the for ** loop below generates code for a single nested loop of the VM ** program. */ notReady = ~(Bitmask)0; - for(i=0; inSrc; i++){ + for(i=0; iiContinue = pWInfo->a[i].addrCont; } @@ -89966,7 +99356,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( ** the index is listed as "{}". If the primary key is used the ** index name is '*'. */ - for(i=0; inSrc; i++){ + for(i=0; ia[i]; @@ -90015,7 +99405,10 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( /* Jump here if malloc fails */ whereBeginError: - whereInfoFree(db, pWInfo); + if( pWInfo ){ + pParse->nQueryLoop = pWInfo->savedNQueryLoop; + whereInfoFree(db, pWInfo); + } return 0; } @@ -90034,7 +99427,7 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ /* Generate loop termination code. */ sqlite3ExprCacheClear(pParse); - for(i=pTabList->nSrc-1; i>=0; i--){ + for(i=pWInfo->nLevel-1; i>=0; i--){ pLevel = &pWInfo->a[i]; sqlite3VdbeResolveLabel(v, pLevel->addrCont); if( pLevel->op!=OP_Noop ){ @@ -90056,7 +99449,11 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ if( pLevel->iLeftJoin ){ int addr; addr = sqlite3VdbeAddOp1(v, OP_IfPos, pLevel->iLeftJoin); - sqlite3VdbeAddOp1(v, OP_NullRow, pTabList->a[i].iCursor); + assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 + || (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ); + if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 ){ + sqlite3VdbeAddOp1(v, OP_NullRow, pTabList->a[i].iCursor); + } if( pLevel->iIdxCur>=0 ){ sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur); } @@ -90076,16 +99473,20 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ /* Close all of the cursors that were opened by sqlite3WhereBegin. */ - for(i=0, pLevel=pWInfo->a; inSrc; i++, pLevel++){ + assert( pWInfo->nLevel==1 || pWInfo->nLevel==pTabList->nSrc ); + for(i=0, pLevel=pWInfo->a; inLevel; i++, pLevel++){ struct SrcList_item *pTabItem = &pTabList->a[pLevel->iFrom]; Table *pTab = pTabItem->pTab; assert( pTab!=0 ); - if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ) continue; - if( (pWInfo->wctrlFlags & WHERE_OMIT_CLOSE)==0 ){ - if( !pWInfo->okOnePass && (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 ){ + if( (pTab->tabFlags & TF_Ephemeral)==0 + && pTab->pSelect==0 + && (pWInfo->wctrlFlags & WHERE_OMIT_CLOSE)==0 + ){ + int ws = pLevel->plan.wsFlags; + if( !pWInfo->okOnePass && (ws & WHERE_IDX_ONLY)==0 ){ sqlite3VdbeAddOp1(v, OP_Close, pTabItem->iCursor); } - if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ + if( (ws & WHERE_INDEXED)!=0 && (ws & WHERE_TEMP_INDEX)==0 ){ sqlite3VdbeAddOp1(v, OP_Close, pLevel->iIdxCur); } } @@ -90107,7 +99508,6 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ int k, j, last; VdbeOp *pOp; Index *pIdx = pLevel->plan.u.pIdx; - int useIndexOnly = pLevel->plan.wsFlags & WHERE_IDX_ONLY; assert( pIdx!=0 ); pOp = sqlite3VdbeGetOp(v, pWInfo->iTop); @@ -90122,12 +99522,11 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ break; } } - assert(!useIndexOnly || jnColumn); + assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 + || jnColumn ); }else if( pOp->opcode==OP_Rowid ){ pOp->p1 = pLevel->iIdxCur; pOp->opcode = OP_IdxRowid; - }else if( pOp->opcode==OP_NullRow && useIndexOnly ){ - pOp->opcode = OP_Noop; } } } @@ -90135,6 +99534,7 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ /* Final cleanup */ + pParse->nQueryLoop = pWInfo->savedNQueryLoop; whereInfoFree(db, pWInfo); return; } @@ -90248,6 +99648,17 @@ struct AttachKey { int type; Token key; }; pOut->zEnd = &pPostOp->z[pPostOp->n]; } + /* A routine to convert a binary TK_IS or TK_ISNOT expression into a + ** unary TK_ISNULL or TK_NOTNULL expression. */ + static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){ + sqlite3 *db = pParse->db; + if( db->mallocFailed==0 && pY->op==TK_NULL ){ + pA->op = (u8)op; + sqlite3ExprDelete(db, pA->pRight); + pA->pRight = 0; + } + } + /* Construct an expression node for a unary prefix operator */ static void spanUnaryPrefix( @@ -90311,26 +99722,26 @@ struct AttachKey { int type; Token key; }; ** defined, then do no error processing. */ #define YYCODETYPE unsigned char -#define YYNOCODE 254 +#define YYNOCODE 253 #define YYACTIONTYPE unsigned short int #define YYWILDCARD 67 #define sqlite3ParserTOKENTYPE Token typedef union { int yyinit; sqlite3ParserTOKENTYPE yy0; - Select* yy3; - ExprList* yy14; - SrcList* yy65; - struct LikeOp yy96; - Expr* yy132; - u8 yy186; - int yy328; - ExprSpan yy346; - struct TrigEvent yy378; - IdList* yy408; - struct {int value; int mask;} yy429; - TriggerStep* yy473; - struct LimitVal yy476; + int yy4; + struct TrigEvent yy90; + ExprSpan yy118; + TriggerStep* yy203; + u8 yy210; + struct {int value; int mask;} yy215; + SrcList* yy259; + struct LimitVal yy292; + Expr* yy314; + ExprList* yy322; + struct LikeOp yy342; + IdList* yy384; + Select* yy387; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -90339,7 +99750,7 @@ typedef union { #define sqlite3ParserARG_PDECL ,Parse *pParse #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse #define sqlite3ParserARG_STORE yypParser->pParse = pParse -#define YYNSTATE 629 +#define YYNSTATE 630 #define YYNRULE 329 #define YYFALLBACK 1 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) @@ -90410,471 +99821,473 @@ static const YYMINORTYPE yyzerominor = { 0 }; ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. */ -#define YY_ACTTAB_COUNT (1543) +#define YY_ACTTAB_COUNT (1557) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 312, 49, 554, 46, 147, 172, 626, 596, 55, 55, - /* 10 */ 55, 55, 301, 53, 53, 53, 53, 52, 52, 51, - /* 20 */ 51, 51, 50, 237, 617, 616, 615, 622, 621, 607, - /* 30 */ 589, 583, 48, 53, 53, 53, 53, 52, 52, 51, - /* 40 */ 51, 51, 50, 237, 51, 51, 51, 50, 237, 56, - /* 50 */ 57, 47, 581, 580, 582, 582, 54, 54, 55, 55, - /* 60 */ 55, 55, 216, 53, 53, 53, 53, 52, 52, 51, - /* 70 */ 51, 51, 50, 237, 312, 596, 49, 329, 46, 147, + /* 0 */ 313, 960, 186, 419, 2, 172, 627, 597, 55, 55, + /* 10 */ 55, 55, 48, 53, 53, 53, 53, 52, 52, 51, + /* 20 */ 51, 51, 50, 238, 302, 283, 623, 622, 516, 515, + /* 30 */ 590, 584, 55, 55, 55, 55, 282, 53, 53, 53, + /* 40 */ 53, 52, 52, 51, 51, 51, 50, 238, 6, 56, + /* 50 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, + /* 60 */ 55, 55, 608, 53, 53, 53, 53, 52, 52, 51, + /* 70 */ 51, 51, 50, 238, 313, 597, 409, 330, 579, 579, /* 80 */ 32, 53, 53, 53, 53, 52, 52, 51, 51, 51, - /* 90 */ 50, 237, 329, 622, 621, 619, 618, 166, 433, 547, - /* 100 */ 381, 378, 377, 549, 589, 583, 389, 490, 166, 58, - /* 110 */ 376, 381, 378, 377, 390, 299, 622, 621, 480, 67, - /* 120 */ 670, 376, 620, 56, 57, 47, 581, 580, 582, 582, - /* 130 */ 54, 54, 55, 55, 55, 55, 253, 53, 53, 53, - /* 140 */ 53, 52, 52, 51, 51, 51, 50, 237, 312, 408, - /* 150 */ 225, 578, 578, 133, 177, 139, 283, 384, 278, 383, - /* 160 */ 169, 619, 618, 601, 197, 225, 274, 602, 439, 146, - /* 170 */ 139, 283, 384, 278, 383, 169, 569, 235, 589, 583, - /* 180 */ 250, 274, 252, 620, 619, 618, 546, 436, 440, 441, - /* 190 */ 168, 622, 621, 547, 438, 437, 192, 56, 57, 47, - /* 200 */ 581, 580, 582, 582, 54, 54, 55, 55, 55, 55, - /* 210 */ 6, 53, 53, 53, 53, 52, 52, 51, 51, 51, - /* 220 */ 50, 237, 312, 282, 52, 52, 51, 51, 51, 50, - /* 230 */ 237, 490, 183, 281, 547, 166, 439, 565, 381, 378, - /* 240 */ 377, 596, 606, 67, 327, 172, 620, 596, 376, 442, - /* 250 */ 236, 620, 589, 583, 306, 423, 440, 339, 251, 619, - /* 260 */ 618, 331, 574, 573, 7, 524, 194, 481, 16, 594, - /* 270 */ 189, 56, 57, 47, 581, 580, 582, 582, 54, 54, - /* 280 */ 55, 55, 55, 55, 545, 53, 53, 53, 53, 52, - /* 290 */ 52, 51, 51, 51, 50, 237, 312, 410, 464, 421, - /* 300 */ 592, 592, 592, 671, 146, 410, 1, 205, 410, 596, - /* 310 */ 622, 621, 413, 420, 949, 596, 949, 340, 236, 530, - /* 320 */ 413, 600, 74, 413, 236, 552, 589, 583, 547, 600, - /* 330 */ 95, 68, 600, 88, 551, 622, 621, 465, 542, 38, - /* 340 */ 49, 599, 46, 147, 465, 56, 57, 47, 581, 580, - /* 350 */ 582, 582, 54, 54, 55, 55, 55, 55, 424, 53, - /* 360 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 237, - /* 370 */ 312, 397, 395, 232, 529, 577, 387, 533, 619, 618, - /* 380 */ 605, 492, 560, 588, 587, 350, 257, 622, 621, 495, - /* 390 */ 564, 356, 350, 257, 49, 239, 46, 147, 559, 357, - /* 400 */ 589, 583, 239, 619, 618, 585, 584, 408, 258, 578, - /* 410 */ 578, 672, 209, 35, 558, 258, 401, 622, 621, 56, - /* 420 */ 57, 47, 581, 580, 582, 582, 54, 54, 55, 55, - /* 430 */ 55, 55, 586, 53, 53, 53, 53, 52, 52, 51, - /* 440 */ 51, 51, 50, 237, 312, 560, 599, 410, 526, 531, - /* 450 */ 184, 514, 513, 474, 366, 619, 618, 576, 410, 65, - /* 460 */ 176, 559, 413, 408, 311, 578, 578, 567, 491, 215, - /* 470 */ 352, 600, 94, 413, 589, 583, 474, 558, 408, 518, - /* 480 */ 578, 578, 600, 95, 470, 619, 618, 62, 420, 948, - /* 490 */ 517, 948, 349, 56, 57, 47, 581, 580, 582, 582, - /* 500 */ 54, 54, 55, 55, 55, 55, 175, 53, 53, 53, - /* 510 */ 53, 52, 52, 51, 51, 51, 50, 237, 312, 490, - /* 520 */ 157, 410, 509, 292, 393, 373, 348, 410, 623, 410, - /* 530 */ 428, 67, 611, 424, 620, 410, 413, 540, 408, 171, - /* 540 */ 578, 578, 413, 620, 413, 600, 73, 620, 589, 583, - /* 550 */ 413, 600, 80, 600, 88, 238, 168, 306, 422, 600, - /* 560 */ 80, 201, 18, 468, 406, 574, 573, 56, 57, 47, - /* 570 */ 581, 580, 582, 582, 54, 54, 55, 55, 55, 55, - /* 580 */ 579, 53, 53, 53, 53, 52, 52, 51, 51, 51, - /* 590 */ 50, 237, 312, 44, 233, 599, 271, 320, 341, 472, - /* 600 */ 410, 874, 421, 473, 503, 319, 410, 200, 144, 66, - /* 610 */ 327, 483, 508, 596, 274, 413, 239, 364, 484, 382, - /* 620 */ 30, 413, 589, 583, 600, 69, 502, 236, 342, 575, - /* 630 */ 600, 97, 199, 198, 209, 959, 186, 418, 2, 566, - /* 640 */ 269, 56, 57, 47, 581, 580, 582, 582, 54, 54, - /* 650 */ 55, 55, 55, 55, 410, 53, 53, 53, 53, 52, - /* 660 */ 52, 51, 51, 51, 50, 237, 312, 263, 599, 413, - /* 670 */ 410, 21, 190, 358, 410, 326, 410, 202, 600, 100, - /* 680 */ 386, 596, 620, 562, 265, 413, 267, 410, 620, 413, - /* 690 */ 563, 413, 352, 4, 600, 98, 589, 583, 600, 106, - /* 700 */ 600, 104, 413, 174, 601, 629, 627, 333, 602, 34, - /* 710 */ 337, 600, 108, 561, 359, 56, 57, 47, 581, 580, - /* 720 */ 582, 582, 54, 54, 55, 55, 55, 55, 410, 53, - /* 730 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 237, - /* 740 */ 312, 410, 499, 413, 167, 567, 405, 215, 504, 505, - /* 750 */ 316, 557, 600, 109, 353, 13, 413, 410, 12, 410, - /* 760 */ 538, 410, 335, 358, 223, 600, 134, 571, 571, 620, - /* 770 */ 589, 583, 413, 20, 413, 620, 413, 272, 620, 167, - /* 780 */ 167, 600, 135, 600, 61, 600, 105, 317, 148, 56, - /* 790 */ 57, 47, 581, 580, 582, 582, 54, 54, 55, 55, - /* 800 */ 55, 55, 410, 53, 53, 53, 53, 52, 52, 51, - /* 810 */ 51, 51, 50, 237, 312, 410, 275, 413, 410, 275, - /* 820 */ 275, 222, 410, 330, 363, 544, 600, 103, 132, 360, - /* 830 */ 413, 620, 522, 413, 620, 620, 410, 413, 170, 600, - /* 840 */ 96, 603, 600, 102, 589, 583, 600, 77, 374, 536, - /* 850 */ 167, 413, 143, 325, 256, 28, 224, 324, 511, 528, - /* 860 */ 600, 99, 527, 56, 57, 47, 581, 580, 582, 582, - /* 870 */ 54, 54, 55, 55, 55, 55, 410, 53, 53, 53, - /* 880 */ 53, 52, 52, 51, 51, 51, 50, 237, 312, 410, - /* 890 */ 275, 413, 410, 469, 275, 167, 458, 39, 171, 37, - /* 900 */ 600, 138, 214, 144, 413, 620, 142, 413, 410, 620, - /* 910 */ 410, 358, 239, 600, 137, 230, 600, 136, 589, 583, - /* 920 */ 457, 263, 23, 413, 351, 413, 620, 323, 445, 501, - /* 930 */ 23, 322, 600, 76, 600, 93, 620, 56, 45, 47, - /* 940 */ 581, 580, 582, 582, 54, 54, 55, 55, 55, 55, - /* 950 */ 410, 53, 53, 53, 53, 52, 52, 51, 51, 51, - /* 960 */ 50, 237, 312, 410, 262, 413, 410, 426, 263, 308, - /* 970 */ 203, 213, 212, 380, 600, 92, 520, 519, 413, 130, - /* 980 */ 538, 413, 538, 620, 410, 628, 2, 600, 75, 273, - /* 990 */ 600, 91, 589, 583, 375, 620, 129, 620, 27, 413, - /* 1000 */ 425, 307, 221, 128, 599, 599, 599, 281, 600, 90, - /* 1010 */ 371, 452, 57, 47, 581, 580, 582, 582, 54, 54, - /* 1020 */ 55, 55, 55, 55, 410, 53, 53, 53, 53, 52, - /* 1030 */ 52, 51, 51, 51, 50, 237, 312, 410, 263, 413, - /* 1040 */ 410, 263, 263, 365, 208, 321, 206, 542, 600, 101, - /* 1050 */ 50, 237, 413, 620, 610, 413, 620, 620, 410, 542, - /* 1060 */ 165, 600, 89, 188, 600, 87, 589, 583, 478, 620, - /* 1070 */ 467, 519, 125, 413, 569, 235, 542, 367, 599, 475, - /* 1080 */ 599, 450, 600, 86, 449, 448, 231, 47, 581, 580, - /* 1090 */ 582, 582, 54, 54, 55, 55, 55, 55, 287, 53, - /* 1100 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 237, - /* 1110 */ 43, 404, 410, 3, 410, 285, 260, 414, 621, 263, - /* 1120 */ 609, 627, 333, 43, 404, 410, 3, 413, 407, 413, - /* 1130 */ 414, 621, 171, 263, 620, 620, 600, 85, 600, 72, - /* 1140 */ 413, 407, 124, 140, 353, 604, 409, 402, 620, 600, - /* 1150 */ 71, 291, 471, 495, 160, 123, 593, 565, 620, 620, - /* 1160 */ 402, 620, 220, 15, 463, 460, 620, 417, 625, 159, - /* 1170 */ 565, 620, 399, 240, 158, 126, 219, 40, 41, 532, - /* 1180 */ 410, 207, 121, 120, 42, 412, 411, 620, 263, 594, - /* 1190 */ 40, 41, 556, 543, 25, 413, 11, 42, 412, 411, - /* 1200 */ 24, 118, 594, 620, 600, 84, 455, 620, 620, 43, - /* 1210 */ 404, 218, 3, 539, 156, 599, 414, 621, 113, 239, - /* 1220 */ 592, 592, 592, 591, 590, 14, 155, 407, 620, 537, - /* 1230 */ 451, 247, 444, 592, 592, 592, 591, 590, 14, 343, - /* 1240 */ 410, 111, 410, 277, 620, 410, 402, 410, 507, 110, - /* 1250 */ 10, 64, 204, 336, 435, 413, 565, 413, 620, 276, - /* 1260 */ 413, 434, 413, 620, 600, 83, 600, 95, 334, 600, - /* 1270 */ 82, 600, 81, 150, 620, 488, 40, 41, 270, 268, - /* 1280 */ 266, 191, 332, 42, 412, 411, 599, 410, 594, 241, - /* 1290 */ 620, 410, 264, 620, 620, 620, 33, 404, 419, 3, - /* 1300 */ 107, 229, 413, 414, 621, 149, 413, 620, 397, 181, - /* 1310 */ 259, 600, 70, 398, 407, 600, 17, 315, 314, 592, - /* 1320 */ 592, 592, 591, 590, 14, 620, 127, 361, 624, 217, - /* 1330 */ 462, 461, 354, 402, 304, 303, 302, 179, 300, 254, - /* 1340 */ 614, 453, 620, 565, 454, 620, 620, 620, 613, 612, - /* 1350 */ 443, 416, 180, 246, 620, 151, 415, 245, 243, 620, - /* 1360 */ 178, 598, 242, 40, 41, 620, 244, 8, 620, 239, - /* 1370 */ 42, 412, 411, 620, 410, 594, 410, 620, 60, 153, - /* 1380 */ 429, 465, 622, 621, 296, 154, 30, 145, 152, 413, - /* 1390 */ 388, 413, 295, 394, 294, 620, 31, 392, 600, 79, - /* 1400 */ 600, 78, 620, 290, 396, 413, 592, 592, 592, 591, - /* 1410 */ 590, 14, 620, 293, 600, 9, 597, 59, 620, 36, - /* 1420 */ 555, 173, 565, 234, 185, 288, 29, 541, 391, 345, - /* 1430 */ 248, 286, 521, 535, 313, 284, 385, 328, 534, 239, - /* 1440 */ 516, 515, 196, 195, 279, 310, 511, 512, 510, 131, - /* 1450 */ 524, 227, 258, 228, 594, 309, 487, 486, 493, 226, - /* 1460 */ 372, 485, 164, 338, 479, 163, 368, 370, 162, 26, - /* 1470 */ 211, 477, 261, 161, 141, 476, 362, 466, 122, 187, - /* 1480 */ 119, 456, 347, 117, 346, 592, 592, 592, 116, 115, - /* 1490 */ 114, 447, 112, 182, 318, 22, 432, 19, 431, 430, - /* 1500 */ 63, 427, 608, 193, 297, 595, 572, 570, 403, 553, - /* 1510 */ 550, 289, 280, 508, 498, 497, 496, 494, 379, 355, - /* 1520 */ 459, 255, 249, 344, 446, 305, 5, 568, 548, 298, - /* 1530 */ 298, 210, 369, 298, 400, 506, 500, 489, 525, 523, - /* 1540 */ 482, 239, 237, + /* 90 */ 50, 238, 330, 217, 620, 619, 166, 411, 624, 382, + /* 100 */ 379, 378, 7, 491, 590, 584, 200, 199, 198, 58, + /* 110 */ 377, 300, 414, 621, 481, 66, 623, 622, 621, 580, + /* 120 */ 254, 601, 94, 56, 57, 47, 582, 581, 583, 583, + /* 130 */ 54, 54, 55, 55, 55, 55, 671, 53, 53, 53, + /* 140 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 532, + /* 150 */ 226, 506, 507, 133, 177, 139, 284, 385, 279, 384, + /* 160 */ 169, 197, 342, 398, 251, 226, 253, 275, 388, 167, + /* 170 */ 139, 284, 385, 279, 384, 169, 570, 236, 590, 584, + /* 180 */ 672, 240, 275, 157, 620, 619, 554, 437, 51, 51, + /* 190 */ 51, 50, 238, 343, 439, 553, 438, 56, 57, 47, + /* 200 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, + /* 210 */ 465, 53, 53, 53, 53, 52, 52, 51, 51, 51, + /* 220 */ 50, 238, 313, 390, 52, 52, 51, 51, 51, 50, + /* 230 */ 238, 391, 166, 491, 566, 382, 379, 378, 409, 440, + /* 240 */ 579, 579, 252, 440, 607, 66, 377, 513, 621, 49, + /* 250 */ 46, 147, 590, 584, 621, 16, 466, 189, 621, 441, + /* 260 */ 442, 673, 526, 441, 340, 577, 595, 64, 194, 482, + /* 270 */ 434, 56, 57, 47, 582, 581, 583, 583, 54, 54, + /* 280 */ 55, 55, 55, 55, 30, 53, 53, 53, 53, 52, + /* 290 */ 52, 51, 51, 51, 50, 238, 313, 593, 593, 593, + /* 300 */ 387, 578, 606, 493, 259, 351, 258, 411, 1, 623, + /* 310 */ 622, 496, 623, 622, 65, 240, 623, 622, 597, 443, + /* 320 */ 237, 239, 414, 341, 237, 602, 590, 584, 18, 603, + /* 330 */ 166, 601, 87, 382, 379, 378, 67, 623, 622, 38, + /* 340 */ 623, 622, 176, 270, 377, 56, 57, 47, 582, 581, + /* 350 */ 583, 583, 54, 54, 55, 55, 55, 55, 175, 53, + /* 360 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, + /* 370 */ 313, 396, 233, 411, 531, 565, 317, 620, 619, 44, + /* 380 */ 620, 619, 240, 206, 620, 619, 597, 266, 414, 268, + /* 390 */ 409, 597, 579, 579, 352, 184, 505, 601, 73, 533, + /* 400 */ 590, 584, 466, 548, 190, 620, 619, 576, 620, 619, + /* 410 */ 547, 383, 551, 35, 332, 575, 574, 600, 504, 56, + /* 420 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, + /* 430 */ 55, 55, 567, 53, 53, 53, 53, 52, 52, 51, + /* 440 */ 51, 51, 50, 238, 313, 411, 561, 561, 528, 364, + /* 450 */ 259, 351, 258, 183, 361, 549, 524, 374, 411, 597, + /* 460 */ 414, 240, 560, 560, 409, 604, 579, 579, 328, 601, + /* 470 */ 93, 623, 622, 414, 590, 584, 237, 564, 559, 559, + /* 480 */ 520, 402, 601, 87, 409, 210, 579, 579, 168, 421, + /* 490 */ 950, 519, 950, 56, 57, 47, 582, 581, 583, 583, + /* 500 */ 54, 54, 55, 55, 55, 55, 192, 53, 53, 53, + /* 510 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 600, + /* 520 */ 293, 563, 511, 234, 357, 146, 475, 475, 367, 411, + /* 530 */ 562, 411, 358, 542, 425, 171, 411, 215, 144, 620, + /* 540 */ 619, 544, 318, 353, 414, 203, 414, 275, 590, 584, + /* 550 */ 549, 414, 174, 601, 94, 601, 79, 558, 471, 61, + /* 560 */ 601, 79, 421, 949, 350, 949, 34, 56, 57, 47, + /* 570 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, + /* 580 */ 535, 53, 53, 53, 53, 52, 52, 51, 51, 51, + /* 590 */ 50, 238, 313, 307, 424, 394, 272, 49, 46, 147, + /* 600 */ 349, 322, 4, 411, 491, 312, 321, 425, 568, 492, + /* 610 */ 216, 264, 407, 575, 574, 429, 66, 549, 414, 621, + /* 620 */ 540, 602, 590, 584, 13, 603, 621, 601, 72, 12, + /* 630 */ 618, 617, 616, 202, 210, 621, 546, 469, 422, 319, + /* 640 */ 148, 56, 57, 47, 582, 581, 583, 583, 54, 54, + /* 650 */ 55, 55, 55, 55, 338, 53, 53, 53, 53, 52, + /* 660 */ 52, 51, 51, 51, 50, 238, 313, 600, 600, 411, + /* 670 */ 39, 21, 37, 170, 237, 875, 411, 572, 572, 201, + /* 680 */ 144, 473, 538, 331, 414, 474, 143, 146, 630, 628, + /* 690 */ 334, 414, 353, 601, 68, 168, 590, 584, 132, 365, + /* 700 */ 601, 96, 307, 423, 530, 336, 49, 46, 147, 568, + /* 710 */ 406, 216, 549, 360, 529, 56, 57, 47, 582, 581, + /* 720 */ 583, 583, 54, 54, 55, 55, 55, 55, 411, 53, + /* 730 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, + /* 740 */ 313, 411, 605, 414, 484, 510, 172, 422, 597, 318, + /* 750 */ 496, 485, 601, 99, 411, 142, 414, 411, 231, 411, + /* 760 */ 540, 411, 359, 629, 2, 601, 97, 426, 308, 414, + /* 770 */ 590, 584, 414, 20, 414, 621, 414, 621, 601, 106, + /* 780 */ 503, 601, 105, 601, 108, 601, 109, 204, 28, 56, + /* 790 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, + /* 800 */ 55, 55, 411, 53, 53, 53, 53, 52, 52, 51, + /* 810 */ 51, 51, 50, 238, 313, 411, 597, 414, 411, 276, + /* 820 */ 214, 600, 411, 366, 213, 381, 601, 134, 274, 500, + /* 830 */ 414, 167, 130, 414, 621, 411, 354, 414, 376, 601, + /* 840 */ 135, 129, 601, 100, 590, 584, 601, 104, 522, 521, + /* 850 */ 414, 621, 224, 273, 600, 167, 327, 282, 600, 601, + /* 860 */ 103, 468, 521, 56, 57, 47, 582, 581, 583, 583, + /* 870 */ 54, 54, 55, 55, 55, 55, 411, 53, 53, 53, + /* 880 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 411, + /* 890 */ 27, 414, 411, 375, 276, 167, 359, 544, 50, 238, + /* 900 */ 601, 95, 128, 223, 414, 411, 165, 414, 411, 621, + /* 910 */ 411, 621, 612, 601, 102, 372, 601, 76, 590, 584, + /* 920 */ 414, 570, 236, 414, 470, 414, 167, 621, 188, 601, + /* 930 */ 98, 225, 601, 138, 601, 137, 232, 56, 45, 47, + /* 940 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, + /* 950 */ 411, 53, 53, 53, 53, 52, 52, 51, 51, 51, + /* 960 */ 50, 238, 313, 276, 276, 414, 411, 276, 544, 459, + /* 970 */ 359, 171, 209, 479, 601, 136, 628, 334, 621, 621, + /* 980 */ 125, 414, 621, 368, 411, 621, 257, 540, 589, 588, + /* 990 */ 601, 75, 590, 584, 458, 446, 23, 23, 124, 414, + /* 1000 */ 326, 325, 621, 427, 324, 309, 600, 288, 601, 92, + /* 1010 */ 586, 585, 57, 47, 582, 581, 583, 583, 54, 54, + /* 1020 */ 55, 55, 55, 55, 411, 53, 53, 53, 53, 52, + /* 1030 */ 52, 51, 51, 51, 50, 238, 313, 587, 411, 414, + /* 1040 */ 411, 207, 611, 476, 171, 472, 160, 123, 601, 91, + /* 1050 */ 323, 261, 15, 414, 464, 414, 411, 621, 411, 354, + /* 1060 */ 222, 411, 601, 74, 601, 90, 590, 584, 159, 264, + /* 1070 */ 158, 414, 461, 414, 621, 600, 414, 121, 120, 25, + /* 1080 */ 601, 89, 601, 101, 621, 601, 88, 47, 582, 581, + /* 1090 */ 583, 583, 54, 54, 55, 55, 55, 55, 544, 53, + /* 1100 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, + /* 1110 */ 43, 405, 263, 3, 610, 264, 140, 415, 622, 24, + /* 1120 */ 410, 11, 456, 594, 118, 155, 219, 452, 408, 621, + /* 1130 */ 621, 621, 156, 43, 405, 621, 3, 286, 621, 113, + /* 1140 */ 415, 622, 111, 445, 411, 400, 557, 403, 545, 10, + /* 1150 */ 411, 408, 264, 110, 205, 436, 541, 566, 453, 414, + /* 1160 */ 621, 621, 63, 621, 435, 414, 411, 621, 601, 94, + /* 1170 */ 403, 621, 411, 337, 601, 86, 150, 40, 41, 534, + /* 1180 */ 566, 414, 242, 264, 42, 413, 412, 414, 600, 595, + /* 1190 */ 601, 85, 191, 333, 107, 451, 601, 84, 621, 539, + /* 1200 */ 40, 41, 420, 230, 411, 149, 316, 42, 413, 412, + /* 1210 */ 398, 127, 595, 315, 621, 399, 278, 625, 181, 414, + /* 1220 */ 593, 593, 593, 592, 591, 14, 450, 411, 601, 71, + /* 1230 */ 240, 621, 43, 405, 264, 3, 615, 180, 264, 415, + /* 1240 */ 622, 614, 414, 593, 593, 593, 592, 591, 14, 621, + /* 1250 */ 408, 601, 70, 621, 417, 33, 405, 613, 3, 411, + /* 1260 */ 264, 411, 415, 622, 418, 626, 178, 509, 8, 403, + /* 1270 */ 241, 416, 126, 408, 414, 621, 414, 449, 208, 566, + /* 1280 */ 240, 221, 621, 601, 83, 601, 82, 599, 297, 277, + /* 1290 */ 296, 30, 403, 31, 395, 264, 295, 397, 489, 40, + /* 1300 */ 41, 411, 566, 220, 621, 294, 42, 413, 412, 271, + /* 1310 */ 621, 595, 600, 621, 59, 60, 414, 269, 267, 623, + /* 1320 */ 622, 36, 40, 41, 621, 601, 81, 598, 235, 42, + /* 1330 */ 413, 412, 621, 621, 595, 265, 344, 411, 248, 556, + /* 1340 */ 173, 185, 593, 593, 593, 592, 591, 14, 218, 29, + /* 1350 */ 621, 543, 414, 305, 304, 303, 179, 301, 411, 566, + /* 1360 */ 454, 601, 80, 289, 335, 593, 593, 593, 592, 591, + /* 1370 */ 14, 411, 287, 414, 151, 392, 246, 260, 411, 196, + /* 1380 */ 195, 523, 601, 69, 411, 245, 414, 526, 537, 285, + /* 1390 */ 389, 595, 621, 414, 536, 601, 17, 362, 153, 414, + /* 1400 */ 466, 463, 601, 78, 154, 414, 462, 152, 601, 77, + /* 1410 */ 355, 255, 621, 455, 601, 9, 621, 386, 444, 517, + /* 1420 */ 247, 621, 593, 593, 593, 621, 621, 244, 621, 243, + /* 1430 */ 430, 518, 292, 621, 329, 621, 145, 393, 280, 513, + /* 1440 */ 291, 131, 621, 514, 621, 621, 311, 621, 259, 346, + /* 1450 */ 249, 621, 621, 229, 314, 621, 228, 512, 227, 240, + /* 1460 */ 494, 488, 310, 164, 487, 486, 373, 480, 163, 262, + /* 1470 */ 369, 371, 162, 26, 212, 478, 477, 161, 141, 363, + /* 1480 */ 467, 122, 339, 187, 119, 348, 347, 117, 116, 115, + /* 1490 */ 114, 112, 182, 457, 320, 22, 433, 432, 448, 19, + /* 1500 */ 609, 431, 428, 62, 193, 596, 573, 298, 555, 552, + /* 1510 */ 571, 404, 290, 380, 498, 510, 495, 306, 281, 499, + /* 1520 */ 250, 5, 497, 460, 345, 447, 569, 550, 238, 299, + /* 1530 */ 527, 525, 508, 961, 502, 501, 961, 401, 961, 211, + /* 1540 */ 490, 356, 256, 961, 483, 961, 961, 961, 961, 961, + /* 1550 */ 961, 961, 961, 961, 961, 961, 370, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 19, 222, 223, 224, 225, 24, 1, 26, 77, 78, - /* 10 */ 79, 80, 15, 82, 83, 84, 85, 86, 87, 88, - /* 20 */ 89, 90, 91, 92, 7, 8, 9, 26, 27, 23, - /* 30 */ 49, 50, 81, 82, 83, 84, 85, 86, 87, 88, - /* 40 */ 89, 90, 91, 92, 88, 89, 90, 91, 92, 68, + /* 0 */ 19, 142, 143, 144, 145, 24, 1, 26, 77, 78, + /* 10 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + /* 20 */ 89, 90, 91, 92, 15, 98, 26, 27, 7, 8, + /* 30 */ 49, 50, 77, 78, 79, 80, 109, 82, 83, 84, + /* 40 */ 85, 86, 87, 88, 89, 90, 91, 92, 22, 68, /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - /* 60 */ 79, 80, 22, 82, 83, 84, 85, 86, 87, 88, - /* 70 */ 89, 90, 91, 92, 19, 94, 222, 19, 224, 225, + /* 60 */ 79, 80, 23, 82, 83, 84, 85, 86, 87, 88, + /* 70 */ 89, 90, 91, 92, 19, 94, 112, 19, 114, 115, /* 80 */ 25, 82, 83, 84, 85, 86, 87, 88, 89, 90, - /* 90 */ 91, 92, 19, 26, 27, 94, 95, 96, 244, 25, - /* 100 */ 99, 100, 101, 25, 49, 50, 19, 150, 96, 54, - /* 110 */ 109, 99, 100, 101, 27, 158, 26, 27, 161, 162, - /* 120 */ 117, 109, 165, 68, 69, 70, 71, 72, 73, 74, - /* 130 */ 75, 76, 77, 78, 79, 80, 16, 82, 83, 84, - /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 111, - /* 150 */ 92, 113, 114, 24, 96, 97, 98, 99, 100, 101, - /* 160 */ 102, 94, 95, 112, 25, 92, 108, 116, 150, 95, + /* 90 */ 91, 92, 19, 22, 94, 95, 96, 150, 150, 99, + /* 100 */ 100, 101, 76, 150, 49, 50, 105, 106, 107, 54, + /* 110 */ 110, 158, 165, 165, 161, 162, 26, 27, 165, 113, + /* 120 */ 16, 174, 175, 68, 69, 70, 71, 72, 73, 74, + /* 130 */ 75, 76, 77, 78, 79, 80, 118, 82, 83, 84, + /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 23, + /* 150 */ 92, 97, 98, 24, 96, 97, 98, 99, 100, 101, + /* 160 */ 102, 25, 97, 216, 60, 92, 62, 109, 221, 25, /* 170 */ 97, 98, 99, 100, 101, 102, 86, 87, 49, 50, - /* 180 */ 60, 108, 62, 165, 94, 95, 119, 97, 170, 171, - /* 190 */ 50, 26, 27, 119, 104, 105, 118, 68, 69, 70, + /* 180 */ 118, 116, 109, 25, 94, 95, 32, 97, 88, 89, + /* 190 */ 90, 91, 92, 128, 104, 41, 106, 68, 69, 70, /* 200 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - /* 210 */ 22, 82, 83, 84, 85, 86, 87, 88, 89, 90, - /* 220 */ 91, 92, 19, 98, 86, 87, 88, 89, 90, 91, - /* 230 */ 92, 150, 23, 108, 25, 96, 150, 66, 99, 100, - /* 240 */ 101, 26, 161, 162, 104, 24, 165, 26, 109, 231, - /* 250 */ 232, 165, 49, 50, 22, 23, 170, 171, 138, 94, - /* 260 */ 95, 169, 170, 171, 76, 94, 185, 186, 22, 98, - /* 270 */ 24, 68, 69, 70, 71, 72, 73, 74, 75, 76, - /* 280 */ 77, 78, 79, 80, 119, 82, 83, 84, 85, 86, - /* 290 */ 87, 88, 89, 90, 91, 92, 19, 150, 11, 67, - /* 300 */ 129, 130, 131, 117, 95, 150, 22, 160, 150, 94, - /* 310 */ 26, 27, 165, 22, 23, 94, 25, 231, 232, 23, - /* 320 */ 165, 174, 175, 165, 232, 32, 49, 50, 119, 174, - /* 330 */ 175, 22, 174, 175, 41, 26, 27, 57, 166, 136, - /* 340 */ 222, 194, 224, 225, 57, 68, 69, 70, 71, 72, - /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 67, 82, + /* 210 */ 11, 82, 83, 84, 85, 86, 87, 88, 89, 90, + /* 220 */ 91, 92, 19, 19, 86, 87, 88, 89, 90, 91, + /* 230 */ 92, 27, 96, 150, 66, 99, 100, 101, 112, 150, + /* 240 */ 114, 115, 138, 150, 161, 162, 110, 103, 165, 222, + /* 250 */ 223, 224, 49, 50, 165, 22, 57, 24, 165, 170, + /* 260 */ 171, 118, 94, 170, 171, 23, 98, 25, 185, 186, + /* 270 */ 243, 68, 69, 70, 71, 72, 73, 74, 75, 76, + /* 280 */ 77, 78, 79, 80, 126, 82, 83, 84, 85, 86, + /* 290 */ 87, 88, 89, 90, 91, 92, 19, 129, 130, 131, + /* 300 */ 88, 23, 172, 173, 105, 106, 107, 150, 22, 26, + /* 310 */ 27, 181, 26, 27, 22, 116, 26, 27, 26, 230, + /* 320 */ 231, 197, 165, 230, 231, 113, 49, 50, 204, 117, + /* 330 */ 96, 174, 175, 99, 100, 101, 22, 26, 27, 136, + /* 340 */ 26, 27, 118, 16, 110, 68, 69, 70, 71, 72, + /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 118, 82, /* 360 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - /* 370 */ 19, 216, 214, 215, 23, 23, 221, 205, 94, 95, - /* 380 */ 172, 173, 12, 49, 50, 105, 106, 26, 27, 181, - /* 390 */ 23, 19, 105, 106, 222, 115, 224, 225, 28, 27, - /* 400 */ 49, 50, 115, 94, 95, 71, 72, 111, 128, 113, - /* 410 */ 114, 117, 160, 136, 44, 128, 46, 26, 27, 68, + /* 370 */ 19, 214, 215, 150, 23, 23, 155, 94, 95, 22, + /* 380 */ 94, 95, 116, 160, 94, 95, 94, 60, 165, 62, + /* 390 */ 112, 26, 114, 115, 128, 23, 36, 174, 175, 88, + /* 400 */ 49, 50, 57, 120, 22, 94, 95, 23, 94, 95, + /* 410 */ 120, 51, 25, 136, 169, 170, 171, 194, 58, 68, /* 420 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - /* 430 */ 79, 80, 98, 82, 83, 84, 85, 86, 87, 88, - /* 440 */ 89, 90, 91, 92, 19, 12, 194, 150, 23, 88, - /* 450 */ 23, 7, 8, 105, 106, 94, 95, 23, 150, 25, - /* 460 */ 117, 28, 165, 111, 163, 113, 114, 166, 167, 168, - /* 470 */ 218, 174, 175, 165, 49, 50, 128, 44, 111, 46, - /* 480 */ 113, 114, 174, 175, 21, 94, 95, 235, 22, 23, - /* 490 */ 57, 25, 240, 68, 69, 70, 71, 72, 73, 74, - /* 500 */ 75, 76, 77, 78, 79, 80, 117, 82, 83, 84, - /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150, - /* 520 */ 25, 150, 23, 226, 216, 19, 63, 150, 150, 150, - /* 530 */ 161, 162, 150, 67, 165, 150, 165, 23, 111, 25, - /* 540 */ 113, 114, 165, 165, 165, 174, 175, 165, 49, 50, - /* 550 */ 165, 174, 175, 174, 175, 197, 50, 22, 23, 174, - /* 560 */ 175, 160, 204, 100, 169, 170, 171, 68, 69, 70, + /* 430 */ 79, 80, 23, 82, 83, 84, 85, 86, 87, 88, + /* 440 */ 89, 90, 91, 92, 19, 150, 12, 12, 23, 228, + /* 450 */ 105, 106, 107, 23, 233, 25, 165, 19, 150, 94, + /* 460 */ 165, 116, 28, 28, 112, 174, 114, 115, 108, 174, + /* 470 */ 175, 26, 27, 165, 49, 50, 231, 11, 44, 44, + /* 480 */ 46, 46, 174, 175, 112, 160, 114, 115, 50, 22, + /* 490 */ 23, 57, 25, 68, 69, 70, 71, 72, 73, 74, + /* 500 */ 75, 76, 77, 78, 79, 80, 119, 82, 83, 84, + /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 194, + /* 520 */ 225, 23, 23, 215, 19, 95, 105, 106, 107, 150, + /* 530 */ 23, 150, 27, 23, 67, 25, 150, 206, 207, 94, + /* 540 */ 95, 166, 104, 218, 165, 22, 165, 109, 49, 50, + /* 550 */ 120, 165, 25, 174, 175, 174, 175, 23, 21, 234, + /* 560 */ 174, 175, 22, 23, 239, 25, 25, 68, 69, 70, /* 570 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - /* 580 */ 112, 82, 83, 84, 85, 86, 87, 88, 89, 90, - /* 590 */ 91, 92, 19, 22, 215, 194, 23, 220, 97, 30, - /* 600 */ 150, 138, 67, 34, 36, 220, 150, 206, 207, 22, - /* 610 */ 104, 181, 182, 26, 108, 165, 115, 48, 188, 51, - /* 620 */ 125, 165, 49, 50, 174, 175, 58, 232, 127, 23, - /* 630 */ 174, 175, 105, 106, 160, 142, 143, 144, 145, 23, - /* 640 */ 16, 68, 69, 70, 71, 72, 73, 74, 75, 76, - /* 650 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, - /* 660 */ 87, 88, 89, 90, 91, 92, 19, 150, 194, 165, - /* 670 */ 150, 24, 22, 150, 150, 107, 150, 22, 174, 175, - /* 680 */ 88, 94, 165, 23, 60, 165, 62, 150, 165, 165, - /* 690 */ 11, 165, 218, 35, 174, 175, 49, 50, 174, 175, - /* 700 */ 174, 175, 165, 25, 112, 0, 1, 2, 116, 25, - /* 710 */ 193, 174, 175, 23, 240, 68, 69, 70, 71, 72, + /* 580 */ 205, 82, 83, 84, 85, 86, 87, 88, 89, 90, + /* 590 */ 91, 92, 19, 22, 23, 216, 23, 222, 223, 224, + /* 600 */ 63, 220, 35, 150, 150, 163, 220, 67, 166, 167, + /* 610 */ 168, 150, 169, 170, 171, 161, 162, 25, 165, 165, + /* 620 */ 150, 113, 49, 50, 25, 117, 165, 174, 175, 35, + /* 630 */ 7, 8, 9, 160, 160, 165, 120, 100, 67, 247, + /* 640 */ 248, 68, 69, 70, 71, 72, 73, 74, 75, 76, + /* 650 */ 77, 78, 79, 80, 193, 82, 83, 84, 85, 86, + /* 660 */ 87, 88, 89, 90, 91, 92, 19, 194, 194, 150, + /* 670 */ 135, 24, 137, 35, 231, 138, 150, 129, 130, 206, + /* 680 */ 207, 30, 27, 213, 165, 34, 118, 95, 0, 1, + /* 690 */ 2, 165, 218, 174, 175, 50, 49, 50, 22, 48, + /* 700 */ 174, 175, 22, 23, 23, 244, 222, 223, 224, 166, + /* 710 */ 167, 168, 120, 239, 23, 68, 69, 70, 71, 72, /* 720 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82, /* 730 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - /* 740 */ 19, 150, 23, 165, 25, 166, 167, 168, 97, 98, - /* 750 */ 155, 23, 174, 175, 150, 25, 165, 150, 35, 150, - /* 760 */ 150, 150, 245, 150, 241, 174, 175, 129, 130, 165, - /* 770 */ 49, 50, 165, 52, 165, 165, 165, 23, 165, 25, - /* 780 */ 25, 174, 175, 174, 175, 174, 175, 248, 249, 68, + /* 740 */ 19, 150, 173, 165, 181, 182, 24, 67, 26, 104, + /* 750 */ 181, 188, 174, 175, 150, 39, 165, 150, 52, 150, + /* 760 */ 150, 150, 150, 144, 145, 174, 175, 249, 250, 165, + /* 770 */ 49, 50, 165, 52, 165, 165, 165, 165, 174, 175, + /* 780 */ 29, 174, 175, 174, 175, 174, 175, 160, 22, 68, /* 790 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, /* 800 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88, - /* 810 */ 89, 90, 91, 92, 19, 150, 150, 165, 150, 150, - /* 820 */ 150, 217, 150, 213, 229, 119, 174, 175, 22, 234, - /* 830 */ 165, 165, 165, 165, 165, 165, 150, 165, 35, 174, - /* 840 */ 175, 174, 174, 175, 49, 50, 174, 175, 23, 27, - /* 850 */ 25, 165, 117, 187, 241, 22, 187, 187, 103, 23, - /* 860 */ 174, 175, 23, 68, 69, 70, 71, 72, 73, 74, + /* 810 */ 89, 90, 91, 92, 19, 150, 94, 165, 150, 150, + /* 820 */ 160, 194, 150, 213, 160, 52, 174, 175, 23, 23, + /* 830 */ 165, 25, 22, 165, 165, 150, 150, 165, 52, 174, + /* 840 */ 175, 22, 174, 175, 49, 50, 174, 175, 190, 191, + /* 850 */ 165, 165, 240, 23, 194, 25, 187, 109, 194, 174, + /* 860 */ 175, 190, 191, 68, 69, 70, 71, 72, 73, 74, /* 870 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84, /* 880 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150, - /* 890 */ 150, 165, 150, 23, 150, 25, 23, 135, 25, 137, - /* 900 */ 174, 175, 206, 207, 165, 165, 39, 165, 150, 165, - /* 910 */ 150, 150, 115, 174, 175, 52, 174, 175, 49, 50, - /* 920 */ 23, 150, 25, 165, 127, 165, 165, 187, 23, 29, - /* 930 */ 25, 187, 174, 175, 174, 175, 165, 68, 69, 70, + /* 890 */ 22, 165, 150, 23, 150, 25, 150, 166, 91, 92, + /* 900 */ 174, 175, 22, 217, 165, 150, 102, 165, 150, 165, + /* 910 */ 150, 165, 150, 174, 175, 19, 174, 175, 49, 50, + /* 920 */ 165, 86, 87, 165, 23, 165, 25, 165, 24, 174, + /* 930 */ 175, 187, 174, 175, 174, 175, 205, 68, 69, 70, /* 940 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 950 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90, - /* 960 */ 91, 92, 19, 150, 193, 165, 150, 23, 150, 25, - /* 970 */ 160, 160, 160, 52, 174, 175, 190, 191, 165, 22, - /* 980 */ 150, 165, 150, 165, 150, 144, 145, 174, 175, 23, - /* 990 */ 174, 175, 49, 50, 52, 165, 22, 165, 22, 165, - /* 1000 */ 250, 251, 241, 22, 194, 194, 194, 108, 174, 175, - /* 1010 */ 19, 193, 69, 70, 71, 72, 73, 74, 75, 76, + /* 960 */ 91, 92, 19, 150, 150, 165, 150, 150, 166, 23, + /* 970 */ 150, 25, 160, 20, 174, 175, 1, 2, 165, 165, + /* 980 */ 104, 165, 165, 43, 150, 165, 240, 150, 49, 50, + /* 990 */ 174, 175, 49, 50, 23, 23, 25, 25, 53, 165, + /* 1000 */ 187, 187, 165, 23, 187, 25, 194, 205, 174, 175, + /* 1010 */ 71, 72, 69, 70, 71, 72, 73, 74, 75, 76, /* 1020 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, - /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 150, 150, 165, - /* 1040 */ 150, 150, 150, 213, 160, 213, 160, 166, 174, 175, - /* 1050 */ 91, 92, 165, 165, 150, 165, 165, 165, 150, 166, - /* 1060 */ 102, 174, 175, 24, 174, 175, 49, 50, 20, 165, - /* 1070 */ 190, 191, 104, 165, 86, 87, 166, 43, 194, 59, - /* 1080 */ 194, 193, 174, 175, 193, 193, 205, 70, 71, 72, - /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 205, 82, + /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 98, 150, 165, + /* 1040 */ 150, 160, 150, 59, 25, 53, 104, 22, 174, 175, + /* 1050 */ 213, 138, 5, 165, 1, 165, 150, 165, 150, 150, + /* 1060 */ 240, 150, 174, 175, 174, 175, 49, 50, 118, 150, + /* 1070 */ 35, 165, 27, 165, 165, 194, 165, 108, 127, 76, + /* 1080 */ 174, 175, 174, 175, 165, 174, 175, 70, 71, 72, + /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 166, 82, /* 1100 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - /* 1110 */ 19, 20, 150, 22, 150, 205, 138, 26, 27, 150, - /* 1120 */ 150, 1, 2, 19, 20, 150, 22, 165, 37, 165, - /* 1130 */ 26, 27, 25, 150, 165, 165, 174, 175, 174, 175, - /* 1140 */ 165, 37, 53, 150, 150, 173, 150, 56, 165, 174, - /* 1150 */ 175, 150, 53, 181, 104, 22, 150, 66, 165, 165, - /* 1160 */ 56, 165, 193, 5, 1, 27, 165, 146, 147, 117, - /* 1170 */ 66, 165, 150, 152, 35, 154, 193, 86, 87, 88, - /* 1180 */ 150, 160, 107, 126, 93, 94, 95, 165, 150, 98, - /* 1190 */ 86, 87, 150, 150, 76, 165, 22, 93, 94, 95, - /* 1200 */ 76, 118, 98, 165, 174, 175, 1, 165, 165, 19, - /* 1210 */ 20, 217, 22, 150, 16, 194, 26, 27, 118, 115, - /* 1220 */ 129, 130, 131, 132, 133, 134, 120, 37, 165, 150, - /* 1230 */ 20, 193, 127, 129, 130, 131, 132, 133, 134, 218, - /* 1240 */ 150, 107, 150, 150, 165, 150, 56, 150, 150, 126, - /* 1250 */ 22, 16, 160, 65, 23, 165, 66, 165, 165, 150, - /* 1260 */ 165, 23, 165, 165, 174, 175, 174, 175, 247, 174, - /* 1270 */ 175, 174, 175, 15, 165, 150, 86, 87, 150, 150, - /* 1280 */ 150, 22, 3, 93, 94, 95, 194, 150, 98, 140, - /* 1290 */ 165, 150, 150, 165, 165, 165, 19, 20, 4, 22, - /* 1300 */ 164, 180, 165, 26, 27, 249, 165, 165, 216, 6, - /* 1310 */ 150, 174, 175, 221, 37, 174, 175, 252, 252, 129, - /* 1320 */ 130, 131, 132, 133, 134, 165, 180, 150, 149, 5, - /* 1330 */ 150, 150, 150, 56, 10, 11, 12, 13, 14, 150, - /* 1340 */ 149, 17, 165, 66, 150, 165, 165, 165, 149, 13, - /* 1350 */ 150, 149, 151, 150, 165, 31, 159, 33, 150, 165, - /* 1360 */ 151, 194, 150, 86, 87, 165, 42, 25, 165, 115, - /* 1370 */ 93, 94, 95, 165, 150, 98, 150, 165, 22, 55, - /* 1380 */ 150, 57, 26, 27, 199, 61, 125, 150, 64, 165, - /* 1390 */ 150, 165, 200, 122, 201, 165, 123, 150, 174, 175, - /* 1400 */ 174, 175, 165, 150, 121, 165, 129, 130, 131, 132, - /* 1410 */ 133, 134, 165, 202, 174, 175, 203, 124, 165, 135, - /* 1420 */ 157, 117, 66, 227, 157, 210, 104, 211, 120, 105, - /* 1430 */ 106, 210, 176, 211, 110, 210, 104, 47, 211, 115, - /* 1440 */ 176, 184, 86, 87, 176, 179, 103, 178, 176, 22, - /* 1450 */ 94, 92, 128, 230, 98, 179, 176, 176, 184, 230, - /* 1460 */ 18, 176, 156, 139, 157, 156, 45, 157, 156, 135, - /* 1470 */ 157, 157, 238, 156, 68, 239, 157, 189, 189, 219, - /* 1480 */ 22, 199, 157, 192, 18, 129, 130, 131, 192, 192, - /* 1490 */ 192, 199, 189, 219, 157, 243, 40, 243, 157, 157, - /* 1500 */ 246, 38, 153, 196, 198, 166, 233, 233, 228, 177, - /* 1510 */ 177, 209, 177, 182, 177, 166, 177, 166, 178, 242, - /* 1520 */ 199, 242, 209, 209, 199, 148, 196, 166, 208, 195, - /* 1530 */ 195, 236, 237, 195, 191, 183, 183, 186, 174, 174, - /* 1540 */ 186, 115, 92, + /* 1110 */ 19, 20, 193, 22, 150, 150, 150, 26, 27, 76, + /* 1120 */ 150, 22, 1, 150, 119, 121, 217, 20, 37, 165, + /* 1130 */ 165, 165, 16, 19, 20, 165, 22, 205, 165, 119, + /* 1140 */ 26, 27, 108, 128, 150, 150, 150, 56, 150, 22, + /* 1150 */ 150, 37, 150, 127, 160, 23, 150, 66, 193, 165, + /* 1160 */ 165, 165, 16, 165, 23, 165, 150, 165, 174, 175, + /* 1170 */ 56, 165, 150, 65, 174, 175, 15, 86, 87, 88, + /* 1180 */ 66, 165, 140, 150, 93, 94, 95, 165, 194, 98, + /* 1190 */ 174, 175, 22, 3, 164, 193, 174, 175, 165, 150, + /* 1200 */ 86, 87, 4, 180, 150, 248, 251, 93, 94, 95, + /* 1210 */ 216, 180, 98, 251, 165, 221, 150, 149, 6, 165, + /* 1220 */ 129, 130, 131, 132, 133, 134, 193, 150, 174, 175, + /* 1230 */ 116, 165, 19, 20, 150, 22, 149, 151, 150, 26, + /* 1240 */ 27, 149, 165, 129, 130, 131, 132, 133, 134, 165, + /* 1250 */ 37, 174, 175, 165, 149, 19, 20, 13, 22, 150, + /* 1260 */ 150, 150, 26, 27, 146, 147, 151, 150, 25, 56, + /* 1270 */ 152, 159, 154, 37, 165, 165, 165, 193, 160, 66, + /* 1280 */ 116, 193, 165, 174, 175, 174, 175, 194, 199, 150, + /* 1290 */ 200, 126, 56, 124, 123, 150, 201, 122, 150, 86, + /* 1300 */ 87, 150, 66, 193, 165, 202, 93, 94, 95, 150, + /* 1310 */ 165, 98, 194, 165, 125, 22, 165, 150, 150, 26, + /* 1320 */ 27, 135, 86, 87, 165, 174, 175, 203, 226, 93, + /* 1330 */ 94, 95, 165, 165, 98, 150, 218, 150, 193, 157, + /* 1340 */ 118, 157, 129, 130, 131, 132, 133, 134, 5, 104, + /* 1350 */ 165, 211, 165, 10, 11, 12, 13, 14, 150, 66, + /* 1360 */ 17, 174, 175, 210, 246, 129, 130, 131, 132, 133, + /* 1370 */ 134, 150, 210, 165, 31, 121, 33, 150, 150, 86, + /* 1380 */ 87, 176, 174, 175, 150, 42, 165, 94, 211, 210, + /* 1390 */ 150, 98, 165, 165, 211, 174, 175, 150, 55, 165, + /* 1400 */ 57, 150, 174, 175, 61, 165, 150, 64, 174, 175, + /* 1410 */ 150, 150, 165, 150, 174, 175, 165, 104, 150, 184, + /* 1420 */ 150, 165, 129, 130, 131, 165, 165, 150, 165, 150, + /* 1430 */ 150, 176, 150, 165, 47, 165, 150, 150, 176, 103, + /* 1440 */ 150, 22, 165, 178, 165, 165, 179, 165, 105, 106, + /* 1450 */ 107, 165, 165, 229, 111, 165, 92, 176, 229, 116, + /* 1460 */ 184, 176, 179, 156, 176, 176, 18, 157, 156, 237, + /* 1470 */ 45, 157, 156, 135, 157, 157, 238, 156, 68, 157, + /* 1480 */ 189, 189, 139, 219, 22, 157, 18, 192, 192, 192, + /* 1490 */ 192, 189, 219, 199, 157, 242, 40, 157, 199, 242, + /* 1500 */ 153, 157, 38, 245, 196, 166, 232, 198, 177, 177, + /* 1510 */ 232, 227, 209, 178, 166, 182, 166, 148, 177, 177, + /* 1520 */ 209, 196, 177, 199, 209, 199, 166, 208, 92, 195, + /* 1530 */ 174, 174, 183, 252, 183, 183, 252, 191, 252, 235, + /* 1540 */ 186, 241, 241, 252, 186, 252, 252, 252, 252, 252, + /* 1550 */ 252, 252, 252, 252, 252, 252, 236, }; -#define YY_SHIFT_USE_DFLT (-70) -#define YY_SHIFT_COUNT (417) -#define YY_SHIFT_MIN (-69) -#define YY_SHIFT_MAX (1466) +#define YY_SHIFT_USE_DFLT (-74) +#define YY_SHIFT_COUNT (418) +#define YY_SHIFT_MIN (-73) +#define YY_SHIFT_MAX (1468) static const short yy_shift_ofst[] = { - /* 0 */ 1120, 1104, 1324, 1104, 1190, 1190, 90, 90, 1, -19, - /* 10 */ 1190, 1190, 1190, 1190, 1190, 280, 391, 721, 1091, 1190, - /* 20 */ 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, - /* 30 */ 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, - /* 40 */ 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1277, 1190, 1190, - /* 50 */ 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, - /* 60 */ 1190, -49, 287, 391, 391, 988, 988, 215, 1426, 55, - /* 70 */ 647, 573, 499, 425, 351, 277, 203, 129, 795, 795, + /* 0 */ 975, 1114, 1343, 1114, 1213, 1213, 90, 90, 0, -19, + /* 10 */ 1213, 1213, 1213, 1213, 1213, 345, 445, 721, 1091, 1213, + /* 20 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, + /* 30 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, + /* 40 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1236, 1213, 1213, + /* 50 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, + /* 60 */ 1213, 199, 445, 445, 835, 835, 365, 1164, 55, 647, + /* 70 */ 573, 499, 425, 351, 277, 203, 129, 795, 795, 795, /* 80 */ 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, - /* 90 */ 795, 795, 795, 795, 795, 795, 869, 795, 943, 1017, - /* 100 */ 1017, -69, -69, -69, -69, -1, -1, 58, 138, -44, - /* 110 */ 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - /* 120 */ 391, 391, 391, 391, 391, 391, 463, 506, 391, 391, - /* 130 */ 391, 391, 391, 215, 959, 1450, -70, -70, -70, 1356, - /* 140 */ 73, 433, 433, 361, 309, 165, 67, 284, 466, 291, - /* 150 */ 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - /* 160 */ 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - /* 170 */ 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - /* 180 */ 391, 391, 501, 221, 221, 221, 705, 797, 1426, 1426, - /* 190 */ 1426, -70, -70, -70, 139, 171, 171, 12, 568, 568, - /* 200 */ 209, 427, 370, 367, 352, 296, 38, 38, 38, 38, - /* 210 */ 348, 569, 38, 38, 74, 587, 592, 17, 495, 87, - /* 220 */ 87, 372, 495, 372, 755, 215, 293, 215, 293, 140, - /* 230 */ 293, 87, 293, 293, 762, 638, 638, 215, 78, 51, - /* 240 */ 246, 1463, 1304, 1304, 1456, 1456, 1304, 1458, 1406, 1261, - /* 250 */ 1466, 1466, 1466, 1466, 1304, 1261, 1458, 1406, 1406, 1304, - /* 260 */ 1442, 1334, 1421, 1304, 1304, 1442, 1304, 1442, 1304, 1442, - /* 270 */ 1427, 1332, 1332, 1332, 1390, 1359, 1359, 1427, 1332, 1343, - /* 280 */ 1332, 1390, 1332, 1332, 1308, 1322, 1308, 1322, 1308, 1322, - /* 290 */ 1304, 1304, 1284, 1293, 1283, 1273, 1271, 1261, 1254, 1342, - /* 300 */ 1336, 1336, 1303, 1303, 1303, 1303, -70, -70, -70, -70, - /* 310 */ -70, -70, 334, 120, 535, 232, 624, 944, 188, 905, - /* 320 */ 897, 873, 870, 825, 754, 719, 651, 527, 444, 125, - /* 330 */ 514, 434, 1294, 1279, 1259, 1149, 1258, 1188, 1235, 1238, - /* 340 */ 1231, 1105, 1228, 1123, 1134, 1100, 1210, 1106, 1198, 1205, - /* 350 */ 1083, 1174, 1057, 1124, 1118, 1075, 1138, 1139, 1052, 1163, - /* 360 */ 1158, 1133, 1050, 978, 1099, 1107, 1089, 1020, 1034, 968, - /* 370 */ 1039, 1048, 991, 899, 958, 981, 942, 976, 974, 966, - /* 380 */ 957, 921, 900, 833, 863, 867, 839, 836, 735, 822, - /* 390 */ 803, 806, 706, 684, 723, 730, 658, 684, 728, 690, - /* 400 */ 678, 660, 655, 679, 650, 616, 606, 571, 468, 389, - /* 410 */ 343, 294, 186, 3, 40, 6, -3, 5, + /* 90 */ 795, 795, 795, 795, 795, 869, 795, 943, 1017, 1017, + /* 100 */ -69, -45, -45, -45, -45, -45, -1, 58, 138, 100, + /* 110 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, + /* 120 */ 445, 445, 445, 445, 445, 445, 537, 438, 445, 445, + /* 130 */ 445, 445, 445, 365, 807, 1436, -74, -74, -74, 1293, + /* 140 */ 73, 434, 434, 311, 314, 290, 283, 286, 540, 467, + /* 150 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, + /* 160 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, + /* 170 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, + /* 180 */ 445, 445, 65, 722, 722, 722, 688, 266, 1164, 1164, + /* 190 */ 1164, -74, -74, -74, 136, 168, 168, 234, 360, 360, + /* 200 */ 360, 430, 372, 435, 352, 278, 126, -36, -36, -36, + /* 210 */ -36, 421, 651, -36, -36, 592, 292, 212, 623, 158, + /* 220 */ 204, 204, 505, 158, 505, 144, 365, 154, 365, 154, + /* 230 */ 645, 154, 204, 154, 154, 535, 548, 548, 365, 387, + /* 240 */ 508, 233, 1464, 1222, 1222, 1456, 1456, 1222, 1462, 1410, + /* 250 */ 1165, 1468, 1468, 1468, 1468, 1222, 1165, 1462, 1410, 1410, + /* 260 */ 1222, 1448, 1338, 1425, 1222, 1222, 1448, 1222, 1448, 1222, + /* 270 */ 1448, 1419, 1313, 1313, 1313, 1387, 1364, 1364, 1419, 1313, + /* 280 */ 1336, 1313, 1387, 1313, 1313, 1254, 1245, 1254, 1245, 1254, + /* 290 */ 1245, 1222, 1222, 1186, 1189, 1175, 1169, 1171, 1165, 1164, + /* 300 */ 1243, 1244, 1244, 1212, 1212, 1212, 1212, -74, -74, -74, + /* 310 */ -74, -74, -74, 939, 104, 680, 571, 327, 1, 980, + /* 320 */ 26, 972, 971, 946, 901, 870, 830, 806, 54, 21, + /* 330 */ -73, 510, 242, 1198, 1190, 1170, 1042, 1161, 1108, 1146, + /* 340 */ 1141, 1132, 1015, 1127, 1026, 1034, 1020, 1107, 1004, 1116, + /* 350 */ 1121, 1005, 1099, 951, 1043, 1003, 969, 1045, 1035, 950, + /* 360 */ 1053, 1047, 1025, 942, 913, 992, 1019, 945, 984, 940, + /* 370 */ 876, 904, 953, 896, 748, 804, 880, 786, 868, 819, + /* 380 */ 805, 810, 773, 751, 766, 706, 716, 691, 681, 568, + /* 390 */ 655, 638, 676, 516, 541, 594, 599, 567, 541, 534, + /* 400 */ 507, 527, 498, 523, 466, 382, 409, 384, 357, 6, + /* 410 */ 240, 224, 143, 62, 18, 71, 39, 9, 5, }; -#define YY_REDUCE_USE_DFLT (-222) -#define YY_REDUCE_COUNT (311) -#define YY_REDUCE_MIN (-221) -#define YY_REDUCE_MAX (1377) +#define YY_REDUCE_USE_DFLT (-142) +#define YY_REDUCE_COUNT (312) +#define YY_REDUCE_MIN (-141) +#define YY_REDUCE_MAX (1369) static const short yy_reduce_ofst[] = { - /* 0 */ 493, 1092, 1021, 147, 158, 155, 86, 18, 81, 172, - /* 10 */ 385, 377, 308, 379, 297, 252, -43, -146, 1240, 1226, - /* 20 */ 1224, 1141, 1137, 1097, 1095, 1090, 1030, 975, 964, 962, - /* 30 */ 908, 890, 887, 874, 834, 816, 813, 800, 760, 758, - /* 40 */ 742, 739, 726, 686, 672, 668, 665, 652, 611, 609, - /* 50 */ 607, 591, 578, 537, 526, 524, 520, 504, 456, 450, - /* 60 */ 371, -221, 474, 369, 517, 395, 92, 301, 401, 118, - /* 70 */ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - /* 80 */ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - /* 90 */ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - /* 100 */ 118, 118, 118, 118, 118, 118, 118, 208, 118, 118, - /* 110 */ 1038, 994, 983, 969, 892, 891, 888, 818, 761, 832, - /* 120 */ 613, 604, 523, 744, 830, 771, 595, 430, 740, 670, - /* 130 */ 669, 666, 610, 579, 118, 118, 118, 118, 118, 667, - /* 140 */ 972, 880, 786, 996, 1253, 1247, 1237, 1001, 750, 750, - /* 150 */ 1230, 1212, 1208, 1203, 1200, 1194, 1189, 1182, 1181, 1180, - /* 160 */ 1177, 1160, 1142, 1130, 1129, 1128, 1125, 1109, 1098, 1093, - /* 170 */ 1079, 1063, 1043, 1042, 1022, 1006, 996, 993, 970, 904, - /* 180 */ 382, 378, 886, 910, 893, 881, 841, 884, 812, 811, - /* 190 */ 810, 539, 696, 358, 1354, 1365, 1364, 1351, 1353, 1352, - /* 200 */ 1320, 1338, 1343, 1338, 1338, 1338, 1338, 1338, 1338, 1338, - /* 210 */ 1295, 1295, 1335, 1334, 1320, 1361, 1330, 1377, 1325, 1314, - /* 220 */ 1313, 1279, 1321, 1277, 1340, 1351, 1339, 1349, 1337, 1331, - /* 230 */ 1335, 1302, 1333, 1332, 1280, 1274, 1273, 1339, 1306, 1307, - /* 240 */ 1349, 1254, 1342, 1341, 1254, 1252, 1337, 1274, 1303, 1292, - /* 250 */ 1298, 1297, 1296, 1291, 1325, 1282, 1260, 1289, 1288, 1319, - /* 260 */ 1317, 1236, 1234, 1314, 1313, 1312, 1310, 1309, 1307, 1306, - /* 270 */ 1276, 1285, 1281, 1280, 1274, 1229, 1223, 1266, 1272, 1269, - /* 280 */ 1268, 1257, 1264, 1256, 1227, 1225, 1222, 1221, 1216, 1215, - /* 290 */ 1267, 1263, 1196, 1213, 1211, 1193, 1192, 1185, 1167, 1197, - /* 300 */ 1209, 1201, 1202, 1199, 1191, 1179, 1066, 1065, 1056, 1146, - /* 310 */ 1121, 1136, + /* 0 */ -141, 994, 1118, 223, 157, -53, 93, 89, 83, 375, + /* 10 */ 386, 381, 379, 308, 295, 325, -47, 27, 1240, 1234, + /* 20 */ 1228, 1221, 1208, 1187, 1151, 1111, 1109, 1077, 1054, 1022, + /* 30 */ 1016, 1000, 911, 908, 906, 890, 888, 874, 834, 816, + /* 40 */ 800, 760, 758, 755, 742, 739, 726, 685, 672, 668, + /* 50 */ 665, 652, 611, 609, 607, 604, 591, 578, 526, 519, + /* 60 */ 453, 474, 454, 461, 443, 245, 442, 473, 484, 484, + /* 70 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, + /* 80 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, + /* 90 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, + /* 100 */ 484, 484, 484, 484, 484, 484, 484, 130, 484, 484, + /* 110 */ 1145, 909, 1110, 1088, 1084, 1033, 1002, 965, 820, 837, + /* 120 */ 746, 686, 612, 817, 610, 919, 221, 563, 814, 813, + /* 130 */ 744, 669, 470, 543, 484, 484, 484, 484, 484, 291, + /* 140 */ 569, 671, 658, 970, 1290, 1287, 1286, 1282, 518, 518, + /* 150 */ 1280, 1279, 1277, 1270, 1268, 1263, 1261, 1260, 1256, 1251, + /* 160 */ 1247, 1227, 1185, 1168, 1167, 1159, 1148, 1139, 1117, 1066, + /* 170 */ 1049, 1006, 998, 996, 995, 973, 970, 966, 964, 892, + /* 180 */ 762, -52, 881, 932, 802, 731, 619, 812, 664, 660, + /* 190 */ 627, 392, 331, 124, 1358, 1357, 1356, 1354, 1352, 1351, + /* 200 */ 1349, 1319, 1334, 1346, 1334, 1334, 1334, 1334, 1334, 1334, + /* 210 */ 1334, 1320, 1304, 1334, 1334, 1319, 1360, 1325, 1369, 1326, + /* 220 */ 1315, 1311, 1301, 1324, 1300, 1335, 1350, 1345, 1348, 1342, + /* 230 */ 1333, 1341, 1303, 1332, 1331, 1284, 1278, 1274, 1339, 1309, + /* 240 */ 1308, 1347, 1258, 1344, 1340, 1257, 1253, 1337, 1273, 1302, + /* 250 */ 1299, 1298, 1297, 1296, 1295, 1328, 1294, 1264, 1292, 1291, + /* 260 */ 1322, 1321, 1238, 1232, 1318, 1317, 1316, 1314, 1312, 1310, + /* 270 */ 1307, 1283, 1289, 1288, 1285, 1276, 1229, 1224, 1267, 1281, + /* 280 */ 1265, 1262, 1235, 1255, 1205, 1183, 1179, 1177, 1162, 1140, + /* 290 */ 1153, 1184, 1182, 1102, 1124, 1103, 1095, 1090, 1089, 1093, + /* 300 */ 1112, 1115, 1086, 1105, 1092, 1087, 1068, 962, 955, 957, + /* 310 */ 1031, 1023, 1030, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 634, 869, 958, 958, 958, 869, 898, 898, 958, 757, - /* 10 */ 958, 958, 958, 958, 867, 958, 958, 932, 958, 958, - /* 20 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 30 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 40 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 50 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 60 */ 958, 841, 958, 958, 958, 898, 898, 673, 761, 792, - /* 70 */ 958, 958, 958, 958, 958, 958, 958, 958, 931, 933, - /* 80 */ 807, 806, 800, 799, 911, 772, 797, 790, 783, 794, - /* 90 */ 870, 863, 864, 862, 866, 871, 958, 793, 829, 847, - /* 100 */ 828, 846, 853, 845, 831, 840, 830, 665, 832, 833, - /* 110 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 120 */ 958, 958, 958, 958, 958, 958, 660, 726, 958, 958, - /* 130 */ 958, 958, 958, 958, 834, 835, 850, 849, 848, 958, - /* 140 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 150 */ 958, 938, 936, 958, 882, 958, 958, 958, 958, 958, - /* 160 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 170 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 180 */ 958, 640, 958, 757, 757, 757, 634, 958, 958, 958, - /* 190 */ 958, 950, 761, 751, 717, 958, 958, 958, 958, 958, - /* 200 */ 958, 958, 958, 958, 958, 958, 802, 740, 921, 923, - /* 210 */ 958, 904, 738, 662, 759, 675, 749, 642, 796, 774, - /* 220 */ 774, 916, 796, 916, 699, 958, 786, 958, 786, 696, - /* 230 */ 786, 774, 786, 786, 865, 958, 958, 958, 758, 749, - /* 240 */ 958, 943, 765, 765, 935, 935, 765, 808, 730, 796, - /* 250 */ 737, 737, 737, 737, 765, 796, 808, 730, 730, 765, - /* 260 */ 657, 910, 908, 765, 765, 657, 765, 657, 765, 657, - /* 270 */ 875, 728, 728, 728, 713, 879, 879, 875, 728, 699, - /* 280 */ 728, 713, 728, 728, 778, 773, 778, 773, 778, 773, - /* 290 */ 765, 765, 958, 791, 779, 789, 787, 796, 958, 716, - /* 300 */ 650, 650, 639, 639, 639, 639, 955, 955, 950, 701, - /* 310 */ 701, 683, 958, 958, 958, 958, 958, 958, 884, 958, - /* 320 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 330 */ 958, 958, 958, 635, 945, 958, 958, 942, 958, 958, - /* 340 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 350 */ 958, 958, 958, 958, 958, 958, 958, 958, 914, 958, - /* 360 */ 958, 958, 958, 958, 958, 907, 906, 958, 958, 958, - /* 370 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 380 */ 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, - /* 390 */ 958, 958, 958, 788, 958, 780, 958, 868, 958, 958, - /* 400 */ 958, 958, 958, 958, 958, 958, 958, 958, 743, 817, - /* 410 */ 958, 816, 820, 815, 667, 958, 648, 958, 631, 636, - /* 420 */ 954, 957, 956, 953, 952, 951, 946, 944, 941, 940, - /* 430 */ 939, 937, 934, 930, 888, 886, 893, 892, 891, 890, - /* 440 */ 889, 887, 885, 883, 803, 801, 798, 795, 929, 881, - /* 450 */ 739, 736, 735, 656, 947, 913, 922, 920, 809, 919, - /* 460 */ 918, 917, 915, 912, 899, 805, 804, 731, 873, 872, - /* 470 */ 659, 903, 902, 901, 905, 909, 900, 767, 658, 655, - /* 480 */ 664, 720, 719, 727, 725, 724, 723, 722, 721, 718, - /* 490 */ 666, 674, 685, 712, 698, 697, 878, 880, 877, 876, - /* 500 */ 705, 710, 709, 708, 707, 706, 704, 703, 702, 695, - /* 510 */ 694, 700, 693, 715, 714, 711, 692, 734, 733, 732, - /* 520 */ 729, 691, 690, 689, 820, 688, 687, 826, 825, 813, - /* 530 */ 857, 754, 753, 752, 764, 763, 776, 775, 811, 810, - /* 540 */ 777, 762, 756, 755, 771, 770, 769, 768, 760, 750, - /* 550 */ 782, 785, 784, 781, 842, 859, 766, 856, 928, 927, - /* 560 */ 926, 925, 924, 861, 860, 827, 824, 678, 679, 897, - /* 570 */ 895, 896, 894, 681, 680, 677, 676, 858, 745, 744, - /* 580 */ 854, 851, 843, 838, 855, 852, 844, 839, 837, 836, - /* 590 */ 822, 821, 819, 818, 814, 823, 669, 746, 742, 741, - /* 600 */ 812, 748, 747, 686, 684, 682, 663, 661, 654, 652, - /* 610 */ 651, 653, 649, 647, 646, 645, 644, 643, 672, 671, - /* 620 */ 670, 668, 667, 641, 638, 637, 633, 632, 630, + /* 0 */ 635, 870, 959, 959, 959, 870, 899, 899, 959, 759, + /* 10 */ 959, 959, 959, 959, 868, 959, 959, 933, 959, 959, + /* 20 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 30 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 40 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 50 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 60 */ 959, 959, 959, 959, 899, 899, 674, 763, 794, 959, + /* 70 */ 959, 959, 959, 959, 959, 959, 959, 932, 934, 809, + /* 80 */ 808, 802, 801, 912, 774, 799, 792, 785, 796, 871, + /* 90 */ 864, 865, 863, 867, 872, 959, 795, 831, 848, 830, + /* 100 */ 842, 847, 854, 846, 843, 833, 832, 666, 834, 835, + /* 110 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 120 */ 959, 959, 959, 959, 959, 959, 661, 728, 959, 959, + /* 130 */ 959, 959, 959, 959, 836, 837, 851, 850, 849, 959, + /* 140 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 150 */ 959, 939, 937, 959, 883, 959, 959, 959, 959, 959, + /* 160 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 170 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 180 */ 959, 641, 959, 759, 759, 759, 635, 959, 959, 959, + /* 190 */ 959, 951, 763, 753, 719, 959, 959, 959, 959, 959, + /* 200 */ 959, 959, 959, 959, 959, 959, 959, 804, 742, 922, + /* 210 */ 924, 959, 905, 740, 663, 761, 676, 751, 643, 798, + /* 220 */ 776, 776, 917, 798, 917, 700, 959, 788, 959, 788, + /* 230 */ 697, 788, 776, 788, 788, 866, 959, 959, 959, 760, + /* 240 */ 751, 959, 944, 767, 767, 936, 936, 767, 810, 732, + /* 250 */ 798, 739, 739, 739, 739, 767, 798, 810, 732, 732, + /* 260 */ 767, 658, 911, 909, 767, 767, 658, 767, 658, 767, + /* 270 */ 658, 876, 730, 730, 730, 715, 880, 880, 876, 730, + /* 280 */ 700, 730, 715, 730, 730, 780, 775, 780, 775, 780, + /* 290 */ 775, 767, 767, 959, 793, 781, 791, 789, 798, 959, + /* 300 */ 718, 651, 651, 640, 640, 640, 640, 956, 956, 951, + /* 310 */ 702, 702, 684, 959, 959, 959, 959, 959, 959, 959, + /* 320 */ 885, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 330 */ 959, 959, 959, 959, 636, 946, 959, 959, 943, 959, + /* 340 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 350 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 915, + /* 360 */ 959, 959, 959, 959, 959, 959, 908, 907, 959, 959, + /* 370 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 380 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 390 */ 959, 959, 959, 959, 790, 959, 782, 959, 869, 959, + /* 400 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 745, + /* 410 */ 819, 959, 818, 822, 817, 668, 959, 649, 959, 632, + /* 420 */ 637, 955, 958, 957, 954, 953, 952, 947, 945, 942, + /* 430 */ 941, 940, 938, 935, 931, 889, 887, 894, 893, 892, + /* 440 */ 891, 890, 888, 886, 884, 805, 803, 800, 797, 930, + /* 450 */ 882, 741, 738, 737, 657, 948, 914, 923, 921, 811, + /* 460 */ 920, 919, 918, 916, 913, 900, 807, 806, 733, 874, + /* 470 */ 873, 660, 904, 903, 902, 906, 910, 901, 769, 659, + /* 480 */ 656, 665, 722, 721, 729, 727, 726, 725, 724, 723, + /* 490 */ 720, 667, 675, 686, 714, 699, 698, 879, 881, 878, + /* 500 */ 877, 707, 706, 712, 711, 710, 709, 708, 705, 704, + /* 510 */ 703, 696, 695, 701, 694, 717, 716, 713, 693, 736, + /* 520 */ 735, 734, 731, 692, 691, 690, 822, 689, 688, 828, + /* 530 */ 827, 815, 858, 756, 755, 754, 766, 765, 778, 777, + /* 540 */ 813, 812, 779, 764, 758, 757, 773, 772, 771, 770, + /* 550 */ 762, 752, 784, 787, 786, 783, 860, 768, 857, 929, + /* 560 */ 928, 927, 926, 925, 862, 861, 829, 826, 679, 680, + /* 570 */ 898, 896, 897, 895, 682, 681, 678, 677, 859, 747, + /* 580 */ 746, 855, 852, 844, 840, 856, 853, 845, 841, 839, + /* 590 */ 838, 824, 823, 821, 820, 816, 825, 670, 748, 744, + /* 600 */ 743, 814, 750, 749, 687, 685, 683, 664, 662, 655, + /* 610 */ 653, 652, 654, 650, 648, 647, 646, 645, 644, 673, + /* 620 */ 672, 671, 669, 668, 642, 639, 638, 634, 633, 631, }; /* The next table maps tokens into fallback tokens. If a construct @@ -91059,13 +100472,13 @@ static const char *const yyTokenName[] = { "COLLATE", "BITNOT", "STRING", "JOIN_KW", "CONSTRAINT", "DEFAULT", "NULL", "PRIMARY", "UNIQUE", "CHECK", "REFERENCES", "AUTOINCR", - "ON", "DELETE", "UPDATE", "SET", - "DEFERRABLE", "FOREIGN", "DROP", "UNION", - "ALL", "EXCEPT", "INTERSECT", "SELECT", - "DISTINCT", "DOT", "FROM", "JOIN", - "USING", "ORDER", "GROUP", "HAVING", - "LIMIT", "WHERE", "INTO", "VALUES", - "INSERT", "INTEGER", "FLOAT", "BLOB", + "ON", "INSERT", "DELETE", "UPDATE", + "SET", "DEFERRABLE", "FOREIGN", "DROP", + "UNION", "ALL", "EXCEPT", "INTERSECT", + "SELECT", "DISTINCT", "DOT", "FROM", + "JOIN", "USING", "ORDER", "GROUP", + "HAVING", "LIMIT", "WHERE", "INTO", + "VALUES", "INTEGER", "FLOAT", "BLOB", "REGISTER", "VARIABLE", "CASE", "WHEN", "THEN", "ELSE", "INDEX", "ALTER", "ADD", "error", "input", "cmdlist", @@ -91088,15 +100501,14 @@ static const char *const yyTokenName[] = { "joinop", "indexed_opt", "on_opt", "using_opt", "joinop2", "inscollist", "sortlist", "sortitem", "nexprlist", "setlist", "insert_cmd", "inscollist_opt", - "itemlist", "exprlist", "likeop", "escape", - "between_op", "in_op", "case_operand", "case_exprlist", - "case_else", "uniqueflag", "collate", "nmnum", - "plus_opt", "number", "trigger_decl", "trigger_cmd_list", - "trigger_time", "trigger_event", "foreach_clause", "when_clause", - "trigger_cmd", "trnm", "tridxby", "database_kw_opt", - "key_opt", "add_column_fullname", "kwcolumn_opt", "create_vtab", - "vtabarglist", "vtabarg", "vtabargtoken", "lp", - "anylist", + "itemlist", "exprlist", "likeop", "between_op", + "in_op", "case_operand", "case_exprlist", "case_else", + "uniqueflag", "collate", "nmnum", "plus_opt", + "number", "trigger_decl", "trigger_cmd_list", "trigger_time", + "trigger_event", "foreach_clause", "when_clause", "trigger_cmd", + "trnm", "tridxby", "database_kw_opt", "key_opt", + "add_column_fullname", "kwcolumn_opt", "create_vtab", "vtabarglist", + "vtabarg", "vtabargtoken", "lp", "anylist", }; #endif /* NDEBUG */ @@ -91179,145 +100591,145 @@ static const char *const yyRuleName[] = { /* 72 */ "refargs ::=", /* 73 */ "refargs ::= refargs refarg", /* 74 */ "refarg ::= MATCH nm", - /* 75 */ "refarg ::= ON DELETE refact", - /* 76 */ "refarg ::= ON UPDATE refact", - /* 77 */ "refact ::= SET NULL", - /* 78 */ "refact ::= SET DEFAULT", - /* 79 */ "refact ::= CASCADE", - /* 80 */ "refact ::= RESTRICT", - /* 81 */ "refact ::= NO ACTION", - /* 82 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", - /* 83 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", - /* 84 */ "init_deferred_pred_opt ::=", - /* 85 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", - /* 86 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", - /* 87 */ "conslist_opt ::=", - /* 88 */ "conslist_opt ::= COMMA conslist", - /* 89 */ "conslist ::= conslist COMMA tcons", - /* 90 */ "conslist ::= conslist tcons", - /* 91 */ "conslist ::= tcons", - /* 92 */ "tcons ::= CONSTRAINT nm", - /* 93 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf", - /* 94 */ "tcons ::= UNIQUE LP idxlist RP onconf", - /* 95 */ "tcons ::= CHECK LP expr RP onconf", - /* 96 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt", - /* 97 */ "defer_subclause_opt ::=", - /* 98 */ "defer_subclause_opt ::= defer_subclause", - /* 99 */ "onconf ::=", - /* 100 */ "onconf ::= ON CONFLICT resolvetype", - /* 101 */ "orconf ::=", - /* 102 */ "orconf ::= OR resolvetype", - /* 103 */ "resolvetype ::= raisetype", - /* 104 */ "resolvetype ::= IGNORE", - /* 105 */ "resolvetype ::= REPLACE", - /* 106 */ "cmd ::= DROP TABLE ifexists fullname", - /* 107 */ "ifexists ::= IF EXISTS", - /* 108 */ "ifexists ::=", - /* 109 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select", - /* 110 */ "cmd ::= DROP VIEW ifexists fullname", - /* 111 */ "cmd ::= select", - /* 112 */ "select ::= oneselect", - /* 113 */ "select ::= select multiselect_op oneselect", - /* 114 */ "multiselect_op ::= UNION", - /* 115 */ "multiselect_op ::= UNION ALL", - /* 116 */ "multiselect_op ::= EXCEPT|INTERSECT", - /* 117 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", - /* 118 */ "distinct ::= DISTINCT", - /* 119 */ "distinct ::= ALL", - /* 120 */ "distinct ::=", - /* 121 */ "sclp ::= selcollist COMMA", - /* 122 */ "sclp ::=", - /* 123 */ "selcollist ::= sclp expr as", - /* 124 */ "selcollist ::= sclp STAR", - /* 125 */ "selcollist ::= sclp nm DOT STAR", - /* 126 */ "as ::= AS nm", - /* 127 */ "as ::= ids", - /* 128 */ "as ::=", - /* 129 */ "from ::=", - /* 130 */ "from ::= FROM seltablist", - /* 131 */ "stl_prefix ::= seltablist joinop", - /* 132 */ "stl_prefix ::=", - /* 133 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt", - /* 134 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt", - /* 135 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt", - /* 136 */ "dbnm ::=", - /* 137 */ "dbnm ::= DOT nm", - /* 138 */ "fullname ::= nm dbnm", - /* 139 */ "joinop ::= COMMA|JOIN", - /* 140 */ "joinop ::= JOIN_KW JOIN", - /* 141 */ "joinop ::= JOIN_KW nm JOIN", - /* 142 */ "joinop ::= JOIN_KW nm nm JOIN", - /* 143 */ "on_opt ::= ON expr", - /* 144 */ "on_opt ::=", - /* 145 */ "indexed_opt ::=", - /* 146 */ "indexed_opt ::= INDEXED BY nm", - /* 147 */ "indexed_opt ::= NOT INDEXED", - /* 148 */ "using_opt ::= USING LP inscollist RP", - /* 149 */ "using_opt ::=", - /* 150 */ "orderby_opt ::=", - /* 151 */ "orderby_opt ::= ORDER BY sortlist", - /* 152 */ "sortlist ::= sortlist COMMA sortitem sortorder", - /* 153 */ "sortlist ::= sortitem sortorder", - /* 154 */ "sortitem ::= expr", - /* 155 */ "sortorder ::= ASC", - /* 156 */ "sortorder ::= DESC", - /* 157 */ "sortorder ::=", - /* 158 */ "groupby_opt ::=", - /* 159 */ "groupby_opt ::= GROUP BY nexprlist", - /* 160 */ "having_opt ::=", - /* 161 */ "having_opt ::= HAVING expr", - /* 162 */ "limit_opt ::=", - /* 163 */ "limit_opt ::= LIMIT expr", - /* 164 */ "limit_opt ::= LIMIT expr OFFSET expr", - /* 165 */ "limit_opt ::= LIMIT expr COMMA expr", - /* 166 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt", - /* 167 */ "where_opt ::=", - /* 168 */ "where_opt ::= WHERE expr", - /* 169 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt", - /* 170 */ "setlist ::= setlist COMMA nm EQ expr", - /* 171 */ "setlist ::= nm EQ expr", - /* 172 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP", - /* 173 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", - /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES", - /* 175 */ "insert_cmd ::= INSERT orconf", - /* 176 */ "insert_cmd ::= REPLACE", - /* 177 */ "itemlist ::= itemlist COMMA expr", - /* 178 */ "itemlist ::= expr", - /* 179 */ "inscollist_opt ::=", - /* 180 */ "inscollist_opt ::= LP inscollist RP", - /* 181 */ "inscollist ::= inscollist COMMA nm", - /* 182 */ "inscollist ::= nm", - /* 183 */ "expr ::= term", - /* 184 */ "expr ::= LP expr RP", - /* 185 */ "term ::= NULL", - /* 186 */ "expr ::= id", - /* 187 */ "expr ::= JOIN_KW", - /* 188 */ "expr ::= nm DOT nm", - /* 189 */ "expr ::= nm DOT nm DOT nm", - /* 190 */ "term ::= INTEGER|FLOAT|BLOB", - /* 191 */ "term ::= STRING", - /* 192 */ "expr ::= REGISTER", - /* 193 */ "expr ::= VARIABLE", - /* 194 */ "expr ::= expr COLLATE ids", - /* 195 */ "expr ::= CAST LP expr AS typetoken RP", - /* 196 */ "expr ::= ID LP distinct exprlist RP", - /* 197 */ "expr ::= ID LP STAR RP", - /* 198 */ "term ::= CTIME_KW", - /* 199 */ "expr ::= expr AND expr", - /* 200 */ "expr ::= expr OR expr", - /* 201 */ "expr ::= expr LT|GT|GE|LE expr", - /* 202 */ "expr ::= expr EQ|NE expr", - /* 203 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", - /* 204 */ "expr ::= expr PLUS|MINUS expr", - /* 205 */ "expr ::= expr STAR|SLASH|REM expr", - /* 206 */ "expr ::= expr CONCAT expr", - /* 207 */ "likeop ::= LIKE_KW", - /* 208 */ "likeop ::= NOT LIKE_KW", - /* 209 */ "likeop ::= MATCH", - /* 210 */ "likeop ::= NOT MATCH", - /* 211 */ "escape ::= ESCAPE expr", - /* 212 */ "escape ::=", - /* 213 */ "expr ::= expr likeop expr escape", + /* 75 */ "refarg ::= ON INSERT refact", + /* 76 */ "refarg ::= ON DELETE refact", + /* 77 */ "refarg ::= ON UPDATE refact", + /* 78 */ "refact ::= SET NULL", + /* 79 */ "refact ::= SET DEFAULT", + /* 80 */ "refact ::= CASCADE", + /* 81 */ "refact ::= RESTRICT", + /* 82 */ "refact ::= NO ACTION", + /* 83 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", + /* 84 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", + /* 85 */ "init_deferred_pred_opt ::=", + /* 86 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", + /* 87 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", + /* 88 */ "conslist_opt ::=", + /* 89 */ "conslist_opt ::= COMMA conslist", + /* 90 */ "conslist ::= conslist COMMA tcons", + /* 91 */ "conslist ::= conslist tcons", + /* 92 */ "conslist ::= tcons", + /* 93 */ "tcons ::= CONSTRAINT nm", + /* 94 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf", + /* 95 */ "tcons ::= UNIQUE LP idxlist RP onconf", + /* 96 */ "tcons ::= CHECK LP expr RP onconf", + /* 97 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt", + /* 98 */ "defer_subclause_opt ::=", + /* 99 */ "defer_subclause_opt ::= defer_subclause", + /* 100 */ "onconf ::=", + /* 101 */ "onconf ::= ON CONFLICT resolvetype", + /* 102 */ "orconf ::=", + /* 103 */ "orconf ::= OR resolvetype", + /* 104 */ "resolvetype ::= raisetype", + /* 105 */ "resolvetype ::= IGNORE", + /* 106 */ "resolvetype ::= REPLACE", + /* 107 */ "cmd ::= DROP TABLE ifexists fullname", + /* 108 */ "ifexists ::= IF EXISTS", + /* 109 */ "ifexists ::=", + /* 110 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select", + /* 111 */ "cmd ::= DROP VIEW ifexists fullname", + /* 112 */ "cmd ::= select", + /* 113 */ "select ::= oneselect", + /* 114 */ "select ::= select multiselect_op oneselect", + /* 115 */ "multiselect_op ::= UNION", + /* 116 */ "multiselect_op ::= UNION ALL", + /* 117 */ "multiselect_op ::= EXCEPT|INTERSECT", + /* 118 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt", + /* 119 */ "distinct ::= DISTINCT", + /* 120 */ "distinct ::= ALL", + /* 121 */ "distinct ::=", + /* 122 */ "sclp ::= selcollist COMMA", + /* 123 */ "sclp ::=", + /* 124 */ "selcollist ::= sclp expr as", + /* 125 */ "selcollist ::= sclp STAR", + /* 126 */ "selcollist ::= sclp nm DOT STAR", + /* 127 */ "as ::= AS nm", + /* 128 */ "as ::= ids", + /* 129 */ "as ::=", + /* 130 */ "from ::=", + /* 131 */ "from ::= FROM seltablist", + /* 132 */ "stl_prefix ::= seltablist joinop", + /* 133 */ "stl_prefix ::=", + /* 134 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt", + /* 135 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt", + /* 136 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt", + /* 137 */ "dbnm ::=", + /* 138 */ "dbnm ::= DOT nm", + /* 139 */ "fullname ::= nm dbnm", + /* 140 */ "joinop ::= COMMA|JOIN", + /* 141 */ "joinop ::= JOIN_KW JOIN", + /* 142 */ "joinop ::= JOIN_KW nm JOIN", + /* 143 */ "joinop ::= JOIN_KW nm nm JOIN", + /* 144 */ "on_opt ::= ON expr", + /* 145 */ "on_opt ::=", + /* 146 */ "indexed_opt ::=", + /* 147 */ "indexed_opt ::= INDEXED BY nm", + /* 148 */ "indexed_opt ::= NOT INDEXED", + /* 149 */ "using_opt ::= USING LP inscollist RP", + /* 150 */ "using_opt ::=", + /* 151 */ "orderby_opt ::=", + /* 152 */ "orderby_opt ::= ORDER BY sortlist", + /* 153 */ "sortlist ::= sortlist COMMA sortitem sortorder", + /* 154 */ "sortlist ::= sortitem sortorder", + /* 155 */ "sortitem ::= expr", + /* 156 */ "sortorder ::= ASC", + /* 157 */ "sortorder ::= DESC", + /* 158 */ "sortorder ::=", + /* 159 */ "groupby_opt ::=", + /* 160 */ "groupby_opt ::= GROUP BY nexprlist", + /* 161 */ "having_opt ::=", + /* 162 */ "having_opt ::= HAVING expr", + /* 163 */ "limit_opt ::=", + /* 164 */ "limit_opt ::= LIMIT expr", + /* 165 */ "limit_opt ::= LIMIT expr OFFSET expr", + /* 166 */ "limit_opt ::= LIMIT expr COMMA expr", + /* 167 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt", + /* 168 */ "where_opt ::=", + /* 169 */ "where_opt ::= WHERE expr", + /* 170 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt", + /* 171 */ "setlist ::= setlist COMMA nm EQ expr", + /* 172 */ "setlist ::= nm EQ expr", + /* 173 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP", + /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", + /* 175 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES", + /* 176 */ "insert_cmd ::= INSERT orconf", + /* 177 */ "insert_cmd ::= REPLACE", + /* 178 */ "itemlist ::= itemlist COMMA expr", + /* 179 */ "itemlist ::= expr", + /* 180 */ "inscollist_opt ::=", + /* 181 */ "inscollist_opt ::= LP inscollist RP", + /* 182 */ "inscollist ::= inscollist COMMA nm", + /* 183 */ "inscollist ::= nm", + /* 184 */ "expr ::= term", + /* 185 */ "expr ::= LP expr RP", + /* 186 */ "term ::= NULL", + /* 187 */ "expr ::= id", + /* 188 */ "expr ::= JOIN_KW", + /* 189 */ "expr ::= nm DOT nm", + /* 190 */ "expr ::= nm DOT nm DOT nm", + /* 191 */ "term ::= INTEGER|FLOAT|BLOB", + /* 192 */ "term ::= STRING", + /* 193 */ "expr ::= REGISTER", + /* 194 */ "expr ::= VARIABLE", + /* 195 */ "expr ::= expr COLLATE ids", + /* 196 */ "expr ::= CAST LP expr AS typetoken RP", + /* 197 */ "expr ::= ID LP distinct exprlist RP", + /* 198 */ "expr ::= ID LP STAR RP", + /* 199 */ "term ::= CTIME_KW", + /* 200 */ "expr ::= expr AND expr", + /* 201 */ "expr ::= expr OR expr", + /* 202 */ "expr ::= expr LT|GT|GE|LE expr", + /* 203 */ "expr ::= expr EQ|NE expr", + /* 204 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", + /* 205 */ "expr ::= expr PLUS|MINUS expr", + /* 206 */ "expr ::= expr STAR|SLASH|REM expr", + /* 207 */ "expr ::= expr CONCAT expr", + /* 208 */ "likeop ::= LIKE_KW", + /* 209 */ "likeop ::= NOT LIKE_KW", + /* 210 */ "likeop ::= MATCH", + /* 211 */ "likeop ::= NOT MATCH", + /* 212 */ "expr ::= expr likeop expr", + /* 213 */ "expr ::= expr likeop expr ESCAPE expr", /* 214 */ "expr ::= expr ISNULL|NOTNULL", /* 215 */ "expr ::= expr NOT NULL", /* 216 */ "expr ::= expr IS expr", @@ -91514,14 +100926,13 @@ static void yy_destructor( case 160: /* select */ case 194: /* oneselect */ { -sqlite3SelectDelete(pParse->db, (yypminor->yy3)); +sqlite3SelectDelete(pParse->db, (yypminor->yy387)); } break; case 174: /* term */ case 175: /* expr */ - case 223: /* escape */ { -sqlite3ExprDelete(pParse->db, (yypminor->yy346).pExpr); +sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr); } break; case 179: /* idxlist_opt */ @@ -91535,9 +100946,9 @@ sqlite3ExprDelete(pParse->db, (yypminor->yy346).pExpr); case 217: /* setlist */ case 220: /* itemlist */ case 221: /* exprlist */ - case 227: /* case_exprlist */ + case 226: /* case_exprlist */ { -sqlite3ExprListDelete(pParse->db, (yypminor->yy14)); +sqlite3ExprListDelete(pParse->db, (yypminor->yy322)); } break; case 193: /* fullname */ @@ -91545,37 +100956,37 @@ sqlite3ExprListDelete(pParse->db, (yypminor->yy14)); case 206: /* seltablist */ case 207: /* stl_prefix */ { -sqlite3SrcListDelete(pParse->db, (yypminor->yy65)); +sqlite3SrcListDelete(pParse->db, (yypminor->yy259)); } break; case 199: /* where_opt */ case 201: /* having_opt */ case 210: /* on_opt */ case 215: /* sortitem */ - case 226: /* case_operand */ - case 228: /* case_else */ - case 239: /* when_clause */ - case 244: /* key_opt */ + case 225: /* case_operand */ + case 227: /* case_else */ + case 238: /* when_clause */ + case 243: /* key_opt */ { -sqlite3ExprDelete(pParse->db, (yypminor->yy132)); +sqlite3ExprDelete(pParse->db, (yypminor->yy314)); } break; case 211: /* using_opt */ case 213: /* inscollist */ case 219: /* inscollist_opt */ { -sqlite3IdListDelete(pParse->db, (yypminor->yy408)); +sqlite3IdListDelete(pParse->db, (yypminor->yy384)); } break; - case 235: /* trigger_cmd_list */ - case 240: /* trigger_cmd */ + case 234: /* trigger_cmd_list */ + case 239: /* trigger_cmd */ { -sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy473)); +sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203)); } break; - case 237: /* trigger_event */ + case 236: /* trigger_event */ { -sqlite3IdListDelete(pParse->db, (yypminor->yy378).b); +sqlite3IdListDelete(pParse->db, (yypminor->yy90).b); } break; default: break; /* If no destructor action specified: do nothing */ @@ -91898,6 +101309,7 @@ static const struct { { 182, 2 }, { 182, 3 }, { 182, 3 }, + { 182, 3 }, { 183, 2 }, { 183, 2 }, { 183, 1 }, @@ -92032,47 +101444,46 @@ static const struct { { 222, 2 }, { 222, 1 }, { 222, 2 }, + { 175, 3 }, + { 175, 5 }, + { 175, 2 }, + { 175, 3 }, + { 175, 3 }, + { 175, 4 }, + { 175, 2 }, + { 175, 2 }, + { 175, 2 }, + { 175, 2 }, + { 223, 1 }, { 223, 2 }, - { 223, 0 }, - { 175, 4 }, - { 175, 2 }, - { 175, 3 }, - { 175, 3 }, - { 175, 4 }, - { 175, 2 }, - { 175, 2 }, - { 175, 2 }, - { 175, 2 }, + { 175, 5 }, { 224, 1 }, { 224, 2 }, { 175, 5 }, - { 225, 1 }, - { 225, 2 }, - { 175, 5 }, { 175, 3 }, { 175, 5 }, { 175, 4 }, { 175, 4 }, { 175, 5 }, - { 227, 5 }, - { 227, 4 }, - { 228, 2 }, - { 228, 0 }, - { 226, 1 }, - { 226, 0 }, + { 226, 5 }, + { 226, 4 }, + { 227, 2 }, + { 227, 0 }, + { 225, 1 }, + { 225, 0 }, { 221, 1 }, { 221, 0 }, { 216, 3 }, { 216, 1 }, { 147, 11 }, - { 229, 1 }, - { 229, 0 }, + { 228, 1 }, + { 228, 0 }, { 179, 0 }, { 179, 3 }, { 187, 5 }, { 187, 3 }, - { 230, 0 }, - { 230, 2 }, + { 229, 0 }, + { 229, 2 }, { 147, 4 }, { 147, 1 }, { 147, 2 }, @@ -92081,41 +101492,41 @@ static const struct { { 147, 6 }, { 147, 5 }, { 147, 6 }, - { 231, 1 }, - { 231, 1 }, - { 231, 1 }, - { 231, 1 }, - { 231, 1 }, + { 230, 1 }, + { 230, 1 }, + { 230, 1 }, + { 230, 1 }, + { 230, 1 }, { 170, 2 }, { 171, 2 }, - { 233, 1 }, { 232, 1 }, - { 232, 0 }, + { 231, 1 }, + { 231, 0 }, { 147, 5 }, - { 234, 11 }, + { 233, 11 }, + { 235, 1 }, + { 235, 1 }, + { 235, 2 }, + { 235, 0 }, { 236, 1 }, { 236, 1 }, - { 236, 2 }, - { 236, 0 }, - { 237, 1 }, - { 237, 1 }, + { 236, 3 }, + { 237, 0 }, { 237, 3 }, { 238, 0 }, - { 238, 3 }, - { 239, 0 }, - { 239, 2 }, - { 235, 3 }, - { 235, 2 }, - { 241, 1 }, - { 241, 3 }, - { 242, 0 }, - { 242, 3 }, - { 242, 2 }, - { 240, 7 }, - { 240, 8 }, - { 240, 5 }, - { 240, 5 }, + { 238, 2 }, + { 234, 3 }, + { 234, 2 }, { 240, 1 }, + { 240, 3 }, + { 241, 0 }, + { 241, 3 }, + { 241, 2 }, + { 239, 7 }, + { 239, 8 }, + { 239, 5 }, + { 239, 5 }, + { 239, 1 }, { 175, 4 }, { 175, 6 }, { 191, 1 }, @@ -92124,32 +101535,32 @@ static const struct { { 147, 4 }, { 147, 6 }, { 147, 3 }, - { 244, 0 }, - { 244, 2 }, - { 243, 1 }, { 243, 0 }, + { 243, 2 }, + { 242, 1 }, + { 242, 0 }, { 147, 1 }, { 147, 3 }, { 147, 1 }, { 147, 3 }, { 147, 6 }, { 147, 6 }, + { 244, 1 }, + { 245, 0 }, { 245, 1 }, - { 246, 0 }, - { 246, 1 }, { 147, 1 }, { 147, 4 }, - { 247, 7 }, - { 248, 1 }, - { 248, 3 }, - { 249, 0 }, - { 249, 2 }, + { 246, 7 }, + { 247, 1 }, + { 247, 3 }, + { 248, 0 }, + { 248, 2 }, + { 249, 1 }, + { 249, 3 }, { 250, 1 }, - { 250, 3 }, - { 251, 1 }, - { 252, 0 }, - { 252, 4 }, - { 252, 2 }, + { 251, 0 }, + { 251, 4 }, + { 251, 2 }, }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -92217,17 +101628,17 @@ static void yy_reduce( { sqlite3FinishCoding(pParse); } break; case 9: /* cmd ::= BEGIN transtype trans_opt */ -{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy328);} +{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);} break; case 13: /* transtype ::= */ -{yygotominor.yy328 = TK_DEFERRED;} +{yygotominor.yy4 = TK_DEFERRED;} break; case 14: /* transtype ::= DEFERRED */ case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15); case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16); - case 114: /* multiselect_op ::= UNION */ yytestcase(yyruleno==114); - case 116: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==116); -{yygotominor.yy328 = yymsp[0].major;} + case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115); + case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117); +{yygotominor.yy4 = yymsp[0].major;} break; case 17: /* cmd ::= COMMIT trans_opt */ case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18); @@ -92253,7 +101664,7 @@ static void yy_reduce( break; case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */ { - sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy328,0,0,yymsp[-2].minor.yy328); + sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4); } break; case 27: /* createkw ::= CREATE */ @@ -92265,26 +101676,26 @@ static void yy_reduce( case 28: /* ifnotexists ::= */ case 31: /* temp ::= */ yytestcase(yyruleno==31); case 70: /* autoinc ::= */ yytestcase(yyruleno==70); - case 82: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==82); - case 84: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==84); - case 86: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==86); - case 97: /* defer_subclause_opt ::= */ yytestcase(yyruleno==97); - case 108: /* ifexists ::= */ yytestcase(yyruleno==108); - case 119: /* distinct ::= ALL */ yytestcase(yyruleno==119); - case 120: /* distinct ::= */ yytestcase(yyruleno==120); + case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83); + case 85: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==85); + case 87: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==87); + case 98: /* defer_subclause_opt ::= */ yytestcase(yyruleno==98); + case 109: /* ifexists ::= */ yytestcase(yyruleno==109); + case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120); + case 121: /* distinct ::= */ yytestcase(yyruleno==121); case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222); case 225: /* in_op ::= IN */ yytestcase(yyruleno==225); -{yygotominor.yy328 = 0;} +{yygotominor.yy4 = 0;} break; case 29: /* ifnotexists ::= IF NOT EXISTS */ case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30); case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71); - case 85: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==85); - case 107: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==107); - case 118: /* distinct ::= DISTINCT */ yytestcase(yyruleno==118); + case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86); + case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108); + case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119); case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223); case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226); -{yygotominor.yy328 = 1;} +{yygotominor.yy4 = 1;} break; case 32: /* create_table_args ::= LP columnlist conslist_opt RP */ { @@ -92293,8 +101704,8 @@ static void yy_reduce( break; case 33: /* create_table_args ::= AS select */ { - sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy3); - sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy3); + sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387); + sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); } break; case 36: /* column ::= columnid type carglist */ @@ -92317,10 +101728,10 @@ static void yy_reduce( case 43: /* nm ::= JOIN_KW */ yytestcase(yyruleno==43); case 46: /* typetoken ::= typename */ yytestcase(yyruleno==46); case 49: /* typename ::= ids */ yytestcase(yyruleno==49); - case 126: /* as ::= AS nm */ yytestcase(yyruleno==126); - case 127: /* as ::= ids */ yytestcase(yyruleno==127); - case 137: /* dbnm ::= DOT nm */ yytestcase(yyruleno==137); - case 146: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==146); + case 127: /* as ::= AS nm */ yytestcase(yyruleno==127); + case 128: /* as ::= ids */ yytestcase(yyruleno==128); + case 138: /* dbnm ::= DOT nm */ yytestcase(yyruleno==138); + case 147: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==147); case 251: /* collate ::= COLLATE ids */ yytestcase(yyruleno==251); case 260: /* nmnum ::= plus_num */ yytestcase(yyruleno==260); case 261: /* nmnum ::= nm */ yytestcase(yyruleno==261); @@ -92353,17 +101764,17 @@ static void yy_reduce( break; case 57: /* ccons ::= DEFAULT term */ case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59); -{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy346);} +{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);} break; case 58: /* ccons ::= DEFAULT LP expr RP */ -{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy346);} +{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);} break; case 60: /* ccons ::= DEFAULT MINUS term */ { ExprSpan v; - v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy346.pExpr, 0, 0); + v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0); v.zStart = yymsp[-1].minor.yy0.z; - v.zEnd = yymsp[0].minor.yy346.zEnd; + v.zEnd = yymsp[0].minor.yy118.zEnd; sqlite3AddDefaultValue(pParse,&v); } break; @@ -92375,657 +101786,673 @@ static void yy_reduce( } break; case 63: /* ccons ::= NOT NULL onconf */ -{sqlite3AddNotNull(pParse, yymsp[0].minor.yy328);} +{sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);} break; case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ -{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy328,yymsp[0].minor.yy328,yymsp[-2].minor.yy328);} +{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);} break; case 65: /* ccons ::= UNIQUE onconf */ -{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy328,0,0,0,0);} +{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);} break; case 66: /* ccons ::= CHECK LP expr RP */ -{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy346.pExpr);} +{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);} break; case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */ -{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy14,yymsp[0].minor.yy328);} +{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);} break; case 68: /* ccons ::= defer_subclause */ -{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy328);} +{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);} break; case 69: /* ccons ::= COLLATE ids */ {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} break; case 72: /* refargs ::= */ -{ yygotominor.yy328 = OE_None*0x0101; /* EV: R-19803-45884 */} +{ yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */} break; case 73: /* refargs ::= refargs refarg */ -{ yygotominor.yy328 = (yymsp[-1].minor.yy328 & ~yymsp[0].minor.yy429.mask) | yymsp[0].minor.yy429.value; } +{ yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; } break; case 74: /* refarg ::= MATCH nm */ -{ yygotominor.yy429.value = 0; yygotominor.yy429.mask = 0x000000; } + case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75); +{ yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; } break; - case 75: /* refarg ::= ON DELETE refact */ -{ yygotominor.yy429.value = yymsp[0].minor.yy328; yygotominor.yy429.mask = 0x0000ff; } + case 76: /* refarg ::= ON DELETE refact */ +{ yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; } break; - case 76: /* refarg ::= ON UPDATE refact */ -{ yygotominor.yy429.value = yymsp[0].minor.yy328<<8; yygotominor.yy429.mask = 0x00ff00; } + case 77: /* refarg ::= ON UPDATE refact */ +{ yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; } break; - case 77: /* refact ::= SET NULL */ -{ yygotominor.yy328 = OE_SetNull; /* EV: R-33326-45252 */} + case 78: /* refact ::= SET NULL */ +{ yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */} break; - case 78: /* refact ::= SET DEFAULT */ -{ yygotominor.yy328 = OE_SetDflt; /* EV: R-33326-45252 */} + case 79: /* refact ::= SET DEFAULT */ +{ yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */} break; - case 79: /* refact ::= CASCADE */ -{ yygotominor.yy328 = OE_Cascade; /* EV: R-33326-45252 */} + case 80: /* refact ::= CASCADE */ +{ yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */} break; - case 80: /* refact ::= RESTRICT */ -{ yygotominor.yy328 = OE_Restrict; /* EV: R-33326-45252 */} + case 81: /* refact ::= RESTRICT */ +{ yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */} break; - case 81: /* refact ::= NO ACTION */ -{ yygotominor.yy328 = OE_None; /* EV: R-33326-45252 */} + case 82: /* refact ::= NO ACTION */ +{ yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */} break; - case 83: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ - case 98: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==98); - case 100: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==100); - case 103: /* resolvetype ::= raisetype */ yytestcase(yyruleno==103); -{yygotominor.yy328 = yymsp[0].minor.yy328;} + case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ + case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99); + case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101); + case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104); +{yygotominor.yy4 = yymsp[0].minor.yy4;} break; - case 87: /* conslist_opt ::= */ + case 88: /* conslist_opt ::= */ {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} break; - case 88: /* conslist_opt ::= COMMA conslist */ + case 89: /* conslist_opt ::= COMMA conslist */ {yygotominor.yy0 = yymsp[-1].minor.yy0;} break; - case 93: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ -{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy14,yymsp[0].minor.yy328,yymsp[-2].minor.yy328,0);} + case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ +{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);} break; - case 94: /* tcons ::= UNIQUE LP idxlist RP onconf */ -{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy14,yymsp[0].minor.yy328,0,0,0,0);} + case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */ +{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);} break; - case 95: /* tcons ::= CHECK LP expr RP onconf */ -{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy346.pExpr);} + case 96: /* tcons ::= CHECK LP expr RP onconf */ +{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);} break; - case 96: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ + case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ { - sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy14, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy14, yymsp[-1].minor.yy328); - sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy328); + sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4); + sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4); } break; - case 99: /* onconf ::= */ -{yygotominor.yy328 = OE_Default;} + case 100: /* onconf ::= */ +{yygotominor.yy4 = OE_Default;} break; - case 101: /* orconf ::= */ -{yygotominor.yy186 = OE_Default;} + case 102: /* orconf ::= */ +{yygotominor.yy210 = OE_Default;} break; - case 102: /* orconf ::= OR resolvetype */ -{yygotominor.yy186 = (u8)yymsp[0].minor.yy328;} + case 103: /* orconf ::= OR resolvetype */ +{yygotominor.yy210 = (u8)yymsp[0].minor.yy4;} break; - case 104: /* resolvetype ::= IGNORE */ -{yygotominor.yy328 = OE_Ignore;} + case 105: /* resolvetype ::= IGNORE */ +{yygotominor.yy4 = OE_Ignore;} break; - case 105: /* resolvetype ::= REPLACE */ -{yygotominor.yy328 = OE_Replace;} + case 106: /* resolvetype ::= REPLACE */ +{yygotominor.yy4 = OE_Replace;} break; - case 106: /* cmd ::= DROP TABLE ifexists fullname */ + case 107: /* cmd ::= DROP TABLE ifexists fullname */ { - sqlite3DropTable(pParse, yymsp[0].minor.yy65, 0, yymsp[-1].minor.yy328); + sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4); } break; - case 109: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */ + case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */ { - sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy3, yymsp[-6].minor.yy328, yymsp[-4].minor.yy328); + sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4); } break; - case 110: /* cmd ::= DROP VIEW ifexists fullname */ + case 111: /* cmd ::= DROP VIEW ifexists fullname */ { - sqlite3DropTable(pParse, yymsp[0].minor.yy65, 1, yymsp[-1].minor.yy328); + sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4); } break; - case 111: /* cmd ::= select */ + case 112: /* cmd ::= select */ { SelectDest dest = {SRT_Output, 0, 0, 0, 0}; - sqlite3Select(pParse, yymsp[0].minor.yy3, &dest); - sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy3); + sqlite3Select(pParse, yymsp[0].minor.yy387, &dest); + sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); } break; - case 112: /* select ::= oneselect */ -{yygotominor.yy3 = yymsp[0].minor.yy3;} + case 113: /* select ::= oneselect */ +{yygotominor.yy387 = yymsp[0].minor.yy387;} break; - case 113: /* select ::= select multiselect_op oneselect */ + case 114: /* select ::= select multiselect_op oneselect */ { - if( yymsp[0].minor.yy3 ){ - yymsp[0].minor.yy3->op = (u8)yymsp[-1].minor.yy328; - yymsp[0].minor.yy3->pPrior = yymsp[-2].minor.yy3; + if( yymsp[0].minor.yy387 ){ + yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4; + yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387; }else{ - sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy3); + sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387); } - yygotominor.yy3 = yymsp[0].minor.yy3; + yygotominor.yy387 = yymsp[0].minor.yy387; } break; - case 115: /* multiselect_op ::= UNION ALL */ -{yygotominor.yy328 = TK_ALL;} + case 116: /* multiselect_op ::= UNION ALL */ +{yygotominor.yy4 = TK_ALL;} break; - case 117: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ + case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ { - yygotominor.yy3 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy14,yymsp[-5].minor.yy65,yymsp[-4].minor.yy132,yymsp[-3].minor.yy14,yymsp[-2].minor.yy132,yymsp[-1].minor.yy14,yymsp[-7].minor.yy328,yymsp[0].minor.yy476.pLimit,yymsp[0].minor.yy476.pOffset); + yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset); } break; - case 121: /* sclp ::= selcollist COMMA */ + case 122: /* sclp ::= selcollist COMMA */ case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247); -{yygotominor.yy14 = yymsp[-1].minor.yy14;} +{yygotominor.yy322 = yymsp[-1].minor.yy322;} break; - case 122: /* sclp ::= */ - case 150: /* orderby_opt ::= */ yytestcase(yyruleno==150); - case 158: /* groupby_opt ::= */ yytestcase(yyruleno==158); + case 123: /* sclp ::= */ + case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151); + case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159); case 240: /* exprlist ::= */ yytestcase(yyruleno==240); case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246); -{yygotominor.yy14 = 0;} +{yygotominor.yy322 = 0;} break; - case 123: /* selcollist ::= sclp expr as */ + case 124: /* selcollist ::= sclp expr as */ { - yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy14, yymsp[-1].minor.yy346.pExpr); - if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[0].minor.yy0, 1); - sqlite3ExprListSetSpan(pParse,yygotominor.yy14,&yymsp[-1].minor.yy346); + yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr); + if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1); + sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118); } break; - case 124: /* selcollist ::= sclp STAR */ + case 125: /* selcollist ::= sclp STAR */ { Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0); - yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy14, p); + yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p); } break; - case 125: /* selcollist ::= sclp nm DOT STAR */ + case 126: /* selcollist ::= sclp nm DOT STAR */ { Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); - yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14, pDot); + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot); } break; - case 128: /* as ::= */ + case 129: /* as ::= */ {yygotominor.yy0.n = 0;} break; - case 129: /* from ::= */ -{yygotominor.yy65 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy65));} + case 130: /* from ::= */ +{yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));} break; - case 130: /* from ::= FROM seltablist */ + case 131: /* from ::= FROM seltablist */ { - yygotominor.yy65 = yymsp[0].minor.yy65; - sqlite3SrcListShiftJoinType(yygotominor.yy65); + yygotominor.yy259 = yymsp[0].minor.yy259; + sqlite3SrcListShiftJoinType(yygotominor.yy259); } break; - case 131: /* stl_prefix ::= seltablist joinop */ + case 132: /* stl_prefix ::= seltablist joinop */ { - yygotominor.yy65 = yymsp[-1].minor.yy65; - if( ALWAYS(yygotominor.yy65 && yygotominor.yy65->nSrc>0) ) yygotominor.yy65->a[yygotominor.yy65->nSrc-1].jointype = (u8)yymsp[0].minor.yy328; + yygotominor.yy259 = yymsp[-1].minor.yy259; + if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4; } break; - case 132: /* stl_prefix ::= */ -{yygotominor.yy65 = 0;} + case 133: /* stl_prefix ::= */ +{yygotominor.yy259 = 0;} break; - case 133: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ + case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ { - yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy132,yymsp[0].minor.yy408); - sqlite3SrcListIndexedBy(pParse, yygotominor.yy65, &yymsp[-2].minor.yy0); + yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); + sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0); } break; - case 134: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ + case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ { - yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy3,yymsp[-1].minor.yy132,yymsp[0].minor.yy408); + yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); } break; - case 135: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ + case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ { - if( yymsp[-6].minor.yy65==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy132==0 && yymsp[0].minor.yy408==0 ){ - yygotominor.yy65 = yymsp[-4].minor.yy65; + if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){ + yygotominor.yy259 = yymsp[-4].minor.yy259; }else{ Select *pSubquery; - sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy65); - pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy65,0,0,0,0,0,0,0); - yygotominor.yy65 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy65,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy132,yymsp[0].minor.yy408); + sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259); + pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0); + yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); } } break; - case 136: /* dbnm ::= */ - case 145: /* indexed_opt ::= */ yytestcase(yyruleno==145); + case 137: /* dbnm ::= */ + case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146); {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} break; - case 138: /* fullname ::= nm dbnm */ -{yygotominor.yy65 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} + case 139: /* fullname ::= nm dbnm */ +{yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} break; - case 139: /* joinop ::= COMMA|JOIN */ -{ yygotominor.yy328 = JT_INNER; } + case 140: /* joinop ::= COMMA|JOIN */ +{ yygotominor.yy4 = JT_INNER; } break; - case 140: /* joinop ::= JOIN_KW JOIN */ -{ yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } + case 141: /* joinop ::= JOIN_KW JOIN */ +{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } break; - case 141: /* joinop ::= JOIN_KW nm JOIN */ -{ yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } + case 142: /* joinop ::= JOIN_KW nm JOIN */ +{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } break; - case 142: /* joinop ::= JOIN_KW nm nm JOIN */ -{ yygotominor.yy328 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } + case 143: /* joinop ::= JOIN_KW nm nm JOIN */ +{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } break; - case 143: /* on_opt ::= ON expr */ - case 154: /* sortitem ::= expr */ yytestcase(yyruleno==154); - case 161: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==161); - case 168: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==168); + case 144: /* on_opt ::= ON expr */ + case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155); + case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162); + case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169); case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235); case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237); -{yygotominor.yy132 = yymsp[0].minor.yy346.pExpr;} +{yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;} break; - case 144: /* on_opt ::= */ - case 160: /* having_opt ::= */ yytestcase(yyruleno==160); - case 167: /* where_opt ::= */ yytestcase(yyruleno==167); + case 145: /* on_opt ::= */ + case 161: /* having_opt ::= */ yytestcase(yyruleno==161); + case 168: /* where_opt ::= */ yytestcase(yyruleno==168); case 236: /* case_else ::= */ yytestcase(yyruleno==236); case 238: /* case_operand ::= */ yytestcase(yyruleno==238); -{yygotominor.yy132 = 0;} +{yygotominor.yy314 = 0;} break; - case 147: /* indexed_opt ::= NOT INDEXED */ + case 148: /* indexed_opt ::= NOT INDEXED */ {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} break; - case 148: /* using_opt ::= USING LP inscollist RP */ - case 180: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==180); -{yygotominor.yy408 = yymsp[-1].minor.yy408;} + case 149: /* using_opt ::= USING LP inscollist RP */ + case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181); +{yygotominor.yy384 = yymsp[-1].minor.yy384;} break; - case 149: /* using_opt ::= */ - case 179: /* inscollist_opt ::= */ yytestcase(yyruleno==179); -{yygotominor.yy408 = 0;} + case 150: /* using_opt ::= */ + case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180); +{yygotominor.yy384 = 0;} break; - case 151: /* orderby_opt ::= ORDER BY sortlist */ - case 159: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==159); + case 152: /* orderby_opt ::= ORDER BY sortlist */ + case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160); case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239); -{yygotominor.yy14 = yymsp[0].minor.yy14;} +{yygotominor.yy322 = yymsp[0].minor.yy322;} break; - case 152: /* sortlist ::= sortlist COMMA sortitem sortorder */ + case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */ { - yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14,yymsp[-1].minor.yy132); - if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328; + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314); + if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; } break; - case 153: /* sortlist ::= sortitem sortorder */ + case 154: /* sortlist ::= sortitem sortorder */ { - yygotominor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy132); - if( yygotominor.yy14 && ALWAYS(yygotominor.yy14->a) ) yygotominor.yy14->a[0].sortOrder = (u8)yymsp[0].minor.yy328; + yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); + if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4; } break; - case 155: /* sortorder ::= ASC */ - case 157: /* sortorder ::= */ yytestcase(yyruleno==157); -{yygotominor.yy328 = SQLITE_SO_ASC;} + case 156: /* sortorder ::= ASC */ + case 158: /* sortorder ::= */ yytestcase(yyruleno==158); +{yygotominor.yy4 = SQLITE_SO_ASC;} break; - case 156: /* sortorder ::= DESC */ -{yygotominor.yy328 = SQLITE_SO_DESC;} + case 157: /* sortorder ::= DESC */ +{yygotominor.yy4 = SQLITE_SO_DESC;} break; - case 162: /* limit_opt ::= */ -{yygotominor.yy476.pLimit = 0; yygotominor.yy476.pOffset = 0;} + case 163: /* limit_opt ::= */ +{yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;} break; - case 163: /* limit_opt ::= LIMIT expr */ -{yygotominor.yy476.pLimit = yymsp[0].minor.yy346.pExpr; yygotominor.yy476.pOffset = 0;} + case 164: /* limit_opt ::= LIMIT expr */ +{yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;} break; - case 164: /* limit_opt ::= LIMIT expr OFFSET expr */ -{yygotominor.yy476.pLimit = yymsp[-2].minor.yy346.pExpr; yygotominor.yy476.pOffset = yymsp[0].minor.yy346.pExpr;} + case 165: /* limit_opt ::= LIMIT expr OFFSET expr */ +{yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;} break; - case 165: /* limit_opt ::= LIMIT expr COMMA expr */ -{yygotominor.yy476.pOffset = yymsp[-2].minor.yy346.pExpr; yygotominor.yy476.pLimit = yymsp[0].minor.yy346.pExpr;} + case 166: /* limit_opt ::= LIMIT expr COMMA expr */ +{yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;} break; - case 166: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ + case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ { - sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy65, &yymsp[-1].minor.yy0); - sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy65,yymsp[0].minor.yy132); + sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0); + sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314); } break; - case 169: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ + case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ { - sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy65, &yymsp[-3].minor.yy0); - sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy14,"set list"); - sqlite3Update(pParse,yymsp[-4].minor.yy65,yymsp[-1].minor.yy14,yymsp[0].minor.yy132,yymsp[-5].minor.yy186); + sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0); + sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list"); + sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210); } break; - case 170: /* setlist ::= setlist COMMA nm EQ expr */ + case 171: /* setlist ::= setlist COMMA nm EQ expr */ { - yygotominor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy14, yymsp[0].minor.yy346.pExpr); - sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1); + yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr); + sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); } break; - case 171: /* setlist ::= nm EQ expr */ + case 172: /* setlist ::= nm EQ expr */ { - yygotominor.yy14 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy346.pExpr); - sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1); + yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr); + sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); } break; - case 172: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */ -{sqlite3Insert(pParse, yymsp[-5].minor.yy65, yymsp[-1].minor.yy14, 0, yymsp[-4].minor.yy408, yymsp[-7].minor.yy186);} + case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */ +{sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);} break; - case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ -{sqlite3Insert(pParse, yymsp[-2].minor.yy65, 0, yymsp[0].minor.yy3, yymsp[-1].minor.yy408, yymsp[-4].minor.yy186);} + case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ +{sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);} break; - case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ -{sqlite3Insert(pParse, yymsp[-3].minor.yy65, 0, 0, yymsp[-2].minor.yy408, yymsp[-5].minor.yy186);} + case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ +{sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);} break; - case 175: /* insert_cmd ::= INSERT orconf */ -{yygotominor.yy186 = yymsp[0].minor.yy186;} + case 176: /* insert_cmd ::= INSERT orconf */ +{yygotominor.yy210 = yymsp[0].minor.yy210;} break; - case 176: /* insert_cmd ::= REPLACE */ -{yygotominor.yy186 = OE_Replace;} + case 177: /* insert_cmd ::= REPLACE */ +{yygotominor.yy210 = OE_Replace;} break; - case 177: /* itemlist ::= itemlist COMMA expr */ + case 178: /* itemlist ::= itemlist COMMA expr */ case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241); -{yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[0].minor.yy346.pExpr);} +{yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);} break; - case 178: /* itemlist ::= expr */ + case 179: /* itemlist ::= expr */ case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242); -{yygotominor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy346.pExpr);} +{yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);} break; - case 181: /* inscollist ::= inscollist COMMA nm */ -{yygotominor.yy408 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy408,&yymsp[0].minor.yy0);} + case 182: /* inscollist ::= inscollist COMMA nm */ +{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);} break; - case 182: /* inscollist ::= nm */ -{yygotominor.yy408 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} + case 183: /* inscollist ::= nm */ +{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} break; - case 183: /* expr ::= term */ - case 211: /* escape ::= ESCAPE expr */ yytestcase(yyruleno==211); -{yygotominor.yy346 = yymsp[0].minor.yy346;} + case 184: /* expr ::= term */ +{yygotominor.yy118 = yymsp[0].minor.yy118;} break; - case 184: /* expr ::= LP expr RP */ -{yygotominor.yy346.pExpr = yymsp[-1].minor.yy346.pExpr; spanSet(&yygotominor.yy346,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);} + case 185: /* expr ::= LP expr RP */ +{yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);} break; - case 185: /* term ::= NULL */ - case 190: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==190); - case 191: /* term ::= STRING */ yytestcase(yyruleno==191); -{spanExpr(&yygotominor.yy346, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} + case 186: /* term ::= NULL */ + case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191); + case 192: /* term ::= STRING */ yytestcase(yyruleno==192); +{spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} break; - case 186: /* expr ::= id */ - case 187: /* expr ::= JOIN_KW */ yytestcase(yyruleno==187); -{spanExpr(&yygotominor.yy346, pParse, TK_ID, &yymsp[0].minor.yy0);} + case 187: /* expr ::= id */ + case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188); +{spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);} break; - case 188: /* expr ::= nm DOT nm */ + case 189: /* expr ::= nm DOT nm */ { Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); - spanSet(&yygotominor.yy346,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); + spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } break; - case 189: /* expr ::= nm DOT nm DOT nm */ + case 190: /* expr ::= nm DOT nm DOT nm */ { Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); - spanSet(&yygotominor.yy346,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); + spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); } break; - case 192: /* expr ::= REGISTER */ + case 193: /* expr ::= REGISTER */ { /* When doing a nested parse, one can include terms in an expression ** that look like this: #1 #2 ... These terms refer to registers ** in the virtual machine. #N is the N-th register. */ if( pParse->nested==0 ){ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0); - yygotominor.yy346.pExpr = 0; + yygotominor.yy118.pExpr = 0; }else{ - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0); - if( yygotominor.yy346.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy346.pExpr->iTable); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0); + if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable); } - spanSet(&yygotominor.yy346, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); + spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); } break; - case 193: /* expr ::= VARIABLE */ + case 194: /* expr ::= VARIABLE */ { - spanExpr(&yygotominor.yy346, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); - sqlite3ExprAssignVarNumber(pParse, yygotominor.yy346.pExpr); - spanSet(&yygotominor.yy346, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); + spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); + sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr); + spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); } break; - case 194: /* expr ::= expr COLLATE ids */ + case 195: /* expr ::= expr COLLATE ids */ { - yygotominor.yy346.pExpr = sqlite3ExprSetColl(pParse, yymsp[-2].minor.yy346.pExpr, &yymsp[0].minor.yy0); - yygotominor.yy346.zStart = yymsp[-2].minor.yy346.zStart; - yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0); + yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; - case 195: /* expr ::= CAST LP expr AS typetoken RP */ + case 196: /* expr ::= CAST LP expr AS typetoken RP */ { - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy346.pExpr, 0, &yymsp[-1].minor.yy0); - spanSet(&yygotominor.yy346,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0); + spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); } break; - case 196: /* expr ::= ID LP distinct exprlist RP */ + case 197: /* expr ::= ID LP distinct exprlist RP */ { - if( yymsp[-1].minor.yy14 && yymsp[-1].minor.yy14->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ + if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0); } - yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy14, &yymsp[-4].minor.yy0); - spanSet(&yygotominor.yy346,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); - if( yymsp[-2].minor.yy328 && yygotominor.yy346.pExpr ){ - yygotominor.yy346.pExpr->flags |= EP_Distinct; + yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0); + spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); + if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->flags |= EP_Distinct; } } break; - case 197: /* expr ::= ID LP STAR RP */ + case 198: /* expr ::= ID LP STAR RP */ { - yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); - spanSet(&yygotominor.yy346,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); + yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); + spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); } break; - case 198: /* term ::= CTIME_KW */ + case 199: /* term ::= CTIME_KW */ { /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are ** treated as functions that return constants */ - yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); - if( yygotominor.yy346.pExpr ){ - yygotominor.yy346.pExpr->op = TK_CONST_FUNC; + yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->op = TK_CONST_FUNC; } - spanSet(&yygotominor.yy346, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); + spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); } break; - case 199: /* expr ::= expr AND expr */ - case 200: /* expr ::= expr OR expr */ yytestcase(yyruleno==200); - case 201: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==201); - case 202: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==202); - case 203: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==203); - case 204: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==204); - case 205: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==205); - case 206: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==206); -{spanBinaryExpr(&yygotominor.yy346,pParse,yymsp[-1].major,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy346);} + case 200: /* expr ::= expr AND expr */ + case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201); + case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202); + case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203); + case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204); + case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205); + case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206); + case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207); +{spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);} break; - case 207: /* likeop ::= LIKE_KW */ - case 209: /* likeop ::= MATCH */ yytestcase(yyruleno==209); -{yygotominor.yy96.eOperator = yymsp[0].minor.yy0; yygotominor.yy96.not = 0;} + case 208: /* likeop ::= LIKE_KW */ + case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210); +{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;} break; - case 208: /* likeop ::= NOT LIKE_KW */ - case 210: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==210); -{yygotominor.yy96.eOperator = yymsp[0].minor.yy0; yygotominor.yy96.not = 1;} + case 209: /* likeop ::= NOT LIKE_KW */ + case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211); +{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;} break; - case 212: /* escape ::= */ -{memset(&yygotominor.yy346,0,sizeof(yygotominor.yy346));} - break; - case 213: /* expr ::= expr likeop expr escape */ + case 212: /* expr ::= expr likeop expr */ { ExprList *pList; - pList = sqlite3ExprListAppend(pParse,0, yymsp[-1].minor.yy346.pExpr); - pList = sqlite3ExprListAppend(pParse,pList, yymsp[-3].minor.yy346.pExpr); - if( yymsp[0].minor.yy346.pExpr ){ - pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy346.pExpr); - } - yygotominor.yy346.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-2].minor.yy96.eOperator); - if( yymsp[-2].minor.yy96.not ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0); - yygotominor.yy346.zStart = yymsp[-3].minor.yy346.zStart; - yygotominor.yy346.zEnd = yymsp[-1].minor.yy346.zEnd; - if( yygotominor.yy346.pExpr ) yygotominor.yy346.pExpr->flags |= EP_InfixFunc; + pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr); + pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr); + yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator); + if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; + yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; + if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; +} + break; + case 213: /* expr ::= expr likeop expr ESCAPE expr */ +{ + ExprList *pList; + pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); + pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr); + pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); + yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy342.eOperator); + if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; + yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; + if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; } break; case 214: /* expr ::= expr ISNULL|NOTNULL */ -{spanUnaryPostfix(&yygotominor.yy346,pParse,yymsp[0].major,&yymsp[-1].minor.yy346,&yymsp[0].minor.yy0);} +{spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);} break; case 215: /* expr ::= expr NOT NULL */ -{spanUnaryPostfix(&yygotominor.yy346,pParse,TK_NOTNULL,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy0);} +{spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);} break; case 216: /* expr ::= expr IS expr */ { - spanBinaryExpr(&yygotominor.yy346,pParse,TK_IS,&yymsp[-2].minor.yy346,&yymsp[0].minor.yy346); - if( pParse->db->mallocFailed==0 && yymsp[0].minor.yy346.pExpr->op==TK_NULL ){ - yygotominor.yy346.pExpr->op = TK_ISNULL; - } + spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118); + binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL); } break; case 217: /* expr ::= expr IS NOT expr */ { - spanBinaryExpr(&yygotominor.yy346,pParse,TK_ISNOT,&yymsp[-3].minor.yy346,&yymsp[0].minor.yy346); - if( pParse->db->mallocFailed==0 && yymsp[0].minor.yy346.pExpr->op==TK_NULL ){ - yygotominor.yy346.pExpr->op = TK_NOTNULL; - } + spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118); + binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL); } break; case 218: /* expr ::= NOT expr */ case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219); -{spanUnaryPrefix(&yygotominor.yy346,pParse,yymsp[-1].major,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);} +{spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} break; case 220: /* expr ::= MINUS expr */ -{spanUnaryPrefix(&yygotominor.yy346,pParse,TK_UMINUS,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);} +{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} break; case 221: /* expr ::= PLUS expr */ -{spanUnaryPrefix(&yygotominor.yy346,pParse,TK_UPLUS,&yymsp[0].minor.yy346,&yymsp[-1].minor.yy0);} +{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} break; case 224: /* expr ::= expr between_op expr AND expr */ { - ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr); - pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy346.pExpr); - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy346.pExpr, 0, 0); - if( yygotominor.yy346.pExpr ){ - yygotominor.yy346.pExpr->x.pList = pList; + ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); + pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pList = pList; }else{ sqlite3ExprListDelete(pParse->db, pList); } - if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0); - yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart; - yygotominor.yy346.zEnd = yymsp[0].minor.yy346.zEnd; + if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; + yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; } break; case 227: /* expr ::= expr in_op LP exprlist RP */ { - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy346.pExpr, 0, 0); - if( yygotominor.yy346.pExpr ){ - yygotominor.yy346.pExpr->x.pList = yymsp[-1].minor.yy14; - sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr); + if( yymsp[-1].minor.yy322==0 ){ + /* Expressions of the form + ** + ** expr1 IN () + ** expr1 NOT IN () + ** + ** simplify to constants 0 (false) and 1 (true), respectively, + ** regardless of the value of expr1. + */ + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy4]); + sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy118.pExpr); }else{ - sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy14); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pList = yymsp[-1].minor.yy322; + sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); + }else{ + sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322); + } + if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); } - if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0); - yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart; - yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 228: /* expr ::= LP select RP */ { - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); - if( yygotominor.yy346.pExpr ){ - yygotominor.yy346.pExpr->x.pSelect = yymsp[-1].minor.yy3; - ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect); - sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; + ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); + sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); }else{ - sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3); + sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); } - yygotominor.yy346.zStart = yymsp[-2].minor.yy0.z; - yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 229: /* expr ::= expr in_op LP select RP */ { - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy346.pExpr, 0, 0); - if( yygotominor.yy346.pExpr ){ - yygotominor.yy346.pExpr->x.pSelect = yymsp[-1].minor.yy3; - ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect); - sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; + ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); + sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); }else{ - sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3); + sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); } - if( yymsp[-3].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0); - yygotominor.yy346.zStart = yymsp[-4].minor.yy346.zStart; - yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 230: /* expr ::= expr in_op nm dbnm */ { SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy346.pExpr, 0, 0); - if( yygotominor.yy346.pExpr ){ - yygotominor.yy346.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); - ExprSetProperty(yygotominor.yy346.pExpr, EP_xIsSelect); - sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); + ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); + sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); }else{ sqlite3SrcListDelete(pParse->db, pSrc); } - if( yymsp[-2].minor.yy328 ) yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy346.pExpr, 0, 0); - yygotominor.yy346.zStart = yymsp[-3].minor.yy346.zStart; - yygotominor.yy346.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]; + if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart; + yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]; } break; case 231: /* expr ::= EXISTS LP select RP */ { - Expr *p = yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); + Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); if( p ){ - p->x.pSelect = yymsp[-1].minor.yy3; + p->x.pSelect = yymsp[-1].minor.yy387; ExprSetProperty(p, EP_xIsSelect); sqlite3ExprSetHeight(pParse, p); }else{ - sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy3); + sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); } - yygotominor.yy346.zStart = yymsp[-3].minor.yy0.z; - yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 232: /* expr ::= CASE case_operand case_exprlist case_else END */ { - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy132, yymsp[-1].minor.yy132, 0); - if( yygotominor.yy346.pExpr ){ - yygotominor.yy346.pExpr->x.pList = yymsp[-2].minor.yy14; - sqlite3ExprSetHeight(pParse, yygotominor.yy346.pExpr); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322; + sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); }else{ - sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy14); + sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322); } - yygotominor.yy346.zStart = yymsp[-4].minor.yy0.z; - yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ { - yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, yymsp[-2].minor.yy346.pExpr); - yygotominor.yy14 = sqlite3ExprListAppend(pParse,yygotominor.yy14, yymsp[0].minor.yy346.pExpr); + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr); + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); } break; case 234: /* case_exprlist ::= WHEN expr THEN expr */ { - yygotominor.yy14 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy346.pExpr); - yygotominor.yy14 = sqlite3ExprListAppend(pParse,yygotominor.yy14, yymsp[0].minor.yy346.pExpr); + yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); } break; case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */ { sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, - sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy14, yymsp[-9].minor.yy328, - &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy328); + sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4, + &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4); } break; case 244: /* uniqueflag ::= UNIQUE */ case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298); -{yygotominor.yy328 = OE_Abort;} +{yygotominor.yy4 = OE_Abort;} break; case 245: /* uniqueflag ::= */ -{yygotominor.yy328 = OE_None;} +{yygotominor.yy4 = OE_None;} break; case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */ { Expr *p = 0; if( yymsp[-1].minor.yy0.n>0 ){ p = sqlite3Expr(pParse->db, TK_COLUMN, 0); - sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy0); + sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); } - yygotominor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, p); - sqlite3ExprListSetName(pParse,yygotominor.yy14,&yymsp[-2].minor.yy0,1); - sqlite3ExprListCheckLength(pParse, yygotominor.yy14, "index"); - if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328; + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p); + sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1); + sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); + if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; } break; case 249: /* idxlist ::= nm collate sortorder */ @@ -93033,19 +102460,19 @@ static void yy_reduce( Expr *p = 0; if( yymsp[-1].minor.yy0.n>0 ){ p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); - sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy0); + sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); } - yygotominor.yy14 = sqlite3ExprListAppend(pParse,0, p); - sqlite3ExprListSetName(pParse, yygotominor.yy14, &yymsp[-2].minor.yy0, 1); - sqlite3ExprListCheckLength(pParse, yygotominor.yy14, "index"); - if( yygotominor.yy14 ) yygotominor.yy14->a[yygotominor.yy14->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy328; + yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p); + sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); + sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); + if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; } break; case 250: /* collate ::= */ {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} break; case 252: /* cmd ::= DROP INDEX ifexists fullname */ -{sqlite3DropIndex(pParse, yymsp[0].minor.yy65, yymsp[-1].minor.yy328);} +{sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);} break; case 253: /* cmd ::= VACUUM */ case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254); @@ -93071,53 +102498,53 @@ static void yy_reduce( Token all; all.z = yymsp[-3].minor.yy0.z; all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; - sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy473, &all); + sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all); } break; case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ { - sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy328, yymsp[-4].minor.yy378.a, yymsp[-4].minor.yy378.b, yymsp[-2].minor.yy65, yymsp[0].minor.yy132, yymsp[-10].minor.yy328, yymsp[-8].minor.yy328); + sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4); yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); } break; case 272: /* trigger_time ::= BEFORE */ case 275: /* trigger_time ::= */ yytestcase(yyruleno==275); -{ yygotominor.yy328 = TK_BEFORE; } +{ yygotominor.yy4 = TK_BEFORE; } break; case 273: /* trigger_time ::= AFTER */ -{ yygotominor.yy328 = TK_AFTER; } +{ yygotominor.yy4 = TK_AFTER; } break; case 274: /* trigger_time ::= INSTEAD OF */ -{ yygotominor.yy328 = TK_INSTEAD;} +{ yygotominor.yy4 = TK_INSTEAD;} break; case 276: /* trigger_event ::= DELETE|INSERT */ case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277); -{yygotominor.yy378.a = yymsp[0].major; yygotominor.yy378.b = 0;} +{yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;} break; case 278: /* trigger_event ::= UPDATE OF inscollist */ -{yygotominor.yy378.a = TK_UPDATE; yygotominor.yy378.b = yymsp[0].minor.yy408;} +{yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;} break; case 281: /* when_clause ::= */ case 303: /* key_opt ::= */ yytestcase(yyruleno==303); -{ yygotominor.yy132 = 0; } +{ yygotominor.yy314 = 0; } break; case 282: /* when_clause ::= WHEN expr */ case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304); -{ yygotominor.yy132 = yymsp[0].minor.yy346.pExpr; } +{ yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; } break; case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ { - assert( yymsp[-2].minor.yy473!=0 ); - yymsp[-2].minor.yy473->pLast->pNext = yymsp[-1].minor.yy473; - yymsp[-2].minor.yy473->pLast = yymsp[-1].minor.yy473; - yygotominor.yy473 = yymsp[-2].minor.yy473; + assert( yymsp[-2].minor.yy203!=0 ); + yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203; + yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203; + yygotominor.yy203 = yymsp[-2].minor.yy203; } break; case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */ { - assert( yymsp[-1].minor.yy473!=0 ); - yymsp[-1].minor.yy473->pLast = yymsp[-1].minor.yy473; - yygotominor.yy473 = yymsp[-1].minor.yy473; + assert( yymsp[-1].minor.yy203!=0 ); + yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203; + yygotominor.yy203 = yymsp[-1].minor.yy203; } break; case 286: /* trnm ::= nm DOT nm */ @@ -93143,59 +102570,59 @@ static void yy_reduce( } break; case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */ -{ yygotominor.yy473 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy14, yymsp[0].minor.yy132, yymsp[-5].minor.yy186); } +{ yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); } break; case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */ -{yygotominor.yy473 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy408, yymsp[-1].minor.yy14, 0, yymsp[-7].minor.yy186);} +{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);} break; case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */ -{yygotominor.yy473 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy408, 0, yymsp[0].minor.yy3, yymsp[-4].minor.yy186);} +{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);} break; case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */ -{yygotominor.yy473 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy132);} +{yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);} break; case 294: /* trigger_cmd ::= select */ -{yygotominor.yy473 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy3); } +{yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); } break; case 295: /* expr ::= RAISE LP IGNORE RP */ { - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); - if( yygotominor.yy346.pExpr ){ - yygotominor.yy346.pExpr->affinity = OE_Ignore; + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->affinity = OE_Ignore; } - yygotominor.yy346.zStart = yymsp[-3].minor.yy0.z; - yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */ { - yygotominor.yy346.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); - if( yygotominor.yy346.pExpr ) { - yygotominor.yy346.pExpr->affinity = (char)yymsp[-3].minor.yy328; + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); + if( yygotominor.yy118.pExpr ) { + yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4; } - yygotominor.yy346.zStart = yymsp[-5].minor.yy0.z; - yygotominor.yy346.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; } break; case 297: /* raisetype ::= ROLLBACK */ -{yygotominor.yy328 = OE_Rollback;} +{yygotominor.yy4 = OE_Rollback;} break; case 299: /* raisetype ::= FAIL */ -{yygotominor.yy328 = OE_Fail;} +{yygotominor.yy4 = OE_Fail;} break; case 300: /* cmd ::= DROP TRIGGER ifexists fullname */ { - sqlite3DropTrigger(pParse,yymsp[0].minor.yy65,yymsp[-1].minor.yy328); + sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4); } break; case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ { - sqlite3Attach(pParse, yymsp[-3].minor.yy346.pExpr, yymsp[-1].minor.yy346.pExpr, yymsp[0].minor.yy132); + sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314); } break; case 302: /* cmd ::= DETACH database_kw_opt expr */ { - sqlite3Detach(pParse, yymsp[0].minor.yy346.pExpr); + sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr); } break; case 307: /* cmd ::= REINDEX */ @@ -93212,7 +102639,7 @@ static void yy_reduce( break; case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ { - sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy65,&yymsp[0].minor.yy0); + sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0); } break; case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */ @@ -93223,7 +102650,7 @@ static void yy_reduce( case 313: /* add_column_fullname ::= fullname */ { pParse->db->lookaside.bEnabled = 0; - sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy65); + sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259); } break; case 316: /* cmd ::= create_vtab */ @@ -93267,10 +102694,10 @@ static void yy_reduce( /* (55) carg ::= CONSTRAINT nm ccons */ yytestcase(yyruleno==55); /* (56) carg ::= ccons */ yytestcase(yyruleno==56); /* (62) ccons ::= NULL onconf */ yytestcase(yyruleno==62); - /* (89) conslist ::= conslist COMMA tcons */ yytestcase(yyruleno==89); - /* (90) conslist ::= conslist tcons */ yytestcase(yyruleno==90); - /* (91) conslist ::= tcons */ yytestcase(yyruleno==91); - /* (92) tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==92); + /* (90) conslist ::= conslist COMMA tcons */ yytestcase(yyruleno==90); + /* (91) conslist ::= conslist tcons */ yytestcase(yyruleno==91); + /* (92) conslist ::= tcons */ yytestcase(yyruleno==92); + /* (93) tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==93); /* (268) plus_opt ::= PLUS */ yytestcase(yyruleno==268); /* (269) plus_opt ::= */ yytestcase(yyruleno==269); /* (279) foreach_clause ::= */ yytestcase(yyruleno==279); @@ -93559,8 +102986,6 @@ SQLITE_PRIVATE void sqlite3Parser( ** This file contains C code that splits an SQL input string up into ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. -** -** $Id: tokenize.c,v 1.163 2009/07/03 22:54:37 drh Exp $ */ /* @@ -93878,6 +103303,7 @@ static int keywordCode(const char *z, int n){ SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){ return keywordCode((char*)z, n); } +#define SQLITE_N_KEYWORD 121 /************** End of keywordhash.h *****************************************/ /************** Continuing where we left off in tokenize.c *******************/ @@ -93900,16 +103326,7 @@ SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){ ** But the feature is undocumented. */ #ifdef SQLITE_ASCII -SQLITE_PRIVATE const char sqlite3IsAsciiIdChar[] = { -/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ -}; -#define IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && sqlite3IsAsciiIdChar[c-0x20])) +#define IdChar(C) ((sqlite3CtypeMap[(unsigned char)C]&0x46)!=0) #endif #ifdef SQLITE_EBCDIC SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[] = { @@ -93950,8 +103367,9 @@ SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){ } case '-': { if( z[1]=='-' ){ + /* IMP: R-15891-05542 -- syntax diagram for comments */ for(i=2; (c=z[i])!=0 && c!='\n'; i++){} - *tokenType = TK_SPACE; + *tokenType = TK_SPACE; /* IMP: R-22934-25134 */ return i; } *tokenType = TK_MINUS; @@ -93982,9 +103400,10 @@ SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){ *tokenType = TK_SLASH; return 1; } + /* IMP: R-15891-05542 -- syntax diagram for comments */ for(i=3, c=z[2]; (c!='*' || z[i]!='/') && (c=z[i])!=0; i++){} if( c ) i++; - *tokenType = TK_SPACE; + *tokenType = TK_SPACE; /* IMP: R-22934-25134 */ return i; } case '%': { @@ -94305,6 +103724,7 @@ abort_parse: assert( pzErrMsg!=0 ); if( pParse->zErrMsg ){ *pzErrMsg = pParse->zErrMsg; + sqlite3_log(pParse->rc, "%s", *pzErrMsg); pParse->zErrMsg = 0; nErr++; } @@ -94320,7 +103740,7 @@ abort_parse: } #endif #ifndef SQLITE_OMIT_VIRTUALTABLE - sqlite3DbFree(db, pParse->apVtabLock); + sqlite3_free(pParse->apVtabLock); #endif if( !IN_DECLARE_VTAB ){ @@ -94328,7 +103748,7 @@ abort_parse: ** structure built up in pParse->pNewTable. The calling code (see vtab.c) ** will take responsibility for freeing the Table structure. */ - sqlite3DeleteTable(pParse->pNewTable); + sqlite3DeleteTable(db, pParse->pNewTable); } sqlite3DeleteTrigger(db, pParse->pNewTrigger); @@ -94342,7 +103762,7 @@ abort_parse: while( pParse->pZombieTab ){ Table *p = pParse->pZombieTab; pParse->pZombieTab = p->pNextZombie; - sqlite3DeleteTable(p); + sqlite3DeleteTable(db, p); } if( nErr>0 && pParse->rc==SQLITE_OK ){ pParse->rc = SQLITE_ERROR; @@ -94369,8 +103789,6 @@ abort_parse: ** This code used to be part of the tokenizer.c source file. But by ** separating it out, the code will be automatically omitted from ** static links that do not use it. -** -** $Id: complete.c,v 1.8 2009/04/28 04:46:42 drh Exp $ */ #ifndef SQLITE_OMIT_COMPLETE @@ -94379,8 +103797,7 @@ abort_parse: */ #ifndef SQLITE_AMALGAMATION #ifdef SQLITE_ASCII -SQLITE_PRIVATE const char sqlite3IsAsciiIdChar[]; -#define IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && sqlite3IsAsciiIdChar[c-0x20])) +#define IdChar(C) ((sqlite3CtypeMap[(unsigned char)C]&0x46)!=0) #endif #ifdef SQLITE_EBCDIC SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[]; @@ -94396,11 +103813,13 @@ SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[]; #define tkSEMI 0 #define tkWS 1 #define tkOTHER 2 +#ifndef SQLITE_OMIT_TRIGGER #define tkEXPLAIN 3 #define tkCREATE 4 #define tkTEMP 5 #define tkTRIGGER 6 #define tkEND 7 +#endif /* ** Return TRUE if the given SQL string ends in a semicolon. @@ -94409,36 +103828,38 @@ SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[]; ** Whenever the CREATE TRIGGER keywords are seen, the statement ** must end with ";END;". ** -** This implementation uses a state machine with 7 states: +** This implementation uses a state machine with 8 states: ** -** (0) START At the beginning or end of an SQL statement. This routine +** (0) INVALID We have not yet seen a non-whitespace character. +** +** (1) START At the beginning or end of an SQL statement. This routine ** returns 1 if it ends in the START state and 0 if it ends ** in any other state. ** -** (1) NORMAL We are in the middle of statement which ends with a single +** (2) NORMAL We are in the middle of statement which ends with a single ** semicolon. ** -** (2) EXPLAIN The keyword EXPLAIN has been seen at the beginning of +** (3) EXPLAIN The keyword EXPLAIN has been seen at the beginning of ** a statement. ** -** (3) CREATE The keyword CREATE has been seen at the beginning of a -** statement, possibly preceded by EXPLAIN and/or followed by +** (4) CREATE The keyword CREATE has been seen at the beginning of a +** statement, possibly preceeded by EXPLAIN and/or followed by ** TEMP or TEMPORARY ** -** (4) TRIGGER We are in the middle of a trigger definition that must be +** (5) TRIGGER We are in the middle of a trigger definition that must be ** ended by a semicolon, the keyword END, and another semicolon. ** -** (5) SEMI We've seen the first semicolon in the ";END;" that occurs at +** (6) SEMI We've seen the first semicolon in the ";END;" that occurs at ** the end of a trigger definition. ** -** (6) END We've seen the ";END" of the ";END;" that occurs at the end +** (7) END We've seen the ";END" of the ";END;" that occurs at the end ** of a trigger difinition. ** ** Transitions between states above are determined by tokens extracted ** from the input. The following tokens are significant: ** ** (0) tkSEMI A semicolon. -** (1) tkWS Whitespace +** (1) tkWS Whitespace. ** (2) tkOTHER Any other SQL token. ** (3) tkEXPLAIN The "explain" keyword. ** (4) tkCREATE The "create" keyword. @@ -94447,6 +103868,7 @@ SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[]; ** (7) tkEND The "end" keyword. ** ** Whitespace never causes a state transition and is always ignored. +** This means that a SQL string of all whitespace is invalid. ** ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed ** to recognize the end of a trigger can be omitted. All we have to do @@ -94460,26 +103882,28 @@ SQLITE_API int sqlite3_complete(const char *zSql){ /* A complex statement machine used to detect the end of a CREATE TRIGGER ** statement. This is the normal case. */ - static const u8 trans[7][8] = { + static const u8 trans[8][8] = { /* Token: */ - /* State: ** SEMI WS OTHER EXPLAIN CREATE TEMP TRIGGER END */ - /* 0 START: */ { 0, 0, 1, 2, 3, 1, 1, 1, }, - /* 1 NORMAL: */ { 0, 1, 1, 1, 1, 1, 1, 1, }, - /* 2 EXPLAIN: */ { 0, 2, 2, 1, 3, 1, 1, 1, }, - /* 3 CREATE: */ { 0, 3, 1, 1, 1, 3, 4, 1, }, - /* 4 TRIGGER: */ { 5, 4, 4, 4, 4, 4, 4, 4, }, - /* 5 SEMI: */ { 5, 5, 4, 4, 4, 4, 4, 6, }, - /* 6 END: */ { 0, 6, 4, 4, 4, 4, 4, 4, }, + /* State: ** SEMI WS OTHER EXPLAIN CREATE TEMP TRIGGER END */ + /* 0 INVALID: */ { 1, 0, 2, 3, 4, 2, 2, 2, }, + /* 1 START: */ { 1, 1, 2, 3, 4, 2, 2, 2, }, + /* 2 NORMAL: */ { 1, 2, 2, 2, 2, 2, 2, 2, }, + /* 3 EXPLAIN: */ { 1, 3, 3, 2, 4, 2, 2, 2, }, + /* 4 CREATE: */ { 1, 4, 2, 2, 2, 4, 5, 2, }, + /* 5 TRIGGER: */ { 6, 5, 5, 5, 5, 5, 5, 5, }, + /* 6 SEMI: */ { 6, 6, 5, 5, 5, 5, 5, 7, }, + /* 7 END: */ { 1, 7, 5, 5, 5, 5, 5, 5, }, }; #else /* If triggers are not supported by this compile then the statement machine ** used to detect the end of a statement is much simplier */ - static const u8 trans[2][3] = { + static const u8 trans[3][3] = { /* Token: */ /* State: ** SEMI WS OTHER */ - /* 0 START: */ { 0, 0, 1, }, - /* 1 NORMAL: */ { 0, 1, 1, }, + /* 0 INVALID: */ { 1, 0, 2, }, + /* 1 START: */ { 1, 1, 2, }, + /* 2 NORMAL: */ { 1, 2, 2, }, }; #endif /* SQLITE_OMIT_TRIGGER */ @@ -94515,7 +103939,7 @@ SQLITE_API int sqlite3_complete(const char *zSql){ break; } while( *zSql && *zSql!='\n' ){ zSql++; } - if( *zSql==0 ) return state==0; + if( *zSql==0 ) return state==1; token = tkWS; break; } @@ -94537,7 +103961,9 @@ SQLITE_API int sqlite3_complete(const char *zSql){ break; } default: { - int c; +#ifdef SQLITE_EBCDIC + unsigned char c; +#endif if( IdChar((u8)*zSql) ){ /* Keywords and unquoted identifiers */ int nId; @@ -94597,7 +104023,7 @@ SQLITE_API int sqlite3_complete(const char *zSql){ state = trans[state][token]; zSql++; } - return state==0; + return state==1; } #ifndef SQLITE_OMIT_UTF16 @@ -94746,15 +104172,33 @@ SQLITE_PRIVATE int sqlite3IcuInit(sqlite3 *db); /************** Continuing where we left off in main.c ***********************/ #endif -/* -** The version of the library -*/ #ifndef SQLITE_AMALGAMATION +/* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant +** contains the text of SQLITE_VERSION macro. +*/ SQLITE_API const char sqlite3_version[] = SQLITE_VERSION; #endif + +/* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns +** a pointer to the to the sqlite3_version[] string constant. +*/ SQLITE_API const char *sqlite3_libversion(void){ return sqlite3_version; } + +/* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a +** pointer to a string constant whose value is the same as the +** SQLITE_SOURCE_ID C preprocessor macro. +*/ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } + +/* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function +** returns an integer equal to SQLITE_VERSION_NUMBER. +*/ SQLITE_API int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; } + +/* IMPLEMENTATION-OF: R-54823-41343 The sqlite3_threadsafe() function returns +** zero if and only if SQLite was compiled mutexing code omitted due to +** the SQLITE_THREADSAFE compile-time option being set to 0. +*/ SQLITE_API int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } #if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE) @@ -94875,6 +104319,13 @@ SQLITE_API int sqlite3_initialize(void){ ** sqlite3_initialize(). The recursive calls normally come through ** sqlite3_os_init() when it invokes sqlite3_vfs_register(), but other ** recursive calls might also be possible. + ** + ** IMPLEMENTATION-OF: R-00140-37445 SQLite automatically serializes calls + ** to the xInit method, so the xInit method need not be threadsafe. + ** + ** The following mutex is what serializes access to the appdef pcache xInit + ** methods. The sqlite3_pcache_methods.xInit() all is embedded in the + ** call to sqlite3PcacheInitialize(). */ sqlite3_mutex_enter(sqlite3GlobalConfig.pInitMutex); if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){ @@ -94977,7 +104428,7 @@ SQLITE_API int sqlite3_config(int op, ...){ /* sqlite3_config() shall return SQLITE_MISUSE if it is invoked while ** the SQLite library is in use. */ - if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE; + if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE_BKPT; va_start(ap, op); switch( op ){ @@ -94985,7 +104436,7 @@ SQLITE_API int sqlite3_config(int op, ...){ /* Mutex configuration options are only available in a threadsafe ** compile. */ -#if SQLITE_THREADSAFE +#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0 case SQLITE_CONFIG_SINGLETHREAD: { /* Disable all mutexing */ sqlite3GlobalConfig.bCoreMutex = 0; @@ -95098,6 +104549,21 @@ SQLITE_API int sqlite3_config(int op, ...){ sqlite3GlobalConfig.nLookaside = va_arg(ap, int); break; } + + /* Record a pointer to the logger funcction and its first argument. + ** The default is NULL. Logging is disabled if the function pointer is + ** NULL. + */ + case SQLITE_CONFIG_LOG: { + /* MSVC is picky about pulling func ptrs from va lists. + ** http://support.microsoft.com/kb/47961 + ** sqlite3GlobalConfig.xLog = va_arg(ap, void(*)(void*,int,const char*)); + */ + typedef void(*LOGFUNC_t)(void*,int,const char*); + sqlite3GlobalConfig.xLog = va_arg(ap, LOGFUNC_t); + sqlite3GlobalConfig.pLogArg = va_arg(ap, void*); + break; + } default: { rc = SQLITE_ERROR; @@ -95140,12 +104606,12 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){ sz = 0; pStart = 0; }else if( pBuf==0 ){ - sz = ROUND8(sz); + sz = ROUNDDOWN8(sz); /* IMP: R-33038-09382 */ sqlite3BeginBenignMalloc(); - pStart = sqlite3Malloc( sz*cnt ); + pStart = sqlite3Malloc( sz*cnt ); /* IMP: R-61949-35727 */ sqlite3EndBenignMalloc(); }else{ - sz = ROUNDDOWN8(sz); + sz = ROUNDDOWN8(sz); /* IMP: R-33038-09382 */ pStart = pBuf; } db->lookaside.pStart = pStart; @@ -95188,14 +104654,14 @@ SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){ va_start(ap, op); switch( op ){ case SQLITE_DBCONFIG_LOOKASIDE: { - void *pBuf = va_arg(ap, void*); - int sz = va_arg(ap, int); - int cnt = va_arg(ap, int); + void *pBuf = va_arg(ap, void*); /* IMP: R-21112-12275 */ + int sz = va_arg(ap, int); /* IMP: R-47871-25994 */ + int cnt = va_arg(ap, int); /* IMP: R-04460-53386 */ rc = setupLookaside(db, pBuf, sz, cnt); break; } default: { - rc = SQLITE_ERROR; + rc = SQLITE_ERROR; /* IMP: R-42790-23372 */ break; } } @@ -95243,7 +104709,7 @@ static int binCollFunc( /* ** Another built-in collating sequence: NOCASE. ** -** This collating sequence is intended to be used for "case independent +** This collating sequence is intended to be used for "case independant ** comparison". SQLite's knowledge of upper and lower case equivalents ** extends only to the 26 characters used in the English language. ** @@ -95300,18 +104766,35 @@ SQLITE_PRIVATE void sqlite3CloseSavepoints(sqlite3 *db){ db->isTransactionSavepoint = 0; } +/* +** Invoke the destructor function associated with FuncDef p, if any. Except, +** if this is not the last copy of the function, do not invoke it. Multiple +** copies of a single function are created when create_function() is called +** with SQLITE_ANY as the encoding. +*/ +static void functionDestroy(sqlite3 *db, FuncDef *p){ + FuncDestructor *pDestructor = p->pDestructor; + if( pDestructor ){ + pDestructor->nRef--; + if( pDestructor->nRef==0 ){ + pDestructor->xDestroy(pDestructor->pUserData); + sqlite3DbFree(db, pDestructor); + } + } +} + /* ** Close an existing SQLite database */ SQLITE_API int sqlite3_close(sqlite3 *db){ - HashElem *i; + HashElem *i; /* Hash table iterator */ int j; if( !db ){ return SQLITE_OK; } if( !sqlite3SafetyCheckSickOrOk(db) ){ - return SQLITE_MISUSE; + return SQLITE_MISUSE_BKPT; } sqlite3_mutex_enter(db->mutex); @@ -95372,6 +104855,7 @@ SQLITE_API int sqlite3_close(sqlite3 *db){ for(p=db->aFunc.a[j]; p; p=pHash){ pHash = p->pHash; while( p ){ + functionDestroy(db, p); pNext = p->pNext; sqlite3DbFree(db, p); p = pNext; @@ -95481,7 +104965,7 @@ SQLITE_PRIVATE const char *sqlite3ErrStr(int rc){ /* SQLITE_NOTFOUND */ 0, /* SQLITE_FULL */ "database or disk is full", /* SQLITE_CANTOPEN */ "unable to open database file", - /* SQLITE_PROTOCOL */ 0, + /* SQLITE_PROTOCOL */ "locking protocol", /* SQLITE_EMPTY */ "table contains no data", /* SQLITE_SCHEMA */ "database schema has changed", /* SQLITE_TOOBIG */ "string or blob too big", @@ -95646,7 +105130,8 @@ SQLITE_PRIVATE int sqlite3CreateFunc( void *pUserData, void (*xFunc)(sqlite3_context*,int,sqlite3_value **), void (*xStep)(sqlite3_context*,int,sqlite3_value **), - void (*xFinal)(sqlite3_context*) + void (*xFinal)(sqlite3_context*), + FuncDestructor *pDestructor ){ FuncDef *p; int nName; @@ -95658,7 +105143,7 @@ SQLITE_PRIVATE int sqlite3CreateFunc( (!xFunc && (!xFinal && xStep)) || (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG) || (255<(nName = sqlite3Strlen30( zFunctionName))) ){ - return SQLITE_MISUSE; + return SQLITE_MISUSE_BKPT; } #ifndef SQLITE_OMIT_UTF16 @@ -95674,10 +105159,10 @@ SQLITE_PRIVATE int sqlite3CreateFunc( }else if( enc==SQLITE_ANY ){ int rc; rc = sqlite3CreateFunc(db, zFunctionName, nArg, SQLITE_UTF8, - pUserData, xFunc, xStep, xFinal); + pUserData, xFunc, xStep, xFinal, pDestructor); if( rc==SQLITE_OK ){ rc = sqlite3CreateFunc(db, zFunctionName, nArg, SQLITE_UTF16LE, - pUserData, xFunc, xStep, xFinal); + pUserData, xFunc, xStep, xFinal, pDestructor); } if( rc!=SQLITE_OK ){ return rc; @@ -95710,6 +105195,15 @@ SQLITE_PRIVATE int sqlite3CreateFunc( if( !p ){ return SQLITE_NOMEM; } + + /* If an older version of the function with a configured destructor is + ** being replaced invoke the destructor function here. */ + functionDestroy(db, p); + + if( pDestructor ){ + pDestructor->nRef++; + } + p->pDestructor = pDestructor; p->flags = 0; p->xFunc = xFunc; p->xStep = xStep; @@ -95724,7 +105218,7 @@ SQLITE_PRIVATE int sqlite3CreateFunc( */ SQLITE_API int sqlite3_create_function( sqlite3 *db, - const char *zFunctionName, + const char *zFunc, int nArg, int enc, void *p, @@ -95732,9 +105226,41 @@ SQLITE_API int sqlite3_create_function( void (*xStep)(sqlite3_context*,int,sqlite3_value **), void (*xFinal)(sqlite3_context*) ){ - int rc; + return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xFunc, xStep, + xFinal, 0); +} + +SQLITE_API int sqlite3_create_function_v2( + sqlite3 *db, + const char *zFunc, + int nArg, + int enc, + void *p, + void (*xFunc)(sqlite3_context*,int,sqlite3_value **), + void (*xStep)(sqlite3_context*,int,sqlite3_value **), + void (*xFinal)(sqlite3_context*), + void (*xDestroy)(void *) +){ + int rc = SQLITE_ERROR; + FuncDestructor *pArg = 0; sqlite3_mutex_enter(db->mutex); - rc = sqlite3CreateFunc(db, zFunctionName, nArg, enc, p, xFunc, xStep, xFinal); + if( xDestroy ){ + pArg = (FuncDestructor *)sqlite3DbMallocZero(db, sizeof(FuncDestructor)); + if( !pArg ){ + xDestroy(p); + goto out; + } + pArg->xDestroy = xDestroy; + pArg->pUserData = p; + } + rc = sqlite3CreateFunc(db, zFunc, nArg, enc, p, xFunc, xStep, xFinal, pArg); + if( pArg && pArg->nRef==0 ){ + assert( rc!=SQLITE_OK ); + xDestroy(p); + sqlite3DbFree(db, pArg); + } + + out: rc = sqlite3ApiExit(db, rc); sqlite3_mutex_leave(db->mutex); return rc; @@ -95755,8 +105281,8 @@ SQLITE_API int sqlite3_create_function16( char *zFunc8; sqlite3_mutex_enter(db->mutex); assert( !db->mallocFailed ); - zFunc8 = sqlite3Utf16to8(db, zFunctionName, -1); - rc = sqlite3CreateFunc(db, zFunc8, nArg, eTextRep, p, xFunc, xStep, xFinal); + zFunc8 = sqlite3Utf16to8(db, zFunctionName, -1, SQLITE_UTF16NATIVE); + rc = sqlite3CreateFunc(db, zFunc8, nArg, eTextRep, p, xFunc, xStep, xFinal,0); sqlite3DbFree(db, zFunc8); rc = sqlite3ApiExit(db, rc); sqlite3_mutex_leave(db->mutex); @@ -95787,7 +105313,7 @@ SQLITE_API int sqlite3_overload_function( sqlite3_mutex_enter(db->mutex); if( sqlite3FindFunction(db, zName, nName, nArg, SQLITE_UTF8, 0)==0 ){ sqlite3CreateFunc(db, zName, nArg, SQLITE_UTF8, - 0, sqlite3InvalidFunction, 0, 0); + 0, sqlite3InvalidFunction, 0, 0, 0); } rc = sqlite3ApiExit(db, SQLITE_OK); sqlite3_mutex_leave(db->mutex); @@ -95891,6 +105417,139 @@ SQLITE_API void *sqlite3_rollback_hook( return pRet; } +#ifndef SQLITE_OMIT_WAL +/* +** The sqlite3_wal_hook() callback registered by sqlite3_wal_autocheckpoint(). +** Invoke sqlite3_wal_checkpoint if the number of frames in the log file +** is greater than sqlite3.pWalArg cast to an integer (the value configured by +** wal_autocheckpoint()). +*/ +SQLITE_PRIVATE int sqlite3WalDefaultHook( + void *pClientData, /* Argument */ + sqlite3 *db, /* Connection */ + const char *zDb, /* Database */ + int nFrame /* Size of WAL */ +){ + if( nFrame>=SQLITE_PTR_TO_INT(pClientData) ){ + sqlite3BeginBenignMalloc(); + sqlite3_wal_checkpoint(db, zDb); + sqlite3EndBenignMalloc(); + } + return SQLITE_OK; +} +#endif /* SQLITE_OMIT_WAL */ + +/* +** Configure an sqlite3_wal_hook() callback to automatically checkpoint +** a database after committing a transaction if there are nFrame or +** more frames in the log file. Passing zero or a negative value as the +** nFrame parameter disables automatic checkpoints entirely. +** +** The callback registered by this function replaces any existing callback +** registered using sqlite3_wal_hook(). Likewise, registering a callback +** using sqlite3_wal_hook() disables the automatic checkpoint mechanism +** configured by this function. +*/ +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){ +#ifdef SQLITE_OMIT_WAL + UNUSED_PARAMETER(db); + UNUSED_PARAMETER(nFrame); +#else + if( nFrame>0 ){ + sqlite3_wal_hook(db, sqlite3WalDefaultHook, SQLITE_INT_TO_PTR(nFrame)); + }else{ + sqlite3_wal_hook(db, 0, 0); + } +#endif + return SQLITE_OK; +} + +/* +** Register a callback to be invoked each time a transaction is written +** into the write-ahead-log by this database connection. +*/ +SQLITE_API void *sqlite3_wal_hook( + sqlite3 *db, /* Attach the hook to this db handle */ + int(*xCallback)(void *, sqlite3*, const char*, int), + void *pArg /* First argument passed to xCallback() */ +){ +#ifndef SQLITE_OMIT_WAL + void *pRet; + sqlite3_mutex_enter(db->mutex); + pRet = db->pWalArg; + db->xWalCallback = xCallback; + db->pWalArg = pArg; + sqlite3_mutex_leave(db->mutex); + return pRet; +#else + return 0; +#endif +} + + +/* +** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points +** to contains a zero-length string, all attached databases are +** checkpointed. +*/ +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ +#ifdef SQLITE_OMIT_WAL + return SQLITE_OK; +#else + int rc; /* Return code */ + int iDb = SQLITE_MAX_ATTACHED; /* sqlite3.aDb[] index of db to checkpoint */ + + sqlite3_mutex_enter(db->mutex); + if( zDb && zDb[0] ){ + iDb = sqlite3FindDbName(db, zDb); + } + if( iDb<0 ){ + rc = SQLITE_ERROR; + sqlite3Error(db, SQLITE_ERROR, "unknown database: %s", zDb); + }else{ + rc = sqlite3Checkpoint(db, iDb); + sqlite3Error(db, rc, 0); + } + rc = sqlite3ApiExit(db, rc); + sqlite3_mutex_leave(db->mutex); + return rc; +#endif +} + +#ifndef SQLITE_OMIT_WAL +/* +** Run a checkpoint on database iDb. This is a no-op if database iDb is +** not currently open in WAL mode. +** +** If a transaction is open on the database being checkpointed, this +** function returns SQLITE_LOCKED and a checkpoint is not attempted. If +** an error occurs while running the checkpoint, an SQLite error code is +** returned (i.e. SQLITE_IOERR). Otherwise, SQLITE_OK. +** +** The mutex on database handle db should be held by the caller. The mutex +** associated with the specific b-tree being checkpointed is taken by +** this function while the checkpoint is running. +** +** If iDb is passed SQLITE_MAX_ATTACHED, then all attached databases are +** checkpointed. If an error is encountered it is returned immediately - +** no attempt is made to checkpoint any remaining databases. +*/ +SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3 *db, int iDb){ + int rc = SQLITE_OK; /* Return code */ + int i; /* Used to iterate through attached dbs */ + + assert( sqlite3_mutex_held(db->mutex) ); + + for(i=0; inDb && rc==SQLITE_OK; i++){ + if( i==iDb || iDb==SQLITE_MAX_ATTACHED ){ + rc = sqlite3BtreeCheckpoint(db->aDb[i].pBt); + } + } + + return rc; +} +#endif /* SQLITE_OMIT_WAL */ + /* ** This function returns true if main-memory should be used instead of ** a temporary file for transient pager files and statement journals. @@ -95925,60 +105584,6 @@ SQLITE_PRIVATE int sqlite3TempInMemory(const sqlite3 *db){ #endif } -/* -** This routine is called to create a connection to a database BTree -** driver. If zFilename is the name of a file, then that file is -** opened and used. If zFilename is the magic name ":memory:" then -** the database is stored in memory (and is thus forgotten as soon as -** the connection is closed.) If zFilename is NULL then the database -** is a "virtual" database for transient use only and is deleted as -** soon as the connection is closed. -** -** A virtual database can be either a disk file (that is automatically -** deleted when the file is closed) or it an be held entirely in memory. -** The sqlite3TempInMemory() function is used to determine which. -*/ -SQLITE_PRIVATE int sqlite3BtreeFactory( - sqlite3 *db, /* Main database when opening aux otherwise 0 */ - const char *zFilename, /* Name of the file containing the BTree database */ - int omitJournal, /* if TRUE then do not journal this file */ - int nCache, /* How many pages in the page cache */ - int vfsFlags, /* Flags passed through to vfsOpen */ - Btree **ppBtree /* Pointer to new Btree object written here */ -){ - int btFlags = 0; - int rc; - - assert( sqlite3_mutex_held(db->mutex) ); - assert( ppBtree != 0); - if( omitJournal ){ - btFlags |= BTREE_OMIT_JOURNAL; - } - if( db->flags & SQLITE_NoReadlock ){ - btFlags |= BTREE_NO_READLOCK; - } -#ifndef SQLITE_OMIT_MEMORYDB - if( zFilename==0 && sqlite3TempInMemory(db) ){ - zFilename = ":memory:"; - } -#endif - - if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (zFilename==0 || *zFilename==0) ){ - vfsFlags = (vfsFlags & ~SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB; - } - rc = sqlite3BtreeOpen(zFilename, (sqlite3 *)db, ppBtree, btFlags, vfsFlags); - - /* If the B-Tree was successfully opened, set the pager-cache size to the - ** default value. Except, if the call to BtreeOpen() returned a handle - ** open on an existing shared pager-cache, do not change the pager-cache - ** size. - */ - if( rc==SQLITE_OK && 0==sqlite3BtreeSchema(*ppBtree, 0, 0) ){ - sqlite3BtreeSetCacheSize(*ppBtree, nCache); - } - return rc; -} - /* ** Return UTF-8 encoded English language explanation of the most recent ** error. @@ -95989,7 +105594,7 @@ SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){ return sqlite3ErrStr(SQLITE_NOMEM); } if( !sqlite3SafetyCheckSickOrOk(db) ){ - return sqlite3ErrStr(SQLITE_MISUSE); + return sqlite3ErrStr(SQLITE_MISUSE_BKPT); } sqlite3_mutex_enter(db->mutex); if( db->mallocFailed ){ @@ -96058,7 +105663,7 @@ SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){ */ SQLITE_API int sqlite3_errcode(sqlite3 *db){ if( db && !sqlite3SafetyCheckSickOrOk(db) ){ - return SQLITE_MISUSE; + return SQLITE_MISUSE_BKPT; } if( !db || db->mallocFailed ){ return SQLITE_NOMEM; @@ -96067,7 +105672,7 @@ SQLITE_API int sqlite3_errcode(sqlite3 *db){ } SQLITE_API int sqlite3_extended_errcode(sqlite3 *db){ if( db && !sqlite3SafetyCheckSickOrOk(db) ){ - return SQLITE_MISUSE; + return SQLITE_MISUSE_BKPT; } if( !db || db->mallocFailed ){ return SQLITE_NOMEM; @@ -96105,7 +105710,7 @@ static int createCollation( enc2 = SQLITE_UTF16NATIVE; } if( enc2SQLITE_UTF16BE ){ - return SQLITE_MISUSE; + return SQLITE_MISUSE_BKPT; } /* Check if this call is removing or replacing an existing collation @@ -96221,17 +105826,39 @@ static const int aHardLimit[] = { */ SQLITE_API int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ int oldLimit; + + + /* EVIDENCE-OF: R-30189-54097 For each limit category SQLITE_LIMIT_NAME + ** there is a hard upper bound set at compile-time by a C preprocessor + ** macro called SQLITE_MAX_NAME. (The "_LIMIT_" in the name is changed to + ** "_MAX_".) + */ + assert( aHardLimit[SQLITE_LIMIT_LENGTH]==SQLITE_MAX_LENGTH ); + assert( aHardLimit[SQLITE_LIMIT_SQL_LENGTH]==SQLITE_MAX_SQL_LENGTH ); + assert( aHardLimit[SQLITE_LIMIT_COLUMN]==SQLITE_MAX_COLUMN ); + assert( aHardLimit[SQLITE_LIMIT_EXPR_DEPTH]==SQLITE_MAX_EXPR_DEPTH ); + assert( aHardLimit[SQLITE_LIMIT_COMPOUND_SELECT]==SQLITE_MAX_COMPOUND_SELECT); + assert( aHardLimit[SQLITE_LIMIT_VDBE_OP]==SQLITE_MAX_VDBE_OP ); + assert( aHardLimit[SQLITE_LIMIT_FUNCTION_ARG]==SQLITE_MAX_FUNCTION_ARG ); + assert( aHardLimit[SQLITE_LIMIT_ATTACHED]==SQLITE_MAX_ATTACHED ); + assert( aHardLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH]== + SQLITE_MAX_LIKE_PATTERN_LENGTH ); + assert( aHardLimit[SQLITE_LIMIT_VARIABLE_NUMBER]==SQLITE_MAX_VARIABLE_NUMBER); + assert( aHardLimit[SQLITE_LIMIT_TRIGGER_DEPTH]==SQLITE_MAX_TRIGGER_DEPTH ); + assert( SQLITE_LIMIT_TRIGGER_DEPTH==(SQLITE_N_LIMIT-1) ); + + if( limitId<0 || limitId>=SQLITE_N_LIMIT ){ return -1; } oldLimit = db->aLimit[limitId]; - if( newLimit>=0 ){ + if( newLimit>=0 ){ /* IMP: R-52476-28732 */ if( newLimit>aHardLimit[limitId] ){ - newLimit = aHardLimit[limitId]; + newLimit = aHardLimit[limitId]; /* IMP: R-51463-25634 */ } db->aLimit[limitId] = newLimit; } - return oldLimit; + return oldLimit; /* IMP: R-53341-35419 */ } /* @@ -96255,6 +105882,24 @@ static int openDatabase( if( rc ) return rc; #endif + /* Only allow sensible combinations of bits in the flags argument. + ** Throw an error if any non-sense combination is used. If we + ** do not block illegal combinations here, it could trigger + ** assert() statements in deeper layers. Sensible combinations + ** are: + ** + ** 1: SQLITE_OPEN_READONLY + ** 2: SQLITE_OPEN_READWRITE + ** 6: SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE + */ + assert( SQLITE_OPEN_READONLY == 0x01 ); + assert( SQLITE_OPEN_READWRITE == 0x02 ); + assert( SQLITE_OPEN_CREATE == 0x04 ); + testcase( (1<<(flags&7))==0x02 ); /* READONLY */ + testcase( (1<<(flags&7))==0x04 ); /* READWRITE */ + testcase( (1<<(flags&7))==0x40 ); /* READWRITE | CREATE */ + if( ((1<<(flags&7)) & 0x46)==0 ) return SQLITE_MISUSE; + if( sqlite3GlobalConfig.bCoreMutex==0 ){ isThreadsafe = 0; }else if( flags & SQLITE_OPEN_NOMUTEX ){ @@ -96288,7 +105933,8 @@ static int openDatabase( SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_MASTER_JOURNAL | SQLITE_OPEN_NOMUTEX | - SQLITE_OPEN_FULLMUTEX + SQLITE_OPEN_FULLMUTEX | + SQLITE_OPEN_WAL ); /* Allocate the sqlite data structure */ @@ -96313,7 +105959,7 @@ static int openDatabase( db->autoCommit = 1; db->nextAutovac = -1; db->nextPagesize = 0; - db->flags |= SQLITE_ShortColNames + db->flags |= SQLITE_ShortColNames | SQLITE_AutoIndex #if SQLITE_DEFAULT_FILE_FORMAT<4 | SQLITE_LegacyFileFmt #endif @@ -96360,9 +106006,8 @@ static int openDatabase( /* Open the backend database driver */ db->openFlags = flags; - rc = sqlite3BtreeFactory(db, zFilename, 0, SQLITE_DEFAULT_CACHE_SIZE, - flags | SQLITE_OPEN_MAIN_DB, - &db->aDb[0].pBt); + rc = sqlite3BtreeOpen(zFilename, db, &db->aDb[0].pBt, 0, + flags | SQLITE_OPEN_MAIN_DB); if( rc!=SQLITE_OK ){ if( rc==SQLITE_IOERR_NOMEM ){ rc = SQLITE_NOMEM; @@ -96451,6 +106096,8 @@ static int openDatabase( setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside, sqlite3GlobalConfig.nLookaside); + sqlite3_wal_autocheckpoint(db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT); + opendb_out: if( db ){ assert( db->mutex!=0 || isThreadsafe==0 || sqlite3GlobalConfig.bFullMutex==0 ); @@ -96578,7 +106225,7 @@ SQLITE_API int sqlite3_create_collation16( char *zName8; sqlite3_mutex_enter(db->mutex); assert( !db->mallocFailed ); - zName8 = sqlite3Utf16to8(db, zName, -1); + zName8 = sqlite3Utf16to8(db, zName, -1, SQLITE_UTF16NATIVE); if( zName8 ){ rc = createCollation(db, zName8, (u8)enc, SQLITE_COLL_USER, pCtx, xCompare, 0); sqlite3DbFree(db, zName8); @@ -96625,7 +106272,6 @@ SQLITE_API int sqlite3_collation_needed16( } #endif /* SQLITE_OMIT_UTF16 */ -#ifndef SQLITE_OMIT_GLOBALRECOVER #ifndef SQLITE_OMIT_DEPRECATED /* ** This function is now an anachronism. It used to be used to recover from a @@ -96635,12 +106281,11 @@ SQLITE_API int sqlite3_global_recover(void){ return SQLITE_OK; } #endif -#endif /* ** Test to see whether or not the database connection is in autocommit ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on -** by default. Autocommit is disabled by a BEGIN statement and re-enabled +** by default. Autocommit is disabled by a BEGIN statement and reenabled ** by the next COMMIT or ROLLBACK. ** ******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** @@ -96649,16 +106294,39 @@ SQLITE_API int sqlite3_get_autocommit(sqlite3 *db){ return db->autoCommit; } -#ifdef SQLITE_DEBUG /* -** The following routine is subtituted for constant SQLITE_CORRUPT in -** debugging builds. This provides a way to set a breakpoint for when -** corruption is first detected. +** The following routines are subtitutes for constants SQLITE_CORRUPT, +** SQLITE_MISUSE, SQLITE_CANTOPEN, SQLITE_IOERR and possibly other error +** constants. They server two purposes: +** +** 1. Serve as a convenient place to set a breakpoint in a debugger +** to detect when version error conditions occurs. +** +** 2. Invoke sqlite3_log() to provide the source code location where +** a low-level error is first detected. */ -SQLITE_PRIVATE int sqlite3Corrupt(void){ +SQLITE_PRIVATE int sqlite3CorruptError(int lineno){ + testcase( sqlite3GlobalConfig.xLog!=0 ); + sqlite3_log(SQLITE_CORRUPT, + "database corruption at line %d of [%.10s]", + lineno, 20+sqlite3_sourceid()); return SQLITE_CORRUPT; } -#endif +SQLITE_PRIVATE int sqlite3MisuseError(int lineno){ + testcase( sqlite3GlobalConfig.xLog!=0 ); + sqlite3_log(SQLITE_MISUSE, + "misuse at line %d of [%.10s]", + lineno, 20+sqlite3_sourceid()); + return SQLITE_MISUSE; +} +SQLITE_PRIVATE int sqlite3CantopenError(int lineno){ + testcase( sqlite3GlobalConfig.xLog!=0 ); + sqlite3_log(SQLITE_CANTOPEN, + "cannot open file at line %d of [%.10s]", + lineno, 20+sqlite3_sourceid()); + return SQLITE_CANTOPEN; +} + #ifndef SQLITE_OMIT_DEPRECATED /* @@ -96702,7 +106370,6 @@ SQLITE_API int sqlite3_table_column_metadata( /* Ensure the database schema has been loaded */ sqlite3_mutex_enter(db->mutex); - (void)sqlite3SafetyOn(db); sqlite3BtreeEnterAll(db); rc = sqlite3Init(db, &zErrMsg); if( SQLITE_OK!=rc ){ @@ -96761,7 +106428,6 @@ SQLITE_API int sqlite3_table_column_metadata( error_out: sqlite3BtreeLeaveAll(db); - (void)sqlite3SafetyOff(db); /* Whether the function call succeeded or failed, set the output parameters ** to whatever their local counterparts contain. If an error did occur, @@ -96929,9 +106595,13 @@ SQLITE_API int sqlite3_test_control(int op, ...){ ** dileterious behavior. */ case SQLITE_TESTCTRL_PENDING_BYTE: { - unsigned int newVal = va_arg(ap, unsigned int); - rc = sqlite3PendingByte; - if( newVal ) sqlite3PendingByte = newVal; + rc = PENDING_BYTE; +#ifndef SQLITE_OMIT_WSD + { + unsigned int newVal = va_arg(ap, unsigned int); + if( newVal ) sqlite3PendingByte = newVal; + } +#endif break; } @@ -97001,6 +106671,65 @@ SQLITE_API int sqlite3_test_control(int op, ...){ break; } + /* sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, sqlite3 *db, int N) + ** + ** Enable or disable various optimizations for testing purposes. The + ** argument N is a bitmask of optimizations to be disabled. For normal + ** operation N should be 0. The idea is that a test program (like the + ** SQL Logic Test or SLT test module) can run the same SQL multiple times + ** with various optimizations disabled to verify that the same answer + ** is obtained in every case. + */ + case SQLITE_TESTCTRL_OPTIMIZATIONS: { + sqlite3 *db = va_arg(ap, sqlite3*); + int x = va_arg(ap,int); + db->flags = (x & SQLITE_OptMask) | (db->flags & ~SQLITE_OptMask); + break; + } + +#ifdef SQLITE_N_KEYWORD + /* sqlite3_test_control(SQLITE_TESTCTRL_ISKEYWORD, const char *zWord) + ** + ** If zWord is a keyword recognized by the parser, then return the + ** number of keywords. Or if zWord is not a keyword, return 0. + ** + ** This test feature is only available in the amalgamation since + ** the SQLITE_N_KEYWORD macro is not defined in this file if SQLite + ** is built using separate source files. + */ + case SQLITE_TESTCTRL_ISKEYWORD: { + const char *zWord = va_arg(ap, const char*); + int n = sqlite3Strlen30(zWord); + rc = (sqlite3KeywordCode((u8*)zWord, n)!=TK_ID) ? SQLITE_N_KEYWORD : 0; + break; + } +#endif + + /* sqlite3_test_control(SQLITE_TESTCTRL_PGHDRSZ) + ** + ** Return the size of a pcache header in bytes. + */ + case SQLITE_TESTCTRL_PGHDRSZ: { + rc = sizeof(PgHdr); + break; + } + + /* sqlite3_test_control(SQLITE_TESTCTRL_SCRATCHMALLOC, sz, &pNew, pFree); + ** + ** Pass pFree into sqlite3ScratchFree(). + ** If sz>0 then allocate a scratch buffer into pNew. + */ + case SQLITE_TESTCTRL_SCRATCHMALLOC: { + void *pFree, **ppNew; + int sz; + sz = va_arg(ap, int); + ppNew = va_arg(ap, void**); + pFree = va_arg(ap, void*); + if( sz ) *ppNew = sqlite3ScratchMalloc(sz); + sqlite3ScratchFree(pFree); + break; + } + } va_end(ap); #endif /* SQLITE_OMIT_BUILTIN_TEST */ @@ -97023,8 +106752,6 @@ SQLITE_API int sqlite3_test_control(int op, ...){ ** ** This file contains the implementation of the sqlite3_unlock_notify() ** API method and its associated functionality. -** -** $Id: notify.c,v 1.4 2009/04/07 22:06:57 drh Exp $ */ /* Omit this entire file if SQLITE_ENABLE_UNLOCK_NOTIFY is not defined. */ @@ -97168,6 +106895,7 @@ SQLITE_API int sqlite3_unlock_notify( if( xNotify==0 ){ removeFromBlockedList(db); + db->pBlockingConnection = 0; db->pUnlockConnection = 0; db->xUnlockNotify = 0; db->pUnlockArg = 0; @@ -97265,7 +106993,7 @@ SQLITE_PRIVATE void sqlite3ConnectionUnlocked(sqlite3 *db){ assert( aArg==aDyn || (aDyn==0 && aArg==aStatic) ); assert( nArg<=(int)ArraySize(aStatic) || aArg==aDyn ); if( (!aDyn && nArg==(int)ArraySize(aStatic)) - || (aDyn && nArg==(int)(sqlite3DbMallocSize(db, aDyn)/sizeof(void*))) + || (aDyn && nArg==(int)(sqlite3MallocSize(aDyn)/sizeof(void*))) ){ /* The aArg[] array needs to grow. */ void **pNew = (void **)sqlite3Malloc(nArg*sizeof(void *)*2); @@ -97368,9 +107096,6 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined). */ -/* TODO(shess) Consider exporting this comment to an HTML file or the -** wiki. -*/ /* The full-text index is stored in a series of b+tree (-like) ** structures called segments which map terms to doclists. The ** structures are like b+trees in layout, but are constructed from the @@ -97393,30 +107118,40 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ ** 21 bits - BBA ** and so on. ** -** This is identical to how sqlite encodes varints (see util.c). +** This is similar in concept to how sqlite encodes "varints" but +** the encoding is not the same. SQLite varints are big-endian +** are are limited to 9 bytes in length whereas FTS3 varints are +** little-endian and can be up to 10 bytes in length (in theory). +** +** Example encodings: +** +** 1: 0x01 +** 127: 0x7f +** 128: 0x81 0x00 ** ** **** Document lists **** ** A doclist (document list) holds a docid-sorted list of hits for a -** given term. Doclists hold docids, and can optionally associate -** token positions and offsets with docids. +** given term. Doclists hold docids and associated token positions. +** A docid is the unique integer identifier for a single document. +** A position is the index of a word within the document. The first +** word of the document has a position of 0. ** -** A DL_POSITIONS_OFFSETS doclist is stored like this: +** FTS3 used to optionally store character offsets using a compile-time +** option. But that functionality is no longer supported. +** +** A doclist is stored like this: ** ** array { ** varint docid; ** array { (position list for column 0) -** varint position; (delta from previous position plus POS_BASE) -** varint startOffset; (delta from previous startOffset) -** varint endOffset; (delta from startOffset) +** varint position; (2 more than the delta from previous position) ** } ** array { ** varint POS_COLUMN; (marks start of position list for new column) ** varint column; (index of new column) ** array { -** varint position; (delta from previous position plus POS_BASE) -** varint startOffset;(delta from previous startOffset) -** varint endOffset; (delta from startOffset) +** varint position; (2 more than the delta from previous position) ** } ** } ** varint POS_END; (marks end of positions for this document. @@ -97424,19 +107159,32 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ ** ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream -** generated by the tokenizer, while an "offset" is a byte offset, -** both based at 0. Note that POS_END and POS_COLUMN occur in the -** same logical place as the position element, and act as sentinals -** ending a position list array. +** generated by the tokenizer. Note that POS_END and POS_COLUMN occur +** in the same logical place as the position element, and act as sentinals +** ending a position list array. POS_END is 0. POS_COLUMN is 1. +** The positions numbers are not stored literally but rather as two more +** than the difference from the prior position, or the just the position plus +** 2 for the first position. Example: ** -** A DL_POSITIONS doclist omits the startOffset and endOffset -** information. A DL_DOCIDS doclist omits both the position and -** offset information, becoming an array of varint-encoded docids. +** label: A B C D E F G H I J K +** value: 123 5 9 1 1 14 35 0 234 72 0 ** -** On-disk data is stored as type DL_DEFAULT, so we don't serialize -** the type. Due to how deletion is implemented in the segmentation -** system, on-disk doclists MUST store at least positions. +** The 123 value is the first docid. For column zero in this document +** there are two matches at positions 3 and 10 (5-2 and 9-2+3). The 1 +** at D signals the start of a new column; the 1 at E indicates that the +** new column is column number 1. There are two positions at 12 and 45 +** (14-2 and 35-2+12). The 0 at H indicate the end-of-document. The +** 234 at I is the next docid. It has one position 72 (72-2) and then +** terminates with the 0 at K. ** +** A "position-list" is the list of positions for multiple columns for +** a single docid. A "column-list" is the set of positions for a single +** column. Hence, a position-list consists of one or more column-lists, +** a document record consists of a docid followed by a position-list and +** a doclist consists of one or more document records. +** +** A bare doclist omits the position information, becoming an +** array of varint-encoded docids. ** **** Segment leaf nodes **** ** Segment leaf nodes store terms and doclists, ordered by term. Leaf @@ -97623,11 +107371,10 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ # define SQLITE_CORE 1 #endif - -/************** Include fts3_expr.h in the middle of fts3.c ******************/ -/************** Begin file fts3_expr.h ***************************************/ +/************** Include fts3Int.h in the middle of fts3.c ********************/ +/************** Begin file fts3Int.h *****************************************/ /* -** 2008 Nov 28 +** 2009 Nov 12 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: @@ -97640,7 +107387,14 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ ** */ -/************** Include fts3_tokenizer.h in the middle of fts3_expr.h ********/ +#ifndef _FTSINT_H +#define _FTSINT_H + +#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) +# define NDEBUG 1 +#endif + +/************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/ /************** Begin file fts3_tokenizer.h **********************************/ /* ** 2006 July 10 @@ -97788,94 +107542,15 @@ struct sqlite3_tokenizer_cursor { /* Tokenizer implementations will typically add additional fields */ }; +int fts3_global_term_cnt(int iTerm, int iCol); +int fts3_term_cnt(int iTerm, int iCol); + + #endif /* _FTS3_TOKENIZER_H_ */ /************** End of fts3_tokenizer.h **************************************/ -/************** Continuing where we left off in fts3_expr.h ******************/ - -/* -** The following describes the syntax supported by the fts3 MATCH -** operator in a similar format to that used by the lemon parser -** generator. This module does not use actually lemon, it uses a -** custom parser. -** -** query ::= andexpr (OR andexpr)*. -** -** andexpr ::= notexpr (AND? notexpr)*. -** -** notexpr ::= nearexpr (NOT nearexpr|-TOKEN)*. -** notexpr ::= LP query RP. -** -** nearexpr ::= phrase (NEAR distance_opt nearexpr)*. -** -** distance_opt ::= . -** distance_opt ::= / INTEGER. -** -** phrase ::= TOKEN. -** phrase ::= COLUMN:TOKEN. -** phrase ::= "TOKEN TOKEN TOKEN...". -*/ - -typedef struct Fts3Expr Fts3Expr; -typedef struct Fts3Phrase Fts3Phrase; - -/* -** A "phrase" is a sequence of one or more tokens that must match in -** sequence. A single token is the base case and the most common case. -** For a sequence of tokens contained in "...", nToken will be the number -** of tokens in the string. -*/ -struct Fts3Phrase { - int nToken; /* Number of tokens in the phrase */ - int iColumn; /* Index of column this phrase must match */ - int isNot; /* Phrase prefixed by unary not (-) operator */ - struct PhraseToken { - char *z; /* Text of the token */ - int n; /* Number of bytes in buffer pointed to by z */ - int isPrefix; /* True if token ends in with a "*" character */ - } aToken[1]; /* One entry for each token in the phrase */ -}; - -/* -** A tree of these objects forms the RHS of a MATCH operator. -*/ -struct Fts3Expr { - int eType; /* One of the FTSQUERY_XXX values defined below */ - int nNear; /* Valid if eType==FTSQUERY_NEAR */ - Fts3Expr *pParent; /* pParent->pLeft==this or pParent->pRight==this */ - Fts3Expr *pLeft; /* Left operand */ - Fts3Expr *pRight; /* Right operand */ - Fts3Phrase *pPhrase; /* Valid if eType==FTSQUERY_PHRASE */ -}; - -SQLITE_PRIVATE int sqlite3Fts3ExprParse(sqlite3_tokenizer *, char **, int, int, - const char *, int, Fts3Expr **); -SQLITE_PRIVATE void sqlite3Fts3ExprFree(Fts3Expr *); - -/* -** Candidate values for Fts3Query.eType. Note that the order of the first -** four values is in order of precedence when parsing expressions. For -** example, the following: -** -** "a OR b AND c NOT d NEAR e" -** -** is equivalent to: -** -** "a OR (b AND (c NOT (d NEAR e)))" -*/ -#define FTSQUERY_NEAR 1 -#define FTSQUERY_NOT 2 -#define FTSQUERY_AND 3 -#define FTSQUERY_OR 4 -#define FTSQUERY_PHRASE 5 - -#ifdef SQLITE_TEST -SQLITE_PRIVATE void sqlite3Fts3ExprInitTestInterface(sqlite3 *db); -#endif - -/************** End of fts3_expr.h *******************************************/ -/************** Continuing where we left off in fts3.c ***********************/ -/************** Include fts3_hash.h in the middle of fts3.c ******************/ +/************** Continuing where we left off in fts3Int.h ********************/ +/************** Include fts3_hash.h in the middle of fts3Int.h ***************/ /************** Begin file fts3_hash.h ***************************************/ /* ** 2001 September 22 @@ -97897,8 +107572,8 @@ SQLITE_PRIVATE void sqlite3Fts3ExprInitTestInterface(sqlite3 *db); #define _FTS3_HASH_H_ /* Forward declarations of structures. */ -typedef struct fts3Hash fts3Hash; -typedef struct fts3HashElem fts3HashElem; +typedef struct Fts3Hash Fts3Hash; +typedef struct Fts3HashElem Fts3HashElem; /* A complete hash table is an instance of the following structure. ** The internals of this structure are intended to be opaque -- client @@ -97908,15 +107583,15 @@ typedef struct fts3HashElem fts3HashElem; ** accessing this structure are really macros, so we can't really make ** this structure opaque. */ -struct fts3Hash { +struct Fts3Hash { char keyClass; /* HASH_INT, _POINTER, _STRING, _BINARY */ char copyKey; /* True if copy of key made on insert */ int count; /* Number of entries in this table */ - fts3HashElem *first; /* The first element of the array */ + Fts3HashElem *first; /* The first element of the array */ int htsize; /* Number of buckets in the hash table */ struct _fts3ht { /* the hash table */ int count; /* Number of entries with this hash */ - fts3HashElem *chain; /* Pointer to first entry with this hash */ + Fts3HashElem *chain; /* Pointer to first entry with this hash */ } *ht; }; @@ -97926,8 +107601,8 @@ struct fts3Hash { ** Again, this structure is intended to be opaque, but it can't really ** be opaque because it is used by macros. */ -struct fts3HashElem { - fts3HashElem *next, *prev; /* Next and previous elements in the table */ +struct Fts3HashElem { + Fts3HashElem *next, *prev; /* Next and previous elements in the table */ void *data; /* Data associated with this element */ void *pKey; int nKey; /* Key associated with this element */ }; @@ -97950,25 +107625,27 @@ struct fts3HashElem { /* ** Access routines. To delete, insert a NULL pointer. */ -SQLITE_PRIVATE void sqlite3Fts3HashInit(fts3Hash*, int keytype, int copyKey); -SQLITE_PRIVATE void *sqlite3Fts3HashInsert(fts3Hash*, const void *pKey, int nKey, void *pData); -SQLITE_PRIVATE void *sqlite3Fts3HashFind(const fts3Hash*, const void *pKey, int nKey); -SQLITE_PRIVATE void sqlite3Fts3HashClear(fts3Hash*); +SQLITE_PRIVATE void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey); +SQLITE_PRIVATE void *sqlite3Fts3HashInsert(Fts3Hash*, const void *pKey, int nKey, void *pData); +SQLITE_PRIVATE void *sqlite3Fts3HashFind(const Fts3Hash*, const void *pKey, int nKey); +SQLITE_PRIVATE void sqlite3Fts3HashClear(Fts3Hash*); +SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem(const Fts3Hash *, const void *, int); /* ** Shorthand for the functions above */ -#define fts3HashInit sqlite3Fts3HashInit -#define fts3HashInsert sqlite3Fts3HashInsert -#define fts3HashFind sqlite3Fts3HashFind -#define fts3HashClear sqlite3Fts3HashClear +#define fts3HashInit sqlite3Fts3HashInit +#define fts3HashInsert sqlite3Fts3HashInsert +#define fts3HashFind sqlite3Fts3HashFind +#define fts3HashClear sqlite3Fts3HashClear +#define fts3HashFindElem sqlite3Fts3HashFindElem /* ** Macros for looping over all elements of a hash table. The idiom is ** like this: ** -** fts3Hash h; -** fts3HashElem *p; +** Fts3Hash h; +** Fts3HashElem *p; ** ... ** for(p=fts3HashFirst(&h); p; p=fts3HashNext(p)){ ** SomeStructure *pData = fts3HashData(p); @@ -97989,105 +107666,324 @@ SQLITE_PRIVATE void sqlite3Fts3HashClear(fts3Hash*); #endif /* _FTS3_HASH_H_ */ /************** End of fts3_hash.h *******************************************/ +/************** Continuing where we left off in fts3Int.h ********************/ + +/* +** This constant controls how often segments are merged. Once there are +** FTS3_MERGE_COUNT segments of level N, they are merged into a single +** segment of level N+1. +*/ +#define FTS3_MERGE_COUNT 16 + +/* +** This is the maximum amount of data (in bytes) to store in the +** Fts3Table.pendingTerms hash table. Normally, the hash table is +** populated as documents are inserted/updated/deleted in a transaction +** and used to create a new segment when the transaction is committed. +** However if this limit is reached midway through a transaction, a new +** segment is created and the hash table cleared immediately. +*/ +#define FTS3_MAX_PENDING_DATA (1*1024*1024) + +/* +** Macro to return the number of elements in an array. SQLite has a +** similar macro called ArraySize(). Use a different name to avoid +** a collision when building an amalgamation with built-in FTS3. +*/ +#define SizeofArray(X) ((int)(sizeof(X)/sizeof(X[0]))) + +/* +** Maximum length of a varint encoded integer. The varint format is different +** from that used by SQLite, so the maximum length is 10, not 9. +*/ +#define FTS3_VARINT_MAX 10 + +/* +** The testcase() macro is only used by the amalgamation. If undefined, +** make it a no-op. +*/ +#ifndef testcase +# define testcase(X) +#endif + +/* +** Terminator values for position-lists and column-lists. +*/ +#define POS_COLUMN (1) /* Column-list terminator */ +#define POS_END (0) /* Position-list terminator */ + +/* +** This section provides definitions to allow the +** FTS3 extension to be compiled outside of the +** amalgamation. +*/ +#ifndef SQLITE_AMALGAMATION +/* +** Macros indicating that conditional expressions are always true or +** false. +*/ +# define ALWAYS(x) (x) +# define NEVER(X) (x) +/* +** Internal types used by SQLite. +*/ +typedef unsigned char u8; /* 1-byte (or larger) unsigned integer */ +typedef short int i16; /* 2-byte (or larger) signed integer */ +typedef unsigned int u32; /* 4-byte unsigned integer */ +typedef sqlite3_uint64 u64; /* 8-byte unsigned integer */ +/* +** Macro used to suppress compiler warnings for unused parameters. +*/ +#define UNUSED_PARAMETER(x) (void)(x) +#endif + +typedef struct Fts3Table Fts3Table; +typedef struct Fts3Cursor Fts3Cursor; +typedef struct Fts3Expr Fts3Expr; +typedef struct Fts3Phrase Fts3Phrase; +typedef struct Fts3SegReader Fts3SegReader; +typedef struct Fts3SegFilter Fts3SegFilter; + +/* +** A connection to a fulltext index is an instance of the following +** structure. The xCreate and xConnect methods create an instance +** of this structure and xDestroy and xDisconnect free that instance. +** All other methods receive a pointer to the structure as one of their +** arguments. +*/ +struct Fts3Table { + sqlite3_vtab base; /* Base class used by SQLite core */ + sqlite3 *db; /* The database connection */ + const char *zDb; /* logical database name */ + const char *zName; /* virtual table name */ + int nColumn; /* number of named columns in virtual table */ + char **azColumn; /* column names. malloced */ + sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ + + /* Precompiled statements used by the implementation. Each of these + ** statements is run and reset within a single virtual table API call. + */ + sqlite3_stmt *aStmt[25]; + + /* Pointer to string containing the SQL: + ** + ** "SELECT block FROM %_segments WHERE blockid BETWEEN ? AND ? + ** ORDER BY blockid" + */ + char *zSelectLeaves; + int nLeavesStmt; /* Valid statements in aLeavesStmt */ + int nLeavesTotal; /* Total number of prepared leaves stmts */ + int nLeavesAlloc; /* Allocated size of aLeavesStmt */ + sqlite3_stmt **aLeavesStmt; /* Array of prepared zSelectLeaves stmts */ + + int nNodeSize; /* Soft limit for node size */ + u8 bHasContent; /* True if %_content table exists */ + u8 bHasDocsize; /* True if %_docsize table exists */ + + /* The following hash table is used to buffer pending index updates during + ** transactions. Variable nPendingData estimates the memory size of the + ** pending data, including hash table overhead, but not malloc overhead. + ** When nPendingData exceeds nMaxPendingData, the buffer is flushed + ** automatically. Variable iPrevDocid is the docid of the most recently + ** inserted record. + */ + int nMaxPendingData; + int nPendingData; + sqlite_int64 iPrevDocid; + Fts3Hash pendingTerms; +}; + +/* +** When the core wants to read from the virtual table, it creates a +** virtual table cursor (an instance of the following structure) using +** the xOpen method. Cursors are destroyed using the xClose method. +*/ +struct Fts3Cursor { + sqlite3_vtab_cursor base; /* Base class used by SQLite core */ + i16 eSearch; /* Search strategy (see below) */ + u8 isEof; /* True if at End Of Results */ + u8 isRequireSeek; /* True if must seek pStmt to %_content row */ + sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ + Fts3Expr *pExpr; /* Parsed MATCH query string */ + sqlite3_int64 iPrevId; /* Previous id read from aDoclist */ + char *pNextId; /* Pointer into the body of aDoclist */ + char *aDoclist; /* List of docids for full-text queries */ + int nDoclist; /* Size of buffer at aDoclist */ + int isMatchinfoNeeded; /* True when aMatchinfo[] needs filling in */ + u32 *aMatchinfo; /* Information about most recent match */ +}; + +/* +** The Fts3Cursor.eSearch member is always set to one of the following. +** Actualy, Fts3Cursor.eSearch can be greater than or equal to +** FTS3_FULLTEXT_SEARCH. If so, then Fts3Cursor.eSearch - 2 is the index +** of the column to be searched. For example, in +** +** CREATE VIRTUAL TABLE ex1 USING fts3(a,b,c,d); +** SELECT docid FROM ex1 WHERE b MATCH 'one two three'; +** +** Because the LHS of the MATCH operator is 2nd column "b", +** Fts3Cursor.eSearch will be set to FTS3_FULLTEXT_SEARCH+1. (+0 for a, +** +1 for b, +2 for c, +3 for d.) If the LHS of MATCH were "ex1" +** indicating that all columns should be searched, +** then eSearch would be set to FTS3_FULLTEXT_SEARCH+4. +*/ +#define FTS3_FULLSCAN_SEARCH 0 /* Linear scan of %_content table */ +#define FTS3_DOCID_SEARCH 1 /* Lookup by rowid on %_content table */ +#define FTS3_FULLTEXT_SEARCH 2 /* Full-text index search */ + +/* +** A "phrase" is a sequence of one or more tokens that must match in +** sequence. A single token is the base case and the most common case. +** For a sequence of tokens contained in "...", nToken will be the number +** of tokens in the string. +*/ +struct Fts3Phrase { + int nToken; /* Number of tokens in the phrase */ + int iColumn; /* Index of column this phrase must match */ + int isNot; /* Phrase prefixed by unary not (-) operator */ + struct PhraseToken { + char *z; /* Text of the token */ + int n; /* Number of bytes in buffer pointed to by z */ + int isPrefix; /* True if token ends in with a "*" character */ + } aToken[1]; /* One entry for each token in the phrase */ +}; + +/* +** A tree of these objects forms the RHS of a MATCH operator. +** +** If Fts3Expr.eType is either FTSQUERY_NEAR or FTSQUERY_PHRASE and isLoaded +** is true, then aDoclist points to a malloced buffer, size nDoclist bytes, +** containing the results of the NEAR or phrase query in FTS3 doclist +** format. As usual, the initial "Length" field found in doclists stored +** on disk is omitted from this buffer. +** +** Variable pCurrent always points to the start of a docid field within +** aDoclist. Since the doclist is usually scanned in docid order, this can +** be used to accelerate seeking to the required docid within the doclist. +*/ +struct Fts3Expr { + int eType; /* One of the FTSQUERY_XXX values defined below */ + int nNear; /* Valid if eType==FTSQUERY_NEAR */ + Fts3Expr *pParent; /* pParent->pLeft==this or pParent->pRight==this */ + Fts3Expr *pLeft; /* Left operand */ + Fts3Expr *pRight; /* Right operand */ + Fts3Phrase *pPhrase; /* Valid if eType==FTSQUERY_PHRASE */ + + int isLoaded; /* True if aDoclist/nDoclist are initialized. */ + char *aDoclist; /* Buffer containing doclist */ + int nDoclist; /* Size of aDoclist in bytes */ + + sqlite3_int64 iCurrent; + char *pCurrent; +}; + +/* +** Candidate values for Fts3Query.eType. Note that the order of the first +** four values is in order of precedence when parsing expressions. For +** example, the following: +** +** "a OR b AND c NOT d NEAR e" +** +** is equivalent to: +** +** "a OR (b AND (c NOT (d NEAR e)))" +*/ +#define FTSQUERY_NEAR 1 +#define FTSQUERY_NOT 2 +#define FTSQUERY_AND 3 +#define FTSQUERY_OR 4 +#define FTSQUERY_PHRASE 5 + + +/* fts3_init.c */ +SQLITE_PRIVATE int sqlite3Fts3DeleteVtab(int, sqlite3_vtab *); +SQLITE_PRIVATE int sqlite3Fts3InitVtab(int, sqlite3*, void*, int, const char*const*, + sqlite3_vtab **, char **); + +/* fts3_write.c */ +SQLITE_PRIVATE int sqlite3Fts3UpdateMethod(sqlite3_vtab*,int,sqlite3_value**,sqlite3_int64*); +SQLITE_PRIVATE int sqlite3Fts3PendingTermsFlush(Fts3Table *); +SQLITE_PRIVATE void sqlite3Fts3PendingTermsClear(Fts3Table *); +SQLITE_PRIVATE int sqlite3Fts3Optimize(Fts3Table *); +SQLITE_PRIVATE int sqlite3Fts3SegReaderNew(Fts3Table *,int, sqlite3_int64, + sqlite3_int64, sqlite3_int64, const char *, int, Fts3SegReader**); +SQLITE_PRIVATE int sqlite3Fts3SegReaderPending(Fts3Table*,const char*,int,int,Fts3SegReader**); +SQLITE_PRIVATE void sqlite3Fts3SegReaderFree(Fts3Table *, Fts3SegReader *); +SQLITE_PRIVATE int sqlite3Fts3SegReaderIterate( + Fts3Table *, Fts3SegReader **, int, Fts3SegFilter *, + int (*)(Fts3Table *, void *, char *, int, char *, int), void * +); +SQLITE_PRIVATE int sqlite3Fts3ReadBlock(Fts3Table*, sqlite3_int64, char const**, int*); +SQLITE_PRIVATE int sqlite3Fts3AllSegdirs(Fts3Table*, sqlite3_stmt **); +SQLITE_PRIVATE int sqlite3Fts3MatchinfoDocsizeLocal(Fts3Cursor*, u32*); +SQLITE_PRIVATE int sqlite3Fts3MatchinfoDocsizeGlobal(Fts3Cursor*, u32*); +SQLITE_PRIVATE int sqlite3Fts3ReadLock(Fts3Table *); + +/* Flags allowed as part of the 4th argument to SegmentReaderIterate() */ +#define FTS3_SEGMENT_REQUIRE_POS 0x00000001 +#define FTS3_SEGMENT_IGNORE_EMPTY 0x00000002 +#define FTS3_SEGMENT_COLUMN_FILTER 0x00000004 +#define FTS3_SEGMENT_PREFIX 0x00000008 + +/* Type passed as 4th argument to SegmentReaderIterate() */ +struct Fts3SegFilter { + const char *zTerm; + int nTerm; + int iCol; + int flags; +}; + +/* fts3.c */ +SQLITE_PRIVATE int sqlite3Fts3PutVarint(char *, sqlite3_int64); +SQLITE_PRIVATE int sqlite3Fts3GetVarint(const char *, sqlite_int64 *); +SQLITE_PRIVATE int sqlite3Fts3GetVarint32(const char *, int *); +SQLITE_PRIVATE int sqlite3Fts3VarintLen(sqlite3_uint64); +SQLITE_PRIVATE void sqlite3Fts3Dequote(char *); + +SQLITE_PRIVATE char *sqlite3Fts3FindPositions(Fts3Expr *, sqlite3_int64, int); +SQLITE_PRIVATE int sqlite3Fts3ExprLoadDoclist(Fts3Table *, Fts3Expr *); +SQLITE_PRIVATE int sqlite3Fts3ExprNearTrim(Fts3Expr *, Fts3Expr *, int); + +/* fts3_tokenizer.c */ +SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *, int *); +SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *); +SQLITE_PRIVATE int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, + const char *, sqlite3_tokenizer **, const char **, char ** +); + +/* fts3_snippet.c */ +SQLITE_PRIVATE void sqlite3Fts3Offsets(sqlite3_context*, Fts3Cursor*); +SQLITE_PRIVATE void sqlite3Fts3Snippet(sqlite3_context *, Fts3Cursor *, const char *, + const char *, const char *, int, int +); +SQLITE_PRIVATE void sqlite3Fts3Matchinfo(sqlite3_context *, Fts3Cursor *); + +/* fts3_expr.c */ +SQLITE_PRIVATE int sqlite3Fts3ExprParse(sqlite3_tokenizer *, + char **, int, int, const char *, int, Fts3Expr ** +); +SQLITE_PRIVATE void sqlite3Fts3ExprFree(Fts3Expr *); +#ifdef SQLITE_TEST +SQLITE_PRIVATE int sqlite3Fts3ExprInitTestInterface(sqlite3 *db); +#endif + +#endif /* _FTSINT_H */ + +/************** End of fts3Int.h *********************************************/ /************** Continuing where we left off in fts3.c ***********************/ + + #ifndef SQLITE_CORE SQLITE_EXTENSION_INIT1 #endif - -/* TODO(shess) MAN, this thing needs some refactoring. At minimum, it -** would be nice to order the file better, perhaps something along the -** lines of: -** -** - utility functions -** - table setup functions -** - table update functions -** - table query functions -** -** Put the query functions last because they're likely to reference -** typedefs or functions from the table update section. +/* +** Write a 64-bit variable-length integer to memory starting at p[0]. +** The length of data written will be between 1 and FTS3_VARINT_MAX bytes. +** The number of bytes written is returned. */ - -#if 0 -# define FTSTRACE(A) printf A; fflush(stdout) -#else -# define FTSTRACE(A) -#endif - -/* It is not safe to call isspace(), tolower(), or isalnum() on -** hi-bit-set characters. This is the same solution used in the -** tokenizer. -*/ -/* TODO(shess) The snippet-generation code should be using the -** tokenizer-generated tokens rather than doing its own local -** tokenization. -*/ -/* TODO(shess) Is __isascii() a portable version of (c&0x80)==0? */ -static int safe_isspace(char c){ - return (c&0x80)==0 ? isspace(c) : 0; -} -static int safe_tolower(char c){ - return (c&0x80)==0 ? tolower(c) : c; -} -static int safe_isalnum(char c){ - return (c&0x80)==0 ? isalnum(c) : 0; -} - -typedef enum DocListType { - DL_DOCIDS, /* docids only */ - DL_POSITIONS, /* docids + positions */ - DL_POSITIONS_OFFSETS /* docids + positions + offsets */ -} DocListType; - -/* -** By default, only positions and not offsets are stored in the doclists. -** To change this so that offsets are stored too, compile with -** -** -DDL_DEFAULT=DL_POSITIONS_OFFSETS -** -** If DL_DEFAULT is set to DL_DOCIDS, your table can only be inserted -** into (no deletes or updates). -*/ -#ifndef DL_DEFAULT -# define DL_DEFAULT DL_POSITIONS -#endif - -enum { - POS_END = 0, /* end of this position list */ - POS_COLUMN, /* followed by new column number */ - POS_BASE -}; - -/* MERGE_COUNT controls how often we merge segments (see comment at -** top of file). -*/ -#define MERGE_COUNT 16 - -/* utility functions */ - -/* CLEAR() and SCRAMBLE() abstract memset() on a pointer to a single -** record to prevent errors of the form: -** -** my_function(SomeType *b){ -** memset(b, '\0', sizeof(b)); // sizeof(b)!=sizeof(*b) -** } -*/ -/* TODO(shess) Obvious candidates for a header file. */ -#define CLEAR(b) memset(b, '\0', sizeof(*(b))) - -#ifndef NDEBUG -# define SCRAMBLE(b) memset(b, 0x55, sizeof(*(b))) -#else -# define SCRAMBLE(b) -#endif - -/* We may need up to VARINT_MAX bytes to store an encoded 64-bit integer. */ -#define VARINT_MAX 10 - -/* Write a 64-bit variable-length integer to memory starting at p[0]. - * The length of data written will be between 1 and VARINT_MAX bytes. - * The number of bytes written is returned. */ -static int fts3PutVarint(char *p, sqlite_int64 v){ +SQLITE_PRIVATE int sqlite3Fts3PutVarint(char *p, sqlite_int64 v){ unsigned char *q = (unsigned char *) p; sqlite_uint64 vu = v; do{ @@ -98095,2207 +107991,48 @@ static int fts3PutVarint(char *p, sqlite_int64 v){ vu >>= 7; }while( vu!=0 ); q[-1] &= 0x7f; /* turn off high bit in final byte */ - assert( q - (unsigned char *)p <= VARINT_MAX ); + assert( q - (unsigned char *)p <= FTS3_VARINT_MAX ); return (int) (q - (unsigned char *)p); } -/* Read a 64-bit variable-length integer from memory starting at p[0]. - * Return the number of bytes read, or 0 on error. - * The value is stored in *v. */ -static int fts3GetVarint(const char *p, sqlite_int64 *v){ +/* +** Read a 64-bit variable-length integer from memory starting at p[0]. +** Return the number of bytes read, or 0 on error. +** The value is stored in *v. +*/ +SQLITE_PRIVATE int sqlite3Fts3GetVarint(const char *p, sqlite_int64 *v){ const unsigned char *q = (const unsigned char *) p; sqlite_uint64 x = 0, y = 1; - while( (*q & 0x80) == 0x80 ){ + while( (*q&0x80)==0x80 && q-(unsigned char *)p= VARINT_MAX ){ /* bad data */ - assert( 0 ); - return 0; - } } x += y * (*q++); *v = (sqlite_int64) x; return (int) (q - (unsigned char *)p); } -static int fts3GetVarint32(const char *p, int *pi){ +/* +** Similar to sqlite3Fts3GetVarint(), except that the output is truncated to a +** 32-bit integer before it is returned. +*/ +SQLITE_PRIVATE int sqlite3Fts3GetVarint32(const char *p, int *pi){ sqlite_int64 i; - int ret = fts3GetVarint(p, &i); + int ret = sqlite3Fts3GetVarint(p, &i); *pi = (int) i; - assert( *pi==i ); return ret; } -/*******************************************************************/ -/* DataBuffer is used to collect data into a buffer in piecemeal -** fashion. It implements the usual distinction between amount of -** data currently stored (nData) and buffer capacity (nCapacity). -** -** dataBufferInit - create a buffer with given initial capacity. -** dataBufferReset - forget buffer's data, retaining capacity. -** dataBufferDestroy - free buffer's data. -** dataBufferSwap - swap contents of two buffers. -** dataBufferExpand - expand capacity without adding data. -** dataBufferAppend - append data. -** dataBufferAppend2 - append two pieces of data at once. -** dataBufferReplace - replace buffer's data. -*/ -typedef struct DataBuffer { - char *pData; /* Pointer to malloc'ed buffer. */ - int nCapacity; /* Size of pData buffer. */ - int nData; /* End of data loaded into pData. */ -} DataBuffer; - -static void dataBufferInit(DataBuffer *pBuffer, int nCapacity){ - assert( nCapacity>=0 ); - pBuffer->nData = 0; - pBuffer->nCapacity = nCapacity; - pBuffer->pData = nCapacity==0 ? NULL : sqlite3_malloc(nCapacity); -} -static void dataBufferReset(DataBuffer *pBuffer){ - pBuffer->nData = 0; -} -static void dataBufferDestroy(DataBuffer *pBuffer){ - if( pBuffer->pData!=NULL ) sqlite3_free(pBuffer->pData); - SCRAMBLE(pBuffer); -} -static void dataBufferSwap(DataBuffer *pBuffer1, DataBuffer *pBuffer2){ - DataBuffer tmp = *pBuffer1; - *pBuffer1 = *pBuffer2; - *pBuffer2 = tmp; -} -static void dataBufferExpand(DataBuffer *pBuffer, int nAddCapacity){ - assert( nAddCapacity>0 ); - /* TODO(shess) Consider expanding more aggressively. Note that the - ** underlying malloc implementation may take care of such things for - ** us already. - */ - if( pBuffer->nData+nAddCapacity>pBuffer->nCapacity ){ - pBuffer->nCapacity = pBuffer->nData+nAddCapacity; - pBuffer->pData = sqlite3_realloc(pBuffer->pData, pBuffer->nCapacity); - } -} -static void dataBufferAppend(DataBuffer *pBuffer, - const char *pSource, int nSource){ - assert( nSource>0 && pSource!=NULL ); - dataBufferExpand(pBuffer, nSource); - memcpy(pBuffer->pData+pBuffer->nData, pSource, nSource); - pBuffer->nData += nSource; -} -static void dataBufferAppend2(DataBuffer *pBuffer, - const char *pSource1, int nSource1, - const char *pSource2, int nSource2){ - assert( nSource1>0 && pSource1!=NULL ); - assert( nSource2>0 && pSource2!=NULL ); - dataBufferExpand(pBuffer, nSource1+nSource2); - memcpy(pBuffer->pData+pBuffer->nData, pSource1, nSource1); - memcpy(pBuffer->pData+pBuffer->nData+nSource1, pSource2, nSource2); - pBuffer->nData += nSource1+nSource2; -} -static void dataBufferReplace(DataBuffer *pBuffer, - const char *pSource, int nSource){ - dataBufferReset(pBuffer); - dataBufferAppend(pBuffer, pSource, nSource); -} - -/* StringBuffer is a null-terminated version of DataBuffer. */ -typedef struct StringBuffer { - DataBuffer b; /* Includes null terminator. */ -} StringBuffer; - -static void initStringBuffer(StringBuffer *sb){ - dataBufferInit(&sb->b, 100); - dataBufferReplace(&sb->b, "", 1); -} -static int stringBufferLength(StringBuffer *sb){ - return sb->b.nData-1; -} -static char *stringBufferData(StringBuffer *sb){ - return sb->b.pData; -} -static void stringBufferDestroy(StringBuffer *sb){ - dataBufferDestroy(&sb->b); -} - -static void nappend(StringBuffer *sb, const char *zFrom, int nFrom){ - assert( sb->b.nData>0 ); - if( nFrom>0 ){ - sb->b.nData--; - dataBufferAppend2(&sb->b, zFrom, nFrom, "", 1); - } -} -static void append(StringBuffer *sb, const char *zFrom){ - nappend(sb, zFrom, strlen(zFrom)); -} - -/* Append a list of strings separated by commas. */ -static void appendList(StringBuffer *sb, int nString, char **azString){ - int i; - for(i=0; i0 ) append(sb, ", "); - append(sb, azString[i]); - } -} - -static int endsInWhiteSpace(StringBuffer *p){ - return stringBufferLength(p)>0 && - safe_isspace(stringBufferData(p)[stringBufferLength(p)-1]); -} - -/* If the StringBuffer ends in something other than white space, add a -** single space character to the end. -*/ -static void appendWhiteSpace(StringBuffer *p){ - if( stringBufferLength(p)==0 ) return; - if( !endsInWhiteSpace(p) ) append(p, " "); -} - -/* Remove white space from the end of the StringBuffer */ -static void trimWhiteSpace(StringBuffer *p){ - while( endsInWhiteSpace(p) ){ - p->b.pData[--p->b.nData-1] = '\0'; - } -} - -/*******************************************************************/ -/* DLReader is used to read document elements from a doclist. The -** current docid is cached, so dlrDocid() is fast. DLReader does not -** own the doclist buffer. -** -** dlrAtEnd - true if there's no more data to read. -** dlrDocid - docid of current document. -** dlrDocData - doclist data for current document (including docid). -** dlrDocDataBytes - length of same. -** dlrAllDataBytes - length of all remaining data. -** dlrPosData - position data for current document. -** dlrPosDataLen - length of pos data for current document (incl POS_END). -** dlrStep - step to current document. -** dlrInit - initial for doclist of given type against given data. -** dlrDestroy - clean up. -** -** Expected usage is something like: -** -** DLReader reader; -** dlrInit(&reader, pData, nData); -** while( !dlrAtEnd(&reader) ){ -** // calls to dlrDocid() and kin. -** dlrStep(&reader); -** } -** dlrDestroy(&reader); -*/ -typedef struct DLReader { - DocListType iType; - const char *pData; - int nData; - - sqlite_int64 iDocid; - int nElement; -} DLReader; - -static int dlrAtEnd(DLReader *pReader){ - assert( pReader->nData>=0 ); - return pReader->nData==0; -} -static sqlite_int64 dlrDocid(DLReader *pReader){ - assert( !dlrAtEnd(pReader) ); - return pReader->iDocid; -} -static const char *dlrDocData(DLReader *pReader){ - assert( !dlrAtEnd(pReader) ); - return pReader->pData; -} -static int dlrDocDataBytes(DLReader *pReader){ - assert( !dlrAtEnd(pReader) ); - return pReader->nElement; -} -static int dlrAllDataBytes(DLReader *pReader){ - assert( !dlrAtEnd(pReader) ); - return pReader->nData; -} -/* TODO(shess) Consider adding a field to track iDocid varint length -** to make these two functions faster. This might matter (a tiny bit) -** for queries. -*/ -static const char *dlrPosData(DLReader *pReader){ - sqlite_int64 iDummy; - int n = fts3GetVarint(pReader->pData, &iDummy); - assert( !dlrAtEnd(pReader) ); - return pReader->pData+n; -} -static int dlrPosDataLen(DLReader *pReader){ - sqlite_int64 iDummy; - int n = fts3GetVarint(pReader->pData, &iDummy); - assert( !dlrAtEnd(pReader) ); - return pReader->nElement-n; -} -static void dlrStep(DLReader *pReader){ - assert( !dlrAtEnd(pReader) ); - - /* Skip past current doclist element. */ - assert( pReader->nElement<=pReader->nData ); - pReader->pData += pReader->nElement; - pReader->nData -= pReader->nElement; - - /* If there is more data, read the next doclist element. */ - if( pReader->nData!=0 ){ - sqlite_int64 iDocidDelta; - int iDummy, n = fts3GetVarint(pReader->pData, &iDocidDelta); - pReader->iDocid += iDocidDelta; - if( pReader->iType>=DL_POSITIONS ){ - assert( nnData ); - while( 1 ){ - n += fts3GetVarint32(pReader->pData+n, &iDummy); - assert( n<=pReader->nData ); - if( iDummy==POS_END ) break; - if( iDummy==POS_COLUMN ){ - n += fts3GetVarint32(pReader->pData+n, &iDummy); - assert( nnData ); - }else if( pReader->iType==DL_POSITIONS_OFFSETS ){ - n += fts3GetVarint32(pReader->pData+n, &iDummy); - n += fts3GetVarint32(pReader->pData+n, &iDummy); - assert( nnData ); - } - } - } - pReader->nElement = n; - assert( pReader->nElement<=pReader->nData ); - } -} -static void dlrInit(DLReader *pReader, DocListType iType, - const char *pData, int nData){ - assert( pData!=NULL && nData!=0 ); - pReader->iType = iType; - pReader->pData = pData; - pReader->nData = nData; - pReader->nElement = 0; - pReader->iDocid = 0; - - /* Load the first element's data. There must be a first element. */ - dlrStep(pReader); -} -static void dlrDestroy(DLReader *pReader){ - SCRAMBLE(pReader); -} - -#ifndef NDEBUG -/* Verify that the doclist can be validly decoded. Also returns the -** last docid found because it is convenient in other assertions for -** DLWriter. -*/ -static void docListValidate(DocListType iType, const char *pData, int nData, - sqlite_int64 *pLastDocid){ - sqlite_int64 iPrevDocid = 0; - assert( nData>0 ); - assert( pData!=0 ); - assert( pData+nData>pData ); - while( nData!=0 ){ - sqlite_int64 iDocidDelta; - int n = fts3GetVarint(pData, &iDocidDelta); - iPrevDocid += iDocidDelta; - if( iType>DL_DOCIDS ){ - int iDummy; - while( 1 ){ - n += fts3GetVarint32(pData+n, &iDummy); - if( iDummy==POS_END ) break; - if( iDummy==POS_COLUMN ){ - n += fts3GetVarint32(pData+n, &iDummy); - }else if( iType>DL_POSITIONS ){ - n += fts3GetVarint32(pData+n, &iDummy); - n += fts3GetVarint32(pData+n, &iDummy); - } - assert( n<=nData ); - } - } - assert( n<=nData ); - pData += n; - nData -= n; - } - if( pLastDocid ) *pLastDocid = iPrevDocid; -} -#define ASSERT_VALID_DOCLIST(i, p, n, o) docListValidate(i, p, n, o) -#else -#define ASSERT_VALID_DOCLIST(i, p, n, o) assert( 1 ) -#endif - -/*******************************************************************/ -/* DLWriter is used to write doclist data to a DataBuffer. DLWriter -** always appends to the buffer and does not own it. -** -** dlwInit - initialize to write a given type doclistto a buffer. -** dlwDestroy - clear the writer's memory. Does not free buffer. -** dlwAppend - append raw doclist data to buffer. -** dlwCopy - copy next doclist from reader to writer. -** dlwAdd - construct doclist element and append to buffer. -** Only apply dlwAdd() to DL_DOCIDS doclists (else use PLWriter). -*/ -typedef struct DLWriter { - DocListType iType; - DataBuffer *b; - sqlite_int64 iPrevDocid; -#ifndef NDEBUG - int has_iPrevDocid; -#endif -} DLWriter; - -static void dlwInit(DLWriter *pWriter, DocListType iType, DataBuffer *b){ - pWriter->b = b; - pWriter->iType = iType; - pWriter->iPrevDocid = 0; -#ifndef NDEBUG - pWriter->has_iPrevDocid = 0; -#endif -} -static void dlwDestroy(DLWriter *pWriter){ - SCRAMBLE(pWriter); -} -/* iFirstDocid is the first docid in the doclist in pData. It is -** needed because pData may point within a larger doclist, in which -** case the first item would be delta-encoded. -** -** iLastDocid is the final docid in the doclist in pData. It is -** needed to create the new iPrevDocid for future delta-encoding. The -** code could decode the passed doclist to recreate iLastDocid, but -** the only current user (docListMerge) already has decoded this -** information. -*/ -/* TODO(shess) This has become just a helper for docListMerge. -** Consider a refactor to make this cleaner. -*/ -static void dlwAppend(DLWriter *pWriter, - const char *pData, int nData, - sqlite_int64 iFirstDocid, sqlite_int64 iLastDocid){ - sqlite_int64 iDocid = 0; - char c[VARINT_MAX]; - int nFirstOld, nFirstNew; /* Old and new varint len of first docid. */ -#ifndef NDEBUG - sqlite_int64 iLastDocidDelta; -#endif - - /* Recode the initial docid as delta from iPrevDocid. */ - nFirstOld = fts3GetVarint(pData, &iDocid); - assert( nFirstOldiType==DL_DOCIDS) ); - nFirstNew = fts3PutVarint(c, iFirstDocid-pWriter->iPrevDocid); - - /* Verify that the incoming doclist is valid AND that it ends with - ** the expected docid. This is essential because we'll trust this - ** docid in future delta-encoding. - */ - ASSERT_VALID_DOCLIST(pWriter->iType, pData, nData, &iLastDocidDelta); - assert( iLastDocid==iFirstDocid-iDocid+iLastDocidDelta ); - - /* Append recoded initial docid and everything else. Rest of docids - ** should have been delta-encoded from previous initial docid. - */ - if( nFirstOldb, c, nFirstNew, - pData+nFirstOld, nData-nFirstOld); - }else{ - dataBufferAppend(pWriter->b, c, nFirstNew); - } - pWriter->iPrevDocid = iLastDocid; -} -static void dlwCopy(DLWriter *pWriter, DLReader *pReader){ - dlwAppend(pWriter, dlrDocData(pReader), dlrDocDataBytes(pReader), - dlrDocid(pReader), dlrDocid(pReader)); -} -static void dlwAdd(DLWriter *pWriter, sqlite_int64 iDocid){ - char c[VARINT_MAX]; - int n = fts3PutVarint(c, iDocid-pWriter->iPrevDocid); - - /* Docids must ascend. */ - assert( !pWriter->has_iPrevDocid || iDocid>pWriter->iPrevDocid ); - assert( pWriter->iType==DL_DOCIDS ); - - dataBufferAppend(pWriter->b, c, n); - pWriter->iPrevDocid = iDocid; -#ifndef NDEBUG - pWriter->has_iPrevDocid = 1; -#endif -} - -/*******************************************************************/ -/* PLReader is used to read data from a document's position list. As -** the caller steps through the list, data is cached so that varints -** only need to be decoded once. -** -** plrInit, plrDestroy - create/destroy a reader. -** plrColumn, plrPosition, plrStartOffset, plrEndOffset - accessors -** plrAtEnd - at end of stream, only call plrDestroy once true. -** plrStep - step to the next element. -*/ -typedef struct PLReader { - /* These refer to the next position's data. nData will reach 0 when - ** reading the last position, so plrStep() signals EOF by setting - ** pData to NULL. - */ - const char *pData; - int nData; - - DocListType iType; - int iColumn; /* the last column read */ - int iPosition; /* the last position read */ - int iStartOffset; /* the last start offset read */ - int iEndOffset; /* the last end offset read */ -} PLReader; - -static int plrAtEnd(PLReader *pReader){ - return pReader->pData==NULL; -} -static int plrColumn(PLReader *pReader){ - assert( !plrAtEnd(pReader) ); - return pReader->iColumn; -} -static int plrPosition(PLReader *pReader){ - assert( !plrAtEnd(pReader) ); - return pReader->iPosition; -} -static int plrStartOffset(PLReader *pReader){ - assert( !plrAtEnd(pReader) ); - return pReader->iStartOffset; -} -static int plrEndOffset(PLReader *pReader){ - assert( !plrAtEnd(pReader) ); - return pReader->iEndOffset; -} -static void plrStep(PLReader *pReader){ - int i, n; - - assert( !plrAtEnd(pReader) ); - - if( pReader->nData==0 ){ - pReader->pData = NULL; - return; - } - - n = fts3GetVarint32(pReader->pData, &i); - if( i==POS_COLUMN ){ - n += fts3GetVarint32(pReader->pData+n, &pReader->iColumn); - pReader->iPosition = 0; - pReader->iStartOffset = 0; - n += fts3GetVarint32(pReader->pData+n, &i); - } - /* Should never see adjacent column changes. */ - assert( i!=POS_COLUMN ); - - if( i==POS_END ){ - pReader->nData = 0; - pReader->pData = NULL; - return; - } - - pReader->iPosition += i-POS_BASE; - if( pReader->iType==DL_POSITIONS_OFFSETS ){ - n += fts3GetVarint32(pReader->pData+n, &i); - pReader->iStartOffset += i; - n += fts3GetVarint32(pReader->pData+n, &i); - pReader->iEndOffset = pReader->iStartOffset+i; - } - assert( n<=pReader->nData ); - pReader->pData += n; - pReader->nData -= n; -} - -static void plrInit(PLReader *pReader, DLReader *pDLReader){ - pReader->pData = dlrPosData(pDLReader); - pReader->nData = dlrPosDataLen(pDLReader); - pReader->iType = pDLReader->iType; - pReader->iColumn = 0; - pReader->iPosition = 0; - pReader->iStartOffset = 0; - pReader->iEndOffset = 0; - plrStep(pReader); -} -static void plrDestroy(PLReader *pReader){ - SCRAMBLE(pReader); -} - -/*******************************************************************/ -/* PLWriter is used in constructing a document's position list. As a -** convenience, if iType is DL_DOCIDS, PLWriter becomes a no-op. -** PLWriter writes to the associated DLWriter's buffer. -** -** plwInit - init for writing a document's poslist. -** plwDestroy - clear a writer. -** plwAdd - append position and offset information. -** plwCopy - copy next position's data from reader to writer. -** plwTerminate - add any necessary doclist terminator. -** -** Calling plwAdd() after plwTerminate() may result in a corrupt -** doclist. -*/ -/* TODO(shess) Until we've written the second item, we can cache the -** first item's information. Then we'd have three states: -** -** - initialized with docid, no positions. -** - docid and one position. -** - docid and multiple positions. -** -** Only the last state needs to actually write to dlw->b, which would -** be an improvement in the DLCollector case. -*/ -typedef struct PLWriter { - DLWriter *dlw; - - int iColumn; /* the last column written */ - int iPos; /* the last position written */ - int iOffset; /* the last start offset written */ -} PLWriter; - -/* TODO(shess) In the case where the parent is reading these values -** from a PLReader, we could optimize to a copy if that PLReader has -** the same type as pWriter. -*/ -static void plwAdd(PLWriter *pWriter, int iColumn, int iPos, - int iStartOffset, int iEndOffset){ - /* Worst-case space for POS_COLUMN, iColumn, iPosDelta, - ** iStartOffsetDelta, and iEndOffsetDelta. - */ - char c[5*VARINT_MAX]; - int n = 0; - - /* Ban plwAdd() after plwTerminate(). */ - assert( pWriter->iPos!=-1 ); - - if( pWriter->dlw->iType==DL_DOCIDS ) return; - - if( iColumn!=pWriter->iColumn ){ - n += fts3PutVarint(c+n, POS_COLUMN); - n += fts3PutVarint(c+n, iColumn); - pWriter->iColumn = iColumn; - pWriter->iPos = 0; - pWriter->iOffset = 0; - } - assert( iPos>=pWriter->iPos ); - n += fts3PutVarint(c+n, POS_BASE+(iPos-pWriter->iPos)); - pWriter->iPos = iPos; - if( pWriter->dlw->iType==DL_POSITIONS_OFFSETS ){ - assert( iStartOffset>=pWriter->iOffset ); - n += fts3PutVarint(c+n, iStartOffset-pWriter->iOffset); - pWriter->iOffset = iStartOffset; - assert( iEndOffset>=iStartOffset ); - n += fts3PutVarint(c+n, iEndOffset-iStartOffset); - } - dataBufferAppend(pWriter->dlw->b, c, n); -} -static void plwCopy(PLWriter *pWriter, PLReader *pReader){ - plwAdd(pWriter, plrColumn(pReader), plrPosition(pReader), - plrStartOffset(pReader), plrEndOffset(pReader)); -} -static void plwInit(PLWriter *pWriter, DLWriter *dlw, sqlite_int64 iDocid){ - char c[VARINT_MAX]; - int n; - - pWriter->dlw = dlw; - - /* Docids must ascend. */ - assert( !pWriter->dlw->has_iPrevDocid || iDocid>pWriter->dlw->iPrevDocid ); - n = fts3PutVarint(c, iDocid-pWriter->dlw->iPrevDocid); - dataBufferAppend(pWriter->dlw->b, c, n); - pWriter->dlw->iPrevDocid = iDocid; -#ifndef NDEBUG - pWriter->dlw->has_iPrevDocid = 1; -#endif - - pWriter->iColumn = 0; - pWriter->iPos = 0; - pWriter->iOffset = 0; -} -/* TODO(shess) Should plwDestroy() also terminate the doclist? But -** then plwDestroy() would no longer be just a destructor, it would -** also be doing work, which isn't consistent with the overall idiom. -** Another option would be for plwAdd() to always append any necessary -** terminator, so that the output is always correct. But that would -** add incremental work to the common case with the only benefit being -** API elegance. Punt for now. -*/ -static void plwTerminate(PLWriter *pWriter){ - if( pWriter->dlw->iType>DL_DOCIDS ){ - char c[VARINT_MAX]; - int n = fts3PutVarint(c, POS_END); - dataBufferAppend(pWriter->dlw->b, c, n); - } -#ifndef NDEBUG - /* Mark as terminated for assert in plwAdd(). */ - pWriter->iPos = -1; -#endif -} -static void plwDestroy(PLWriter *pWriter){ - SCRAMBLE(pWriter); -} - -/*******************************************************************/ -/* DLCollector wraps PLWriter and DLWriter to provide a -** dynamically-allocated doclist area to use during tokenization. -** -** dlcNew - malloc up and initialize a collector. -** dlcDelete - destroy a collector and all contained items. -** dlcAddPos - append position and offset information. -** dlcAddDoclist - add the collected doclist to the given buffer. -** dlcNext - terminate the current document and open another. -*/ -typedef struct DLCollector { - DataBuffer b; - DLWriter dlw; - PLWriter plw; -} DLCollector; - -/* TODO(shess) This could also be done by calling plwTerminate() and -** dataBufferAppend(). I tried that, expecting nominal performance -** differences, but it seemed to pretty reliably be worth 1% to code -** it this way. I suspect it is the incremental malloc overhead (some -** percentage of the plwTerminate() calls will cause a realloc), so -** this might be worth revisiting if the DataBuffer implementation -** changes. -*/ -static void dlcAddDoclist(DLCollector *pCollector, DataBuffer *b){ - if( pCollector->dlw.iType>DL_DOCIDS ){ - char c[VARINT_MAX]; - int n = fts3PutVarint(c, POS_END); - dataBufferAppend2(b, pCollector->b.pData, pCollector->b.nData, c, n); - }else{ - dataBufferAppend(b, pCollector->b.pData, pCollector->b.nData); - } -} -static void dlcNext(DLCollector *pCollector, sqlite_int64 iDocid){ - plwTerminate(&pCollector->plw); - plwDestroy(&pCollector->plw); - plwInit(&pCollector->plw, &pCollector->dlw, iDocid); -} -static void dlcAddPos(DLCollector *pCollector, int iColumn, int iPos, - int iStartOffset, int iEndOffset){ - plwAdd(&pCollector->plw, iColumn, iPos, iStartOffset, iEndOffset); -} - -static DLCollector *dlcNew(sqlite_int64 iDocid, DocListType iType){ - DLCollector *pCollector = sqlite3_malloc(sizeof(DLCollector)); - dataBufferInit(&pCollector->b, 0); - dlwInit(&pCollector->dlw, iType, &pCollector->b); - plwInit(&pCollector->plw, &pCollector->dlw, iDocid); - return pCollector; -} -static void dlcDelete(DLCollector *pCollector){ - plwDestroy(&pCollector->plw); - dlwDestroy(&pCollector->dlw); - dataBufferDestroy(&pCollector->b); - SCRAMBLE(pCollector); - sqlite3_free(pCollector); -} - - -/* Copy the doclist data of iType in pData/nData into *out, trimming -** unnecessary data as we go. Only columns matching iColumn are -** copied, all columns copied if iColumn is -1. Elements with no -** matching columns are dropped. The output is an iOutType doclist. -*/ -/* NOTE(shess) This code is only valid after all doclists are merged. -** If this is run before merges, then doclist items which represent -** deletion will be trimmed, and will thus not effect a deletion -** during the merge. -*/ -static void docListTrim(DocListType iType, const char *pData, int nData, - int iColumn, DocListType iOutType, DataBuffer *out){ - DLReader dlReader; - DLWriter dlWriter; - - assert( iOutType<=iType ); - - dlrInit(&dlReader, iType, pData, nData); - dlwInit(&dlWriter, iOutType, out); - - while( !dlrAtEnd(&dlReader) ){ - PLReader plReader; - PLWriter plWriter; - int match = 0; - - plrInit(&plReader, &dlReader); - - while( !plrAtEnd(&plReader) ){ - if( iColumn==-1 || plrColumn(&plReader)==iColumn ){ - if( !match ){ - plwInit(&plWriter, &dlWriter, dlrDocid(&dlReader)); - match = 1; - } - plwAdd(&plWriter, plrColumn(&plReader), plrPosition(&plReader), - plrStartOffset(&plReader), plrEndOffset(&plReader)); - } - plrStep(&plReader); - } - if( match ){ - plwTerminate(&plWriter); - plwDestroy(&plWriter); - } - - plrDestroy(&plReader); - dlrStep(&dlReader); - } - dlwDestroy(&dlWriter); - dlrDestroy(&dlReader); -} - -/* Used by docListMerge() to keep doclists in the ascending order by -** docid, then ascending order by age (so the newest comes first). -*/ -typedef struct OrderedDLReader { - DLReader *pReader; - - /* TODO(shess) If we assume that docListMerge pReaders is ordered by - ** age (which we do), then we could use pReader comparisons to break - ** ties. - */ - int idx; -} OrderedDLReader; - -/* Order eof to end, then by docid asc, idx desc. */ -static int orderedDLReaderCmp(OrderedDLReader *r1, OrderedDLReader *r2){ - if( dlrAtEnd(r1->pReader) ){ - if( dlrAtEnd(r2->pReader) ) return 0; /* Both atEnd(). */ - return 1; /* Only r1 atEnd(). */ - } - if( dlrAtEnd(r2->pReader) ) return -1; /* Only r2 atEnd(). */ - - if( dlrDocid(r1->pReader)pReader) ) return -1; - if( dlrDocid(r1->pReader)>dlrDocid(r2->pReader) ) return 1; - - /* Descending on idx. */ - return r2->idx-r1->idx; -} - -/* Bubble p[0] to appropriate place in p[1..n-1]. Assumes that -** p[1..n-1] is already sorted. -*/ -/* TODO(shess) Is this frequent enough to warrant a binary search? -** Before implementing that, instrument the code to check. In most -** current usage, I expect that p[0] will be less than p[1] a very -** high proportion of the time. -*/ -static void orderedDLReaderReorder(OrderedDLReader *p, int n){ - while( n>1 && orderedDLReaderCmp(p, p+1)>0 ){ - OrderedDLReader tmp = p[0]; - p[0] = p[1]; - p[1] = tmp; - n--; - p++; - } -} - -/* Given an array of doclist readers, merge their doclist elements -** into out in sorted order (by docid), dropping elements from older -** readers when there is a duplicate docid. pReaders is assumed to be -** ordered by age, oldest first. -*/ -/* TODO(shess) nReaders must be <= MERGE_COUNT. This should probably -** be fixed. -*/ -static void docListMerge(DataBuffer *out, - DLReader *pReaders, int nReaders){ - OrderedDLReader readers[MERGE_COUNT]; - DLWriter writer; - int i, n; - const char *pStart = 0; - int nStart = 0; - sqlite_int64 iFirstDocid = 0, iLastDocid = 0; - - assert( nReaders>0 ); - if( nReaders==1 ){ - dataBufferAppend(out, dlrDocData(pReaders), dlrAllDataBytes(pReaders)); - return; - } - - assert( nReaders<=MERGE_COUNT ); - n = 0; - for(i=0; i0 ){ - orderedDLReaderReorder(readers+i, nReaders-i); - } - - dlwInit(&writer, pReaders[0].iType, out); - while( !dlrAtEnd(readers[0].pReader) ){ - sqlite_int64 iDocid = dlrDocid(readers[0].pReader); - - /* If this is a continuation of the current buffer to copy, extend - ** that buffer. memcpy() seems to be more efficient if it has a - ** lots of data to copy. - */ - if( dlrDocData(readers[0].pReader)==pStart+nStart ){ - nStart += dlrDocDataBytes(readers[0].pReader); - }else{ - if( pStart!=0 ){ - dlwAppend(&writer, pStart, nStart, iFirstDocid, iLastDocid); - } - pStart = dlrDocData(readers[0].pReader); - nStart = dlrDocDataBytes(readers[0].pReader); - iFirstDocid = iDocid; - } - iLastDocid = iDocid; - dlrStep(readers[0].pReader); - - /* Drop all of the older elements with the same docid. */ - for(i=1; i0 ){ - orderedDLReaderReorder(readers+i, nReaders-i); - } - } - - /* Copy over any remaining elements. */ - if( nStart>0 ) dlwAppend(&writer, pStart, nStart, iFirstDocid, iLastDocid); - dlwDestroy(&writer); -} - -/* Helper function for posListUnion(). Compares the current position -** between left and right, returning as standard C idiom of <0 if -** left0 if left>right, and 0 if left==right. "End" always -** compares greater. -*/ -static int posListCmp(PLReader *pLeft, PLReader *pRight){ - assert( pLeft->iType==pRight->iType ); - if( pLeft->iType==DL_DOCIDS ) return 0; - - if( plrAtEnd(pLeft) ) return plrAtEnd(pRight) ? 0 : 1; - if( plrAtEnd(pRight) ) return -1; - - if( plrColumn(pLeft)plrColumn(pRight) ) return 1; - - if( plrPosition(pLeft)plrPosition(pRight) ) return 1; - if( pLeft->iType==DL_POSITIONS ) return 0; - - if( plrStartOffset(pLeft)plrStartOffset(pRight) ) return 1; - - if( plrEndOffset(pLeft)plrEndOffset(pRight) ) return 1; - - return 0; -} - -/* Write the union of position lists in pLeft and pRight to pOut. -** "Union" in this case meaning "All unique position tuples". Should -** work with any doclist type, though both inputs and the output -** should be the same type. -*/ -static void posListUnion(DLReader *pLeft, DLReader *pRight, DLWriter *pOut){ - PLReader left, right; - PLWriter writer; - - assert( dlrDocid(pLeft)==dlrDocid(pRight) ); - assert( pLeft->iType==pRight->iType ); - assert( pLeft->iType==pOut->iType ); - - plrInit(&left, pLeft); - plrInit(&right, pRight); - plwInit(&writer, pOut, dlrDocid(pLeft)); - - while( !plrAtEnd(&left) || !plrAtEnd(&right) ){ - int c = posListCmp(&left, &right); - if( c<0 ){ - plwCopy(&writer, &left); - plrStep(&left); - }else if( c>0 ){ - plwCopy(&writer, &right); - plrStep(&right); - }else{ - plwCopy(&writer, &left); - plrStep(&left); - plrStep(&right); - } - } - - plwTerminate(&writer); - plwDestroy(&writer); - plrDestroy(&left); - plrDestroy(&right); -} - -/* Write the union of doclists in pLeft and pRight to pOut. For -** docids in common between the inputs, the union of the position -** lists is written. Inputs and outputs are always type DL_DEFAULT. -*/ -static void docListUnion( - const char *pLeft, int nLeft, - const char *pRight, int nRight, - DataBuffer *pOut /* Write the combined doclist here */ -){ - DLReader left, right; - DLWriter writer; - - if( nLeft==0 ){ - if( nRight!=0) dataBufferAppend(pOut, pRight, nRight); - return; - } - if( nRight==0 ){ - dataBufferAppend(pOut, pLeft, nLeft); - return; - } - - dlrInit(&left, DL_DEFAULT, pLeft, nLeft); - dlrInit(&right, DL_DEFAULT, pRight, nRight); - dlwInit(&writer, DL_DEFAULT, pOut); - - while( !dlrAtEnd(&left) || !dlrAtEnd(&right) ){ - if( dlrAtEnd(&right) ){ - dlwCopy(&writer, &left); - dlrStep(&left); - }else if( dlrAtEnd(&left) ){ - dlwCopy(&writer, &right); - dlrStep(&right); - }else if( dlrDocid(&left)dlrDocid(&right) ){ - dlwCopy(&writer, &right); - dlrStep(&right); - }else{ - posListUnion(&left, &right, &writer); - dlrStep(&left); - dlrStep(&right); - } - } - - dlrDestroy(&left); - dlrDestroy(&right); - dlwDestroy(&writer); -} - -/* -** This function is used as part of the implementation of phrase and -** NEAR matching. -** -** pLeft and pRight are DLReaders positioned to the same docid in -** lists of type DL_POSITION. This function writes an entry to the -** DLWriter pOut for each position in pRight that is less than -** (nNear+1) greater (but not equal to or smaller) than a position -** in pLeft. For example, if nNear is 0, and the positions contained -** by pLeft and pRight are: -** -** pLeft: 5 10 15 20 -** pRight: 6 9 17 21 -** -** then the docid is added to pOut. If pOut is of type DL_POSITIONS, -** then a positionids "6" and "21" are also added to pOut. -** -** If boolean argument isSaveLeft is true, then positionids are copied -** from pLeft instead of pRight. In the example above, the positions "5" -** and "20" would be added instead of "6" and "21". -*/ -static void posListPhraseMerge( - DLReader *pLeft, - DLReader *pRight, - int nNear, - int isSaveLeft, - DLWriter *pOut -){ - PLReader left, right; - PLWriter writer; - int match = 0; - - assert( dlrDocid(pLeft)==dlrDocid(pRight) ); - assert( pOut->iType!=DL_POSITIONS_OFFSETS ); - - plrInit(&left, pLeft); - plrInit(&right, pRight); - - while( !plrAtEnd(&left) && !plrAtEnd(&right) ){ - if( plrColumn(&left)plrColumn(&right) ){ - plrStep(&right); - }else if( plrPosition(&left)>=plrPosition(&right) ){ - plrStep(&right); - }else{ - if( (plrPosition(&right)-plrPosition(&left))<=(nNear+1) ){ - if( !match ){ - plwInit(&writer, pOut, dlrDocid(pLeft)); - match = 1; - } - if( !isSaveLeft ){ - plwAdd(&writer, plrColumn(&right), plrPosition(&right), 0, 0); - }else{ - plwAdd(&writer, plrColumn(&left), plrPosition(&left), 0, 0); - } - plrStep(&right); - }else{ - plrStep(&left); - } - } - } - - if( match ){ - plwTerminate(&writer); - plwDestroy(&writer); - } - - plrDestroy(&left); - plrDestroy(&right); -} - /* -** Compare the values pointed to by the PLReaders passed as arguments. -** Return -1 if the value pointed to by pLeft is considered less than -** the value pointed to by pRight, +1 if it is considered greater -** than it, or 0 if it is equal. i.e. -** -** (*pLeft - *pRight) -** -** A PLReader that is in the EOF condition is considered greater than -** any other. If neither argument is in EOF state, the return value of -** plrColumn() is used. If the plrColumn() values are equal, the -** comparison is on the basis of plrPosition(). +** Return the number of bytes required to encode v as a varint */ -static int plrCompare(PLReader *pLeft, PLReader *pRight){ - assert(!plrAtEnd(pLeft) || !plrAtEnd(pRight)); - - if( plrAtEnd(pRight) || plrAtEnd(pLeft) ){ - return (plrAtEnd(pRight) ? -1 : 1); - } - if( plrColumn(pLeft)!=plrColumn(pRight) ){ - return ((plrColumn(pLeft)0) -** and write the results into pOut. -** -** A phrase intersection means that two documents only match -** if pLeft.iPos+1==pRight.iPos. -** -** A NEAR intersection means that two documents only match if -** (abs(pLeft.iPos-pRight.iPos) 0", - /* SEGDIR_DELETE */ "delete from %_segdir where level = ?", - - /* NOTE(shess): The first three results of the following two - ** statements must match. - */ - /* SEGDIR_SELECT_SEGMENT */ - "select start_block, leaves_end_block, root from %_segdir " - " where level = ? and idx = ?", - /* SEGDIR_SELECT_ALL */ - "select start_block, leaves_end_block, root from %_segdir " - " order by level desc, idx asc", - /* SEGDIR_DELETE_ALL */ "delete from %_segdir", - /* SEGDIR_COUNT */ "select count(*), ifnull(max(level),0) from %_segdir", -}; - -/* -** A connection to a fulltext index is an instance of the following -** structure. The xCreate and xConnect methods create an instance -** of this structure and xDestroy and xDisconnect free that instance. -** All other methods receive a pointer to the structure as one of their -** arguments. -*/ -struct fulltext_vtab { - sqlite3_vtab base; /* Base class used by SQLite core */ - sqlite3 *db; /* The database connection */ - const char *zDb; /* logical database name */ - const char *zName; /* virtual table name */ - int nColumn; /* number of columns in virtual table */ - char **azColumn; /* column names. malloced */ - char **azContentColumn; /* column names in content table; malloced */ - sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ - - /* Precompiled statements which we keep as long as the table is - ** open. - */ - sqlite3_stmt *pFulltextStatements[MAX_STMT]; - - /* Precompiled statements used for segment merges. We run a - ** separate select across the leaf level of each tree being merged. - */ - sqlite3_stmt *pLeafSelectStmts[MERGE_COUNT]; - /* The statement used to prepare pLeafSelectStmts. */ -#define LEAF_SELECT \ - "select block from %_segments where blockid between ? and ? order by blockid" - - /* These buffer pending index updates during transactions. - ** nPendingData estimates the memory size of the pending data. It - ** doesn't include the hash-bucket overhead, nor any malloc - ** overhead. When nPendingData exceeds kPendingThreshold, the - ** buffer is flushed even before the transaction closes. - ** pendingTerms stores the data, and is only valid when nPendingData - ** is >=0 (nPendingData<0 means pendingTerms has not been - ** initialized). iPrevDocid is the last docid written, used to make - ** certain we're inserting in sorted order. - */ - int nPendingData; -#define kPendingThreshold (1*1024*1024) - sqlite_int64 iPrevDocid; - fts3Hash pendingTerms; -}; - -/* -** When the core wants to do a query, it create a cursor using a -** call to xOpen. This structure is an instance of a cursor. It -** is destroyed by xClose. -*/ -typedef struct fulltext_cursor { - sqlite3_vtab_cursor base; /* Base class used by SQLite core */ - QueryType iCursorType; /* Copy of sqlite3_index_info.idxNum */ - sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ - int eof; /* True if at End Of Results */ - Fts3Expr *pExpr; /* Parsed MATCH query string */ - Snippet snippet; /* Cached snippet for the current row */ - int iColumn; /* Column being searched */ - DataBuffer result; /* Doclist results from fulltextQuery */ - DLReader reader; /* Result reader if result not empty */ -} fulltext_cursor; - -static fulltext_vtab *cursor_vtab(fulltext_cursor *c){ - return (fulltext_vtab *) c->base.pVtab; -} - -static const sqlite3_module fts3Module; /* forward declaration */ - -/* Return a dynamically generated statement of the form - * insert into %_content (docid, ...) values (?, ...) - */ -static const char *contentInsertStatement(fulltext_vtab *v){ - StringBuffer sb; - int i; - - initStringBuffer(&sb); - append(&sb, "insert into %_content (docid, "); - appendList(&sb, v->nColumn, v->azContentColumn); - append(&sb, ") values (?"); - for(i=0; inColumn; ++i) - append(&sb, ", ?"); - append(&sb, ")"); - return stringBufferData(&sb); -} - -/* Return a dynamically generated statement of the form - * select from %_content where docid = ? - */ -static const char *contentSelectStatement(fulltext_vtab *v){ - StringBuffer sb; - initStringBuffer(&sb); - append(&sb, "SELECT "); - appendList(&sb, v->nColumn, v->azContentColumn); - append(&sb, " FROM %_content WHERE docid = ?"); - return stringBufferData(&sb); -} - -/* Return a dynamically generated statement of the form - * update %_content set [col_0] = ?, [col_1] = ?, ... - * where docid = ? - */ -static const char *contentUpdateStatement(fulltext_vtab *v){ - StringBuffer sb; - int i; - - initStringBuffer(&sb); - append(&sb, "update %_content set "); - for(i=0; inColumn; ++i) { - if( i>0 ){ - append(&sb, ", "); - } - append(&sb, v->azContentColumn[i]); - append(&sb, " = ?"); - } - append(&sb, " where docid = ?"); - return stringBufferData(&sb); -} - -/* Puts a freshly-prepared statement determined by iStmt in *ppStmt. -** If the indicated statement has never been prepared, it is prepared -** and cached, otherwise the cached version is reset. -*/ -static int sql_get_statement(fulltext_vtab *v, fulltext_statement iStmt, - sqlite3_stmt **ppStmt){ - assert( iStmtpFulltextStatements[iStmt]==NULL ){ - const char *zStmt; - int rc; - switch( iStmt ){ - case CONTENT_INSERT_STMT: - zStmt = contentInsertStatement(v); break; - case CONTENT_SELECT_STMT: - zStmt = contentSelectStatement(v); break; - case CONTENT_UPDATE_STMT: - zStmt = contentUpdateStatement(v); break; - default: - zStmt = fulltext_zStatement[iStmt]; - } - rc = sql_prepare(v->db, v->zDb, v->zName, &v->pFulltextStatements[iStmt], - zStmt); - if( zStmt != fulltext_zStatement[iStmt]) sqlite3_free((void *) zStmt); - if( rc!=SQLITE_OK ) return rc; - } else { - int rc = sqlite3_reset(v->pFulltextStatements[iStmt]); - if( rc!=SQLITE_OK ) return rc; - } - - *ppStmt = v->pFulltextStatements[iStmt]; - return SQLITE_OK; -} - -/* Like sqlite3_step(), but convert SQLITE_DONE to SQLITE_OK and -** SQLITE_ROW to SQLITE_ERROR. Useful for statements like UPDATE, -** where we expect no results. -*/ -static int sql_single_step(sqlite3_stmt *s){ - int rc = sqlite3_step(s); - return (rc==SQLITE_DONE) ? SQLITE_OK : rc; -} - -/* Like sql_get_statement(), but for special replicated LEAF_SELECT -** statements. idx -1 is a special case for an uncached version of -** the statement (used in the optimize implementation). -*/ -/* TODO(shess) Write version for generic statements and then share -** that between the cached-statement functions. -*/ -static int sql_get_leaf_statement(fulltext_vtab *v, int idx, - sqlite3_stmt **ppStmt){ - assert( idx>=-1 && idxdb, v->zDb, v->zName, ppStmt, LEAF_SELECT); - }else if( v->pLeafSelectStmts[idx]==NULL ){ - int rc = sql_prepare(v->db, v->zDb, v->zName, &v->pLeafSelectStmts[idx], - LEAF_SELECT); - if( rc!=SQLITE_OK ) return rc; - }else{ - int rc = sqlite3_reset(v->pLeafSelectStmts[idx]); - if( rc!=SQLITE_OK ) return rc; - } - - *ppStmt = v->pLeafSelectStmts[idx]; - return SQLITE_OK; -} - -/* insert into %_content (docid, ...) values ([docid], [pValues]) -** If the docid contains SQL NULL, then a unique docid will be -** generated. -*/ -static int content_insert(fulltext_vtab *v, sqlite3_value *docid, - sqlite3_value **pValues){ - sqlite3_stmt *s; - int i; - int rc = sql_get_statement(v, CONTENT_INSERT_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_value(s, 1, docid); - if( rc!=SQLITE_OK ) return rc; - - for(i=0; inColumn; ++i){ - rc = sqlite3_bind_value(s, 2+i, pValues[i]); - if( rc!=SQLITE_OK ) return rc; - } - - return sql_single_step(s); -} - -/* update %_content set col0 = pValues[0], col1 = pValues[1], ... - * where docid = [iDocid] */ -static int content_update(fulltext_vtab *v, sqlite3_value **pValues, - sqlite_int64 iDocid){ - sqlite3_stmt *s; - int i; - int rc = sql_get_statement(v, CONTENT_UPDATE_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - for(i=0; inColumn; ++i){ - rc = sqlite3_bind_value(s, 1+i, pValues[i]); - if( rc!=SQLITE_OK ) return rc; - } - - rc = sqlite3_bind_int64(s, 1+v->nColumn, iDocid); - if( rc!=SQLITE_OK ) return rc; - - return sql_single_step(s); -} - -static void freeStringArray(int nString, const char **pString){ - int i; - - for (i=0 ; i < nString ; ++i) { - if( pString[i]!=NULL ) sqlite3_free((void *) pString[i]); - } - sqlite3_free((void *) pString); -} - -/* select * from %_content where docid = [iDocid] - * The caller must delete the returned array and all strings in it. - * null fields will be NULL in the returned array. - * - * TODO: Perhaps we should return pointer/length strings here for consistency - * with other code which uses pointer/length. */ -static int content_select(fulltext_vtab *v, sqlite_int64 iDocid, - const char ***pValues){ - sqlite3_stmt *s; - const char **values; - int i; - int rc; - - *pValues = NULL; - - rc = sql_get_statement(v, CONTENT_SELECT_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 1, iDocid); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_step(s); - if( rc!=SQLITE_ROW ) return rc; - - values = (const char **) sqlite3_malloc(v->nColumn * sizeof(const char *)); - for(i=0; inColumn; ++i){ - if( sqlite3_column_type(s, i)==SQLITE_NULL ){ - values[i] = NULL; - }else{ - values[i] = string_dup((char*)sqlite3_column_text(s, i)); - } - } - - /* We expect only one row. We must execute another sqlite3_step() - * to complete the iteration; otherwise the table will remain locked. */ - rc = sqlite3_step(s); - if( rc==SQLITE_DONE ){ - *pValues = values; - return SQLITE_OK; - } - - freeStringArray(v->nColumn, values); - return rc; -} - -/* delete from %_content where docid = [iDocid ] */ -static int content_delete(fulltext_vtab *v, sqlite_int64 iDocid){ - sqlite3_stmt *s; - int rc = sql_get_statement(v, CONTENT_DELETE_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 1, iDocid); - if( rc!=SQLITE_OK ) return rc; - - return sql_single_step(s); -} - -/* Returns SQLITE_ROW if any rows exist in %_content, SQLITE_DONE if -** no rows exist, and any error in case of failure. -*/ -static int content_exists(fulltext_vtab *v){ - sqlite3_stmt *s; - int rc = sql_get_statement(v, CONTENT_EXISTS_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_step(s); - if( rc!=SQLITE_ROW ) return rc; - - /* We expect only one row. We must execute another sqlite3_step() - * to complete the iteration; otherwise the table will remain locked. */ - rc = sqlite3_step(s); - if( rc==SQLITE_DONE ) return SQLITE_ROW; - if( rc==SQLITE_ROW ) return SQLITE_ERROR; - return rc; -} - -/* insert into %_segments values ([pData]) -** returns assigned blockid in *piBlockid -*/ -static int block_insert(fulltext_vtab *v, const char *pData, int nData, - sqlite_int64 *piBlockid){ - sqlite3_stmt *s; - int rc = sql_get_statement(v, BLOCK_INSERT_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_blob(s, 1, pData, nData, SQLITE_STATIC); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_step(s); - if( rc==SQLITE_ROW ) return SQLITE_ERROR; - if( rc!=SQLITE_DONE ) return rc; - - /* blockid column is an alias for rowid. */ - *piBlockid = sqlite3_last_insert_rowid(v->db); - return SQLITE_OK; -} - -/* delete from %_segments -** where blockid between [iStartBlockid] and [iEndBlockid] -** -** Deletes the range of blocks, inclusive, used to delete the blocks -** which form a segment. -*/ -static int block_delete(fulltext_vtab *v, - sqlite_int64 iStartBlockid, sqlite_int64 iEndBlockid){ - sqlite3_stmt *s; - int rc = sql_get_statement(v, BLOCK_DELETE_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 1, iStartBlockid); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 2, iEndBlockid); - if( rc!=SQLITE_OK ) return rc; - - return sql_single_step(s); -} - -/* Returns SQLITE_ROW with *pidx set to the maximum segment idx found -** at iLevel. Returns SQLITE_DONE if there are no segments at -** iLevel. Otherwise returns an error. -*/ -static int segdir_max_index(fulltext_vtab *v, int iLevel, int *pidx){ - sqlite3_stmt *s; - int rc = sql_get_statement(v, SEGDIR_MAX_INDEX_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int(s, 1, iLevel); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_step(s); - /* Should always get at least one row due to how max() works. */ - if( rc==SQLITE_DONE ) return SQLITE_DONE; - if( rc!=SQLITE_ROW ) return rc; - - /* NULL means that there were no inputs to max(). */ - if( SQLITE_NULL==sqlite3_column_type(s, 0) ){ - rc = sqlite3_step(s); - if( rc==SQLITE_ROW ) return SQLITE_ERROR; - return rc; - } - - *pidx = sqlite3_column_int(s, 0); - - /* We expect only one row. We must execute another sqlite3_step() - * to complete the iteration; otherwise the table will remain locked. */ - rc = sqlite3_step(s); - if( rc==SQLITE_ROW ) return SQLITE_ERROR; - if( rc!=SQLITE_DONE ) return rc; - return SQLITE_ROW; -} - -/* insert into %_segdir values ( -** [iLevel], [idx], -** [iStartBlockid], [iLeavesEndBlockid], [iEndBlockid], -** [pRootData] -** ) -*/ -static int segdir_set(fulltext_vtab *v, int iLevel, int idx, - sqlite_int64 iStartBlockid, - sqlite_int64 iLeavesEndBlockid, - sqlite_int64 iEndBlockid, - const char *pRootData, int nRootData){ - sqlite3_stmt *s; - int rc = sql_get_statement(v, SEGDIR_SET_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int(s, 1, iLevel); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int(s, 2, idx); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 3, iStartBlockid); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 4, iLeavesEndBlockid); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 5, iEndBlockid); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_blob(s, 6, pRootData, nRootData, SQLITE_STATIC); - if( rc!=SQLITE_OK ) return rc; - - return sql_single_step(s); -} - -/* Queries %_segdir for the block span of the segments in level -** iLevel. Returns SQLITE_DONE if there are no blocks for iLevel, -** SQLITE_ROW if there are blocks, else an error. -*/ -static int segdir_span(fulltext_vtab *v, int iLevel, - sqlite_int64 *piStartBlockid, - sqlite_int64 *piEndBlockid){ - sqlite3_stmt *s; - int rc = sql_get_statement(v, SEGDIR_SPAN_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int(s, 1, iLevel); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_step(s); - if( rc==SQLITE_DONE ) return SQLITE_DONE; /* Should never happen */ - if( rc!=SQLITE_ROW ) return rc; - - /* This happens if all segments at this level are entirely inline. */ - if( SQLITE_NULL==sqlite3_column_type(s, 0) ){ - /* We expect only one row. We must execute another sqlite3_step() - * to complete the iteration; otherwise the table will remain locked. */ - int rc2 = sqlite3_step(s); - if( rc2==SQLITE_ROW ) return SQLITE_ERROR; - return rc2; - } - - *piStartBlockid = sqlite3_column_int64(s, 0); - *piEndBlockid = sqlite3_column_int64(s, 1); - - /* We expect only one row. We must execute another sqlite3_step() - * to complete the iteration; otherwise the table will remain locked. */ - rc = sqlite3_step(s); - if( rc==SQLITE_ROW ) return SQLITE_ERROR; - if( rc!=SQLITE_DONE ) return rc; - return SQLITE_ROW; -} - -/* Delete the segment blocks and segment directory records for all -** segments at iLevel. -*/ -static int segdir_delete(fulltext_vtab *v, int iLevel){ - sqlite3_stmt *s; - sqlite_int64 iStartBlockid, iEndBlockid; - int rc = segdir_span(v, iLevel, &iStartBlockid, &iEndBlockid); - if( rc!=SQLITE_ROW && rc!=SQLITE_DONE ) return rc; - - if( rc==SQLITE_ROW ){ - rc = block_delete(v, iStartBlockid, iEndBlockid); - if( rc!=SQLITE_OK ) return rc; - } - - /* Delete the segment directory itself. */ - rc = sql_get_statement(v, SEGDIR_DELETE_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 1, iLevel); - if( rc!=SQLITE_OK ) return rc; - - return sql_single_step(s); -} - -/* Delete entire fts index, SQLITE_OK on success, relevant error on -** failure. -*/ -static int segdir_delete_all(fulltext_vtab *v){ - sqlite3_stmt *s; - int rc = sql_get_statement(v, SEGDIR_DELETE_ALL_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sql_single_step(s); - if( rc!=SQLITE_OK ) return rc; - - rc = sql_get_statement(v, BLOCK_DELETE_ALL_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - return sql_single_step(s); -} - -/* Returns SQLITE_OK with *pnSegments set to the number of entries in -** %_segdir and *piMaxLevel set to the highest level which has a -** segment. Otherwise returns the SQLite error which caused failure. -*/ -static int segdir_count(fulltext_vtab *v, int *pnSegments, int *piMaxLevel){ - sqlite3_stmt *s; - int rc = sql_get_statement(v, SEGDIR_COUNT_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_step(s); - /* TODO(shess): This case should not be possible? Should stronger - ** measures be taken if it happens? - */ - if( rc==SQLITE_DONE ){ - *pnSegments = 0; - *piMaxLevel = 0; - return SQLITE_OK; - } - if( rc!=SQLITE_ROW ) return rc; - - *pnSegments = sqlite3_column_int(s, 0); - *piMaxLevel = sqlite3_column_int(s, 1); - - /* We expect only one row. We must execute another sqlite3_step() - * to complete the iteration; otherwise the table will remain locked. */ - rc = sqlite3_step(s); - if( rc==SQLITE_DONE ) return SQLITE_OK; - if( rc==SQLITE_ROW ) return SQLITE_ERROR; - return rc; -} - -/* TODO(shess) clearPendingTerms() is far down the file because -** writeZeroSegment() is far down the file because LeafWriter is far -** down the file. Consider refactoring the code to move the non-vtab -** code above the vtab code so that we don't need this forward -** reference. -*/ -static int clearPendingTerms(fulltext_vtab *v); - -/* -** Free the memory used to contain a fulltext_vtab structure. -*/ -static void fulltext_vtab_destroy(fulltext_vtab *v){ - int iStmt, i; - - FTSTRACE(("FTS3 Destroy %p\n", v)); - for( iStmt=0; iStmtpFulltextStatements[iStmt]!=NULL ){ - sqlite3_finalize(v->pFulltextStatements[iStmt]); - v->pFulltextStatements[iStmt] = NULL; - } - } - - for( i=0; ipLeafSelectStmts[i]!=NULL ){ - sqlite3_finalize(v->pLeafSelectStmts[i]); - v->pLeafSelectStmts[i] = NULL; - } - } - - if( v->pTokenizer!=NULL ){ - v->pTokenizer->pModule->xDestroy(v->pTokenizer); - v->pTokenizer = NULL; - } - - clearPendingTerms(v); - - sqlite3_free(v->azColumn); - for(i = 0; i < v->nColumn; ++i) { - sqlite3_free(v->azContentColumn[i]); - } - sqlite3_free(v->azContentColumn); - sqlite3_free(v); -} - -/* -** Token types for parsing the arguments to xConnect or xCreate. -*/ -#define TOKEN_EOF 0 /* End of file */ -#define TOKEN_SPACE 1 /* Any kind of whitespace */ -#define TOKEN_ID 2 /* An identifier */ -#define TOKEN_STRING 3 /* A string literal */ -#define TOKEN_PUNCT 4 /* A single punctuation character */ - -/* -** If X is a character that can be used in an identifier then -** ftsIdChar(X) will be true. Otherwise it is false. -** -** For ASCII, any character with the high-order bit set is -** allowed in an identifier. For 7-bit characters, -** isFtsIdChar[X] must be 1. -** -** Ticket #1066. the SQL standard does not allow '$' in the -** middle of identfiers. But many SQL implementations do. -** SQLite will allow '$' in identifiers for compatibility. -** But the feature is undocumented. -*/ -static const char isFtsIdChar[] = { -/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ -}; -#define ftsIdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && isFtsIdChar[c-0x20])) - - -/* -** Return the length of the token that begins at z[0]. -** Store the token type in *tokenType before returning. -*/ -static int ftsGetToken(const char *z, int *tokenType){ - int i, c; - switch( *z ){ - case 0: { - *tokenType = TOKEN_EOF; - return 0; - } - case ' ': case '\t': case '\n': case '\f': case '\r': { - for(i=1; safe_isspace(z[i]); i++){} - *tokenType = TOKEN_SPACE; - return i; - } - case '`': - case '\'': - case '"': { - int delim = z[0]; - for(i=1; (c=z[i])!=0; i++){ - if( c==delim ){ - if( z[i+1]==delim ){ - i++; - }else{ - break; - } - } - } - *tokenType = TOKEN_STRING; - return i + (c!=0); - } - case '[': { - for(i=1, c=z[0]; c!=']' && (c=z[i])!=0; i++){} - *tokenType = TOKEN_ID; - return i; - } - default: { - if( !ftsIdChar(*z) ){ - break; - } - for(i=1; ftsIdChar(z[i]); i++){} - *tokenType = TOKEN_ID; - return i; - } - } - *tokenType = TOKEN_PUNCT; - return 1; -} - -/* -** A token extracted from a string is an instance of the following -** structure. -*/ -typedef struct FtsToken { - const char *z; /* Pointer to token text. Not '\000' terminated */ - short int n; /* Length of the token text in bytes. */ -} FtsToken; - -/* -** Given a input string (which is really one of the argv[] parameters -** passed into xConnect or xCreate) split the string up into tokens. -** Return an array of pointers to '\000' terminated strings, one string -** for each non-whitespace token. -** -** The returned array is terminated by a single NULL pointer. -** -** Space to hold the returned array is obtained from a single -** malloc and should be freed by passing the return value to free(). -** The individual strings within the token list are all a part of -** the single memory allocation and will all be freed at once. -*/ -static char **tokenizeString(const char *z, int *pnToken){ - int nToken = 0; - FtsToken *aToken = sqlite3_malloc( strlen(z) * sizeof(aToken[0]) ); - int n = 1; - int e, i; - int totalSize = 0; - char **azToken; - char *zCopy; - while( n>0 ){ - n = ftsGetToken(z, &e); - if( e!=TOKEN_SPACE ){ - aToken[nToken].z = z; - aToken[nToken].n = n; - nToken++; - totalSize += n+1; - } - z += n; - } - azToken = (char**)sqlite3_malloc( nToken*sizeof(char*) + totalSize ); - zCopy = (char*)&azToken[nToken]; - nToken--; - for(i=0; i>= 7; + }while( v!=0 ); + return i; } /* @@ -100310,4317 +108047,2272 @@ static char **tokenizeString(const char *z, int *pnToken){ ** 'xyz' becomes xyz ** [pqr] becomes pqr ** `mno` becomes mno +** */ -static void dequoteString(char *z){ - int quote; - int i, j; - if( z==0 ) return; +SQLITE_PRIVATE void sqlite3Fts3Dequote(char *z){ + char quote; /* Quote character (if any ) */ + quote = z[0]; - switch( quote ){ - case '\'': break; - case '"': break; - case '`': break; /* For MySQL compatibility */ - case '[': quote = ']'; break; /* For MS SqlServer compatibility */ - default: return; - } - for(i=1, j=0; z[i]; i++){ - if( z[i]==quote ){ - if( z[i+1]==quote ){ - z[j++] = quote; - i++; + if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ + int iIn = 1; /* Index of next byte to read from input */ + int iOut = 0; /* Index of next byte to write to output */ + + /* If the first byte was a '[', then the close-quote character is a ']' */ + if( quote=='[' ) quote = ']'; + + while( ALWAYS(z[iIn]) ){ + if( z[iIn]==quote ){ + if( z[iIn+1]!=quote ) break; + z[iOut++] = quote; + iIn += 2; }else{ - z[j++] = 0; - break; - } - }else{ - z[j++] = z[i]; - } - } -} - -/* -** The input azIn is a NULL-terminated list of tokens. Remove the first -** token and all punctuation tokens. Remove the quotes from -** around string literal tokens. -** -** Example: -** -** input: tokenize chinese ( 'simplifed' , 'mixed' ) -** output: chinese simplifed mixed -** -** Another example: -** -** input: delimiters ( '[' , ']' , '...' ) -** output: [ ] ... -*/ -static void tokenListToIdList(char **azIn){ - int i, j; - if( azIn ){ - for(i=0, j=-1; azIn[i]; i++){ - if( safe_isalnum(azIn[i][0]) || azIn[i][1] ){ - dequoteString(azIn[i]); - if( j>=0 ){ - azIn[j] = azIn[i]; - } - j++; + z[iOut++] = z[iIn++]; } } - azIn[j] = 0; + z[iOut] = '\0'; } } - -/* -** Find the first alphanumeric token in the string zIn. Null-terminate -** this token. Remove any quotation marks. And return a pointer to -** the result. -*/ -static char *firstToken(char *zIn, char **pzTail){ - int n, ttype; - while(1){ - n = ftsGetToken(zIn, &ttype); - if( ttype==TOKEN_SPACE ){ - zIn += n; - }else if( ttype==TOKEN_EOF ){ - *pzTail = zIn; - return 0; - }else{ - zIn[n] = 0; - *pzTail = &zIn[1]; - dequoteString(zIn); - return zIn; - } - } - /*NOTREACHED*/ -} - -/* Return true if... -** -** * s begins with the string t, ignoring case -** * s is longer than t -** * The first character of s beyond t is not a alphanumeric -** -** Ignore leading space in *s. -** -** To put it another way, return true if the first token of -** s[] is t[]. -*/ -static int startsWith(const char *s, const char *t){ - while( safe_isspace(*s) ){ s++; } - while( *t ){ - if( safe_tolower(*s++)!=safe_tolower(*t++) ) return 0; - } - return *s!='_' && !safe_isalnum(*s); -} - /* -** An instance of this structure defines the "spec" of a -** full text index. This structure is populated by parseSpec -** and use by fulltextConnect and fulltextCreate. +** Read a single varint from the doclist at *pp and advance *pp to point +** to the first byte past the end of the varint. Add the value of the varint +** to *pVal. */ -typedef struct TableSpec { - const char *zDb; /* Logical database name */ - const char *zName; /* Name of the full-text index */ - int nColumn; /* Number of columns to be indexed */ - char **azColumn; /* Original names of columns to be indexed */ - char **azContentColumn; /* Column names for %_content */ - char **azTokenizer; /* Name of tokenizer and its arguments */ -} TableSpec; - -/* -** Reclaim all of the memory used by a TableSpec -*/ -static void clearTableSpec(TableSpec *p) { - sqlite3_free(p->azColumn); - sqlite3_free(p->azContentColumn); - sqlite3_free(p->azTokenizer); -} - -/* Parse a CREATE VIRTUAL TABLE statement, which looks like this: - * - * CREATE VIRTUAL TABLE email - * USING fts3(subject, body, tokenize mytokenizer(myarg)) - * - * We return parsed information in a TableSpec structure. - * - */ -static int parseSpec(TableSpec *pSpec, int argc, const char *const*argv, - char**pzErr){ - int i, n; - char *z, *zDummy; - char **azArg; - const char *zTokenizer = 0; /* argv[] entry describing the tokenizer */ - - assert( argc>=3 ); - /* Current interface: - ** argv[0] - module name - ** argv[1] - database name - ** argv[2] - table name - ** argv[3..] - columns, optionally followed by tokenizer specification - ** and snippet delimiters specification. - */ - - /* Make a copy of the complete argv[][] array in a single allocation. - ** The argv[][] array is read-only and transient. We can write to the - ** copy in order to modify things and the copy is persistent. - */ - CLEAR(pSpec); - for(i=n=0; izDb = azArg[1]; - pSpec->zName = azArg[2]; - pSpec->nColumn = 0; - pSpec->azColumn = azArg; - zTokenizer = "tokenize simple"; - for(i=3; inColumn] = firstToken(azArg[i], &zDummy); - pSpec->nColumn++; - } - } - if( pSpec->nColumn==0 ){ - azArg[0] = "content"; - pSpec->nColumn = 1; - } - - /* - ** Construct the list of content column names. - ** - ** Each content column name will be of the form cNNAAAA - ** where NN is the column number and AAAA is the sanitized - ** column name. "sanitized" means that special characters are - ** converted to "_". The cNN prefix guarantees that all column - ** names are unique. - ** - ** The AAAA suffix is not strictly necessary. It is included - ** for the convenience of people who might examine the generated - ** %_content table and wonder what the columns are used for. - */ - pSpec->azContentColumn = sqlite3_malloc( pSpec->nColumn * sizeof(char *) ); - if( pSpec->azContentColumn==0 ){ - clearTableSpec(pSpec); - return SQLITE_NOMEM; - } - for(i=0; inColumn; i++){ - char *p; - pSpec->azContentColumn[i] = sqlite3_mprintf("c%d%s", i, azArg[i]); - for (p = pSpec->azContentColumn[i]; *p ; ++p) { - if( !safe_isalnum(*p) ) *p = '_'; - } - } - - /* - ** Parse the tokenizer specification string. - */ - pSpec->azTokenizer = tokenizeString(zTokenizer, &n); - tokenListToIdList(pSpec->azTokenizer); - - return SQLITE_OK; +static void fts3GetDeltaVarint(char **pp, sqlite3_int64 *pVal){ + sqlite3_int64 iVal; + *pp += sqlite3Fts3GetVarint(*pp, &iVal); + *pVal += iVal; } /* -** Generate a CREATE TABLE statement that describes the schema of -** the virtual table. Return a pointer to this schema string. -** -** Space is obtained from sqlite3_mprintf() and should be freed -** using sqlite3_free(). +** As long as *pp has not reached its end (pEnd), then do the same +** as fts3GetDeltaVarint(): read a single varint and add it to *pVal. +** But if we have reached the end of the varint, just set *pp=0 and +** leave *pVal unchanged. */ -static char *fulltextSchema( - int nColumn, /* Number of columns */ - const char *const* azColumn, /* List of columns */ - const char *zTableName /* Name of the table */ -){ - int i; - char *zSchema, *zNext; - const char *zSep = "("; - zSchema = sqlite3_mprintf("CREATE TABLE x"); - for(i=0; ibase */ - v->db = db; - v->zDb = spec->zDb; /* Freed when azColumn is freed */ - v->zName = spec->zName; /* Freed when azColumn is freed */ - v->nColumn = spec->nColumn; - v->azContentColumn = spec->azContentColumn; - spec->azContentColumn = 0; - v->azColumn = spec->azColumn; - spec->azColumn = 0; - - if( spec->azTokenizer==0 ){ - return SQLITE_NOMEM; - } - - zTok = spec->azTokenizer[0]; - if( !zTok ){ - zTok = "simple"; - } - nTok = strlen(zTok)+1; - - m = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, zTok, nTok); - if( !m ){ - *pzErr = sqlite3_mprintf("unknown tokenizer: %s", spec->azTokenizer[0]); - rc = SQLITE_ERROR; - goto err; - } - - for(n=0; spec->azTokenizer[n]; n++){} - if( n ){ - rc = m->xCreate(n-1, (const char*const*)&spec->azTokenizer[1], - &v->pTokenizer); +static void fts3GetDeltaVarint2(char **pp, char *pEnd, sqlite3_int64 *pVal){ + if( *pp>=pEnd ){ + *pp = 0; }else{ - rc = m->xCreate(0, 0, &v->pTokenizer); + fts3GetDeltaVarint(pp, pVal); } - if( rc!=SQLITE_OK ) goto err; - v->pTokenizer->pModule = m; - - /* TODO: verify the existence of backing tables foo_content, foo_term */ - - schema = fulltextSchema(v->nColumn, (const char*const*)v->azColumn, - spec->zName); - rc = sqlite3_declare_vtab(db, schema); - sqlite3_free(schema); - if( rc!=SQLITE_OK ) goto err; - - memset(v->pFulltextStatements, 0, sizeof(v->pFulltextStatements)); - - /* Indicate that the buffer is not live. */ - v->nPendingData = -1; - - *ppVTab = &v->base; - FTSTRACE(("FTS3 Connect %p\n", v)); - - return rc; - -err: - fulltext_vtab_destroy(v); - return rc; } -static int fulltextConnect( - sqlite3 *db, - void *pAux, - int argc, const char *const*argv, - sqlite3_vtab **ppVTab, - char **pzErr -){ - TableSpec spec; - int rc = parseSpec(&spec, argc, argv, pzErr); - if( rc!=SQLITE_OK ) return rc; - - rc = constructVtab(db, (fts3Hash *)pAux, &spec, ppVTab, pzErr); - clearTableSpec(&spec); - return rc; -} - -/* The %_content table holds the text of each document, with -** the docid column exposed as the SQLite rowid for the table. +/* +** The xDisconnect() virtual table method. */ -/* TODO(shess) This comment needs elaboration to match the updated -** code. Work it into the top-of-file comment at that time. -*/ -static int fulltextCreate(sqlite3 *db, void *pAux, - int argc, const char * const *argv, - sqlite3_vtab **ppVTab, char **pzErr){ - int rc; - TableSpec spec; - StringBuffer schema; - FTSTRACE(("FTS3 Create\n")); - - rc = parseSpec(&spec, argc, argv, pzErr); - if( rc!=SQLITE_OK ) return rc; - - initStringBuffer(&schema); - append(&schema, "CREATE TABLE %_content("); - append(&schema, " docid INTEGER PRIMARY KEY,"); - appendList(&schema, spec.nColumn, spec.azContentColumn); - append(&schema, ")"); - rc = sql_exec(db, spec.zDb, spec.zName, stringBufferData(&schema)); - stringBufferDestroy(&schema); - if( rc!=SQLITE_OK ) goto out; - - rc = sql_exec(db, spec.zDb, spec.zName, - "create table %_segments(" - " blockid INTEGER PRIMARY KEY," - " block blob" - ");" - ); - if( rc!=SQLITE_OK ) goto out; - - rc = sql_exec(db, spec.zDb, spec.zName, - "create table %_segdir(" - " level integer," - " idx integer," - " start_block integer," - " leaves_end_block integer," - " end_block integer," - " root blob," - " primary key(level, idx)" - ");"); - if( rc!=SQLITE_OK ) goto out; - - rc = constructVtab(db, (fts3Hash *)pAux, &spec, ppVTab, pzErr); - -out: - clearTableSpec(&spec); - return rc; -} - -/* Decide how to handle an SQL query. */ -static int fulltextBestIndex(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ - fulltext_vtab *v = (fulltext_vtab *)pVTab; +static int fts3DisconnectMethod(sqlite3_vtab *pVtab){ + Fts3Table *p = (Fts3Table *)pVtab; int i; - FTSTRACE(("FTS3 BestIndex\n")); - for(i=0; inConstraint; ++i){ - const struct sqlite3_index_constraint *pConstraint; - pConstraint = &pInfo->aConstraint[i]; - if( pConstraint->usable ) { - if( (pConstraint->iColumn==-1 || pConstraint->iColumn==v->nColumn+1) && - pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ - pInfo->idxNum = QUERY_DOCID; /* lookup by docid */ - FTSTRACE(("FTS3 QUERY_DOCID\n")); - } else if( pConstraint->iColumn>=0 && pConstraint->iColumn<=v->nColumn && - pConstraint->op==SQLITE_INDEX_CONSTRAINT_MATCH ){ - /* full-text search */ - pInfo->idxNum = QUERY_FULLTEXT + pConstraint->iColumn; - FTSTRACE(("FTS3 QUERY_FULLTEXT %d\n", pConstraint->iColumn)); - } else continue; + assert( p->nPendingData==0 ); - pInfo->aConstraintUsage[i].argvIndex = 1; - pInfo->aConstraintUsage[i].omit = 1; - - /* An arbitrary value for now. - * TODO: Perhaps docid matches should be considered cheaper than - * full-text searches. */ - pInfo->estimatedCost = 1.0; - - return SQLITE_OK; - } + /* Free any prepared statements held */ + for(i=0; iaStmt); i++){ + sqlite3_finalize(p->aStmt[i]); } - pInfo->idxNum = QUERY_GENERIC; + for(i=0; inLeavesStmt; i++){ + sqlite3_finalize(p->aLeavesStmt[i]); + } + sqlite3_free(p->zSelectLeaves); + sqlite3_free(p->aLeavesStmt); + + /* Invoke the tokenizer destructor to free the tokenizer. */ + p->pTokenizer->pModule->xDestroy(p->pTokenizer); + + sqlite3_free(p); return SQLITE_OK; } -static int fulltextDisconnect(sqlite3_vtab *pVTab){ - FTSTRACE(("FTS3 Disconnect %p\n", pVTab)); - fulltext_vtab_destroy((fulltext_vtab *)pVTab); - return SQLITE_OK; -} - -static int fulltextDestroy(sqlite3_vtab *pVTab){ - fulltext_vtab *v = (fulltext_vtab *)pVTab; - int rc; - - FTSTRACE(("FTS3 Destroy %p\n", pVTab)); - rc = sql_exec(v->db, v->zDb, v->zName, - "drop table if exists %_content;" - "drop table if exists %_segments;" - "drop table if exists %_segdir;" - ); - if( rc!=SQLITE_OK ) return rc; - - fulltext_vtab_destroy((fulltext_vtab *)pVTab); - return SQLITE_OK; -} - -static int fulltextOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ - fulltext_cursor *c; - - c = (fulltext_cursor *) sqlite3_malloc(sizeof(fulltext_cursor)); - if( c ){ - memset(c, 0, sizeof(fulltext_cursor)); - /* sqlite will initialize c->base */ - *ppCursor = &c->base; - FTSTRACE(("FTS3 Open %p: %p\n", pVTab, c)); - return SQLITE_OK; - }else{ - return SQLITE_NOMEM; - } -} - -/* Free all of the dynamically allocated memory held by the -** Snippet -*/ -static void snippetClear(Snippet *p){ - sqlite3_free(p->aMatch); - sqlite3_free(p->zOffset); - sqlite3_free(p->zSnippet); - CLEAR(p); -} - /* -** Append a single entry to the p->aMatch[] log. -*/ -static void snippetAppendMatch( - Snippet *p, /* Append the entry to this snippet */ - int iCol, int iTerm, /* The column and query term */ - int iToken, /* Matching token in document */ - int iStart, int nByte /* Offset and size of the match */ -){ - int i; - struct snippetMatch *pMatch; - if( p->nMatch+1>=p->nAlloc ){ - p->nAlloc = p->nAlloc*2 + 10; - p->aMatch = sqlite3_realloc(p->aMatch, p->nAlloc*sizeof(p->aMatch[0]) ); - if( p->aMatch==0 ){ - p->nMatch = 0; - p->nAlloc = 0; - return; - } - } - i = p->nMatch++; - pMatch = &p->aMatch[i]; - pMatch->iCol = iCol; - pMatch->iTerm = iTerm; - pMatch->iToken = iToken; - pMatch->iStart = iStart; - pMatch->nByte = nByte; -} - -/* -** Sizing information for the circular buffer used in snippetOffsetsOfColumn() -*/ -#define FTS3_ROTOR_SZ (32) -#define FTS3_ROTOR_MASK (FTS3_ROTOR_SZ-1) - -/* -** Function to iterate through the tokens of a compiled expression. +** Construct one or more SQL statements from the format string given +** and then evaluate those statements. The success code is writting +** into *pRc. ** -** Except, skip all tokens on the right-hand side of a NOT operator. -** This function is used to find tokens as part of snippet and offset -** generation and we do nt want snippets and offsets to report matches -** for tokens on the RHS of a NOT. +** If *pRc is initially non-zero then this routine is a no-op. */ -static int fts3NextExprToken(Fts3Expr **ppExpr, int *piToken){ - Fts3Expr *p = *ppExpr; - int iToken = *piToken; - if( iToken<0 ){ - /* In this case the expression p is the root of an expression tree. - ** Move to the first token in the expression tree. +static void fts3DbExec( + int *pRc, /* Success code */ + sqlite3 *db, /* Database in which to run SQL */ + const char *zFormat, /* Format string for SQL */ + ... /* Arguments to the format string */ +){ + va_list ap; + char *zSql; + if( *pRc ) return; + va_start(ap, zFormat); + zSql = sqlite3_vmprintf(zFormat, ap); + va_end(ap); + if( zSql==0 ){ + *pRc = SQLITE_NOMEM; + }else{ + *pRc = sqlite3_exec(db, zSql, 0, 0, 0); + sqlite3_free(zSql); + } +} + +/* +** The xDestroy() virtual table method. +*/ +static int fts3DestroyMethod(sqlite3_vtab *pVtab){ + int rc = SQLITE_OK; /* Return code */ + Fts3Table *p = (Fts3Table *)pVtab; + sqlite3 *db = p->db; + + /* Drop the shadow tables */ + fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_content'", p->zDb, p->zName); + fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_segments'", p->zDb,p->zName); + fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_segdir'", p->zDb, p->zName); + fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_docsize'", p->zDb, p->zName); + fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_stat'", p->zDb, p->zName); + + /* If everything has worked, invoke fts3DisconnectMethod() to free the + ** memory associated with the Fts3Table structure and return SQLITE_OK. + ** Otherwise, return an SQLite error code. + */ + return (rc==SQLITE_OK ? fts3DisconnectMethod(pVtab) : rc); +} + + +/* +** Invoke sqlite3_declare_vtab() to declare the schema for the FTS3 table +** passed as the first argument. This is done as part of the xConnect() +** and xCreate() methods. +*/ +static int fts3DeclareVtab(Fts3Table *p){ + int i; /* Iterator variable */ + int rc; /* Return code */ + char *zSql; /* SQL statement passed to declare_vtab() */ + char *zCols; /* List of user defined columns */ + + /* Create a list of user columns for the virtual table */ + zCols = sqlite3_mprintf("%Q, ", p->azColumn[0]); + for(i=1; zCols && inColumn; i++){ + zCols = sqlite3_mprintf("%z%Q, ", zCols, p->azColumn[i]); + } + + /* Create the whole "CREATE TABLE" statement to pass to SQLite */ + zSql = sqlite3_mprintf( + "CREATE TABLE x(%s %Q HIDDEN, docid HIDDEN)", zCols, p->zName + ); + + if( !zCols || !zSql ){ + rc = SQLITE_NOMEM; + }else{ + rc = sqlite3_declare_vtab(p->db, zSql); + } + + sqlite3_free(zSql); + sqlite3_free(zCols); + return rc; +} + +/* +** Create the backing store tables (%_content, %_segments and %_segdir) +** required by the FTS3 table passed as the only argument. This is done +** as part of the vtab xCreate() method. +** +** If the p->bHasDocsize boolean is true (indicating that this is an +** FTS4 table, not an FTS3 table) then also create the %_docsize and +** %_stat tables required by FTS4. +*/ +static int fts3CreateTables(Fts3Table *p){ + int rc = SQLITE_OK; /* Return code */ + int i; /* Iterator variable */ + char *zContentCols; /* Columns of %_content table */ + sqlite3 *db = p->db; /* The database connection */ + + /* Create a list of user columns for the content table */ + if( p->bHasContent ){ + zContentCols = sqlite3_mprintf("docid INTEGER PRIMARY KEY"); + for(i=0; zContentCols && inColumn; i++){ + char *z = p->azColumn[i]; + zContentCols = sqlite3_mprintf("%z, 'c%d%q'", zContentCols, i, z); + } + if( zContentCols==0 ) rc = SQLITE_NOMEM; + + /* Create the content table */ + fts3DbExec(&rc, db, + "CREATE TABLE %Q.'%q_content'(%s)", + p->zDb, p->zName, zContentCols + ); + sqlite3_free(zContentCols); + } + /* Create other tables */ + fts3DbExec(&rc, db, + "CREATE TABLE %Q.'%q_segments'(blockid INTEGER PRIMARY KEY, block BLOB);", + p->zDb, p->zName + ); + fts3DbExec(&rc, db, + "CREATE TABLE %Q.'%q_segdir'(" + "level INTEGER," + "idx INTEGER," + "start_block INTEGER," + "leaves_end_block INTEGER," + "end_block INTEGER," + "root BLOB," + "PRIMARY KEY(level, idx)" + ");", + p->zDb, p->zName + ); + if( p->bHasDocsize ){ + fts3DbExec(&rc, db, + "CREATE TABLE %Q.'%q_docsize'(docid INTEGER PRIMARY KEY, size BLOB);", + p->zDb, p->zName + ); + fts3DbExec(&rc, db, + "CREATE TABLE %Q.'%q_stat'(id INTEGER PRIMARY KEY, value BLOB);", + p->zDb, p->zName + ); + } + return rc; +} + +/* +** An sqlite3_exec() callback for fts3TableExists. +*/ +static int fts3TableExistsCallback(void *pArg, int n, char **pp1, char **pp2){ + UNUSED_PARAMETER(n); + UNUSED_PARAMETER(pp1); + UNUSED_PARAMETER(pp2); + *(int*)pArg = 1; + return 1; +} + +/* +** Determine if a table currently exists in the database. +*/ +static void fts3TableExists( + int *pRc, /* Success code */ + sqlite3 *db, /* The database connection to test */ + const char *zDb, /* ATTACHed database within the connection */ + const char *zName, /* Name of the FTS3 table */ + const char *zSuffix, /* Shadow table extension */ + u8 *pResult /* Write results here */ +){ + int rc = SQLITE_OK; + int res = 0; + char *zSql; + if( *pRc ) return; + zSql = sqlite3_mprintf( + "SELECT 1 FROM %Q.sqlite_master WHERE name='%q%s'", + zDb, zName, zSuffix + ); + rc = sqlite3_exec(db, zSql, fts3TableExistsCallback, &res, 0); + sqlite3_free(zSql); + *pResult = (u8)(res & 0xff); + if( rc!=SQLITE_ABORT ) *pRc = rc; +} + +/* +** This function is the implementation of both the xConnect and xCreate +** methods of the FTS3 virtual table. +** +** The argv[] array contains the following: +** +** argv[0] -> module name ("fts3" or "fts4") +** argv[1] -> database name +** argv[2] -> table name +** argv[...] -> "column name" and other module argument fields. +*/ +static int fts3InitVtab( + int isCreate, /* True for xCreate, false for xConnect */ + sqlite3 *db, /* The SQLite database connection */ + void *pAux, /* Hash table containing tokenizers */ + int argc, /* Number of elements in argv array */ + const char * const *argv, /* xCreate/xConnect argument array */ + sqlite3_vtab **ppVTab, /* Write the resulting vtab structure here */ + char **pzErr /* Write any error message here */ +){ + Fts3Hash *pHash = (Fts3Hash *)pAux; + Fts3Table *p; /* Pointer to allocated vtab */ + int rc; /* Return code */ + int i; /* Iterator variable */ + int nByte; /* Size of allocation used for *p */ + int iCol; /* Column index */ + int nString = 0; /* Bytes required to hold all column names */ + int nCol = 0; /* Number of columns in the FTS table */ + char *zCsr; /* Space for holding column names */ + int nDb; /* Bytes required to hold database name */ + int nName; /* Bytes required to hold table name */ + + const char *zTokenizer = 0; /* Name of tokenizer to use */ + sqlite3_tokenizer *pTokenizer = 0; /* Tokenizer for this table */ + + nDb = (int)strlen(argv[1]) + 1; + nName = (int)strlen(argv[2]) + 1; + for(i=3; idb = db; + p->nColumn = nCol; + p->nPendingData = 0; + p->azColumn = (char **)&p[1]; + p->pTokenizer = pTokenizer; + p->nNodeSize = 1000; + p->nMaxPendingData = FTS3_MAX_PENDING_DATA; + zCsr = (char *)&p->azColumn[nCol]; + + fts3HashInit(&p->pendingTerms, FTS3_HASH_STRING, 1); + + /* Fill in the zName and zDb fields of the vtab structure. */ + p->zName = zCsr; + memcpy(zCsr, argv[2], nName); + zCsr += nName; + p->zDb = zCsr; + memcpy(zCsr, argv[1], nDb); + zCsr += nDb; + + /* Fill in the azColumn array */ + iCol = 0; + for(i=3; iazColumn[iCol++] = zCsr; + zCsr += n+1; + assert( zCsr <= &((char *)p)[nByte] ); + } + } + if( iCol==0 ){ + assert( nCol==1 ); + p->azColumn[0] = "content"; + } + + /* If this is an xCreate call, create the underlying tables in the + ** database. TODO: For xConnect(), it could verify that said tables exist. + */ + if( isCreate ){ + p->bHasContent = 1; + p->bHasDocsize = argv[0][3]=='4'; + rc = fts3CreateTables(p); + }else{ + rc = SQLITE_OK; + fts3TableExists(&rc, db, argv[1], argv[2], "_content", &p->bHasContent); + fts3TableExists(&rc, db, argv[1], argv[2], "_docsize", &p->bHasDocsize); + } + if( rc!=SQLITE_OK ) goto fts3_init_out; + + rc = fts3DeclareVtab(p); + if( rc!=SQLITE_OK ) goto fts3_init_out; + + *ppVTab = &p->base; + +fts3_init_out: + assert( p || (pTokenizer && rc!=SQLITE_OK) ); + if( rc!=SQLITE_OK ){ + if( p ){ + fts3DisconnectMethod((sqlite3_vtab *)p); + }else{ + pTokenizer->pModule->xDestroy(pTokenizer); + } + } + return rc; +} + +/* +** The xConnect() and xCreate() methods for the virtual table. All the +** work is done in function fts3InitVtab(). +*/ +static int fts3ConnectMethod( + sqlite3 *db, /* Database connection */ + void *pAux, /* Pointer to tokenizer hash table */ + int argc, /* Number of elements in argv array */ + const char * const *argv, /* xCreate/xConnect argument array */ + sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ + char **pzErr /* OUT: sqlite3_malloc'd error message */ +){ + return fts3InitVtab(0, db, pAux, argc, argv, ppVtab, pzErr); +} +static int fts3CreateMethod( + sqlite3 *db, /* Database connection */ + void *pAux, /* Pointer to tokenizer hash table */ + int argc, /* Number of elements in argv array */ + const char * const *argv, /* xCreate/xConnect argument array */ + sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ + char **pzErr /* OUT: sqlite3_malloc'd error message */ +){ + return fts3InitVtab(1, db, pAux, argc, argv, ppVtab, pzErr); +} + +/* +** Implementation of the xBestIndex method for FTS3 tables. There +** are three possible strategies, in order of preference: +** +** 1. Direct lookup by rowid or docid. +** 2. Full-text search using a MATCH operator on a non-docid column. +** 3. Linear scan of %_content table. +*/ +static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ + Fts3Table *p = (Fts3Table *)pVTab; + int i; /* Iterator variable */ + int iCons = -1; /* Index of constraint to use */ + + /* By default use a full table scan. This is an expensive option, + ** so search through the constraints to see if a more efficient + ** strategy is possible. + */ + pInfo->idxNum = FTS3_FULLSCAN_SEARCH; + pInfo->estimatedCost = 500000; + for(i=0; inConstraint; i++){ + struct sqlite3_index_constraint *pCons = &pInfo->aConstraint[i]; + if( pCons->usable==0 ) continue; + + /* A direct lookup on the rowid or docid column. Assign a cost of 1.0. */ + if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ + && (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1 ) + ){ + pInfo->idxNum = FTS3_DOCID_SEARCH; + pInfo->estimatedCost = 1.0; + iCons = i; + } + + /* A MATCH constraint. Use a full-text search. + ** + ** If there is more than one MATCH constraint available, use the first + ** one encountered. If there is both a MATCH constraint and a direct + ** rowid/docid lookup, prefer the MATCH strategy. This is done even + ** though the rowid/docid lookup is faster than a MATCH query, selecting + ** it would lead to an "unable to use function MATCH in the requested + ** context" error. */ - while( p->pLeft ){ - p = p->pLeft; - } - iToken = 0; - }else{ - assert(p && p->eType==FTSQUERY_PHRASE ); - if( iToken<(p->pPhrase->nToken-1) ){ - iToken++; - }else{ - iToken = 0; - while( p->pParent && p->pParent->pLeft!=p ){ - assert( p->pParent->pRight==p ); - p = p->pParent; - } - p = p->pParent; - if( p ){ - assert( p->pRight!=0 ); - p = p->pRight; - while( p->pLeft ){ - p = p->pLeft; - } - } + if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH + && pCons->iColumn>=0 && pCons->iColumn<=p->nColumn + ){ + pInfo->idxNum = FTS3_FULLTEXT_SEARCH + pCons->iColumn; + pInfo->estimatedCost = 2.0; + iCons = i; + break; } } - *ppExpr = p; - *piToken = iToken; - return p?1:0; + if( iCons>=0 ){ + pInfo->aConstraintUsage[iCons].argvIndex = 1; + pInfo->aConstraintUsage[iCons].omit = 1; + } + return SQLITE_OK; } /* -** Return TRUE if the expression node pExpr is located beneath the -** RHS of a NOT operator. +** Implementation of xOpen method. */ -static int fts3ExprBeneathNot(Fts3Expr *p){ - Fts3Expr *pParent; - while( p ){ - pParent = p->pParent; - if( pParent && pParent->eType==FTSQUERY_NOT && pParent->pRight==p ){ - return 1; - } - p = pParent; +static int fts3OpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){ + sqlite3_vtab_cursor *pCsr; /* Allocated cursor */ + + UNUSED_PARAMETER(pVTab); + + /* Allocate a buffer large enough for an Fts3Cursor structure. If the + ** allocation succeeds, zero it and return SQLITE_OK. Otherwise, + ** if the allocation fails, return SQLITE_NOMEM. + */ + *ppCsr = pCsr = (sqlite3_vtab_cursor *)sqlite3_malloc(sizeof(Fts3Cursor)); + if( !pCsr ){ + return SQLITE_NOMEM; } - return 0; + memset(pCsr, 0, sizeof(Fts3Cursor)); + return SQLITE_OK; } -/* -** Add entries to pSnippet->aMatch[] for every match that occurs against -** document zDoc[0..nDoc-1] which is stored in column iColumn. -*/ -static void snippetOffsetsOfColumn( - fulltext_cursor *pCur, /* The fulltest search cursor */ - Snippet *pSnippet, /* The Snippet object to be filled in */ - int iColumn, /* Index of fulltext table column */ - const char *zDoc, /* Text of the fulltext table column */ - int nDoc /* Length of zDoc in bytes */ -){ - const sqlite3_tokenizer_module *pTModule; /* The tokenizer module */ - sqlite3_tokenizer *pTokenizer; /* The specific tokenizer */ - sqlite3_tokenizer_cursor *pTCursor; /* Tokenizer cursor */ - fulltext_vtab *pVtab; /* The full text index */ - int nColumn; /* Number of columns in the index */ - int i, j; /* Loop counters */ - int rc; /* Return code */ - unsigned int match, prevMatch; /* Phrase search bitmasks */ - const char *zToken; /* Next token from the tokenizer */ - int nToken; /* Size of zToken */ - int iBegin, iEnd, iPos; /* Offsets of beginning and end */ - - /* The following variables keep a circular buffer of the last - ** few tokens */ - unsigned int iRotor = 0; /* Index of current token */ - int iRotorBegin[FTS3_ROTOR_SZ]; /* Beginning offset of token */ - int iRotorLen[FTS3_ROTOR_SZ]; /* Length of token */ - - pVtab = cursor_vtab(pCur); - nColumn = pVtab->nColumn; - pTokenizer = pVtab->pTokenizer; - pTModule = pTokenizer->pModule; - rc = pTModule->xOpen(pTokenizer, zDoc, nDoc, &pTCursor); - if( rc ) return; - pTCursor->pTokenizer = pTokenizer; - - prevMatch = 0; - while( !pTModule->xNext(pTCursor, &zToken, &nToken, &iBegin, &iEnd, &iPos) ){ - Fts3Expr *pIter = pCur->pExpr; - int iIter = -1; - iRotorBegin[iRotor&FTS3_ROTOR_MASK] = iBegin; - iRotorLen[iRotor&FTS3_ROTOR_MASK] = iEnd-iBegin; - match = 0; - for(i=0; i<(FTS3_ROTOR_SZ-1) && fts3NextExprToken(&pIter, &iIter); i++){ - int nPhrase; /* Number of tokens in current phrase */ - struct PhraseToken *pToken; /* Current token */ - int iCol; /* Column index */ - - if( fts3ExprBeneathNot(pIter) ) continue; - nPhrase = pIter->pPhrase->nToken; - pToken = &pIter->pPhrase->aToken[iIter]; - iCol = pIter->pPhrase->iColumn; - if( iCol>=0 && iColn>nToken ) continue; - if( !pToken->isPrefix && pToken->nn<=nToken ); - if( memcmp(pToken->z, zToken, pToken->n) ) continue; - if( iIter>0 && (prevMatch & (1<=0; j--){ - int k = (iRotor-j) & FTS3_ROTOR_MASK; - snippetAppendMatch(pSnippet, iColumn, i-j, iPos-j, - iRotorBegin[k], iRotorLen[k]); - } - } - } - prevMatch = match<<1; - iRotor++; - } - pTModule->xClose(pTCursor); -} - -/* -** Remove entries from the pSnippet structure to account for the NEAR -** operator. When this is called, pSnippet contains the list of token -** offsets produced by treating all NEAR operators as AND operators. -** This function removes any entries that should not be present after -** accounting for the NEAR restriction. For example, if the queried -** document is: -** -** "A B C D E A" -** -** and the query is: -** -** A NEAR/0 E -** -** then when this function is called the Snippet contains token offsets -** 0, 4 and 5. This function removes the "0" entry (because the first A -** is not near enough to an E). -** -** When this function is called, the value pointed to by parameter piLeft is -** the integer id of the left-most token in the expression tree headed by -** pExpr. This function increments *piLeft by the total number of tokens -** in the expression tree headed by pExpr. -** -** Return 1 if any trimming occurs. Return 0 if no trimming is required. -*/ -static int trimSnippetOffsets( - Fts3Expr *pExpr, /* The search expression */ - Snippet *pSnippet, /* The set of snippet offsets to be trimmed */ - int *piLeft /* Index of left-most token in pExpr */ -){ - if( pExpr ){ - if( trimSnippetOffsets(pExpr->pLeft, pSnippet, piLeft) ){ - return 1; - } - - switch( pExpr->eType ){ - case FTSQUERY_PHRASE: - *piLeft += pExpr->pPhrase->nToken; - break; - case FTSQUERY_NEAR: { - /* The right-hand-side of a NEAR operator is always a phrase. The - ** left-hand-side is either a phrase or an expression tree that is - ** itself headed by a NEAR operator. The following initializations - ** set local variable iLeft to the token number of the left-most - ** token in the right-hand phrase, and iRight to the right most - ** token in the same phrase. For example, if we had: - ** - ** MATCH '"abc def" NEAR/2 "ghi jkl"' - ** - ** then iLeft will be set to 2 (token number of ghi) and nToken will - ** be set to 4. - */ - Fts3Expr *pLeft = pExpr->pLeft; - Fts3Expr *pRight = pExpr->pRight; - int iLeft = *piLeft; - int nNear = pExpr->nNear; - int nToken = pRight->pPhrase->nToken; - int jj, ii; - if( pLeft->eType==FTSQUERY_NEAR ){ - pLeft = pLeft->pRight; - } - assert( pRight->eType==FTSQUERY_PHRASE ); - assert( pLeft->eType==FTSQUERY_PHRASE ); - nToken += pLeft->pPhrase->nToken; - - for(ii=0; iinMatch; ii++){ - struct snippetMatch *p = &pSnippet->aMatch[ii]; - if( p->iTerm==iLeft ){ - int isOk = 0; - /* Snippet ii is an occurence of query term iLeft in the document. - ** It occurs at position (p->iToken) of the document. We now - ** search for an instance of token (iLeft-1) somewhere in the - ** range (p->iToken - nNear)...(p->iToken + nNear + nToken) within - ** the set of snippetMatch structures. If one is found, proceed. - ** If one cannot be found, then remove snippets ii..(ii+N-1) - ** from the matching snippets, where N is the number of tokens - ** in phrase pRight->pPhrase. - */ - for(jj=0; isOk==0 && jjnMatch; jj++){ - struct snippetMatch *p2 = &pSnippet->aMatch[jj]; - if( p2->iTerm==(iLeft-1) ){ - if( p2->iToken>=(p->iToken-nNear-1) - && p2->iToken<(p->iToken+nNear+nToken) - ){ - isOk = 1; - } - } - } - if( !isOk ){ - int kk; - for(kk=0; kkpPhrase->nToken; kk++){ - pSnippet->aMatch[kk+ii].iTerm = -2; - } - return 1; - } - } - if( p->iTerm==(iLeft-1) ){ - int isOk = 0; - for(jj=0; isOk==0 && jjnMatch; jj++){ - struct snippetMatch *p2 = &pSnippet->aMatch[jj]; - if( p2->iTerm==iLeft ){ - if( p2->iToken<=(p->iToken+nNear+1) - && p2->iToken>(p->iToken-nNear-nToken) - ){ - isOk = 1; - } - } - } - if( !isOk ){ - int kk; - for(kk=0; kkpPhrase->nToken; kk++){ - pSnippet->aMatch[ii-kk].iTerm = -2; - } - return 1; - } - } - } - break; - } - } - - if( trimSnippetOffsets(pExpr->pRight, pSnippet, piLeft) ){ - return 1; - } - } - return 0; -} - -/* -** Compute all offsets for the current row of the query. -** If the offsets have already been computed, this routine is a no-op. -*/ -static void snippetAllOffsets(fulltext_cursor *p){ - int nColumn; - int iColumn, i; - int iFirst, iLast; - int iTerm = 0; - fulltext_vtab *pFts = cursor_vtab(p); - - if( p->snippet.nMatch || p->pExpr==0 ){ - return; - } - nColumn = pFts->nColumn; - iColumn = (p->iCursorType - QUERY_FULLTEXT); - if( iColumn<0 || iColumn>=nColumn ){ - /* Look for matches over all columns of the full-text index */ - iFirst = 0; - iLast = nColumn-1; - }else{ - /* Look for matches in the iColumn-th column of the index only */ - iFirst = iColumn; - iLast = iColumn; - } - for(i=iFirst; i<=iLast; i++){ - const char *zDoc; - int nDoc; - zDoc = (const char*)sqlite3_column_text(p->pStmt, i+1); - nDoc = sqlite3_column_bytes(p->pStmt, i+1); - snippetOffsetsOfColumn(p, &p->snippet, i, zDoc, nDoc); - } - - while( trimSnippetOffsets(p->pExpr, &p->snippet, &iTerm) ){ - iTerm = 0; - } -} - -/* -** Convert the information in the aMatch[] array of the snippet -** into the string zOffset[0..nOffset-1]. This string is used as -** the return of the SQL offsets() function. -*/ -static void snippetOffsetText(Snippet *p){ - int i; - int cnt = 0; - StringBuffer sb; - char zBuf[200]; - if( p->zOffset ) return; - initStringBuffer(&sb); - for(i=0; inMatch; i++){ - struct snippetMatch *pMatch = &p->aMatch[i]; - if( pMatch->iTerm>=0 ){ - /* If snippetMatch.iTerm is less than 0, then the match was - ** discarded as part of processing the NEAR operator (see the - ** trimSnippetOffsetsForNear() function for details). Ignore - ** it in this case - */ - zBuf[0] = ' '; - sqlite3_snprintf(sizeof(zBuf)-1, &zBuf[cnt>0], "%d %d %d %d", - pMatch->iCol, pMatch->iTerm, pMatch->iStart, pMatch->nByte); - append(&sb, zBuf); - cnt++; - } - } - p->zOffset = stringBufferData(&sb); - p->nOffset = stringBufferLength(&sb); -} - -/* -** zDoc[0..nDoc-1] is phrase of text. aMatch[0..nMatch-1] are a set -** of matching words some of which might be in zDoc. zDoc is column -** number iCol. -** -** iBreak is suggested spot in zDoc where we could begin or end an -** excerpt. Return a value similar to iBreak but possibly adjusted -** to be a little left or right so that the break point is better. -*/ -static int wordBoundary( - int iBreak, /* The suggested break point */ - const char *zDoc, /* Document text */ - int nDoc, /* Number of bytes in zDoc[] */ - struct snippetMatch *aMatch, /* Matching words */ - int nMatch, /* Number of entries in aMatch[] */ - int iCol /* The column number for zDoc[] */ -){ - int i; - if( iBreak<=10 ){ - return 0; - } - if( iBreak>=nDoc-10 ){ - return nDoc; - } - for(i=0; i0 && aMatch[i-1].iStart+aMatch[i-1].nByte>=iBreak ){ - return aMatch[i-1].iStart; - } - } - for(i=1; i<=10; i++){ - if( safe_isspace(zDoc[iBreak-i]) ){ - return iBreak - i + 1; - } - if( safe_isspace(zDoc[iBreak+i]) ){ - return iBreak + i + 1; - } - } - return iBreak; -} - - - -/* -** Allowed values for Snippet.aMatch[].snStatus -*/ -#define SNIPPET_IGNORE 0 /* It is ok to omit this match from the snippet */ -#define SNIPPET_DESIRED 1 /* We want to include this match in the snippet */ - -/* -** Generate the text of a snippet. -*/ -static void snippetText( - fulltext_cursor *pCursor, /* The cursor we need the snippet for */ - const char *zStartMark, /* Markup to appear before each match */ - const char *zEndMark, /* Markup to appear after each match */ - const char *zEllipsis /* Ellipsis mark */ -){ - int i, j; - struct snippetMatch *aMatch; - int nMatch; - int nDesired; - StringBuffer sb; - int tailCol; - int tailOffset; - int iCol; - int nDoc; - const char *zDoc; - int iStart, iEnd; - int tailEllipsis = 0; - int iMatch; - - - sqlite3_free(pCursor->snippet.zSnippet); - pCursor->snippet.zSnippet = 0; - aMatch = pCursor->snippet.aMatch; - nMatch = pCursor->snippet.nMatch; - initStringBuffer(&sb); - - for(i=0; i0; i++){ - if( aMatch[i].snStatus!=SNIPPET_DESIRED ) continue; - nDesired--; - iCol = aMatch[i].iCol; - zDoc = (const char*)sqlite3_column_text(pCursor->pStmt, iCol+1); - nDoc = sqlite3_column_bytes(pCursor->pStmt, iCol+1); - iStart = aMatch[i].iStart - 40; - iStart = wordBoundary(iStart, zDoc, nDoc, aMatch, nMatch, iCol); - if( iStart<=10 ){ - iStart = 0; - } - if( iCol==tailCol && iStart<=tailOffset+20 ){ - iStart = tailOffset; - } - if( (iCol!=tailCol && tailCol>=0) || iStart!=tailOffset ){ - trimWhiteSpace(&sb); - appendWhiteSpace(&sb); - append(&sb, zEllipsis); - appendWhiteSpace(&sb); - } - iEnd = aMatch[i].iStart + aMatch[i].nByte + 40; - iEnd = wordBoundary(iEnd, zDoc, nDoc, aMatch, nMatch, iCol); - if( iEnd>=nDoc-10 ){ - iEnd = nDoc; - tailEllipsis = 0; - }else{ - tailEllipsis = 1; - } - while( iMatchsnippet.zSnippet = stringBufferData(&sb); - pCursor->snippet.nSnippet = stringBufferLength(&sb); -} - - /* ** Close the cursor. For additional information see the documentation ** on the xClose method of the virtual table interface. */ static int fulltextClose(sqlite3_vtab_cursor *pCursor){ - fulltext_cursor *c = (fulltext_cursor *) pCursor; - FTSTRACE(("FTS3 Close %p\n", c)); - sqlite3_finalize(c->pStmt); - sqlite3Fts3ExprFree(c->pExpr); - snippetClear(&c->snippet); - if( c->result.nData!=0 ){ - dlrDestroy(&c->reader); - } - dataBufferDestroy(&c->result); - sqlite3_free(c); + Fts3Cursor *pCsr = (Fts3Cursor *)pCursor; + sqlite3_finalize(pCsr->pStmt); + sqlite3Fts3ExprFree(pCsr->pExpr); + sqlite3_free(pCsr->aDoclist); + sqlite3_free(pCsr->aMatchinfo); + sqlite3_free(pCsr); return SQLITE_OK; } -static int fulltextNext(sqlite3_vtab_cursor *pCursor){ - fulltext_cursor *c = (fulltext_cursor *) pCursor; - int rc; - - FTSTRACE(("FTS3 Next %p\n", pCursor)); - snippetClear(&c->snippet); - if( c->iCursorType < QUERY_FULLTEXT ){ - /* TODO(shess) Handle SQLITE_SCHEMA AND SQLITE_BUSY. */ - rc = sqlite3_step(c->pStmt); - switch( rc ){ - case SQLITE_ROW: - c->eof = 0; - return SQLITE_OK; - case SQLITE_DONE: - c->eof = 1; - return SQLITE_OK; - default: - c->eof = 1; - return rc; - } - } else { /* full-text query */ - rc = sqlite3_reset(c->pStmt); - if( rc!=SQLITE_OK ) return rc; - - if( c->result.nData==0 || dlrAtEnd(&c->reader) ){ - c->eof = 1; +/* +** Position the pCsr->pStmt statement so that it is on the row +** of the %_content table that contains the last match. Return +** SQLITE_OK on success. +*/ +static int fts3CursorSeek(sqlite3_context *pContext, Fts3Cursor *pCsr){ + if( pCsr->isRequireSeek ){ + pCsr->isRequireSeek = 0; + sqlite3_bind_int64(pCsr->pStmt, 1, pCsr->iPrevId); + if( SQLITE_ROW==sqlite3_step(pCsr->pStmt) ){ return SQLITE_OK; + }else{ + int rc = sqlite3_reset(pCsr->pStmt); + if( rc==SQLITE_OK ){ + /* If no row was found and no error has occured, then the %_content + ** table is missing a row that is present in the full-text index. + ** The data structures are corrupt. + */ + rc = SQLITE_CORRUPT; + } + pCsr->isEof = 1; + if( pContext ){ + sqlite3_result_error_code(pContext, rc); + } + return rc; } - rc = sqlite3_bind_int64(c->pStmt, 1, dlrDocid(&c->reader)); - dlrStep(&c->reader); - if( rc!=SQLITE_OK ) return rc; - /* TODO(shess) Handle SQLITE_SCHEMA AND SQLITE_BUSY. */ - rc = sqlite3_step(c->pStmt); - if( rc==SQLITE_ROW ){ /* the case we expect */ - c->eof = 0; - return SQLITE_OK; - } - /* an error occurred; abort */ - return rc==SQLITE_DONE ? SQLITE_ERROR : rc; + }else{ + return SQLITE_OK; } } - -/* TODO(shess) If we pushed LeafReader to the top of the file, or to -** another file, term_select() could be pushed above -** docListOfTerm(). -*/ -static int termSelect(fulltext_vtab *v, int iColumn, - const char *pTerm, int nTerm, int isPrefix, - DocListType iType, DataBuffer *out); - -/* -** Return a DocList corresponding to the phrase *pPhrase. +/* +** Advance the cursor to the next row in the %_content table that +** matches the search criteria. For a MATCH search, this will be +** the next row that matches. For a full-table scan, this will be +** simply the next row in the %_content table. For a docid lookup, +** this routine simply sets the EOF flag. ** -** The resulting DL_DOCIDS doclist is stored in pResult, which is -** overwritten. +** Return SQLITE_OK if nothing goes wrong. SQLITE_OK is returned +** even if we reach end-of-file. The fts3EofMethod() will be called +** subsequently to determine whether or not an EOF was hit. */ -static int docListOfPhrase( - fulltext_vtab *pTab, /* The full text index */ - Fts3Phrase *pPhrase, /* Phrase to return a doclist corresponding to */ - DocListType eListType, /* Either DL_DOCIDS or DL_POSITIONS */ - DataBuffer *pResult /* Write the result here */ -){ - int ii; - int rc = SQLITE_OK; - int iCol = pPhrase->iColumn; - DocListType eType = eListType; - assert( eType==DL_POSITIONS || eType==DL_DOCIDS ); - if( pPhrase->nToken>1 ){ - eType = DL_POSITIONS; - } +static int fts3NextMethod(sqlite3_vtab_cursor *pCursor){ + int rc = SQLITE_OK; /* Return code */ + Fts3Cursor *pCsr = (Fts3Cursor *)pCursor; - /* This code should never be called with buffered updates. */ - assert( pTab->nPendingData<0 ); - - for(ii=0; rc==SQLITE_OK && iinToken; ii++){ - DataBuffer tmp; - struct PhraseToken *p = &pPhrase->aToken[ii]; - rc = termSelect(pTab, iCol, p->z, p->n, p->isPrefix, eType, &tmp); - if( rc==SQLITE_OK ){ - if( ii==0 ){ - *pResult = tmp; - }else{ - DataBuffer res = *pResult; - dataBufferInit(pResult, 0); - if( ii==(pPhrase->nToken-1) ){ - eType = eListType; - } - docListPhraseMerge( - res.pData, res.nData, tmp.pData, tmp.nData, 0, 0, eType, pResult - ); - dataBufferDestroy(&res); - dataBufferDestroy(&tmp); - } + if( pCsr->aDoclist==0 ){ + if( SQLITE_ROW!=sqlite3_step(pCsr->pStmt) ){ + pCsr->isEof = 1; + rc = sqlite3_reset(pCsr->pStmt); } + }else if( pCsr->pNextId>=&pCsr->aDoclist[pCsr->nDoclist] ){ + pCsr->isEof = 1; + }else{ + sqlite3_reset(pCsr->pStmt); + fts3GetDeltaVarint(&pCsr->pNextId, &pCsr->iPrevId); + pCsr->isRequireSeek = 1; + pCsr->isMatchinfoNeeded = 1; } + return rc; +} + +/* +** The buffer pointed to by argument zNode (size nNode bytes) contains the +** root node of a b-tree segment. The segment is guaranteed to be at least +** one level high (i.e. the root node is not also a leaf). If successful, +** this function locates the leaf node of the segment that may contain the +** term specified by arguments zTerm and nTerm and writes its block number +** to *piLeaf. +** +** It is possible that the returned leaf node does not contain the specified +** term. However, if the segment does contain said term, it is stored on +** the identified leaf node. Because this function only inspects interior +** segment nodes (and never loads leaf nodes into memory), it is not possible +** to be sure. +** +** If an error occurs, an error code other than SQLITE_OK is returned. +*/ +static int fts3SelectLeaf( + Fts3Table *p, /* Virtual table handle */ + const char *zTerm, /* Term to select leaves for */ + int nTerm, /* Size of term zTerm in bytes */ + const char *zNode, /* Buffer containing segment interior node */ + int nNode, /* Size of buffer at zNode */ + sqlite3_int64 *piLeaf /* Selected leaf node */ +){ + int rc = SQLITE_OK; /* Return code */ + const char *zCsr = zNode; /* Cursor to iterate through node */ + const char *zEnd = &zCsr[nNode];/* End of interior node buffer */ + char *zBuffer = 0; /* Buffer to load terms into */ + int nAlloc = 0; /* Size of allocated buffer */ + + while( 1 ){ + int isFirstTerm = 1; /* True when processing first term on page */ + int iHeight; /* Height of this node in tree */ + sqlite3_int64 iChild; /* Block id of child node to descend to */ + int nBlock; /* Size of child node in bytes */ + + zCsr += sqlite3Fts3GetVarint32(zCsr, &iHeight); + zCsr += sqlite3Fts3GetVarint(zCsr, &iChild); + + while( zCsrnAlloc ){ + char *zNew; + nAlloc = (nPrefix+nSuffix) * 2; + zNew = (char *)sqlite3_realloc(zBuffer, nAlloc); + if( !zNew ){ + sqlite3_free(zBuffer); + return SQLITE_NOMEM; + } + zBuffer = zNew; + } + memcpy(&zBuffer[nPrefix], zCsr, nSuffix); + nBuffer = nPrefix + nSuffix; + zCsr += nSuffix; + + /* Compare the term we are searching for with the term just loaded from + ** the interior node. If the specified term is greater than or equal + ** to the term from the interior node, then all terms on the sub-tree + ** headed by node iChild are smaller than zTerm. No need to search + ** iChild. + ** + ** If the interior node term is larger than the specified term, then + ** the tree headed by iChild may contain the specified term. + */ + cmp = memcmp(zTerm, zBuffer, (nBuffer>nTerm ? nTerm : nBuffer)); + if( cmp<0 || (cmp==0 && nBuffer>nTerm) ) break; + iChild++; + }; + + /* If (iHeight==1), the children of this interior node are leaves. The + ** specified term may be present on leaf node iChild. + */ + if( iHeight==1 ){ + *piLeaf = iChild; + break; + } + + /* Descend to interior node iChild. */ + rc = sqlite3Fts3ReadBlock(p, iChild, &zCsr, &nBlock); + if( rc!=SQLITE_OK ) break; + zEnd = &zCsr[nBlock]; + } + sqlite3_free(zBuffer); return rc; } /* -** Evaluate the full-text expression pExpr against fts3 table pTab. Write -** the results into pRes. +** This function is used to create delta-encoded serialized lists of FTS3 +** varints. Each call to this function appends a single varint to a list. +*/ +static void fts3PutDeltaVarint( + char **pp, /* IN/OUT: Output pointer */ + sqlite3_int64 *piPrev, /* IN/OUT: Previous value written to list */ + sqlite3_int64 iVal /* Write this value to the list */ +){ + assert( iVal-*piPrev > 0 || (*piPrev==0 && iVal==0) ); + *pp += sqlite3Fts3PutVarint(*pp, iVal-*piPrev); + *piPrev = iVal; +} + +/* +** When this function is called, *ppPoslist is assumed to point to the +** start of a position-list. After it returns, *ppPoslist points to the +** first byte after the position-list. +** +** A position list is list of positions (delta encoded) and columns for +** a single document record of a doclist. So, in other words, this +** routine advances *ppPoslist so that it points to the next docid in +** the doclist, or to the first byte past the end of the doclist. +** +** If pp is not NULL, then the contents of the position list are copied +** to *pp. *pp is set to point to the first byte past the last byte copied +** before this function returns. +*/ +static void fts3PoslistCopy(char **pp, char **ppPoslist){ + char *pEnd = *ppPoslist; + char c = 0; + + /* The end of a position list is marked by a zero encoded as an FTS3 + ** varint. A single POS_END (0) byte. Except, if the 0 byte is preceded by + ** a byte with the 0x80 bit set, then it is not a varint 0, but the tail + ** of some other, multi-byte, value. + ** + ** The following while-loop moves pEnd to point to the first byte that is not + ** immediately preceded by a byte with the 0x80 bit set. Then increments + ** pEnd once more so that it points to the byte immediately following the + ** last byte in the position-list. + */ + while( *pEnd | c ){ + c = *pEnd++ & 0x80; + testcase( c!=0 && (*pEnd)==0 ); + } + pEnd++; /* Advance past the POS_END terminator byte */ + + if( pp ){ + int n = (int)(pEnd - *ppPoslist); + char *p = *pp; + memcpy(p, *ppPoslist, n); + p += n; + *pp = p; + } + *ppPoslist = pEnd; +} + +/* +** When this function is called, *ppPoslist is assumed to point to the +** start of a column-list. After it returns, *ppPoslist points to the +** to the terminator (POS_COLUMN or POS_END) byte of the column-list. +** +** A column-list is list of delta-encoded positions for a single column +** within a single document within a doclist. +** +** The column-list is terminated either by a POS_COLUMN varint (1) or +** a POS_END varint (0). This routine leaves *ppPoslist pointing to +** the POS_COLUMN or POS_END that terminates the column-list. +** +** If pp is not NULL, then the contents of the column-list are copied +** to *pp. *pp is set to point to the first byte past the last byte copied +** before this function returns. The POS_COLUMN or POS_END terminator +** is not copied into *pp. +*/ +static void fts3ColumnlistCopy(char **pp, char **ppPoslist){ + char *pEnd = *ppPoslist; + char c = 0; + + /* A column-list is terminated by either a 0x01 or 0x00 byte that is + ** not part of a multi-byte varint. + */ + while( 0xFE & (*pEnd | c) ){ + c = *pEnd++ & 0x80; + testcase( c!=0 && ((*pEnd)&0xfe)==0 ); + } + if( pp ){ + int n = (int)(pEnd - *ppPoslist); + char *p = *pp; + memcpy(p, *ppPoslist, n); + p += n; + *pp = p; + } + *ppPoslist = pEnd; +} + +/* +** Value used to signify the end of an position-list. This is safe because +** it is not possible to have a document with 2^31 terms. +*/ +#define POSITION_LIST_END 0x7fffffff + +/* +** This function is used to help parse position-lists. When this function is +** called, *pp may point to the start of the next varint in the position-list +** being parsed, or it may point to 1 byte past the end of the position-list +** (in which case **pp will be a terminator bytes POS_END (0) or +** (1)). +** +** If *pp points past the end of the current position-list, set *pi to +** POSITION_LIST_END and return. Otherwise, read the next varint from *pp, +** increment the current value of *pi by the value read, and set *pp to +** point to the next value before returning. +** +** Before calling this routine *pi must be initialized to the value of +** the previous position, or zero if we are reading the first position +** in the position-list. Because positions are delta-encoded, the value +** of the previous position is needed in order to compute the value of +** the next position. +*/ +static void fts3ReadNextPos( + char **pp, /* IN/OUT: Pointer into position-list buffer */ + sqlite3_int64 *pi /* IN/OUT: Value read from position-list */ +){ + if( (**pp)&0xFE ){ + fts3GetDeltaVarint(pp, pi); + *pi -= 2; + }else{ + *pi = POSITION_LIST_END; + } +} + +/* +** If parameter iCol is not 0, write an POS_COLUMN (1) byte followed by +** the value of iCol encoded as a varint to *pp. This will start a new +** column list. +** +** Set *pp to point to the byte just after the last byte written before +** returning (do not modify it if iCol==0). Return the total number of bytes +** written (0 if iCol==0). +*/ +static int fts3PutColNumber(char **pp, int iCol){ + int n = 0; /* Number of bytes written */ + if( iCol ){ + char *p = *pp; /* Output pointer */ + n = 1 + sqlite3Fts3PutVarint(&p[1], iCol); + *p = 0x01; + *pp = &p[n]; + } + return n; +} + +/* +** Compute the union of two position lists. The output written +** into *pp contains all positions of both *pp1 and *pp2 in sorted +** order and with any duplicates removed. All pointers are +** updated appropriately. The caller is responsible for insuring +** that there is enough space in *pp to hold the complete output. +*/ +static void fts3PoslistMerge( + char **pp, /* Output buffer */ + char **pp1, /* Left input list */ + char **pp2 /* Right input list */ +){ + char *p = *pp; + char *p1 = *pp1; + char *p2 = *pp2; + + while( *p1 || *p2 ){ + int iCol1; /* The current column index in pp1 */ + int iCol2; /* The current column index in pp2 */ + + if( *p1==POS_COLUMN ) sqlite3Fts3GetVarint32(&p1[1], &iCol1); + else if( *p1==POS_END ) iCol1 = POSITION_LIST_END; + else iCol1 = 0; + + if( *p2==POS_COLUMN ) sqlite3Fts3GetVarint32(&p2[1], &iCol2); + else if( *p2==POS_END ) iCol2 = POSITION_LIST_END; + else iCol2 = 0; + + if( iCol1==iCol2 ){ + sqlite3_int64 i1 = 0; /* Last position from pp1 */ + sqlite3_int64 i2 = 0; /* Last position from pp2 */ + sqlite3_int64 iPrev = 0; + int n = fts3PutColNumber(&p, iCol1); + p1 += n; + p2 += n; + + /* At this point, both p1 and p2 point to the start of column-lists + ** for the same column (the column with index iCol1 and iCol2). + ** A column-list is a list of non-negative delta-encoded varints, each + ** incremented by 2 before being stored. Each list is terminated by a + ** POS_END (0) or POS_COLUMN (1). The following block merges the two lists + ** and writes the results to buffer p. p is left pointing to the byte + ** after the list written. No terminator (POS_END or POS_COLUMN) is + ** written to the output. + */ + fts3GetDeltaVarint(&p1, &i1); + fts3GetDeltaVarint(&p2, &i2); + do { + fts3PutDeltaVarint(&p, &iPrev, (i1iPos1 && iPos2<=iPos1+nToken ){ + sqlite3_int64 iSave; + if( !pp ){ + fts3PoslistCopy(0, &p2); + fts3PoslistCopy(0, &p1); + *pp1 = p1; + *pp2 = p2; + return 1; + } + iSave = isSaveLeft ? iPos1 : iPos2; + fts3PutDeltaVarint(&p, &iPrev, iSave+2); iPrev -= 2; + pSave = 0; + } + if( (!isSaveLeft && iPos2<=(iPos1+nToken)) || iPos2<=iPos1 ){ + if( (*p2&0xFE)==0 ) break; + fts3GetDeltaVarint(&p2, &iPos2); iPos2 -= 2; + }else{ + if( (*p1&0xFE)==0 ) break; + fts3GetDeltaVarint(&p1, &iPos1); iPos1 -= 2; + } + } + + if( pSave ){ + assert( pp && p ); + p = pSave; + } + + fts3ColumnlistCopy(0, &p1); + fts3ColumnlistCopy(0, &p2); + assert( (*p1&0xFE)==0 && (*p2&0xFE)==0 ); + if( 0==*p1 || 0==*p2 ) break; + + p1++; + p1 += sqlite3Fts3GetVarint32(p1, &iCol1); + p2++; + p2 += sqlite3Fts3GetVarint32(p2, &iCol2); + } + + /* Advance pointer p1 or p2 (whichever corresponds to the smaller of + ** iCol1 and iCol2) so that it points to either the 0x00 that marks the + ** end of the position list, or the 0x01 that precedes the next + ** column-number in the position list. + */ + else if( iCol1 D */ +#define MERGE_AND 3 /* D + D -> D */ +#define MERGE_OR 4 /* D + D -> D */ +#define MERGE_POS_OR 5 /* P + P -> P */ +#define MERGE_PHRASE 6 /* P + P -> D */ +#define MERGE_POS_PHRASE 7 /* P + P -> P */ +#define MERGE_NEAR 8 /* P + P -> D */ +#define MERGE_POS_NEAR 9 /* P + P -> P */ + +/* +** Merge the two doclists passed in buffer a1 (size n1 bytes) and a2 +** (size n2 bytes). The output is written to pre-allocated buffer aBuffer, +** which is guaranteed to be large enough to hold the results. The number +** of bytes written to aBuffer is stored in *pnBuffer before returning. +** +** If successful, SQLITE_OK is returned. Otherwise, if a malloc error +** occurs while allocating a temporary buffer as part of the merge operation, +** SQLITE_NOMEM is returned. +*/ +static int fts3DoclistMerge( + int mergetype, /* One of the MERGE_XXX constants */ + int nParam1, /* Used by MERGE_NEAR and MERGE_POS_NEAR */ + int nParam2, /* Used by MERGE_NEAR and MERGE_POS_NEAR */ + char *aBuffer, /* Pre-allocated output buffer */ + int *pnBuffer, /* OUT: Bytes written to aBuffer */ + char *a1, /* Buffer containing first doclist */ + int n1, /* Size of buffer a1 */ + char *a2, /* Buffer containing second doclist */ + int n2 /* Size of buffer a2 */ +){ + sqlite3_int64 i1 = 0; + sqlite3_int64 i2 = 0; + sqlite3_int64 iPrev = 0; + + char *p = aBuffer; + char *p1 = a1; + char *p2 = a2; + char *pEnd1 = &a1[n1]; + char *pEnd2 = &a2[n2]; + + assert( mergetype==MERGE_OR || mergetype==MERGE_POS_OR + || mergetype==MERGE_AND || mergetype==MERGE_NOT + || mergetype==MERGE_PHRASE || mergetype==MERGE_POS_PHRASE + || mergetype==MERGE_NEAR || mergetype==MERGE_POS_NEAR + ); + + if( !aBuffer ){ + *pnBuffer = 0; + return SQLITE_NOMEM; + } + + /* Read the first docid from each doclist */ + fts3GetDeltaVarint2(&p1, pEnd1, &i1); + fts3GetDeltaVarint2(&p2, pEnd2, &i2); + + switch( mergetype ){ + case MERGE_OR: + case MERGE_POS_OR: + while( p1 || p2 ){ + if( p2 && p1 && i1==i2 ){ + fts3PutDeltaVarint(&p, &iPrev, i1); + if( mergetype==MERGE_POS_OR ) fts3PoslistMerge(&p, &p1, &p2); + fts3GetDeltaVarint2(&p1, pEnd1, &i1); + fts3GetDeltaVarint2(&p2, pEnd2, &i2); + }else if( !p2 || (p1 && i1isReqPos ? MERGE_POS_OR : MERGE_OR); + char *aOut = 0; + int nOut = 0; + int i; + + /* Loop through the doclists in the aaOutput[] array. Merge them all + ** into a single doclist. + */ + for(i=0; iaaOutput); i++){ + if( pTS->aaOutput[i] ){ + if( !aOut ){ + aOut = pTS->aaOutput[i]; + nOut = pTS->anOutput[i]; + pTS->aaOutput[0] = 0; + }else{ + int nNew = nOut + pTS->anOutput[i]; + char *aNew = sqlite3_malloc(nNew); + if( !aNew ){ + sqlite3_free(aOut); + return SQLITE_NOMEM; + } + fts3DoclistMerge(mergetype, 0, 0, + aNew, &nNew, pTS->aaOutput[i], pTS->anOutput[i], aOut, nOut + ); + sqlite3_free(pTS->aaOutput[i]); + sqlite3_free(aOut); + pTS->aaOutput[i] = 0; + aOut = aNew; + nOut = nNew; + } + } + } + + pTS->aaOutput[0] = aOut; + pTS->anOutput[0] = nOut; + return SQLITE_OK; +} + +/* +** This function is used as the sqlite3Fts3SegReaderIterate() callback when +** querying the full-text index for a doclist associated with a term or +** term-prefix. +*/ +static int fts3TermSelectCb( + Fts3Table *p, /* Virtual table object */ + void *pContext, /* Pointer to TermSelect structure */ + char *zTerm, + int nTerm, + char *aDoclist, + int nDoclist +){ + TermSelect *pTS = (TermSelect *)pContext; + + UNUSED_PARAMETER(p); + UNUSED_PARAMETER(zTerm); + UNUSED_PARAMETER(nTerm); + + if( pTS->aaOutput[0]==0 ){ + /* If this is the first term selected, copy the doclist to the output + ** buffer using memcpy(). TODO: Add a way to transfer control of the + ** aDoclist buffer from the caller so as to avoid the memcpy(). + */ + pTS->aaOutput[0] = sqlite3_malloc(nDoclist); + pTS->anOutput[0] = nDoclist; + if( pTS->aaOutput[0] ){ + memcpy(pTS->aaOutput[0], aDoclist, nDoclist); + }else{ + return SQLITE_NOMEM; + } + }else{ + int mergetype = (pTS->isReqPos ? MERGE_POS_OR : MERGE_OR); + char *aMerge = aDoclist; + int nMerge = nDoclist; + int iOut; + + for(iOut=0; iOutaaOutput); iOut++){ + char *aNew; + int nNew; + if( pTS->aaOutput[iOut]==0 ){ + assert( iOut>0 ); + pTS->aaOutput[iOut] = aMerge; + pTS->anOutput[iOut] = nMerge; + break; + } + + nNew = nMerge + pTS->anOutput[iOut]; + aNew = sqlite3_malloc(nNew); + if( !aNew ){ + if( aMerge!=aDoclist ){ + sqlite3_free(aMerge); + } + return SQLITE_NOMEM; + } + fts3DoclistMerge(mergetype, 0, 0, + aNew, &nNew, pTS->aaOutput[iOut], pTS->anOutput[iOut], aMerge, nMerge + ); + + if( iOut>0 ) sqlite3_free(aMerge); + sqlite3_free(pTS->aaOutput[iOut]); + pTS->aaOutput[iOut] = 0; + + aMerge = aNew; + nMerge = nNew; + if( (iOut+1)==SizeofArray(pTS->aaOutput) ){ + pTS->aaOutput[iOut] = aMerge; + pTS->anOutput[iOut] = nMerge; + } + } + } + return SQLITE_OK; +} + +/* +** This function retreives the doclist for the specified term (or term +** prefix) from the database. +** +** The returned doclist may be in one of two formats, depending on the +** value of parameter isReqPos. If isReqPos is zero, then the doclist is +** a sorted list of delta-compressed docids (a bare doclist). If isReqPos +** is non-zero, then the returned list is in the same format as is stored +** in the database without the found length specifier at the start of on-disk +** doclists. +*/ +static int fts3TermSelect( + Fts3Table *p, /* Virtual table handle */ + int iColumn, /* Column to query (or -ve for all columns) */ + const char *zTerm, /* Term to query for */ + int nTerm, /* Size of zTerm in bytes */ + int isPrefix, /* True for a prefix search */ + int isReqPos, /* True to include position lists in output */ + int *pnOut, /* OUT: Size of buffer at *ppOut */ + char **ppOut /* OUT: Malloced result buffer */ +){ + int i; + TermSelect tsc; + Fts3SegFilter filter; /* Segment term filter configuration */ + Fts3SegReader **apSegment; /* Array of segments to read data from */ + int nSegment = 0; /* Size of apSegment array */ + int nAlloc = 16; /* Allocated size of segment array */ + int rc; /* Return code */ + sqlite3_stmt *pStmt = 0; /* SQL statement to scan %_segdir table */ + int iAge = 0; /* Used to assign ages to segments */ + + apSegment = (Fts3SegReader **)sqlite3_malloc(sizeof(Fts3SegReader*)*nAlloc); + if( !apSegment ) return SQLITE_NOMEM; + rc = sqlite3Fts3SegReaderPending(p, zTerm, nTerm, isPrefix, &apSegment[0]); + if( rc!=SQLITE_OK ) goto finished; + if( apSegment[0] ){ + nSegment = 1; + } + + /* Loop through the entire %_segdir table. For each segment, create a + ** Fts3SegReader to iterate through the subset of the segment leaves + ** that may contain a term that matches zTerm/nTerm. For non-prefix + ** searches, this is always a single leaf. For prefix searches, this + ** may be a contiguous block of leaves. + ** + ** The code in this loop does not actually load any leaves into memory + ** (unless the root node happens to be a leaf). It simply examines the + ** b-tree structure to determine which leaves need to be inspected. + */ + rc = sqlite3Fts3AllSegdirs(p, &pStmt); + while( rc==SQLITE_OK && SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){ + Fts3SegReader *pNew = 0; + int nRoot = sqlite3_column_bytes(pStmt, 4); + char const *zRoot = sqlite3_column_blob(pStmt, 4); + if( sqlite3_column_int64(pStmt, 1)==0 ){ + /* The entire segment is stored on the root node (which must be a + ** leaf). Do not bother inspecting any data in this case, just + ** create a Fts3SegReader to scan the single leaf. + */ + rc = sqlite3Fts3SegReaderNew(p, iAge, 0, 0, 0, zRoot, nRoot, &pNew); + }else{ + int rc2; /* Return value of sqlite3Fts3ReadBlock() */ + sqlite3_int64 i1; /* Blockid of leaf that may contain zTerm */ + rc = fts3SelectLeaf(p, zTerm, nTerm, zRoot, nRoot, &i1); + if( rc==SQLITE_OK ){ + sqlite3_int64 i2 = sqlite3_column_int64(pStmt, 2); + rc = sqlite3Fts3SegReaderNew(p, iAge, i1, i2, 0, 0, 0, &pNew); + } + + /* The following call to ReadBlock() serves to reset the SQL statement + ** used to retrieve blocks of data from the %_segments table. If it is + ** not reset here, then it may remain classified as an active statement + ** by SQLite, which may lead to "DROP TABLE" or "DETACH" commands + ** failing. + */ + rc2 = sqlite3Fts3ReadBlock(p, 0, 0, 0); + if( rc==SQLITE_OK ){ + rc = rc2; + } + } + iAge++; + + /* If a new Fts3SegReader was allocated, add it to the apSegment array. */ + assert( pNew!=0 || rc!=SQLITE_OK ); + if( pNew ){ + if( nSegment==nAlloc ){ + Fts3SegReader **pArray; + nAlloc += 16; + pArray = (Fts3SegReader **)sqlite3_realloc( + apSegment, nAlloc*sizeof(Fts3SegReader *) + ); + if( !pArray ){ + sqlite3Fts3SegReaderFree(p, pNew); + rc = SQLITE_NOMEM; + goto finished; + } + apSegment = pArray; + } + apSegment[nSegment++] = pNew; + } + } + if( rc!=SQLITE_DONE ){ + assert( rc!=SQLITE_OK ); + goto finished; + } + + memset(&tsc, 0, sizeof(TermSelect)); + tsc.isReqPos = isReqPos; + + filter.flags = FTS3_SEGMENT_IGNORE_EMPTY + | (isPrefix ? FTS3_SEGMENT_PREFIX : 0) + | (isReqPos ? FTS3_SEGMENT_REQUIRE_POS : 0) + | (iColumnnColumn ? FTS3_SEGMENT_COLUMN_FILTER : 0); + filter.iCol = iColumn; + filter.zTerm = zTerm; + filter.nTerm = nTerm; + + rc = sqlite3Fts3SegReaderIterate(p, apSegment, nSegment, &filter, + fts3TermSelectCb, (void *)&tsc + ); + if( rc==SQLITE_OK ){ + rc = fts3TermSelectMerge(&tsc); + } + + if( rc==SQLITE_OK ){ + *ppOut = tsc.aaOutput[0]; + *pnOut = tsc.anOutput[0]; + }else{ + for(i=0; iiColumn; + int isTermPos = (pPhrase->nToken>1 || isReqPos); + + for(ii=0; iinToken; ii++){ + struct PhraseToken *pTok = &pPhrase->aToken[ii]; + char *z = pTok->z; /* Next token of the phrase */ + int n = pTok->n; /* Size of z in bytes */ + int isPrefix = pTok->isPrefix;/* True if token is a prefix */ + char *pList; /* Pointer to token doclist */ + int nList; /* Size of buffer at pList */ + + rc = fts3TermSelect(p, iCol, z, n, isPrefix, isTermPos, &nList, &pList); + if( rc!=SQLITE_OK ) break; + + if( ii==0 ){ + pOut = pList; + nOut = nList; + }else{ + /* Merge the new term list and the current output. If this is the + ** last term in the phrase, and positions are not required in the + ** output of this function, the positions can be dropped as part + ** of this merge. Either way, the result of this merge will be + ** smaller than nList bytes. The code in fts3DoclistMerge() is written + ** so that it is safe to use pList as the output as well as an input + ** in this case. + */ + int mergetype = MERGE_POS_PHRASE; + if( ii==pPhrase->nToken-1 && !isReqPos ){ + mergetype = MERGE_PHRASE; + } + fts3DoclistMerge(mergetype, 0, 0, pList, &nOut, pOut, nOut, pList, nList); + sqlite3_free(pOut); + pOut = pList; + } + assert( nOut==0 || pOut!=0 ); + } + + if( rc==SQLITE_OK ){ + *paOut = pOut; + *pnOut = nOut; + }else{ + sqlite3_free(pOut); + } + return rc; +} + +static int fts3NearMerge( + int mergetype, /* MERGE_POS_NEAR or MERGE_NEAR */ + int nNear, /* Parameter to NEAR operator */ + int nTokenLeft, /* Number of tokens in LHS phrase arg */ + char *aLeft, /* Doclist for LHS (incl. positions) */ + int nLeft, /* Size of LHS doclist in bytes */ + int nTokenRight, /* As nTokenLeft */ + char *aRight, /* As aLeft */ + int nRight, /* As nRight */ + char **paOut, /* OUT: Results of merge (malloced) */ + int *pnOut /* OUT: Sized of output buffer */ +){ + char *aOut; + int rc; + + assert( mergetype==MERGE_POS_NEAR || MERGE_NEAR ); + + aOut = sqlite3_malloc(nLeft+nRight+1); + if( aOut==0 ){ + rc = SQLITE_NOMEM; + }else{ + rc = fts3DoclistMerge(mergetype, nNear+nTokenRight, nNear+nTokenLeft, + aOut, pnOut, aLeft, nLeft, aRight, nRight + ); + if( rc!=SQLITE_OK ){ + sqlite3_free(aOut); + aOut = 0; + } + } + + *paOut = aOut; + return rc; +} + +SQLITE_PRIVATE int sqlite3Fts3ExprNearTrim(Fts3Expr *pLeft, Fts3Expr *pRight, int nNear){ + int rc; + if( pLeft->aDoclist==0 || pRight->aDoclist==0 ){ + sqlite3_free(pLeft->aDoclist); + sqlite3_free(pRight->aDoclist); + pRight->aDoclist = 0; + pLeft->aDoclist = 0; + rc = SQLITE_OK; + }else{ + char *aOut; + int nOut; + + rc = fts3NearMerge(MERGE_POS_NEAR, nNear, + pLeft->pPhrase->nToken, pLeft->aDoclist, pLeft->nDoclist, + pRight->pPhrase->nToken, pRight->aDoclist, pRight->nDoclist, + &aOut, &nOut + ); + if( rc!=SQLITE_OK ) return rc; + sqlite3_free(pRight->aDoclist); + pRight->aDoclist = aOut; + pRight->nDoclist = nOut; + + rc = fts3NearMerge(MERGE_POS_NEAR, nNear, + pRight->pPhrase->nToken, pRight->aDoclist, pRight->nDoclist, + pLeft->pPhrase->nToken, pLeft->aDoclist, pLeft->nDoclist, + &aOut, &nOut + ); + sqlite3_free(pLeft->aDoclist); + pLeft->aDoclist = aOut; + pLeft->nDoclist = nOut; + } + return rc; +} + +/* +** Evaluate the full-text expression pExpr against fts3 table pTab. Store +** the resulting doclist in *paOut and *pnOut. This routine mallocs for +** the space needed to store the output. The caller is responsible for +** freeing the space when it has finished. */ static int evalFts3Expr( - fulltext_vtab *pTab, /* Fts3 Virtual table object */ - Fts3Expr *pExpr, /* Parsed fts3 expression */ - DataBuffer *pRes /* OUT: Write results of the expression here */ + Fts3Table *p, /* Virtual table handle */ + Fts3Expr *pExpr, /* Parsed fts3 expression */ + char **paOut, /* OUT: Pointer to malloc'd result buffer */ + int *pnOut, /* OUT: Size of buffer at *paOut */ + int isReqPos /* Require positions in output buffer */ ){ - int rc = SQLITE_OK; + int rc = SQLITE_OK; /* Return code */ - /* Initialize the output buffer. If this is an empty query (pExpr==0), - ** this is all that needs to be done. Empty queries produce empty - ** result sets. - */ - dataBufferInit(pRes, 0); + /* Zero the output parameters. */ + *paOut = 0; + *pnOut = 0; if( pExpr ){ + assert( pExpr->eType==FTSQUERY_PHRASE + || pExpr->eType==FTSQUERY_NEAR + || isReqPos==0 + ); if( pExpr->eType==FTSQUERY_PHRASE ){ - DocListType eType = DL_DOCIDS; - if( pExpr->pParent && pExpr->pParent->eType==FTSQUERY_NEAR ){ - eType = DL_POSITIONS; - } - rc = docListOfPhrase(pTab, pExpr->pPhrase, eType, pRes); + rc = fts3PhraseSelect(p, pExpr->pPhrase, + isReqPos || (pExpr->pParent && pExpr->pParent->eType==FTSQUERY_NEAR), + paOut, pnOut + ); }else{ - DataBuffer lhs; - DataBuffer rhs; + char *aLeft; + char *aRight; + int nLeft; + int nRight; - dataBufferInit(&rhs, 0); - if( SQLITE_OK==(rc = evalFts3Expr(pTab, pExpr->pLeft, &lhs)) - && SQLITE_OK==(rc = evalFts3Expr(pTab, pExpr->pRight, &rhs)) + if( 0==(rc = evalFts3Expr(p, pExpr->pRight, &aRight, &nRight, isReqPos)) + && 0==(rc = evalFts3Expr(p, pExpr->pLeft, &aLeft, &nLeft, isReqPos)) ){ + assert( pExpr->eType==FTSQUERY_NEAR || pExpr->eType==FTSQUERY_OR + || pExpr->eType==FTSQUERY_AND || pExpr->eType==FTSQUERY_NOT + ); switch( pExpr->eType ){ case FTSQUERY_NEAR: { - int nToken; Fts3Expr *pLeft; - DocListType eType = DL_DOCIDS; + Fts3Expr *pRight; + int mergetype = isReqPos ? MERGE_POS_NEAR : MERGE_NEAR; + if( pExpr->pParent && pExpr->pParent->eType==FTSQUERY_NEAR ){ - eType = DL_POSITIONS; + mergetype = MERGE_POS_NEAR; } pLeft = pExpr->pLeft; while( pLeft->eType==FTSQUERY_NEAR ){ pLeft=pLeft->pRight; } - assert( pExpr->pRight->eType==FTSQUERY_PHRASE ); + pRight = pExpr->pRight; + assert( pRight->eType==FTSQUERY_PHRASE ); assert( pLeft->eType==FTSQUERY_PHRASE ); - nToken = pLeft->pPhrase->nToken + pExpr->pRight->pPhrase->nToken; - docListPhraseMerge(lhs.pData, lhs.nData, rhs.pData, rhs.nData, - pExpr->nNear+1, nToken, eType, pRes + + rc = fts3NearMerge(mergetype, pExpr->nNear, + pLeft->pPhrase->nToken, aLeft, nLeft, + pRight->pPhrase->nToken, aRight, nRight, + paOut, pnOut ); + sqlite3_free(aLeft); break; } - case FTSQUERY_NOT: { - docListExceptMerge(lhs.pData, lhs.nData, rhs.pData, rhs.nData,pRes); - break; - } - case FTSQUERY_AND: { - docListAndMerge(lhs.pData, lhs.nData, rhs.pData, rhs.nData, pRes); - break; - } + case FTSQUERY_OR: { - docListOrMerge(lhs.pData, lhs.nData, rhs.pData, rhs.nData, pRes); + /* Allocate a buffer for the output. The maximum size is the + ** sum of the sizes of the two input buffers. The +1 term is + ** so that a buffer of zero bytes is never allocated - this can + ** cause fts3DoclistMerge() to incorrectly return SQLITE_NOMEM. + */ + char *aBuffer = sqlite3_malloc(nRight+nLeft+1); + rc = fts3DoclistMerge(MERGE_OR, 0, 0, aBuffer, pnOut, + aLeft, nLeft, aRight, nRight + ); + *paOut = aBuffer; + sqlite3_free(aLeft); + break; + } + + default: { + assert( FTSQUERY_NOT==MERGE_NOT && FTSQUERY_AND==MERGE_AND ); + fts3DoclistMerge(pExpr->eType, 0, 0, aLeft, pnOut, + aLeft, nLeft, aRight, nRight + ); + *paOut = aLeft; break; } } } - dataBufferDestroy(&lhs); - dataBufferDestroy(&rhs); + sqlite3_free(aRight); } } return rc; } -/* TODO(shess) Refactor the code to remove this forward decl. */ -static int flushPendingTerms(fulltext_vtab *v); - -/* Perform a full-text query using the search expression in -** zInput[0..nInput-1]. Return a list of matching documents -** in pResult. -** -** Queries must match column iColumn. Or if iColumn>=nColumn -** they are allowed to match against any column. -*/ -static int fulltextQuery( - fulltext_vtab *v, /* The full text index */ - int iColumn, /* Match against this column by default */ - const char *zInput, /* The query string */ - int nInput, /* Number of bytes in zInput[] */ - DataBuffer *pResult, /* Write the result doclist here */ - Fts3Expr **ppExpr /* Put parsed query string here */ -){ - int rc; - - /* TODO(shess) Instead of flushing pendingTerms, we could query for - ** the relevant term and merge the doclist into what we receive from - ** the database. Wait and see if this is a common issue, first. - ** - ** A good reason not to flush is to not generate update-related - ** error codes from here. - */ - - /* Flush any buffered updates before executing the query. */ - rc = flushPendingTerms(v); - if( rc!=SQLITE_OK ){ - return rc; - } - - /* Parse the query passed to the MATCH operator. */ - rc = sqlite3Fts3ExprParse(v->pTokenizer, - v->azColumn, v->nColumn, iColumn, zInput, nInput, ppExpr - ); - if( rc!=SQLITE_OK ){ - assert( 0==(*ppExpr) ); - return rc; - } - - return evalFts3Expr(v, *ppExpr, pResult); -} - /* ** This is the xFilter interface for the virtual table. See ** the virtual table xFilter method documentation for additional ** information. ** -** If idxNum==QUERY_GENERIC then do a full table scan against +** If idxNum==FTS3_FULLSCAN_SEARCH then do a full table scan against ** the %_content table. ** -** If idxNum==QUERY_DOCID then do a docid lookup for a single entry +** If idxNum==FTS3_DOCID_SEARCH then do a docid lookup for a single entry ** in the %_content table. ** -** If idxNum>=QUERY_FULLTEXT then use the full text index. The +** If idxNum>=FTS3_FULLTEXT_SEARCH then use the full text index. The ** column on the left-hand side of the MATCH operator is column -** number idxNum-QUERY_FULLTEXT, 0 indexed. argv[0] is the right-hand +** number idxNum-FTS3_FULLTEXT_SEARCH, 0 indexed. argv[0] is the right-hand ** side of the MATCH operator. */ /* TODO(shess) Upgrade the cursor initialization and destruction to -** account for fulltextFilter() being called multiple times on the -** same cursor. The current solution is very fragile. Apply fix to +** account for fts3FilterMethod() being called multiple times on the +** same cursor. The current solution is very fragile. Apply fix to ** fts3 as appropriate. */ -static int fulltextFilter( - sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ - int idxNum, const char *idxStr, /* Which indexing scheme to use */ - int argc, sqlite3_value **argv /* Arguments for the indexing scheme */ +static int fts3FilterMethod( + sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ + int idxNum, /* Strategy index */ + const char *idxStr, /* Unused */ + int nVal, /* Number of elements in apVal */ + sqlite3_value **apVal /* Arguments for the indexing scheme */ ){ - fulltext_cursor *c = (fulltext_cursor *) pCursor; - fulltext_vtab *v = cursor_vtab(c); - int rc; + const char *azSql[] = { + "SELECT * FROM %Q.'%q_content' WHERE docid = ?", /* non-full-table-scan */ + "SELECT * FROM %Q.'%q_content'", /* full-table-scan */ + }; + int rc; /* Return code */ + char *zSql; /* SQL statement used to access %_content */ + Fts3Table *p = (Fts3Table *)pCursor->pVtab; + Fts3Cursor *pCsr = (Fts3Cursor *)pCursor; - FTSTRACE(("FTS3 Filter %p\n",pCursor)); + UNUSED_PARAMETER(idxStr); + UNUSED_PARAMETER(nVal); - /* If the cursor has a statement that was not prepared according to - ** idxNum, clear it. I believe all calls to fulltextFilter with a - ** given cursor will have the same idxNum , but in this case it's - ** easy to be safe. + assert( idxNum>=0 && idxNum<=(FTS3_FULLTEXT_SEARCH+p->nColumn) ); + assert( nVal==0 || nVal==1 ); + assert( (nVal==0)==(idxNum==FTS3_FULLSCAN_SEARCH) ); + + /* In case the cursor has been used before, clear it now. */ + sqlite3_finalize(pCsr->pStmt); + sqlite3_free(pCsr->aDoclist); + sqlite3Fts3ExprFree(pCsr->pExpr); + memset(&pCursor[1], 0, sizeof(Fts3Cursor)-sizeof(sqlite3_vtab_cursor)); + + /* Compile a SELECT statement for this cursor. For a full-table-scan, the + ** statement loops through all rows of the %_content table. For a + ** full-text query or docid lookup, the statement retrieves a single + ** row by docid. */ - if( c->pStmt && c->iCursorType!=idxNum ){ - sqlite3_finalize(c->pStmt); - c->pStmt = NULL; - } - - /* Get a fresh statement appropriate to idxNum. */ - /* TODO(shess): Add a prepared-statement cache in the vt structure. - ** The cache must handle multiple open cursors. Easier to cache the - ** statement variants at the vt to reduce malloc/realloc/free here. - ** Or we could have a StringBuffer variant which allowed stack - ** construction for small values. - */ - if( !c->pStmt ){ - StringBuffer sb; - initStringBuffer(&sb); - append(&sb, "SELECT docid, "); - appendList(&sb, v->nColumn, v->azContentColumn); - append(&sb, " FROM %_content"); - if( idxNum!=QUERY_GENERIC ) append(&sb, " WHERE docid = ?"); - rc = sql_prepare(v->db, v->zDb, v->zName, &c->pStmt, - stringBufferData(&sb)); - stringBufferDestroy(&sb); - if( rc!=SQLITE_OK ) return rc; - c->iCursorType = idxNum; + zSql = sqlite3_mprintf(azSql[idxNum==FTS3_FULLSCAN_SEARCH], p->zDb, p->zName); + if( !zSql ){ + rc = SQLITE_NOMEM; }else{ - sqlite3_reset(c->pStmt); - assert( c->iCursorType==idxNum ); + rc = sqlite3_prepare_v2(p->db, zSql, -1, &pCsr->pStmt, 0); + sqlite3_free(zSql); } + if( rc!=SQLITE_OK ) return rc; + pCsr->eSearch = (i16)idxNum; - switch( idxNum ){ - case QUERY_GENERIC: - break; + if( idxNum==FTS3_DOCID_SEARCH ){ + rc = sqlite3_bind_value(pCsr->pStmt, 1, apVal[0]); + }else if( idxNum!=FTS3_FULLSCAN_SEARCH ){ + int iCol = idxNum-FTS3_FULLTEXT_SEARCH; + const char *zQuery = (const char *)sqlite3_value_text(apVal[0]); - case QUERY_DOCID: - rc = sqlite3_bind_int64(c->pStmt, 1, sqlite3_value_int64(argv[0])); - if( rc!=SQLITE_OK ) return rc; - break; - - default: /* full-text search */ - { - int iCol = idxNum-QUERY_FULLTEXT; - const char *zQuery = (const char *)sqlite3_value_text(argv[0]); - assert( idxNum<=QUERY_FULLTEXT+v->nColumn); - assert( argc==1 ); - if( c->result.nData!=0 ){ - /* This case happens if the same cursor is used repeatedly. */ - dlrDestroy(&c->reader); - dataBufferReset(&c->result); - }else{ - dataBufferInit(&c->result, 0); - } - rc = fulltextQuery(v, iCol, zQuery, -1, &c->result, &c->pExpr); - if( rc!=SQLITE_OK ) return rc; - if( c->result.nData!=0 ){ - dlrInit(&c->reader, DL_DOCIDS, c->result.pData, c->result.nData); - } - break; + if( zQuery==0 && sqlite3_value_type(apVal[0])!=SQLITE_NULL ){ + return SQLITE_NOMEM; } + + rc = sqlite3Fts3ExprParse(p->pTokenizer, p->azColumn, p->nColumn, + iCol, zQuery, -1, &pCsr->pExpr + ); + if( rc!=SQLITE_OK ){ + if( rc==SQLITE_ERROR ){ + p->base.zErrMsg = sqlite3_mprintf("malformed MATCH expression: [%s]", + zQuery); + } + return rc; + } + + rc = sqlite3Fts3ReadLock(p); + if( rc!=SQLITE_OK ) return rc; + + rc = evalFts3Expr(p, pCsr->pExpr, &pCsr->aDoclist, &pCsr->nDoclist, 0); + pCsr->pNextId = pCsr->aDoclist; + pCsr->iPrevId = 0; } - return fulltextNext(pCursor); + if( rc!=SQLITE_OK ) return rc; + return fts3NextMethod(pCursor); } -/* This is the xEof method of the virtual table. The SQLite core -** calls this routine to find out if it has reached the end of -** a query's results set. +/* +** This is the xEof method of the virtual table. SQLite calls this +** routine to find out if it has reached the end of a result set. */ -static int fulltextEof(sqlite3_vtab_cursor *pCursor){ - fulltext_cursor *c = (fulltext_cursor *) pCursor; - return c->eof; +static int fts3EofMethod(sqlite3_vtab_cursor *pCursor){ + return ((Fts3Cursor *)pCursor)->isEof; } -/* This is the xColumn method of the virtual table. The SQLite -** core calls this method during a query when it needs the value -** of a column from the virtual table. This method needs to use -** one of the sqlite3_result_*() routines to store the requested -** value back in the pContext. -*/ -static int fulltextColumn(sqlite3_vtab_cursor *pCursor, - sqlite3_context *pContext, int idxCol){ - fulltext_cursor *c = (fulltext_cursor *) pCursor; - fulltext_vtab *v = cursor_vtab(c); - - if( idxColnColumn ){ - sqlite3_value *pVal = sqlite3_column_value(c->pStmt, idxCol+1); - sqlite3_result_value(pContext, pVal); - }else if( idxCol==v->nColumn ){ - /* The extra column whose name is the same as the table. - ** Return a blob which is a pointer to the cursor - */ - sqlite3_result_blob(pContext, &c, sizeof(c), SQLITE_TRANSIENT); - }else if( idxCol==v->nColumn+1 ){ - /* The docid column, which is an alias for rowid. */ - sqlite3_value *pVal = sqlite3_column_value(c->pStmt, 0); - sqlite3_result_value(pContext, pVal); - } - return SQLITE_OK; -} - -/* This is the xRowid method. The SQLite core calls this routine to -** retrieve the rowid for the current row of the result set. fts3 -** exposes %_content.docid as the rowid for the virtual table. The +/* +** This is the xRowid method. The SQLite core calls this routine to +** retrieve the rowid for the current row of the result set. fts3 +** exposes %_content.docid as the rowid for the virtual table. The ** rowid should be written to *pRowid. */ -static int fulltextRowid(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ - fulltext_cursor *c = (fulltext_cursor *) pCursor; - - *pRowid = sqlite3_column_int64(c->pStmt, 0); - return SQLITE_OK; -} - -/* Add all terms in [zText] to pendingTerms table. If [iColumn] > 0, -** we also store positions and offsets in the hash table using that -** column number. -*/ -static int buildTerms(fulltext_vtab *v, sqlite_int64 iDocid, - const char *zText, int iColumn){ - sqlite3_tokenizer *pTokenizer = v->pTokenizer; - sqlite3_tokenizer_cursor *pCursor; - const char *pToken; - int nTokenBytes; - int iStartOffset, iEndOffset, iPosition; - int rc; - - rc = pTokenizer->pModule->xOpen(pTokenizer, zText, -1, &pCursor); - if( rc!=SQLITE_OK ) return rc; - - pCursor->pTokenizer = pTokenizer; - while( SQLITE_OK==(rc=pTokenizer->pModule->xNext(pCursor, - &pToken, &nTokenBytes, - &iStartOffset, &iEndOffset, - &iPosition)) ){ - DLCollector *p; - int nData; /* Size of doclist before our update. */ - - /* Positions can't be negative; we use -1 as a terminator - * internally. Token can't be NULL or empty. */ - if( iPosition<0 || pToken == NULL || nTokenBytes == 0 ){ - rc = SQLITE_ERROR; - break; - } - - p = fts3HashFind(&v->pendingTerms, pToken, nTokenBytes); - if( p==NULL ){ - nData = 0; - p = dlcNew(iDocid, DL_DEFAULT); - fts3HashInsert(&v->pendingTerms, pToken, nTokenBytes, p); - - /* Overhead for our hash table entry, the key, and the value. */ - v->nPendingData += sizeof(struct fts3HashElem)+sizeof(*p)+nTokenBytes; - }else{ - nData = p->b.nData; - if( p->dlw.iPrevDocid!=iDocid ) dlcNext(p, iDocid); - } - if( iColumn>=0 ){ - dlcAddPos(p, iColumn, iPosition, iStartOffset, iEndOffset); - } - - /* Accumulate data added by dlcNew or dlcNext, and dlcAddPos. */ - v->nPendingData += p->b.nData-nData; - } - - /* TODO(shess) Check return? Should this be able to cause errors at - ** this point? Actually, same question about sqlite3_finalize(), - ** though one could argue that failure there means that the data is - ** not durable. *ponder* - */ - pTokenizer->pModule->xClose(pCursor); - if( SQLITE_DONE == rc ) return SQLITE_OK; - return rc; -} - -/* Add doclists for all terms in [pValues] to pendingTerms table. */ -static int insertTerms(fulltext_vtab *v, sqlite_int64 iDocid, - sqlite3_value **pValues){ - int i; - for(i = 0; i < v->nColumn ; ++i){ - char *zText = (char*)sqlite3_value_text(pValues[i]); - int rc = buildTerms(v, iDocid, zText, i); - if( rc!=SQLITE_OK ) return rc; - } - return SQLITE_OK; -} - -/* Add empty doclists for all terms in the given row's content to -** pendingTerms. -*/ -static int deleteTerms(fulltext_vtab *v, sqlite_int64 iDocid){ - const char **pValues; - int i, rc; - - /* TODO(shess) Should we allow such tables at all? */ - if( DL_DEFAULT==DL_DOCIDS ) return SQLITE_ERROR; - - rc = content_select(v, iDocid, &pValues); - if( rc!=SQLITE_OK ) return rc; - - for(i = 0 ; i < v->nColumn; ++i) { - rc = buildTerms(v, iDocid, pValues[i], -1); - if( rc!=SQLITE_OK ) break; - } - - freeStringArray(v->nColumn, pValues); - return SQLITE_OK; -} - -/* TODO(shess) Refactor the code to remove this forward decl. */ -static int initPendingTerms(fulltext_vtab *v, sqlite_int64 iDocid); - -/* Insert a row into the %_content table; set *piDocid to be the ID of the -** new row. Add doclists for terms to pendingTerms. -*/ -static int index_insert(fulltext_vtab *v, sqlite3_value *pRequestDocid, - sqlite3_value **pValues, sqlite_int64 *piDocid){ - int rc; - - rc = content_insert(v, pRequestDocid, pValues); /* execute an SQL INSERT */ - if( rc!=SQLITE_OK ) return rc; - - /* docid column is an alias for rowid. */ - *piDocid = sqlite3_last_insert_rowid(v->db); - rc = initPendingTerms(v, *piDocid); - if( rc!=SQLITE_OK ) return rc; - - return insertTerms(v, *piDocid, pValues); -} - -/* Delete a row from the %_content table; add empty doclists for terms -** to pendingTerms. -*/ -static int index_delete(fulltext_vtab *v, sqlite_int64 iRow){ - int rc = initPendingTerms(v, iRow); - if( rc!=SQLITE_OK ) return rc; - - rc = deleteTerms(v, iRow); - if( rc!=SQLITE_OK ) return rc; - - return content_delete(v, iRow); /* execute an SQL DELETE */ -} - -/* Update a row in the %_content table; add delete doclists to -** pendingTerms for old terms not in the new data, add insert doclists -** to pendingTerms for terms in the new data. -*/ -static int index_update(fulltext_vtab *v, sqlite_int64 iRow, - sqlite3_value **pValues){ - int rc = initPendingTerms(v, iRow); - if( rc!=SQLITE_OK ) return rc; - - /* Generate an empty doclist for each term that previously appeared in this - * row. */ - rc = deleteTerms(v, iRow); - if( rc!=SQLITE_OK ) return rc; - - rc = content_update(v, pValues, iRow); /* execute an SQL UPDATE */ - if( rc!=SQLITE_OK ) return rc; - - /* Now add positions for terms which appear in the updated row. */ - return insertTerms(v, iRow, pValues); -} - -/*******************************************************************/ -/* InteriorWriter is used to collect terms and block references into -** interior nodes in %_segments. See commentary at top of file for -** format. -*/ - -/* How large interior nodes can grow. */ -#define INTERIOR_MAX 2048 - -/* Minimum number of terms per interior node (except the root). This -** prevents large terms from making the tree too skinny - must be >0 -** so that the tree always makes progress. Note that the min tree -** fanout will be INTERIOR_MIN_TERMS+1. -*/ -#define INTERIOR_MIN_TERMS 7 -#if INTERIOR_MIN_TERMS<1 -# error INTERIOR_MIN_TERMS must be greater than 0. -#endif - -/* ROOT_MAX controls how much data is stored inline in the segment -** directory. -*/ -/* TODO(shess) Push ROOT_MAX down to whoever is writing things. It's -** only here so that interiorWriterRootInfo() and leafWriterRootInfo() -** can both see it, but if the caller passed it in, we wouldn't even -** need a define. -*/ -#define ROOT_MAX 1024 -#if ROOT_MAXterm, 0); - dataBufferReplace(&block->term, pTerm, nTerm); - - n = fts3PutVarint(c, iHeight); - n += fts3PutVarint(c+n, iChildBlock); - dataBufferInit(&block->data, INTERIOR_MAX); - dataBufferReplace(&block->data, c, n); - } - return block; -} - -#ifndef NDEBUG -/* Verify that the data is readable as an interior node. */ -static void interiorBlockValidate(InteriorBlock *pBlock){ - const char *pData = pBlock->data.pData; - int nData = pBlock->data.nData; - int n, iDummy; - sqlite_int64 iBlockid; - - assert( nData>0 ); - assert( pData!=0 ); - assert( pData+nData>pData ); - - /* Must lead with height of node as a varint(n), n>0 */ - n = fts3GetVarint32(pData, &iDummy); - assert( n>0 ); - assert( iDummy>0 ); - assert( n0 ); - assert( n<=nData ); - pData += n; - nData -= n; - - /* Zero or more terms of positive length */ - if( nData!=0 ){ - /* First term is not delta-encoded. */ - n = fts3GetVarint32(pData, &iDummy); - assert( n>0 ); - assert( iDummy>0 ); - assert( n+iDummy>0); - assert( n+iDummy<=nData ); - pData += n+iDummy; - nData -= n+iDummy; - - /* Following terms delta-encoded. */ - while( nData!=0 ){ - /* Length of shared prefix. */ - n = fts3GetVarint32(pData, &iDummy); - assert( n>0 ); - assert( iDummy>=0 ); - assert( n0 ); - assert( iDummy>0 ); - assert( n+iDummy>0); - assert( n+iDummy<=nData ); - pData += n+iDummy; - nData -= n+iDummy; - } - } -} -#define ASSERT_VALID_INTERIOR_BLOCK(x) interiorBlockValidate(x) -#else -#define ASSERT_VALID_INTERIOR_BLOCK(x) assert( 1 ) -#endif - -typedef struct InteriorWriter { - int iHeight; /* from 0 at leaves. */ - InteriorBlock *first, *last; - struct InteriorWriter *parentWriter; - - DataBuffer term; /* Last term written to block "last". */ - sqlite_int64 iOpeningChildBlock; /* First child block in block "last". */ -#ifndef NDEBUG - sqlite_int64 iLastChildBlock; /* for consistency checks. */ -#endif -} InteriorWriter; - -/* Initialize an interior node where pTerm[nTerm] marks the leftmost -** term in the tree. iChildBlock is the leftmost child block at the -** next level down the tree. -*/ -static void interiorWriterInit(int iHeight, const char *pTerm, int nTerm, - sqlite_int64 iChildBlock, - InteriorWriter *pWriter){ - InteriorBlock *block; - assert( iHeight>0 ); - CLEAR(pWriter); - - pWriter->iHeight = iHeight; - pWriter->iOpeningChildBlock = iChildBlock; -#ifndef NDEBUG - pWriter->iLastChildBlock = iChildBlock; -#endif - block = interiorBlockNew(iHeight, iChildBlock, pTerm, nTerm); - pWriter->last = pWriter->first = block; - ASSERT_VALID_INTERIOR_BLOCK(pWriter->last); - dataBufferInit(&pWriter->term, 0); -} - -/* Append the child node rooted at iChildBlock to the interior node, -** with pTerm[nTerm] as the leftmost term in iChildBlock's subtree. -*/ -static void interiorWriterAppend(InteriorWriter *pWriter, - const char *pTerm, int nTerm, - sqlite_int64 iChildBlock){ - char c[VARINT_MAX+VARINT_MAX]; - int n, nPrefix = 0; - - ASSERT_VALID_INTERIOR_BLOCK(pWriter->last); - - /* The first term written into an interior node is actually - ** associated with the second child added (the first child was added - ** in interiorWriterInit, or in the if clause at the bottom of this - ** function). That term gets encoded straight up, with nPrefix left - ** at 0. - */ - if( pWriter->term.nData==0 ){ - n = fts3PutVarint(c, nTerm); +static int fts3RowidMethod(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ + Fts3Cursor *pCsr = (Fts3Cursor *) pCursor; + if( pCsr->aDoclist ){ + *pRowid = pCsr->iPrevId; }else{ - while( nPrefixterm.nData && - pTerm[nPrefix]==pWriter->term.pData[nPrefix] ){ - nPrefix++; - } - - n = fts3PutVarint(c, nPrefix); - n += fts3PutVarint(c+n, nTerm-nPrefix); - } - -#ifndef NDEBUG - pWriter->iLastChildBlock++; -#endif - assert( pWriter->iLastChildBlock==iChildBlock ); - - /* Overflow to a new block if the new term makes the current block - ** too big, and the current block already has enough terms. - */ - if( pWriter->last->data.nData+n+nTerm-nPrefix>INTERIOR_MAX && - iChildBlock-pWriter->iOpeningChildBlock>INTERIOR_MIN_TERMS ){ - pWriter->last->next = interiorBlockNew(pWriter->iHeight, iChildBlock, - pTerm, nTerm); - pWriter->last = pWriter->last->next; - pWriter->iOpeningChildBlock = iChildBlock; - dataBufferReset(&pWriter->term); - }else{ - dataBufferAppend2(&pWriter->last->data, c, n, - pTerm+nPrefix, nTerm-nPrefix); - dataBufferReplace(&pWriter->term, pTerm, nTerm); - } - ASSERT_VALID_INTERIOR_BLOCK(pWriter->last); -} - -/* Free the space used by pWriter, including the linked-list of -** InteriorBlocks, and parentWriter, if present. -*/ -static int interiorWriterDestroy(InteriorWriter *pWriter){ - InteriorBlock *block = pWriter->first; - - while( block!=NULL ){ - InteriorBlock *b = block; - block = block->next; - dataBufferDestroy(&b->term); - dataBufferDestroy(&b->data); - sqlite3_free(b); - } - if( pWriter->parentWriter!=NULL ){ - interiorWriterDestroy(pWriter->parentWriter); - sqlite3_free(pWriter->parentWriter); - } - dataBufferDestroy(&pWriter->term); - SCRAMBLE(pWriter); - return SQLITE_OK; -} - -/* If pWriter can fit entirely in ROOT_MAX, return it as the root info -** directly, leaving *piEndBlockid unchanged. Otherwise, flush -** pWriter to %_segments, building a new layer of interior nodes, and -** recursively ask for their root into. -*/ -static int interiorWriterRootInfo(fulltext_vtab *v, InteriorWriter *pWriter, - char **ppRootInfo, int *pnRootInfo, - sqlite_int64 *piEndBlockid){ - InteriorBlock *block = pWriter->first; - sqlite_int64 iBlockid = 0; - int rc; - - /* If we can fit the segment inline */ - if( block==pWriter->last && block->data.nDatadata.pData; - *pnRootInfo = block->data.nData; - return SQLITE_OK; - } - - /* Flush the first block to %_segments, and create a new level of - ** interior node. - */ - ASSERT_VALID_INTERIOR_BLOCK(block); - rc = block_insert(v, block->data.pData, block->data.nData, &iBlockid); - if( rc!=SQLITE_OK ) return rc; - *piEndBlockid = iBlockid; - - pWriter->parentWriter = sqlite3_malloc(sizeof(*pWriter->parentWriter)); - interiorWriterInit(pWriter->iHeight+1, - block->term.pData, block->term.nData, - iBlockid, pWriter->parentWriter); - - /* Flush additional blocks and append to the higher interior - ** node. - */ - for(block=block->next; block!=NULL; block=block->next){ - ASSERT_VALID_INTERIOR_BLOCK(block); - rc = block_insert(v, block->data.pData, block->data.nData, &iBlockid); - if( rc!=SQLITE_OK ) return rc; - *piEndBlockid = iBlockid; - - interiorWriterAppend(pWriter->parentWriter, - block->term.pData, block->term.nData, iBlockid); - } - - /* Parent node gets the chance to be the root. */ - return interiorWriterRootInfo(v, pWriter->parentWriter, - ppRootInfo, pnRootInfo, piEndBlockid); -} - -/****************************************************************/ -/* InteriorReader is used to read off the data from an interior node -** (see comment at top of file for the format). -*/ -typedef struct InteriorReader { - const char *pData; - int nData; - - DataBuffer term; /* previous term, for decoding term delta. */ - - sqlite_int64 iBlockid; -} InteriorReader; - -static void interiorReaderDestroy(InteriorReader *pReader){ - dataBufferDestroy(&pReader->term); - SCRAMBLE(pReader); -} - -/* TODO(shess) The assertions are great, but what if we're in NDEBUG -** and the blob is empty or otherwise contains suspect data? -*/ -static void interiorReaderInit(const char *pData, int nData, - InteriorReader *pReader){ - int n, nTerm; - - /* Require at least the leading flag byte */ - assert( nData>0 ); - assert( pData[0]!='\0' ); - - CLEAR(pReader); - - /* Decode the base blockid, and set the cursor to the first term. */ - n = fts3GetVarint(pData+1, &pReader->iBlockid); - assert( 1+n<=nData ); - pReader->pData = pData+1+n; - pReader->nData = nData-(1+n); - - /* A single-child interior node (such as when a leaf node was too - ** large for the segment directory) won't have any terms. - ** Otherwise, decode the first term. - */ - if( pReader->nData==0 ){ - dataBufferInit(&pReader->term, 0); - }else{ - n = fts3GetVarint32(pReader->pData, &nTerm); - dataBufferInit(&pReader->term, nTerm); - dataBufferReplace(&pReader->term, pReader->pData+n, nTerm); - assert( n+nTerm<=pReader->nData ); - pReader->pData += n+nTerm; - pReader->nData -= n+nTerm; - } -} - -static int interiorReaderAtEnd(InteriorReader *pReader){ - return pReader->term.nData==0; -} - -static sqlite_int64 interiorReaderCurrentBlockid(InteriorReader *pReader){ - return pReader->iBlockid; -} - -static int interiorReaderTermBytes(InteriorReader *pReader){ - assert( !interiorReaderAtEnd(pReader) ); - return pReader->term.nData; -} -static const char *interiorReaderTerm(InteriorReader *pReader){ - assert( !interiorReaderAtEnd(pReader) ); - return pReader->term.pData; -} - -/* Step forward to the next term in the node. */ -static void interiorReaderStep(InteriorReader *pReader){ - assert( !interiorReaderAtEnd(pReader) ); - - /* If the last term has been read, signal eof, else construct the - ** next term. - */ - if( pReader->nData==0 ){ - dataBufferReset(&pReader->term); - }else{ - int n, nPrefix, nSuffix; - - n = fts3GetVarint32(pReader->pData, &nPrefix); - n += fts3GetVarint32(pReader->pData+n, &nSuffix); - - /* Truncate the current term and append suffix data. */ - pReader->term.nData = nPrefix; - dataBufferAppend(&pReader->term, pReader->pData+n, nSuffix); - - assert( n+nSuffix<=pReader->nData ); - pReader->pData += n+nSuffix; - pReader->nData -= n+nSuffix; - } - pReader->iBlockid++; -} - -/* Compare the current term to pTerm[nTerm], returning strcmp-style -** results. If isPrefix, equality means equal through nTerm bytes. -*/ -static int interiorReaderTermCmp(InteriorReader *pReader, - const char *pTerm, int nTerm, int isPrefix){ - const char *pReaderTerm = interiorReaderTerm(pReader); - int nReaderTerm = interiorReaderTermBytes(pReader); - int c, n = nReaderTerm0 ) return -1; - if( nTerm>0 ) return 1; - return 0; - } - - c = memcmp(pReaderTerm, pTerm, n); - if( c!=0 ) return c; - if( isPrefix && n==nTerm ) return 0; - return nReaderTerm - nTerm; -} - -/****************************************************************/ -/* LeafWriter is used to collect terms and associated doclist data -** into leaf blocks in %_segments (see top of file for format info). -** Expected usage is: -** -** LeafWriter writer; -** leafWriterInit(0, 0, &writer); -** while( sorted_terms_left_to_process ){ -** // data is doclist data for that term. -** rc = leafWriterStep(v, &writer, pTerm, nTerm, pData, nData); -** if( rc!=SQLITE_OK ) goto err; -** } -** rc = leafWriterFinalize(v, &writer); -**err: -** leafWriterDestroy(&writer); -** return rc; -** -** leafWriterStep() may write a collected leaf out to %_segments. -** leafWriterFinalize() finishes writing any buffered data and stores -** a root node in %_segdir. leafWriterDestroy() frees all buffers and -** InteriorWriters allocated as part of writing this segment. -** -** TODO(shess) Document leafWriterStepMerge(). -*/ - -/* Put terms with data this big in their own block. */ -#define STANDALONE_MIN 1024 - -/* Keep leaf blocks below this size. */ -#define LEAF_MAX 2048 - -typedef struct LeafWriter { - int iLevel; - int idx; - sqlite_int64 iStartBlockid; /* needed to create the root info */ - sqlite_int64 iEndBlockid; /* when we're done writing. */ - - DataBuffer term; /* previous encoded term */ - DataBuffer data; /* encoding buffer */ - - /* bytes of first term in the current node which distinguishes that - ** term from the last term of the previous node. - */ - int nTermDistinct; - - InteriorWriter parentWriter; /* if we overflow */ - int has_parent; -} LeafWriter; - -static void leafWriterInit(int iLevel, int idx, LeafWriter *pWriter){ - CLEAR(pWriter); - pWriter->iLevel = iLevel; - pWriter->idx = idx; - - dataBufferInit(&pWriter->term, 32); - - /* Start out with a reasonably sized block, though it can grow. */ - dataBufferInit(&pWriter->data, LEAF_MAX); -} - -#ifndef NDEBUG -/* Verify that the data is readable as a leaf node. */ -static void leafNodeValidate(const char *pData, int nData){ - int n, iDummy; - - if( nData==0 ) return; - assert( nData>0 ); - assert( pData!=0 ); - assert( pData+nData>pData ); - - /* Must lead with a varint(0) */ - n = fts3GetVarint32(pData, &iDummy); - assert( iDummy==0 ); - assert( n>0 ); - assert( n0 ); - assert( iDummy>0 ); - assert( n+iDummy>0 ); - assert( n+iDummy0 ); - assert( iDummy>0 ); - assert( n+iDummy>0 ); - assert( n+iDummy<=nData ); - ASSERT_VALID_DOCLIST(DL_DEFAULT, pData+n, iDummy, NULL); - pData += n+iDummy; - nData -= n+iDummy; - - /* Verify that trailing terms and doclists also are readable. */ - while( nData!=0 ){ - n = fts3GetVarint32(pData, &iDummy); - assert( n>0 ); - assert( iDummy>=0 ); - assert( n0 ); - assert( iDummy>0 ); - assert( n+iDummy>0 ); - assert( n+iDummy0 ); - assert( iDummy>0 ); - assert( n+iDummy>0 ); - assert( n+iDummy<=nData ); - ASSERT_VALID_DOCLIST(DL_DEFAULT, pData+n, iDummy, NULL); - pData += n+iDummy; - nData -= n+iDummy; - } -} -#define ASSERT_VALID_LEAF_NODE(p, n) leafNodeValidate(p, n) -#else -#define ASSERT_VALID_LEAF_NODE(p, n) assert( 1 ) -#endif - -/* Flush the current leaf node to %_segments, and adding the resulting -** blockid and the starting term to the interior node which will -** contain it. -*/ -static int leafWriterInternalFlush(fulltext_vtab *v, LeafWriter *pWriter, - int iData, int nData){ - sqlite_int64 iBlockid = 0; - const char *pStartingTerm; - int nStartingTerm, rc, n; - - /* Must have the leading varint(0) flag, plus at least some - ** valid-looking data. - */ - assert( nData>2 ); - assert( iData>=0 ); - assert( iData+nData<=pWriter->data.nData ); - ASSERT_VALID_LEAF_NODE(pWriter->data.pData+iData, nData); - - rc = block_insert(v, pWriter->data.pData+iData, nData, &iBlockid); - if( rc!=SQLITE_OK ) return rc; - assert( iBlockid!=0 ); - - /* Reconstruct the first term in the leaf for purposes of building - ** the interior node. - */ - n = fts3GetVarint32(pWriter->data.pData+iData+1, &nStartingTerm); - pStartingTerm = pWriter->data.pData+iData+1+n; - assert( pWriter->data.nData>iData+1+n+nStartingTerm ); - assert( pWriter->nTermDistinct>0 ); - assert( pWriter->nTermDistinct<=nStartingTerm ); - nStartingTerm = pWriter->nTermDistinct; - - if( pWriter->has_parent ){ - interiorWriterAppend(&pWriter->parentWriter, - pStartingTerm, nStartingTerm, iBlockid); - }else{ - interiorWriterInit(1, pStartingTerm, nStartingTerm, iBlockid, - &pWriter->parentWriter); - pWriter->has_parent = 1; - } - - /* Track the span of this segment's leaf nodes. */ - if( pWriter->iEndBlockid==0 ){ - pWriter->iEndBlockid = pWriter->iStartBlockid = iBlockid; - }else{ - pWriter->iEndBlockid++; - assert( iBlockid==pWriter->iEndBlockid ); - } - - return SQLITE_OK; -} -static int leafWriterFlush(fulltext_vtab *v, LeafWriter *pWriter){ - int rc = leafWriterInternalFlush(v, pWriter, 0, pWriter->data.nData); - if( rc!=SQLITE_OK ) return rc; - - /* Re-initialize the output buffer. */ - dataBufferReset(&pWriter->data); - - return SQLITE_OK; -} - -/* Fetch the root info for the segment. If the entire leaf fits -** within ROOT_MAX, then it will be returned directly, otherwise it -** will be flushed and the root info will be returned from the -** interior node. *piEndBlockid is set to the blockid of the last -** interior or leaf node written to disk (0 if none are written at -** all). -*/ -static int leafWriterRootInfo(fulltext_vtab *v, LeafWriter *pWriter, - char **ppRootInfo, int *pnRootInfo, - sqlite_int64 *piEndBlockid){ - /* we can fit the segment entirely inline */ - if( !pWriter->has_parent && pWriter->data.nDatadata.pData; - *pnRootInfo = pWriter->data.nData; - *piEndBlockid = 0; - return SQLITE_OK; - } - - /* Flush remaining leaf data. */ - if( pWriter->data.nData>0 ){ - int rc = leafWriterFlush(v, pWriter); - if( rc!=SQLITE_OK ) return rc; - } - - /* We must have flushed a leaf at some point. */ - assert( pWriter->has_parent ); - - /* Tenatively set the end leaf blockid as the end blockid. If the - ** interior node can be returned inline, this will be the final - ** blockid, otherwise it will be overwritten by - ** interiorWriterRootInfo(). - */ - *piEndBlockid = pWriter->iEndBlockid; - - return interiorWriterRootInfo(v, &pWriter->parentWriter, - ppRootInfo, pnRootInfo, piEndBlockid); -} - -/* Collect the rootInfo data and store it into the segment directory. -** This has the effect of flushing the segment's leaf data to -** %_segments, and also flushing any interior nodes to %_segments. -*/ -static int leafWriterFinalize(fulltext_vtab *v, LeafWriter *pWriter){ - sqlite_int64 iEndBlockid; - char *pRootInfo; - int rc, nRootInfo; - - rc = leafWriterRootInfo(v, pWriter, &pRootInfo, &nRootInfo, &iEndBlockid); - if( rc!=SQLITE_OK ) return rc; - - /* Don't bother storing an entirely empty segment. */ - if( iEndBlockid==0 && nRootInfo==0 ) return SQLITE_OK; - - return segdir_set(v, pWriter->iLevel, pWriter->idx, - pWriter->iStartBlockid, pWriter->iEndBlockid, - iEndBlockid, pRootInfo, nRootInfo); -} - -static void leafWriterDestroy(LeafWriter *pWriter){ - if( pWriter->has_parent ) interiorWriterDestroy(&pWriter->parentWriter); - dataBufferDestroy(&pWriter->term); - dataBufferDestroy(&pWriter->data); -} - -/* Encode a term into the leafWriter, delta-encoding as appropriate. -** Returns the length of the new term which distinguishes it from the -** previous term, which can be used to set nTermDistinct when a node -** boundary is crossed. -*/ -static int leafWriterEncodeTerm(LeafWriter *pWriter, - const char *pTerm, int nTerm){ - char c[VARINT_MAX+VARINT_MAX]; - int n, nPrefix = 0; - - assert( nTerm>0 ); - while( nPrefixterm.nData && - pTerm[nPrefix]==pWriter->term.pData[nPrefix] ){ - nPrefix++; - /* Failing this implies that the terms weren't in order. */ - assert( nPrefixdata.nData==0 ){ - /* Encode the node header and leading term as: - ** varint(0) - ** varint(nTerm) - ** char pTerm[nTerm] - */ - n = fts3PutVarint(c, '\0'); - n += fts3PutVarint(c+n, nTerm); - dataBufferAppend2(&pWriter->data, c, n, pTerm, nTerm); - }else{ - /* Delta-encode the term as: - ** varint(nPrefix) - ** varint(nSuffix) - ** char pTermSuffix[nSuffix] - */ - n = fts3PutVarint(c, nPrefix); - n += fts3PutVarint(c+n, nTerm-nPrefix); - dataBufferAppend2(&pWriter->data, c, n, pTerm+nPrefix, nTerm-nPrefix); - } - dataBufferReplace(&pWriter->term, pTerm, nTerm); - - return nPrefix+1; -} - -/* Used to avoid a memmove when a large amount of doclist data is in -** the buffer. This constructs a node and term header before -** iDoclistData and flushes the resulting complete node using -** leafWriterInternalFlush(). -*/ -static int leafWriterInlineFlush(fulltext_vtab *v, LeafWriter *pWriter, - const char *pTerm, int nTerm, - int iDoclistData){ - char c[VARINT_MAX+VARINT_MAX]; - int iData, n = fts3PutVarint(c, 0); - n += fts3PutVarint(c+n, nTerm); - - /* There should always be room for the header. Even if pTerm shared - ** a substantial prefix with the previous term, the entire prefix - ** could be constructed from earlier data in the doclist, so there - ** should be room. - */ - assert( iDoclistData>=n+nTerm ); - - iData = iDoclistData-(n+nTerm); - memcpy(pWriter->data.pData+iData, c, n); - memcpy(pWriter->data.pData+iData+n, pTerm, nTerm); - - return leafWriterInternalFlush(v, pWriter, iData, pWriter->data.nData-iData); -} - -/* Push pTerm[nTerm] along with the doclist data to the leaf layer of -** %_segments. -*/ -static int leafWriterStepMerge(fulltext_vtab *v, LeafWriter *pWriter, - const char *pTerm, int nTerm, - DLReader *pReaders, int nReaders){ - char c[VARINT_MAX+VARINT_MAX]; - int iTermData = pWriter->data.nData, iDoclistData; - int i, nData, n, nActualData, nActual, rc, nTermDistinct; - - ASSERT_VALID_LEAF_NODE(pWriter->data.pData, pWriter->data.nData); - nTermDistinct = leafWriterEncodeTerm(pWriter, pTerm, nTerm); - - /* Remember nTermDistinct if opening a new node. */ - if( iTermData==0 ) pWriter->nTermDistinct = nTermDistinct; - - iDoclistData = pWriter->data.nData; - - /* Estimate the length of the merged doclist so we can leave space - ** to encode it. - */ - for(i=0, nData=0; idata, c, n); - - docListMerge(&pWriter->data, pReaders, nReaders); - ASSERT_VALID_DOCLIST(DL_DEFAULT, - pWriter->data.pData+iDoclistData+n, - pWriter->data.nData-iDoclistData-n, NULL); - - /* The actual amount of doclist data at this point could be smaller - ** than the length we encoded. Additionally, the space required to - ** encode this length could be smaller. For small doclists, this is - ** not a big deal, we can just use memmove() to adjust things. - */ - nActualData = pWriter->data.nData-(iDoclistData+n); - nActual = fts3PutVarint(c, nActualData); - assert( nActualData<=nData ); - assert( nActual<=n ); - - /* If the new doclist is big enough for force a standalone leaf - ** node, we can immediately flush it inline without doing the - ** memmove(). - */ - /* TODO(shess) This test matches leafWriterStep(), which does this - ** test before it knows the cost to varint-encode the term and - ** doclist lengths. At some point, change to - ** pWriter->data.nData-iTermData>STANDALONE_MIN. - */ - if( nTerm+nActualData>STANDALONE_MIN ){ - /* Push leaf node from before this term. */ - if( iTermData>0 ){ - rc = leafWriterInternalFlush(v, pWriter, 0, iTermData); - if( rc!=SQLITE_OK ) return rc; - - pWriter->nTermDistinct = nTermDistinct; - } - - /* Fix the encoded doclist length. */ - iDoclistData += n - nActual; - memcpy(pWriter->data.pData+iDoclistData, c, nActual); - - /* Push the standalone leaf node. */ - rc = leafWriterInlineFlush(v, pWriter, pTerm, nTerm, iDoclistData); - if( rc!=SQLITE_OK ) return rc; - - /* Leave the node empty. */ - dataBufferReset(&pWriter->data); - - return rc; - } - - /* At this point, we know that the doclist was small, so do the - ** memmove if indicated. - */ - if( nActualdata.pData+iDoclistData+nActual, - pWriter->data.pData+iDoclistData+n, - pWriter->data.nData-(iDoclistData+n)); - pWriter->data.nData -= n-nActual; - } - - /* Replace written length with actual length. */ - memcpy(pWriter->data.pData+iDoclistData, c, nActual); - - /* If the node is too large, break things up. */ - /* TODO(shess) This test matches leafWriterStep(), which does this - ** test before it knows the cost to varint-encode the term and - ** doclist lengths. At some point, change to - ** pWriter->data.nData>LEAF_MAX. - */ - if( iTermData+nTerm+nActualData>LEAF_MAX ){ - /* Flush out the leading data as a node */ - rc = leafWriterInternalFlush(v, pWriter, 0, iTermData); - if( rc!=SQLITE_OK ) return rc; - - pWriter->nTermDistinct = nTermDistinct; - - /* Rebuild header using the current term */ - n = fts3PutVarint(pWriter->data.pData, 0); - n += fts3PutVarint(pWriter->data.pData+n, nTerm); - memcpy(pWriter->data.pData+n, pTerm, nTerm); - n += nTerm; - - /* There should always be room, because the previous encoding - ** included all data necessary to construct the term. - */ - assert( ndata.nData-iDoclistDatadata.pData+n, - pWriter->data.pData+iDoclistData, - pWriter->data.nData-iDoclistData); - pWriter->data.nData -= iDoclistData-n; - } - ASSERT_VALID_LEAF_NODE(pWriter->data.pData, pWriter->data.nData); - - return SQLITE_OK; -} - -/* Push pTerm[nTerm] along with the doclist data to the leaf layer of -** %_segments. -*/ -/* TODO(shess) Revise writeZeroSegment() so that doclists are -** constructed directly in pWriter->data. -*/ -static int leafWriterStep(fulltext_vtab *v, LeafWriter *pWriter, - const char *pTerm, int nTerm, - const char *pData, int nData){ - int rc; - DLReader reader; - - dlrInit(&reader, DL_DEFAULT, pData, nData); - rc = leafWriterStepMerge(v, pWriter, pTerm, nTerm, &reader, 1); - dlrDestroy(&reader); - - return rc; -} - - -/****************************************************************/ -/* LeafReader is used to iterate over an individual leaf node. */ -typedef struct LeafReader { - DataBuffer term; /* copy of current term. */ - - const char *pData; /* data for current term. */ - int nData; -} LeafReader; - -static void leafReaderDestroy(LeafReader *pReader){ - dataBufferDestroy(&pReader->term); - SCRAMBLE(pReader); -} - -static int leafReaderAtEnd(LeafReader *pReader){ - return pReader->nData<=0; -} - -/* Access the current term. */ -static int leafReaderTermBytes(LeafReader *pReader){ - return pReader->term.nData; -} -static const char *leafReaderTerm(LeafReader *pReader){ - assert( pReader->term.nData>0 ); - return pReader->term.pData; -} - -/* Access the doclist data for the current term. */ -static int leafReaderDataBytes(LeafReader *pReader){ - int nData; - assert( pReader->term.nData>0 ); - fts3GetVarint32(pReader->pData, &nData); - return nData; -} -static const char *leafReaderData(LeafReader *pReader){ - int n, nData; - assert( pReader->term.nData>0 ); - n = fts3GetVarint32(pReader->pData, &nData); - return pReader->pData+n; -} - -static void leafReaderInit(const char *pData, int nData, - LeafReader *pReader){ - int nTerm, n; - - assert( nData>0 ); - assert( pData[0]=='\0' ); - - CLEAR(pReader); - - /* Read the first term, skipping the header byte. */ - n = fts3GetVarint32(pData+1, &nTerm); - dataBufferInit(&pReader->term, nTerm); - dataBufferReplace(&pReader->term, pData+1+n, nTerm); - - /* Position after the first term. */ - assert( 1+n+nTermpData = pData+1+n+nTerm; - pReader->nData = nData-1-n-nTerm; -} - -/* Step the reader forward to the next term. */ -static void leafReaderStep(LeafReader *pReader){ - int n, nData, nPrefix, nSuffix; - assert( !leafReaderAtEnd(pReader) ); - - /* Skip previous entry's data block. */ - n = fts3GetVarint32(pReader->pData, &nData); - assert( n+nData<=pReader->nData ); - pReader->pData += n+nData; - pReader->nData -= n+nData; - - if( !leafReaderAtEnd(pReader) ){ - /* Construct the new term using a prefix from the old term plus a - ** suffix from the leaf data. - */ - n = fts3GetVarint32(pReader->pData, &nPrefix); - n += fts3GetVarint32(pReader->pData+n, &nSuffix); - assert( n+nSuffixnData ); - pReader->term.nData = nPrefix; - dataBufferAppend(&pReader->term, pReader->pData+n, nSuffix); - - pReader->pData += n+nSuffix; - pReader->nData -= n+nSuffix; - } -} - -/* strcmp-style comparison of pReader's current term against pTerm. -** If isPrefix, equality means equal through nTerm bytes. -*/ -static int leafReaderTermCmp(LeafReader *pReader, - const char *pTerm, int nTerm, int isPrefix){ - int c, n = pReader->term.nDataterm.nData : nTerm; - if( n==0 ){ - if( pReader->term.nData>0 ) return -1; - if(nTerm>0 ) return 1; - return 0; - } - - c = memcmp(pReader->term.pData, pTerm, n); - if( c!=0 ) return c; - if( isPrefix && n==nTerm ) return 0; - return pReader->term.nData - nTerm; -} - - -/****************************************************************/ -/* LeavesReader wraps LeafReader to allow iterating over the entire -** leaf layer of the tree. -*/ -typedef struct LeavesReader { - int idx; /* Index within the segment. */ - - sqlite3_stmt *pStmt; /* Statement we're streaming leaves from. */ - int eof; /* we've seen SQLITE_DONE from pStmt. */ - - LeafReader leafReader; /* reader for the current leaf. */ - DataBuffer rootData; /* root data for inline. */ -} LeavesReader; - -/* Access the current term. */ -static int leavesReaderTermBytes(LeavesReader *pReader){ - assert( !pReader->eof ); - return leafReaderTermBytes(&pReader->leafReader); -} -static const char *leavesReaderTerm(LeavesReader *pReader){ - assert( !pReader->eof ); - return leafReaderTerm(&pReader->leafReader); -} - -/* Access the doclist data for the current term. */ -static int leavesReaderDataBytes(LeavesReader *pReader){ - assert( !pReader->eof ); - return leafReaderDataBytes(&pReader->leafReader); -} -static const char *leavesReaderData(LeavesReader *pReader){ - assert( !pReader->eof ); - return leafReaderData(&pReader->leafReader); -} - -static int leavesReaderAtEnd(LeavesReader *pReader){ - return pReader->eof; -} - -/* loadSegmentLeaves() may not read all the way to SQLITE_DONE, thus -** leaving the statement handle open, which locks the table. -*/ -/* TODO(shess) This "solution" is not satisfactory. Really, there -** should be check-in function for all statement handles which -** arranges to call sqlite3_reset(). This most likely will require -** modification to control flow all over the place, though, so for now -** just punt. -** -** Note the the current system assumes that segment merges will run to -** completion, which is why this particular probably hasn't arisen in -** this case. Probably a brittle assumption. -*/ -static int leavesReaderReset(LeavesReader *pReader){ - return sqlite3_reset(pReader->pStmt); -} - -static void leavesReaderDestroy(LeavesReader *pReader){ - /* If idx is -1, that means we're using a non-cached statement - ** handle in the optimize() case, so we need to release it. - */ - if( pReader->pStmt!=NULL && pReader->idx==-1 ){ - sqlite3_finalize(pReader->pStmt); - } - leafReaderDestroy(&pReader->leafReader); - dataBufferDestroy(&pReader->rootData); - SCRAMBLE(pReader); -} - -/* Initialize pReader with the given root data (if iStartBlockid==0 -** the leaf data was entirely contained in the root), or from the -** stream of blocks between iStartBlockid and iEndBlockid, inclusive. -*/ -static int leavesReaderInit(fulltext_vtab *v, - int idx, - sqlite_int64 iStartBlockid, - sqlite_int64 iEndBlockid, - const char *pRootData, int nRootData, - LeavesReader *pReader){ - CLEAR(pReader); - pReader->idx = idx; - - dataBufferInit(&pReader->rootData, 0); - if( iStartBlockid==0 ){ - /* Entire leaf level fit in root data. */ - dataBufferReplace(&pReader->rootData, pRootData, nRootData); - leafReaderInit(pReader->rootData.pData, pReader->rootData.nData, - &pReader->leafReader); - }else{ - sqlite3_stmt *s; - int rc = sql_get_leaf_statement(v, idx, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 1, iStartBlockid); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 2, iEndBlockid); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_step(s); - if( rc==SQLITE_DONE ){ - pReader->eof = 1; - return SQLITE_OK; - } - if( rc!=SQLITE_ROW ) return rc; - - pReader->pStmt = s; - leafReaderInit(sqlite3_column_blob(pReader->pStmt, 0), - sqlite3_column_bytes(pReader->pStmt, 0), - &pReader->leafReader); + *pRowid = sqlite3_column_int64(pCsr->pStmt, 0); } return SQLITE_OK; } -/* Step the current leaf forward to the next term. If we reach the -** end of the current leaf, step forward to the next leaf block. +/* +** This is the xColumn method, called by SQLite to request a value from +** the row that the supplied cursor currently points to. */ -static int leavesReaderStep(fulltext_vtab *v, LeavesReader *pReader){ - assert( !leavesReaderAtEnd(pReader) ); - leafReaderStep(&pReader->leafReader); - - if( leafReaderAtEnd(&pReader->leafReader) ){ - int rc; - if( pReader->rootData.pData ){ - pReader->eof = 1; - return SQLITE_OK; - } - rc = sqlite3_step(pReader->pStmt); - if( rc!=SQLITE_ROW ){ - pReader->eof = 1; - return rc==SQLITE_DONE ? SQLITE_OK : rc; - } - leafReaderDestroy(&pReader->leafReader); - leafReaderInit(sqlite3_column_blob(pReader->pStmt, 0), - sqlite3_column_bytes(pReader->pStmt, 0), - &pReader->leafReader); - } - return SQLITE_OK; -} - -/* Order LeavesReaders by their term, ignoring idx. Readers at eof -** always sort to the end. -*/ -static int leavesReaderTermCmp(LeavesReader *lr1, LeavesReader *lr2){ - if( leavesReaderAtEnd(lr1) ){ - if( leavesReaderAtEnd(lr2) ) return 0; - return 1; - } - if( leavesReaderAtEnd(lr2) ) return -1; - - return leafReaderTermCmp(&lr1->leafReader, - leavesReaderTerm(lr2), leavesReaderTermBytes(lr2), - 0); -} - -/* Similar to leavesReaderTermCmp(), with additional ordering by idx -** so that older segments sort before newer segments. -*/ -static int leavesReaderCmp(LeavesReader *lr1, LeavesReader *lr2){ - int c = leavesReaderTermCmp(lr1, lr2); - if( c!=0 ) return c; - return lr1->idx-lr2->idx; -} - -/* Assume that pLr[1]..pLr[nLr] are sorted. Bubble pLr[0] into its -** sorted position. -*/ -static void leavesReaderReorder(LeavesReader *pLr, int nLr){ - while( nLr>1 && leavesReaderCmp(pLr, pLr+1)>0 ){ - LeavesReader tmp = pLr[0]; - pLr[0] = pLr[1]; - pLr[1] = tmp; - nLr--; - pLr++; - } -} - -/* Initializes pReaders with the segments from level iLevel, returning -** the number of segments in *piReaders. Leaves pReaders in sorted -** order. -*/ -static int leavesReadersInit(fulltext_vtab *v, int iLevel, - LeavesReader *pReaders, int *piReaders){ - sqlite3_stmt *s; - int i, rc = sql_get_statement(v, SEGDIR_SELECT_LEVEL_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int(s, 1, iLevel); - if( rc!=SQLITE_OK ) return rc; - - i = 0; - while( (rc = sqlite3_step(s))==SQLITE_ROW ){ - sqlite_int64 iStart = sqlite3_column_int64(s, 0); - sqlite_int64 iEnd = sqlite3_column_int64(s, 1); - const char *pRootData = sqlite3_column_blob(s, 2); - int nRootData = sqlite3_column_bytes(s, 2); - - assert( i0 ){ - leavesReaderDestroy(&pReaders[i]); - } - return rc; - } - - *piReaders = i; - - /* Leave our results sorted by term, then age. */ - while( i-- ){ - leavesReaderReorder(pReaders+i, *piReaders-i); - } - return SQLITE_OK; -} - -/* Merge doclists from pReaders[nReaders] into a single doclist, which -** is written to pWriter. Assumes pReaders is ordered oldest to -** newest. -*/ -/* TODO(shess) Consider putting this inline in segmentMerge(). */ -static int leavesReadersMerge(fulltext_vtab *v, - LeavesReader *pReaders, int nReaders, - LeafWriter *pWriter){ - DLReader dlReaders[MERGE_COUNT]; - const char *pTerm = leavesReaderTerm(pReaders); - int i, nTerm = leavesReaderTermBytes(pReaders); - - assert( nReaders<=MERGE_COUNT ); - - for(i=0; i0 ){ - rc = leavesReaderStep(v, lrs+i); - if( rc!=SQLITE_OK ) goto err; - - /* Reorder by term, then by age. */ - leavesReaderReorder(lrs+i, MERGE_COUNT-i); - } - } - - for(i=0; i0 ); - - for(rc=SQLITE_OK; rc==SQLITE_OK && !leavesReaderAtEnd(pReader); - rc=leavesReaderStep(v, pReader)){ - /* TODO(shess) Really want leavesReaderTermCmp(), but that name is - ** already taken to compare the terms of two LeavesReaders. Think - ** on a better name. [Meanwhile, break encapsulation rather than - ** use a confusing name.] - */ - int c = leafReaderTermCmp(&pReader->leafReader, pTerm, nTerm, isPrefix); - if( c>0 ) break; /* Past any possible matches. */ - if( c==0 ){ - const char *pData = leavesReaderData(pReader); - int iBuffer, nData = leavesReaderDataBytes(pReader); - - /* Find the first empty buffer. */ - for(iBuffer=0; iBuffer0 ){ - assert(pBuffers!=NULL); - memcpy(p, pBuffers, nBuffers*sizeof(*pBuffers)); - sqlite3_free(pBuffers); - } - pBuffers = p; - } - dataBufferInit(&(pBuffers[nBuffers]), 0); - nBuffers++; - } - - /* At this point, must have an empty at iBuffer. */ - assert(iBufferpData, p->nData); - - /* dataBufferReset() could allow a large doclist to blow up - ** our memory requirements. - */ - if( p->nCapacity<1024 ){ - dataBufferReset(p); - }else{ - dataBufferDestroy(p); - dataBufferInit(p, 0); - } - } - } - } - } - - /* Union all the doclists together into *out. */ - /* TODO(shess) What if *out is big? Sigh. */ - if( rc==SQLITE_OK && nBuffers>0 ){ - int iBuffer; - for(iBuffer=0; iBuffer0 ){ - if( out->nData==0 ){ - dataBufferSwap(out, &(pBuffers[iBuffer])); - }else{ - docListAccumulateUnion(out, pBuffers[iBuffer].pData, - pBuffers[iBuffer].nData); - } - } - } - } - - while( nBuffers-- ){ - dataBufferDestroy(&(pBuffers[nBuffers])); - } - if( pBuffers!=NULL ) sqlite3_free(pBuffers); - - return rc; -} - -/* Call loadSegmentLeavesInt() with pData/nData as input. */ -static int loadSegmentLeaf(fulltext_vtab *v, const char *pData, int nData, - const char *pTerm, int nTerm, int isPrefix, - DataBuffer *out){ - LeavesReader reader; - int rc; - - assert( nData>1 ); - assert( *pData=='\0' ); - rc = leavesReaderInit(v, 0, 0, 0, pData, nData, &reader); - if( rc!=SQLITE_OK ) return rc; - - rc = loadSegmentLeavesInt(v, &reader, pTerm, nTerm, isPrefix, out); - leavesReaderReset(&reader); - leavesReaderDestroy(&reader); - return rc; -} - -/* Call loadSegmentLeavesInt() with the leaf nodes from iStartLeaf to -** iEndLeaf (inclusive) as input, and merge the resulting doclist into -** out. -*/ -static int loadSegmentLeaves(fulltext_vtab *v, - sqlite_int64 iStartLeaf, sqlite_int64 iEndLeaf, - const char *pTerm, int nTerm, int isPrefix, - DataBuffer *out){ - int rc; - LeavesReader reader; - - assert( iStartLeaf<=iEndLeaf ); - rc = leavesReaderInit(v, 0, iStartLeaf, iEndLeaf, NULL, 0, &reader); - if( rc!=SQLITE_OK ) return rc; - - rc = loadSegmentLeavesInt(v, &reader, pTerm, nTerm, isPrefix, out); - leavesReaderReset(&reader); - leavesReaderDestroy(&reader); - return rc; -} - -/* Taking pData/nData as an interior node, find the sequence of child -** nodes which could include pTerm/nTerm/isPrefix. Note that the -** interior node terms logically come between the blocks, so there is -** one more blockid than there are terms (that block contains terms >= -** the last interior-node term). -*/ -/* TODO(shess) The calling code may already know that the end child is -** not worth calculating, because the end may be in a later sibling -** node. Consider whether breaking symmetry is worthwhile. I suspect -** it is not worthwhile. -*/ -static void getChildrenContaining(const char *pData, int nData, - const char *pTerm, int nTerm, int isPrefix, - sqlite_int64 *piStartChild, - sqlite_int64 *piEndChild){ - InteriorReader reader; - - assert( nData>1 ); - assert( *pData!='\0' ); - interiorReaderInit(pData, nData, &reader); - - /* Scan for the first child which could contain pTerm/nTerm. */ - while( !interiorReaderAtEnd(&reader) ){ - if( interiorReaderTermCmp(&reader, pTerm, nTerm, 0)>0 ) break; - interiorReaderStep(&reader); - } - *piStartChild = interiorReaderCurrentBlockid(&reader); - - /* Keep scanning to find a term greater than our term, using prefix - ** comparison if indicated. If isPrefix is false, this will be the - ** same blockid as the starting block. - */ - while( !interiorReaderAtEnd(&reader) ){ - if( interiorReaderTermCmp(&reader, pTerm, nTerm, isPrefix)>0 ) break; - interiorReaderStep(&reader); - } - *piEndChild = interiorReaderCurrentBlockid(&reader); - - interiorReaderDestroy(&reader); - - /* Children must ascend, and if !prefix, both must be the same. */ - assert( *piEndChild>=*piStartChild ); - assert( isPrefix || *piStartChild==*piEndChild ); -} - -/* Read block at iBlockid and pass it with other params to -** getChildrenContaining(). -*/ -static int loadAndGetChildrenContaining( - fulltext_vtab *v, - sqlite_int64 iBlockid, - const char *pTerm, int nTerm, int isPrefix, - sqlite_int64 *piStartChild, sqlite_int64 *piEndChild +static int fts3ColumnMethod( + sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ + sqlite3_context *pContext, /* Context for sqlite3_result_xxx() calls */ + int iCol /* Index of column to read value from */ ){ - sqlite3_stmt *s = NULL; - int rc; + int rc; /* Return Code */ + Fts3Cursor *pCsr = (Fts3Cursor *) pCursor; + Fts3Table *p = (Fts3Table *)pCursor->pVtab; - assert( iBlockid!=0 ); - assert( pTerm!=NULL ); - assert( nTerm!=0 ); /* TODO(shess) Why not allow this? */ - assert( piStartChild!=NULL ); - assert( piEndChild!=NULL ); + /* The column value supplied by SQLite must be in range. */ + assert( iCol>=0 && iCol<=p->nColumn+1 ); - rc = sql_get_statement(v, BLOCK_SELECT_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_bind_int64(s, 1, iBlockid); - if( rc!=SQLITE_OK ) return rc; - - rc = sqlite3_step(s); - if( rc==SQLITE_DONE ) return SQLITE_ERROR; - if( rc!=SQLITE_ROW ) return rc; - - getChildrenContaining(sqlite3_column_blob(s, 0), sqlite3_column_bytes(s, 0), - pTerm, nTerm, isPrefix, piStartChild, piEndChild); - - /* We expect only one row. We must execute another sqlite3_step() - * to complete the iteration; otherwise the table will remain - * locked. */ - rc = sqlite3_step(s); - if( rc==SQLITE_ROW ) return SQLITE_ERROR; - if( rc!=SQLITE_DONE ) return rc; - - return SQLITE_OK; -} - -/* Traverse the tree represented by pData[nData] looking for -** pTerm[nTerm], placing its doclist into *out. This is internal to -** loadSegment() to make error-handling cleaner. -*/ -static int loadSegmentInt(fulltext_vtab *v, const char *pData, int nData, - sqlite_int64 iLeavesEnd, - const char *pTerm, int nTerm, int isPrefix, - DataBuffer *out){ - /* Special case where root is a leaf. */ - if( *pData=='\0' ){ - return loadSegmentLeaf(v, pData, nData, pTerm, nTerm, isPrefix, out); - }else{ - int rc; - sqlite_int64 iStartChild, iEndChild; - - /* Process pData as an interior node, then loop down the tree - ** until we find the set of leaf nodes to scan for the term. + if( iCol==p->nColumn+1 ){ + /* This call is a request for the "docid" column. Since "docid" is an + ** alias for "rowid", use the xRowid() method to obtain the value. */ - getChildrenContaining(pData, nData, pTerm, nTerm, isPrefix, - &iStartChild, &iEndChild); - while( iStartChild>iLeavesEnd ){ - sqlite_int64 iNextStart, iNextEnd; - rc = loadAndGetChildrenContaining(v, iStartChild, pTerm, nTerm, isPrefix, - &iNextStart, &iNextEnd); - if( rc!=SQLITE_OK ) return rc; - - /* If we've branched, follow the end branch, too. */ - if( iStartChild!=iEndChild ){ - sqlite_int64 iDummy; - rc = loadAndGetChildrenContaining(v, iEndChild, pTerm, nTerm, isPrefix, - &iDummy, &iNextEnd); - if( rc!=SQLITE_OK ) return rc; - } - - assert( iNextStart<=iNextEnd ); - iStartChild = iNextStart; - iEndChild = iNextEnd; - } - assert( iStartChild<=iLeavesEnd ); - assert( iEndChild<=iLeavesEnd ); - - /* Scan through the leaf segments for doclists. */ - return loadSegmentLeaves(v, iStartChild, iEndChild, - pTerm, nTerm, isPrefix, out); - } -} - -/* Call loadSegmentInt() to collect the doclist for pTerm/nTerm, then -** merge its doclist over *out (any duplicate doclists read from the -** segment rooted at pData will overwrite those in *out). -*/ -/* TODO(shess) Consider changing this to determine the depth of the -** leaves using either the first characters of interior nodes (when -** ==1, we're one level above the leaves), or the first character of -** the root (which will describe the height of the tree directly). -** Either feels somewhat tricky to me. -*/ -/* TODO(shess) The current merge is likely to be slow for large -** doclists (though it should process from newest/smallest to -** oldest/largest, so it may not be that bad). It might be useful to -** modify things to allow for N-way merging. This could either be -** within a segment, with pairwise merges across segments, or across -** all segments at once. -*/ -static int loadSegment(fulltext_vtab *v, const char *pData, int nData, - sqlite_int64 iLeavesEnd, - const char *pTerm, int nTerm, int isPrefix, - DataBuffer *out){ - DataBuffer result; - int rc; - - assert( nData>1 ); - - /* This code should never be called with buffered updates. */ - assert( v->nPendingData<0 ); - - dataBufferInit(&result, 0); - rc = loadSegmentInt(v, pData, nData, iLeavesEnd, - pTerm, nTerm, isPrefix, &result); - if( rc==SQLITE_OK && result.nData>0 ){ - if( out->nData==0 ){ - DataBuffer tmp = *out; - *out = result; - result = tmp; - }else{ - DataBuffer merged; - DLReader readers[2]; - - dlrInit(&readers[0], DL_DEFAULT, out->pData, out->nData); - dlrInit(&readers[1], DL_DEFAULT, result.pData, result.nData); - dataBufferInit(&merged, out->nData+result.nData); - docListMerge(&merged, readers, 2); - dataBufferDestroy(out); - *out = merged; - dlrDestroy(&readers[0]); - dlrDestroy(&readers[1]); - } - } - dataBufferDestroy(&result); - return rc; -} - -/* Scan the database and merge together the posting lists for the term -** into *out. -*/ -static int termSelect( - fulltext_vtab *v, - int iColumn, - const char *pTerm, int nTerm, /* Term to query for */ - int isPrefix, /* True for a prefix search */ - DocListType iType, - DataBuffer *out /* Write results here */ -){ - DataBuffer doclist; - sqlite3_stmt *s; - int rc = sql_get_statement(v, SEGDIR_SELECT_ALL_STMT, &s); - if( rc!=SQLITE_OK ) return rc; - - /* This code should never be called with buffered updates. */ - assert( v->nPendingData<0 ); - - dataBufferInit(&doclist, 0); - dataBufferInit(out, 0); - - /* Traverse the segments from oldest to newest so that newer doclist - ** elements for given docids overwrite older elements. - */ - while( (rc = sqlite3_step(s))==SQLITE_ROW ){ - const char *pData = sqlite3_column_blob(s, 2); - const int nData = sqlite3_column_bytes(s, 2); - const sqlite_int64 iLeavesEnd = sqlite3_column_int64(s, 1); - rc = loadSegment(v, pData, nData, iLeavesEnd, pTerm, nTerm, isPrefix, - &doclist); - if( rc!=SQLITE_OK ) goto err; - } - if( rc==SQLITE_DONE ){ - if( doclist.nData!=0 ){ - /* TODO(shess) The old term_select_all() code applied the column - ** restrict as we merged segments, leading to smaller buffers. - ** This is probably worthwhile to bring back, once the new storage - ** system is checked in. - */ - if( iColumn==v->nColumn) iColumn = -1; - docListTrim(DL_DEFAULT, doclist.pData, doclist.nData, - iColumn, iType, out); - } + sqlite3_int64 iRowid; + rc = fts3RowidMethod(pCursor, &iRowid); + sqlite3_result_int64(pContext, iRowid); + }else if( iCol==p->nColumn ){ + /* The extra column whose name is the same as the table. + ** Return a blob which is a pointer to the cursor. + */ + sqlite3_result_blob(pContext, &pCsr, sizeof(pCsr), SQLITE_TRANSIENT); rc = SQLITE_OK; - } - - err: - dataBufferDestroy(&doclist); - return rc; -} - -/****************************************************************/ -/* Used to hold hashtable data for sorting. */ -typedef struct TermData { - const char *pTerm; - int nTerm; - DLCollector *pCollector; -} TermData; - -/* Orders TermData elements in strcmp fashion ( <0 for less-than, 0 -** for equal, >0 for greater-than). -*/ -static int termDataCmp(const void *av, const void *bv){ - const TermData *a = (const TermData *)av; - const TermData *b = (const TermData *)bv; - int n = a->nTermnTerm ? a->nTerm : b->nTerm; - int c = memcmp(a->pTerm, b->pTerm, n); - if( c!=0 ) return c; - return a->nTerm-b->nTerm; -} - -/* Order pTerms data by term, then write a new level 0 segment using -** LeafWriter. -*/ -static int writeZeroSegment(fulltext_vtab *v, fts3Hash *pTerms){ - fts3HashElem *e; - int idx, rc, i, n; - TermData *pData; - LeafWriter writer; - DataBuffer dl; - - /* Determine the next index at level 0, merging as necessary. */ - rc = segdirNextIndex(v, 0, &idx); - if( rc!=SQLITE_OK ) return rc; - - n = fts3HashCount(pTerms); - pData = sqlite3_malloc(n*sizeof(TermData)); - - for(i = 0, e = fts3HashFirst(pTerms); e; i++, e = fts3HashNext(e)){ - assert( i1 ) qsort(pData, n, sizeof(*pData), termDataCmp); - - /* TODO(shess) Refactor so that we can write directly to the segment - ** DataBuffer, as happens for segment merges. - */ - leafWriterInit(0, idx, &writer); - dataBufferInit(&dl, 0); - for(i=0; inPendingData>=0 ){ - fts3HashElem *e; - for(e=fts3HashFirst(&v->pendingTerms); e; e=fts3HashNext(e)){ - dlcDelete(fts3HashData(e)); - } - fts3HashClear(&v->pendingTerms); - v->nPendingData = -1; - } - return SQLITE_OK; -} - -/* If pendingTerms has data, flush it to a level-zero segment, and -** free it. -*/ -static int flushPendingTerms(fulltext_vtab *v){ - if( v->nPendingData>=0 ){ - int rc = writeZeroSegment(v, &v->pendingTerms); - if( rc==SQLITE_OK ) clearPendingTerms(v); - return rc; - } - return SQLITE_OK; -} - -/* If pendingTerms is "too big", or docid is out of order, flush it. -** Regardless, be certain that pendingTerms is initialized for use. -*/ -static int initPendingTerms(fulltext_vtab *v, sqlite_int64 iDocid){ - /* TODO(shess) Explore whether partially flushing the buffer on - ** forced-flush would provide better performance. I suspect that if - ** we ordered the doclists by size and flushed the largest until the - ** buffer was half empty, that would let the less frequent terms - ** generate longer doclists. - */ - if( iDocid<=v->iPrevDocid || v->nPendingData>kPendingThreshold ){ - int rc = flushPendingTerms(v); - if( rc!=SQLITE_OK ) return rc; - } - if( v->nPendingData<0 ){ - fts3HashInit(&v->pendingTerms, FTS3_HASH_STRING, 1); - v->nPendingData = 0; - } - v->iPrevDocid = iDocid; - return SQLITE_OK; -} - -/* This function implements the xUpdate callback; it is the top-level entry - * point for inserting, deleting or updating a row in a full-text table. */ -static int fulltextUpdate(sqlite3_vtab *pVtab, int nArg, sqlite3_value **ppArg, - sqlite_int64 *pRowid){ - fulltext_vtab *v = (fulltext_vtab *) pVtab; - int rc; - - FTSTRACE(("FTS3 Update %p\n", pVtab)); - - if( nArg<2 ){ - rc = index_delete(v, sqlite3_value_int64(ppArg[0])); + }else{ + rc = fts3CursorSeek(0, pCsr); if( rc==SQLITE_OK ){ - /* If we just deleted the last row in the table, clear out the - ** index data. - */ - rc = content_exists(v); - if( rc==SQLITE_ROW ){ - rc = SQLITE_OK; - }else if( rc==SQLITE_DONE ){ - /* Clear the pending terms so we don't flush a useless level-0 - ** segment when the transaction closes. - */ - rc = clearPendingTerms(v); - if( rc==SQLITE_OK ){ - rc = segdir_delete_all(v); - } - } - } - } else if( sqlite3_value_type(ppArg[0]) != SQLITE_NULL ){ - /* An update: - * ppArg[0] = old rowid - * ppArg[1] = new rowid - * ppArg[2..2+v->nColumn-1] = values - * ppArg[2+v->nColumn] = value for magic column (we ignore this) - * ppArg[2+v->nColumn+1] = value for docid - */ - sqlite_int64 rowid = sqlite3_value_int64(ppArg[0]); - if( sqlite3_value_type(ppArg[1]) != SQLITE_INTEGER || - sqlite3_value_int64(ppArg[1]) != rowid ){ - rc = SQLITE_ERROR; /* we don't allow changing the rowid */ - }else if( sqlite3_value_type(ppArg[2+v->nColumn+1]) != SQLITE_INTEGER || - sqlite3_value_int64(ppArg[2+v->nColumn+1]) != rowid ){ - rc = SQLITE_ERROR; /* we don't allow changing the docid */ - }else{ - assert( nArg==2+v->nColumn+2); - rc = index_update(v, rowid, &ppArg[2]); - } - } else { - /* An insert: - * ppArg[1] = requested rowid - * ppArg[2..2+v->nColumn-1] = values - * ppArg[2+v->nColumn] = value for magic column (we ignore this) - * ppArg[2+v->nColumn+1] = value for docid - */ - sqlite3_value *pRequestDocid = ppArg[2+v->nColumn+1]; - assert( nArg==2+v->nColumn+2); - if( SQLITE_NULL != sqlite3_value_type(pRequestDocid) && - SQLITE_NULL != sqlite3_value_type(ppArg[1]) ){ - /* TODO(shess) Consider allowing this to work if the values are - ** identical. I'm inclined to discourage that usage, though, - ** given that both rowid and docid are special columns. Better - ** would be to define one or the other as the default winner, - ** but should it be fts3-centric (docid) or SQLite-centric - ** (rowid)? - */ - rc = SQLITE_ERROR; - }else{ - if( SQLITE_NULL == sqlite3_value_type(pRequestDocid) ){ - pRequestDocid = ppArg[1]; - } - rc = index_insert(v, pRequestDocid, &ppArg[2], pRowid); + sqlite3_result_value(pContext, sqlite3_column_value(pCsr->pStmt, iCol+1)); } } - return rc; } -static int fulltextSync(sqlite3_vtab *pVtab){ - FTSTRACE(("FTS3 xSync()\n")); - return flushPendingTerms((fulltext_vtab *)pVtab); +/* +** This function is the implementation of the xUpdate callback used by +** FTS3 virtual tables. It is invoked by SQLite each time a row is to be +** inserted, updated or deleted. +*/ +static int fts3UpdateMethod( + sqlite3_vtab *pVtab, /* Virtual table handle */ + int nArg, /* Size of argument array */ + sqlite3_value **apVal, /* Array of arguments */ + sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */ +){ + return sqlite3Fts3UpdateMethod(pVtab, nArg, apVal, pRowid); } -static int fulltextBegin(sqlite3_vtab *pVtab){ - fulltext_vtab *v = (fulltext_vtab *) pVtab; - FTSTRACE(("FTS3 xBegin()\n")); - - /* Any buffered updates should have been cleared by the previous - ** transaction. - */ - assert( v->nPendingData<0 ); - return clearPendingTerms(v); +/* +** Implementation of xSync() method. Flush the contents of the pending-terms +** hash-table to the database. +*/ +static int fts3SyncMethod(sqlite3_vtab *pVtab){ + return sqlite3Fts3PendingTermsFlush((Fts3Table *)pVtab); } -static int fulltextCommit(sqlite3_vtab *pVtab){ - fulltext_vtab *v = (fulltext_vtab *) pVtab; - FTSTRACE(("FTS3 xCommit()\n")); - - /* Buffered updates should have been cleared by fulltextSync(). */ - assert( v->nPendingData<0 ); - return clearPendingTerms(v); +/* +** Implementation of xBegin() method. This is a no-op. +*/ +static int fts3BeginMethod(sqlite3_vtab *pVtab){ + UNUSED_PARAMETER(pVtab); + assert( ((Fts3Table *)pVtab)->nPendingData==0 ); + return SQLITE_OK; } -static int fulltextRollback(sqlite3_vtab *pVtab){ - FTSTRACE(("FTS3 xRollback()\n")); - return clearPendingTerms((fulltext_vtab *)pVtab); +/* +** Implementation of xCommit() method. This is a no-op. The contents of +** the pending-terms hash-table have already been flushed into the database +** by fts3SyncMethod(). +*/ +static int fts3CommitMethod(sqlite3_vtab *pVtab){ + UNUSED_PARAMETER(pVtab); + assert( ((Fts3Table *)pVtab)->nPendingData==0 ); + return SQLITE_OK; +} + +/* +** Implementation of xRollback(). Discard the contents of the pending-terms +** hash-table. Any changes made to the database are reverted by SQLite. +*/ +static int fts3RollbackMethod(sqlite3_vtab *pVtab){ + sqlite3Fts3PendingTermsClear((Fts3Table *)pVtab); + return SQLITE_OK; +} + +/* +** Load the doclist associated with expression pExpr to pExpr->aDoclist. +** The loaded doclist contains positions as well as the document ids. +** This is used by the matchinfo(), snippet() and offsets() auxillary +** functions. +*/ +SQLITE_PRIVATE int sqlite3Fts3ExprLoadDoclist(Fts3Table *pTab, Fts3Expr *pExpr){ + return evalFts3Expr(pTab, pExpr, &pExpr->aDoclist, &pExpr->nDoclist, 1); +} + +/* +** After ExprLoadDoclist() (see above) has been called, this function is +** used to iterate/search through the position lists that make up the doclist +** stored in pExpr->aDoclist. +*/ +SQLITE_PRIVATE char *sqlite3Fts3FindPositions( + Fts3Expr *pExpr, /* Access this expressions doclist */ + sqlite3_int64 iDocid, /* Docid associated with requested pos-list */ + int iCol /* Column of requested pos-list */ +){ + assert( pExpr->isLoaded ); + if( pExpr->aDoclist ){ + char *pEnd = &pExpr->aDoclist[pExpr->nDoclist]; + char *pCsr = pExpr->pCurrent; + + assert( pCsr ); + while( pCsriCurrentiCurrent); + } + pExpr->pCurrent = pCsr; + }else{ + if( pExpr->iCurrent==iDocid ){ + int iThis = 0; + if( iCol<0 ){ + /* If iCol is negative, return a pointer to the start of the + ** position-list (instead of a pointer to the start of a list + ** of offsets associated with a specific column). + */ + return pCsr; + } + while( iThis=2 ){ - zStart = (const char*)sqlite3_value_text(argv[1]); - if( argc>=3 ){ - zEnd = (const char*)sqlite3_value_text(argv[2]); - if( argc>=4 ){ - zEllipsis = (const char*)sqlite3_value_text(argv[3]); - } - } - } - snippetAllOffsets(pCursor); - snippetText(pCursor, zStart, zEnd, zEllipsis); - sqlite3_result_text(pContext, pCursor->snippet.zSnippet, - pCursor->snippet.nSnippet, SQLITE_STATIC); + Fts3Cursor *pCsr; /* Cursor handle passed through apVal[0] */ + const char *zStart = ""; + const char *zEnd = ""; + const char *zEllipsis = "..."; + int iCol = -1; + int nToken = 15; /* Default number of tokens in snippet */ + + /* There must be at least one argument passed to this function (otherwise + ** the non-overloaded version would have been called instead of this one). + */ + assert( nVal>=1 ); + + if( nVal>6 ){ + sqlite3_result_error(pContext, + "wrong number of arguments to function snippet()", -1); + return; + } + if( fts3FunctionArg(pContext, "snippet", apVal[0], &pCsr) ) return; + + switch( nVal ){ + case 6: nToken = sqlite3_value_int(apVal[5]); + case 5: iCol = sqlite3_value_int(apVal[4]); + case 4: zEllipsis = (const char*)sqlite3_value_text(apVal[3]); + case 3: zEnd = (const char*)sqlite3_value_text(apVal[2]); + case 2: zStart = (const char*)sqlite3_value_text(apVal[1]); + } + if( !zEllipsis || !zEnd || !zStart ){ + sqlite3_result_error_nomem(pContext); + }else if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){ + sqlite3Fts3Snippet(pContext, pCsr, zStart, zEnd, zEllipsis, iCol, nToken); } } /* ** Implementation of the offsets() function for FTS3 */ -static void snippetOffsetsFunc( - sqlite3_context *pContext, - int argc, - sqlite3_value **argv +static void fts3OffsetsFunc( + sqlite3_context *pContext, /* SQLite function call context */ + int nVal, /* Size of argument array */ + sqlite3_value **apVal /* Array of arguments */ ){ - fulltext_cursor *pCursor; - if( argc<1 ) return; - if( sqlite3_value_type(argv[0])!=SQLITE_BLOB || - sqlite3_value_bytes(argv[0])!=sizeof(pCursor) ){ - sqlite3_result_error(pContext, "illegal first argument to offsets",-1); - }else{ - memcpy(&pCursor, sqlite3_value_blob(argv[0]), sizeof(pCursor)); - snippetAllOffsets(pCursor); - snippetOffsetText(&pCursor->snippet); - sqlite3_result_text(pContext, - pCursor->snippet.zOffset, pCursor->snippet.nOffset, - SQLITE_STATIC); + Fts3Cursor *pCsr; /* Cursor handle passed through apVal[0] */ + + UNUSED_PARAMETER(nVal); + + assert( nVal==1 ); + if( fts3FunctionArg(pContext, "offsets", apVal[0], &pCsr) ) return; + assert( pCsr ); + if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){ + sqlite3Fts3Offsets(pContext, pCsr); } } -/* OptLeavesReader is nearly identical to LeavesReader, except that -** where LeavesReader is geared towards the merging of complete -** segment levels (with exactly MERGE_COUNT segments), OptLeavesReader -** is geared towards implementation of the optimize() function, and -** can merge all segments simultaneously. This version may be -** somewhat less efficient than LeavesReader because it merges into an -** accumulator rather than doing an N-way merge, but since segment -** size grows exponentially (so segment count logrithmically) this is -** probably not an immediate problem. +/* +** Implementation of the special optimize() function for FTS3. This +** function merges all segments in the database to a single segment. +** Example usage is: +** +** SELECT optimize(t) FROM t LIMIT 1; +** +** where 't' is the name of an FTS3 table. */ -/* TODO(shess): Prove that assertion, or extend the merge code to -** merge tree fashion (like the prefix-searching code does). -*/ -/* TODO(shess): OptLeavesReader and LeavesReader could probably be -** merged with little or no loss of performance for LeavesReader. The -** merged code would need to handle >MERGE_COUNT segments, and would -** also need to be able to optionally optimize away deletes. -*/ -typedef struct OptLeavesReader { - /* Segment number, to order readers by age. */ - int segment; - LeavesReader reader; -} OptLeavesReader; +static void fts3OptimizeFunc( + sqlite3_context *pContext, /* SQLite function call context */ + int nVal, /* Size of argument array */ + sqlite3_value **apVal /* Array of arguments */ +){ + int rc; /* Return code */ + Fts3Table *p; /* Virtual table handle */ + Fts3Cursor *pCursor; /* Cursor handle passed through apVal[0] */ -static int optLeavesReaderAtEnd(OptLeavesReader *pReader){ - return leavesReaderAtEnd(&pReader->reader); -} -static int optLeavesReaderTermBytes(OptLeavesReader *pReader){ - return leavesReaderTermBytes(&pReader->reader); -} -static const char *optLeavesReaderData(OptLeavesReader *pReader){ - return leavesReaderData(&pReader->reader); -} -static int optLeavesReaderDataBytes(OptLeavesReader *pReader){ - return leavesReaderDataBytes(&pReader->reader); -} -static const char *optLeavesReaderTerm(OptLeavesReader *pReader){ - return leavesReaderTerm(&pReader->reader); -} -static int optLeavesReaderStep(fulltext_vtab *v, OptLeavesReader *pReader){ - return leavesReaderStep(v, &pReader->reader); -} -static int optLeavesReaderTermCmp(OptLeavesReader *lr1, OptLeavesReader *lr2){ - return leavesReaderTermCmp(&lr1->reader, &lr2->reader); -} -/* Order by term ascending, segment ascending (oldest to newest), with -** exhausted readers to the end. -*/ -static int optLeavesReaderCmp(OptLeavesReader *lr1, OptLeavesReader *lr2){ - int c = optLeavesReaderTermCmp(lr1, lr2); - if( c!=0 ) return c; - return lr1->segment-lr2->segment; -} -/* Bubble pLr[0] to appropriate place in pLr[1..nLr-1]. Assumes that -** pLr[1..nLr-1] is already sorted. -*/ -static void optLeavesReaderReorder(OptLeavesReader *pLr, int nLr){ - while( nLr>1 && optLeavesReaderCmp(pLr, pLr+1)>0 ){ - OptLeavesReader tmp = pLr[0]; - pLr[0] = pLr[1]; - pLr[1] = tmp; - nLr--; - pLr++; + UNUSED_PARAMETER(nVal); + + assert( nVal==1 ); + if( fts3FunctionArg(pContext, "optimize", apVal[0], &pCursor) ) return; + p = (Fts3Table *)pCursor->base.pVtab; + assert( p ); + + rc = sqlite3Fts3Optimize(p); + + switch( rc ){ + case SQLITE_OK: + sqlite3_result_text(pContext, "Index optimized", -1, SQLITE_STATIC); + break; + case SQLITE_DONE: + sqlite3_result_text(pContext, "Index already optimal", -1, SQLITE_STATIC); + break; + default: + sqlite3_result_error_code(pContext, rc); + break; } } -/* optimize() helper function. Put the readers in order and iterate -** through them, merging doclists for matching terms into pWriter. -** Returns SQLITE_OK on success, or the SQLite error code which -** prevented success. +/* +** Implementation of the matchinfo() function for FTS3 */ -static int optimizeInternal(fulltext_vtab *v, - OptLeavesReader *readers, int nReaders, - LeafWriter *pWriter){ - int i, rc = SQLITE_OK; - DataBuffer doclist, merged, tmp; +static void fts3MatchinfoFunc( + sqlite3_context *pContext, /* SQLite function call context */ + int nVal, /* Size of argument array */ + sqlite3_value **apVal /* Array of arguments */ +){ + Fts3Cursor *pCsr; /* Cursor handle passed through apVal[0] */ - /* Order the readers. */ - i = nReaders; - while( i-- > 0 ){ - optLeavesReaderReorder(&readers[i], nReaders-i); - } - - dataBufferInit(&doclist, LEAF_MAX); - dataBufferInit(&merged, LEAF_MAX); - - /* Exhausted readers bubble to the end, so when the first reader is - ** at eof, all are at eof. - */ - while( !optLeavesReaderAtEnd(&readers[0]) ){ - - /* Figure out how many readers share the next term. */ - for(i=1; i 0 ){ - dlrDestroy(&dlReaders[nReaders]); - } - - /* Accumulated doclist to reader 0 for next pass. */ - dlrInit(&dlReaders[0], DL_DEFAULT, doclist.pData, doclist.nData); - } - - /* Destroy reader that was left in the pipeline. */ - dlrDestroy(&dlReaders[0]); - - /* Trim deletions from the doclist. */ - dataBufferReset(&merged); - docListTrim(DL_DEFAULT, doclist.pData, doclist.nData, - -1, DL_DEFAULT, &merged); - } - - /* Only pass doclists with hits (skip if all hits deleted). */ - if( merged.nData>0 ){ - rc = leafWriterStep(v, pWriter, - optLeavesReaderTerm(&readers[0]), - optLeavesReaderTermBytes(&readers[0]), - merged.pData, merged.nData); - if( rc!=SQLITE_OK ) goto err; - } - - /* Step merged readers to next term and reorder. */ - while( i-- > 0 ){ - rc = optLeavesReaderStep(v, &readers[i]); - if( rc!=SQLITE_OK ) goto err; - - optLeavesReaderReorder(&readers[i], nReaders-i); - } - } - - err: - dataBufferDestroy(&doclist); - dataBufferDestroy(&merged); - return rc; -} - -/* Implement optimize() function for FTS3. optimize(t) merges all -** segments in the fts index into a single segment. 't' is the magic -** table-named column. -*/ -static void optimizeFunc(sqlite3_context *pContext, - int argc, sqlite3_value **argv){ - fulltext_cursor *pCursor; - if( argc>1 ){ - sqlite3_result_error(pContext, "excess arguments to optimize()",-1); - }else if( sqlite3_value_type(argv[0])!=SQLITE_BLOB || - sqlite3_value_bytes(argv[0])!=sizeof(pCursor) ){ - sqlite3_result_error(pContext, "illegal first argument to optimize",-1); - }else{ - fulltext_vtab *v; - int i, rc, iMaxLevel; - OptLeavesReader *readers; - int nReaders; - LeafWriter writer; - sqlite3_stmt *s; - - memcpy(&pCursor, sqlite3_value_blob(argv[0]), sizeof(pCursor)); - v = cursor_vtab(pCursor); - - /* Flush any buffered updates before optimizing. */ - rc = flushPendingTerms(v); - if( rc!=SQLITE_OK ) goto err; - - rc = segdir_count(v, &nReaders, &iMaxLevel); - if( rc!=SQLITE_OK ) goto err; - if( nReaders==0 || nReaders==1 ){ - sqlite3_result_text(pContext, "Index already optimal", -1, - SQLITE_STATIC); - return; - } - - rc = sql_get_statement(v, SEGDIR_SELECT_ALL_STMT, &s); - if( rc!=SQLITE_OK ) goto err; - - readers = sqlite3_malloc(nReaders*sizeof(readers[0])); - if( readers==NULL ) goto err; - - /* Note that there will already be a segment at this position - ** until we call segdir_delete() on iMaxLevel. - */ - leafWriterInit(iMaxLevel, 0, &writer); - - i = 0; - while( (rc = sqlite3_step(s))==SQLITE_ROW ){ - sqlite_int64 iStart = sqlite3_column_int64(s, 0); - sqlite_int64 iEnd = sqlite3_column_int64(s, 1); - const char *pRootData = sqlite3_column_blob(s, 2); - int nRootData = sqlite3_column_bytes(s, 2); - - assert( i 0 ){ - leavesReaderDestroy(&readers[i].reader); - } - sqlite3_free(readers); - - /* If we've successfully gotten to here, delete the old segments - ** and flush the interior structure of the new segment. - */ - if( rc==SQLITE_OK ){ - for( i=0; i<=iMaxLevel; i++ ){ - rc = segdir_delete(v, i); - if( rc!=SQLITE_OK ) break; - } - - if( rc==SQLITE_OK ) rc = leafWriterFinalize(v, &writer); - } - - leafWriterDestroy(&writer); - - if( rc!=SQLITE_OK ) goto err; - - sqlite3_result_text(pContext, "Index optimized", -1, SQLITE_STATIC); + if( nVal!=1 ){ + sqlite3_result_error(pContext, + "wrong number of arguments to function matchinfo()", -1); return; + } - /* TODO(shess): Error-handling needs to be improved along the - ** lines of the dump_ functions. - */ - err: - { - char buf[512]; - sqlite3_snprintf(sizeof(buf), buf, "Error in optimize: %s", - sqlite3_errmsg(sqlite3_context_db_handle(pContext))); - sqlite3_result_error(pContext, buf, -1); - } + if( SQLITE_OK==fts3FunctionArg(pContext, "matchinfo", apVal[0], &pCsr) ){ + sqlite3Fts3Matchinfo(pContext, pCsr); } } -#ifdef SQLITE_TEST -/* Generate an error of the form ": ". If msg is NULL, -** pull the error from the context's db handle. -*/ -static void generateError(sqlite3_context *pContext, - const char *prefix, const char *msg){ - char buf[512]; - if( msg==NULL ) msg = sqlite3_errmsg(sqlite3_context_db_handle(pContext)); - sqlite3_snprintf(sizeof(buf), buf, "%s: %s", prefix, msg); - sqlite3_result_error(pContext, buf, -1); -} - -/* Helper function to collect the set of terms in the segment into -** pTerms. The segment is defined by the leaf nodes between -** iStartBlockid and iEndBlockid, inclusive, or by the contents of -** pRootData if iStartBlockid is 0 (in which case the entire segment -** fit in a leaf). -*/ -static int collectSegmentTerms(fulltext_vtab *v, sqlite3_stmt *s, - fts3Hash *pTerms){ - const sqlite_int64 iStartBlockid = sqlite3_column_int64(s, 0); - const sqlite_int64 iEndBlockid = sqlite3_column_int64(s, 1); - const char *pRootData = sqlite3_column_blob(s, 2); - const int nRootData = sqlite3_column_bytes(s, 2); - LeavesReader reader; - int rc = leavesReaderInit(v, 0, iStartBlockid, iEndBlockid, - pRootData, nRootData, &reader); - if( rc!=SQLITE_OK ) return rc; - - while( rc==SQLITE_OK && !leavesReaderAtEnd(&reader) ){ - const char *pTerm = leavesReaderTerm(&reader); - const int nTerm = leavesReaderTermBytes(&reader); - void *oldValue = sqlite3Fts3HashFind(pTerms, pTerm, nTerm); - void *newValue = (void *)((char *)oldValue+1); - - /* From the comment before sqlite3Fts3HashInsert in fts3_hash.c, - ** the data value passed is returned in case of malloc failure. - */ - if( newValue==sqlite3Fts3HashInsert(pTerms, pTerm, nTerm, newValue) ){ - rc = SQLITE_NOMEM; - }else{ - rc = leavesReaderStep(v, &reader); - } - } - - leavesReaderDestroy(&reader); - return rc; -} - -/* Helper function to build the result string for dump_terms(). */ -static int generateTermsResult(sqlite3_context *pContext, fts3Hash *pTerms){ - int iTerm, nTerms, nResultBytes, iByte; - char *result; - TermData *pData; - fts3HashElem *e; - - /* Iterate pTerms to generate an array of terms in pData for - ** sorting. - */ - nTerms = fts3HashCount(pTerms); - assert( nTerms>0 ); - pData = sqlite3_malloc(nTerms*sizeof(TermData)); - if( pData==NULL ) return SQLITE_NOMEM; - - nResultBytes = 0; - for(iTerm = 0, e = fts3HashFirst(pTerms); e; iTerm++, e = fts3HashNext(e)){ - nResultBytes += fts3HashKeysize(e)+1; /* Term plus trailing space */ - assert( iTerm0 ); /* nTerms>0, nResultsBytes must be, too. */ - result = sqlite3_malloc(nResultBytes); - if( result==NULL ){ - sqlite3_free(pData); - return SQLITE_NOMEM; - } - - if( nTerms>1 ) qsort(pData, nTerms, sizeof(*pData), termDataCmp); - - /* Read the terms in order to build the result. */ - iByte = 0; - for(iTerm=0; iTerm0 ){ - rc = generateTermsResult(pContext, &terms); - if( rc==SQLITE_NOMEM ){ - generateError(pContext, "dump_terms", "out of memory"); - }else{ - assert( rc==SQLITE_OK ); - } - }else if( argc==3 ){ - /* The specific segment asked for could not be found. */ - generateError(pContext, "dump_terms", "segment not found"); - }else{ - /* No segments found. */ - /* TODO(shess): It should be impossible to reach this. This - ** case can only happen for an empty table, in which case - ** SQLite has no rows to call this function on. - */ - sqlite3_result_null(pContext); - } - } - sqlite3Fts3HashClear(&terms); - } -} - -/* Expand the DL_DEFAULT doclist in pData into a text result in -** pContext. -*/ -static void createDoclistResult(sqlite3_context *pContext, - const char *pData, int nData){ - DataBuffer dump; - DLReader dlReader; - - assert( pData!=NULL && nData>0 ); - - dataBufferInit(&dump, 0); - dlrInit(&dlReader, DL_DEFAULT, pData, nData); - for( ; !dlrAtEnd(&dlReader); dlrStep(&dlReader) ){ - char buf[256]; - PLReader plReader; - - plrInit(&plReader, &dlReader); - if( DL_DEFAULT==DL_DOCIDS || plrAtEnd(&plReader) ){ - sqlite3_snprintf(sizeof(buf), buf, "[%lld] ", dlrDocid(&dlReader)); - dataBufferAppend(&dump, buf, strlen(buf)); - }else{ - int iColumn = plrColumn(&plReader); - - sqlite3_snprintf(sizeof(buf), buf, "[%lld %d[", - dlrDocid(&dlReader), iColumn); - dataBufferAppend(&dump, buf, strlen(buf)); - - for( ; !plrAtEnd(&plReader); plrStep(&plReader) ){ - if( plrColumn(&plReader)!=iColumn ){ - iColumn = plrColumn(&plReader); - sqlite3_snprintf(sizeof(buf), buf, "] %d[", iColumn); - assert( dump.nData>0 ); - dump.nData--; /* Overwrite trailing space. */ - assert( dump.pData[dump.nData]==' '); - dataBufferAppend(&dump, buf, strlen(buf)); - } - if( DL_DEFAULT==DL_POSITIONS_OFFSETS ){ - sqlite3_snprintf(sizeof(buf), buf, "%d,%d,%d ", - plrPosition(&plReader), - plrStartOffset(&plReader), plrEndOffset(&plReader)); - }else if( DL_DEFAULT==DL_POSITIONS ){ - sqlite3_snprintf(sizeof(buf), buf, "%d ", plrPosition(&plReader)); - }else{ - assert( NULL=="Unhandled DL_DEFAULT value"); - } - dataBufferAppend(&dump, buf, strlen(buf)); - } - plrDestroy(&plReader); - - assert( dump.nData>0 ); - dump.nData--; /* Overwrite trailing space. */ - assert( dump.pData[dump.nData]==' '); - dataBufferAppend(&dump, "]] ", 3); - } - } - dlrDestroy(&dlReader); - - assert( dump.nData>0 ); - dump.nData--; /* Overwrite trailing space. */ - assert( dump.pData[dump.nData]==' '); - dump.pData[dump.nData] = '\0'; - assert( dump.nData>0 ); - - /* Passes ownership of dump's buffer to pContext. */ - sqlite3_result_text(pContext, dump.pData, dump.nData, sqlite3_free); - dump.pData = NULL; - dump.nData = dump.nCapacity = 0; -} - -/* Implements dump_doclist() for use in inspecting the fts3 index from -** tests. TEXT result containing a string representation of the -** doclist for the indicated term. dump_doclist(t, term, level, idx) -** dumps the doclist for term from the segment specified by level, idx -** (in %_segdir), while dump_doclist(t, term) dumps the logical -** doclist for the term across all segments. The per-segment doclist -** can contain deletions, while the full-index doclist will not -** (deletions are omitted). -** -** Result formats differ with the setting of DL_DEFAULTS. Examples: -** -** DL_DOCIDS: [1] [3] [7] -** DL_POSITIONS: [1 0[0 4] 1[17]] [3 1[5]] -** DL_POSITIONS_OFFSETS: [1 0[0,0,3 4,23,26] 1[17,102,105]] [3 1[5,20,23]] -** -** In each case the number after the outer '[' is the docid. In the -** latter two cases, the number before the inner '[' is the column -** associated with the values within. For DL_POSITIONS the numbers -** within are the positions, for DL_POSITIONS_OFFSETS they are the -** position, the start offset, and the end offset. -*/ -static void dumpDoclistFunc( - sqlite3_context *pContext, - int argc, sqlite3_value **argv -){ - fulltext_cursor *pCursor; - if( argc!=2 && argc!=4 ){ - generateError(pContext, "dump_doclist", "incorrect arguments"); - }else if( sqlite3_value_type(argv[0])!=SQLITE_BLOB || - sqlite3_value_bytes(argv[0])!=sizeof(pCursor) ){ - generateError(pContext, "dump_doclist", "illegal first argument"); - }else if( sqlite3_value_text(argv[1])==NULL || - sqlite3_value_text(argv[1])[0]=='\0' ){ - generateError(pContext, "dump_doclist", "empty second argument"); - }else{ - const char *pTerm = (const char *)sqlite3_value_text(argv[1]); - const int nTerm = strlen(pTerm); - fulltext_vtab *v; - int rc; - DataBuffer doclist; - - memcpy(&pCursor, sqlite3_value_blob(argv[0]), sizeof(pCursor)); - v = cursor_vtab(pCursor); - - dataBufferInit(&doclist, 0); - - /* termSelect() yields the same logical doclist that queries are - ** run against. - */ - if( argc==2 ){ - rc = termSelect(v, v->nColumn, pTerm, nTerm, 0, DL_DEFAULT, &doclist); - }else{ - sqlite3_stmt *s = NULL; - - /* Get our specific segment's information. */ - rc = sql_get_statement(v, SEGDIR_SELECT_SEGMENT_STMT, &s); - if( rc==SQLITE_OK ){ - rc = sqlite3_bind_int(s, 1, sqlite3_value_int(argv[2])); - if( rc==SQLITE_OK ){ - rc = sqlite3_bind_int(s, 2, sqlite3_value_int(argv[3])); - } - } - - if( rc==SQLITE_OK ){ - rc = sqlite3_step(s); - - if( rc==SQLITE_DONE ){ - dataBufferDestroy(&doclist); - generateError(pContext, "dump_doclist", "segment not found"); - return; - } - - /* Found a segment, load it into doclist. */ - if( rc==SQLITE_ROW ){ - const sqlite_int64 iLeavesEnd = sqlite3_column_int64(s, 1); - const char *pData = sqlite3_column_blob(s, 2); - const int nData = sqlite3_column_bytes(s, 2); - - /* loadSegment() is used by termSelect() to load each - ** segment's data. - */ - rc = loadSegment(v, pData, nData, iLeavesEnd, pTerm, nTerm, 0, - &doclist); - if( rc==SQLITE_OK ){ - rc = sqlite3_step(s); - - /* Should not have more than one matching segment. */ - if( rc!=SQLITE_DONE ){ - sqlite3_reset(s); - dataBufferDestroy(&doclist); - generateError(pContext, "dump_doclist", "invalid segdir"); - return; - } - rc = SQLITE_OK; - } - } - } - - sqlite3_reset(s); - } - - if( rc==SQLITE_OK ){ - if( doclist.nData>0 ){ - createDoclistResult(pContext, doclist.pData, doclist.nData); - }else{ - /* TODO(shess): This can happen if the term is not present, or - ** if all instances of the term have been deleted and this is - ** an all-index dump. It may be interesting to distinguish - ** these cases. - */ - sqlite3_result_text(pContext, "", 0, SQLITE_STATIC); - } - }else if( rc==SQLITE_NOMEM ){ - /* Handle out-of-memory cases specially because if they are - ** generated in fts3 code they may not be reflected in the db - ** handle. - */ - /* TODO(shess): Handle this more comprehensively. - ** sqlite3ErrStr() has what I need, but is internal. - */ - generateError(pContext, "dump_doclist", "out of memory"); - }else{ - generateError(pContext, "dump_doclist", NULL); - } - - dataBufferDestroy(&doclist); - } -} -#endif - /* ** This routine implements the xFindFunction method for the FTS3 ** virtual table. */ -static int fulltextFindFunction( - sqlite3_vtab *pVtab, - int nArg, - const char *zName, - void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), - void **ppArg +static int fts3FindFunctionMethod( + sqlite3_vtab *pVtab, /* Virtual table handle */ + int nArg, /* Number of SQL function arguments */ + const char *zName, /* Name of SQL function */ + void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), /* OUT: Result */ + void **ppArg /* Unused */ ){ - if( strcmp(zName,"snippet")==0 ){ - *pxFunc = snippetFunc; - return 1; - }else if( strcmp(zName,"offsets")==0 ){ - *pxFunc = snippetOffsetsFunc; - return 1; - }else if( strcmp(zName,"optimize")==0 ){ - *pxFunc = optimizeFunc; - return 1; -#ifdef SQLITE_TEST - /* NOTE(shess): These functions are present only for testing - ** purposes. No particular effort is made to optimize their - ** execution or how they build their results. - */ - }else if( strcmp(zName,"dump_terms")==0 ){ - /* fprintf(stderr, "Found dump_terms\n"); */ - *pxFunc = dumpTermsFunc; - return 1; - }else if( strcmp(zName,"dump_doclist")==0 ){ - /* fprintf(stderr, "Found dump_doclist\n"); */ - *pxFunc = dumpDoclistFunc; - return 1; -#endif + struct Overloaded { + const char *zName; + void (*xFunc)(sqlite3_context*,int,sqlite3_value**); + } aOverload[] = { + { "snippet", fts3SnippetFunc }, + { "offsets", fts3OffsetsFunc }, + { "optimize", fts3OptimizeFunc }, + { "matchinfo", fts3MatchinfoFunc }, + }; + int i; /* Iterator variable */ + + UNUSED_PARAMETER(pVtab); + UNUSED_PARAMETER(nArg); + UNUSED_PARAMETER(ppArg); + + for(i=0; izDb, p->zName, zName - , p->zDb, p->zName, zName - , p->zDb, p->zName, zName - ); - if( zSql ){ - rc = sqlite3_exec(p->db, zSql, 0, 0, 0); - sqlite3_free(zSql); + Fts3Table *p = (Fts3Table *)pVtab; + sqlite3 *db = p->db; /* Database connection */ + int rc; /* Return Code */ + + rc = sqlite3Fts3PendingTermsFlush(p); + if( rc!=SQLITE_OK ){ + return rc; } + + fts3DbExec(&rc, db, + "ALTER TABLE %Q.'%q_content' RENAME TO '%q_content';", + p->zDb, p->zName, zName + ); + if( rc==SQLITE_ERROR ) rc = SQLITE_OK; + if( p->bHasDocsize ){ + fts3DbExec(&rc, db, + "ALTER TABLE %Q.'%q_docsize' RENAME TO '%q_docsize';", + p->zDb, p->zName, zName + ); + fts3DbExec(&rc, db, + "ALTER TABLE %Q.'%q_stat' RENAME TO '%q_stat';", + p->zDb, p->zName, zName + ); + } + fts3DbExec(&rc, db, + "ALTER TABLE %Q.'%q_segments' RENAME TO '%q_segments';", + p->zDb, p->zName, zName + ); + fts3DbExec(&rc, db, + "ALTER TABLE %Q.'%q_segdir' RENAME TO '%q_segdir';", + p->zDb, p->zName, zName + ); return rc; } static const sqlite3_module fts3Module = { /* iVersion */ 0, - /* xCreate */ fulltextCreate, - /* xConnect */ fulltextConnect, - /* xBestIndex */ fulltextBestIndex, - /* xDisconnect */ fulltextDisconnect, - /* xDestroy */ fulltextDestroy, - /* xOpen */ fulltextOpen, + /* xCreate */ fts3CreateMethod, + /* xConnect */ fts3ConnectMethod, + /* xBestIndex */ fts3BestIndexMethod, + /* xDisconnect */ fts3DisconnectMethod, + /* xDestroy */ fts3DestroyMethod, + /* xOpen */ fts3OpenMethod, /* xClose */ fulltextClose, - /* xFilter */ fulltextFilter, - /* xNext */ fulltextNext, - /* xEof */ fulltextEof, - /* xColumn */ fulltextColumn, - /* xRowid */ fulltextRowid, - /* xUpdate */ fulltextUpdate, - /* xBegin */ fulltextBegin, - /* xSync */ fulltextSync, - /* xCommit */ fulltextCommit, - /* xRollback */ fulltextRollback, - /* xFindFunction */ fulltextFindFunction, - /* xRename */ fulltextRename, + /* xFilter */ fts3FilterMethod, + /* xNext */ fts3NextMethod, + /* xEof */ fts3EofMethod, + /* xColumn */ fts3ColumnMethod, + /* xRowid */ fts3RowidMethod, + /* xUpdate */ fts3UpdateMethod, + /* xBegin */ fts3BeginMethod, + /* xSync */ fts3SyncMethod, + /* xCommit */ fts3CommitMethod, + /* xRollback */ fts3RollbackMethod, + /* xFindFunction */ fts3FindFunctionMethod, + /* xRename */ fts3RenameMethod, }; +/* +** This function is registered as the module destructor (called when an +** FTS3 enabled database connection is closed). It frees the memory +** allocated for the tokenizer hash table. +*/ static void hashDestroy(void *p){ - fts3Hash *pHash = (fts3Hash *)p; + Fts3Hash *pHash = (Fts3Hash *)p; sqlite3Fts3HashClear(pHash); sqlite3_free(pHash); } @@ -104632,7 +110324,7 @@ static void hashDestroy(void *p){ ** used to retrieve the respective implementations. ** ** Calling sqlite3Fts3SimpleTokenizerModule() sets the value pointed -** to by the argument to point a the "simple" tokenizer implementation. +** to by the argument to point to the "simple" tokenizer implementation. ** Function ...PorterTokenizerModule() sets *pModule to point to the ** porter tokenizer/stemmer implementation. */ @@ -104640,8 +110332,6 @@ SQLITE_PRIVATE void sqlite3Fts3SimpleTokenizerModule(sqlite3_tokenizer_module co SQLITE_PRIVATE void sqlite3Fts3PorterTokenizerModule(sqlite3_tokenizer_module const**ppModule); SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule(sqlite3_tokenizer_module const**ppModule); -SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, fts3Hash *, const char *); - /* ** Initialise the fts3 extension. If this extension is built as part ** of the sqlite library, then this function is called directly by @@ -104650,19 +110340,20 @@ SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, fts3Hash *, const char *) */ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){ int rc = SQLITE_OK; - fts3Hash *pHash = 0; + Fts3Hash *pHash = 0; const sqlite3_tokenizer_module *pSimple = 0; const sqlite3_tokenizer_module *pPorter = 0; - const sqlite3_tokenizer_module *pIcu = 0; - sqlite3Fts3SimpleTokenizerModule(&pSimple); - sqlite3Fts3PorterTokenizerModule(&pPorter); #ifdef SQLITE_ENABLE_ICU + const sqlite3_tokenizer_module *pIcu = 0; sqlite3Fts3IcuTokenizerModule(&pIcu); #endif + sqlite3Fts3SimpleTokenizerModule(&pSimple); + sqlite3Fts3PorterTokenizerModule(&pPorter); + /* Allocate and initialise the hash-table used to store tokenizers. */ - pHash = sqlite3_malloc(sizeof(fts3Hash)); + pHash = sqlite3_malloc(sizeof(Fts3Hash)); if( !pHash ){ rc = SQLITE_NOMEM; }else{ @@ -104673,14 +110364,18 @@ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){ if( rc==SQLITE_OK ){ if( sqlite3Fts3HashInsert(pHash, "simple", 7, (void *)pSimple) || sqlite3Fts3HashInsert(pHash, "porter", 7, (void *)pPorter) +#ifdef SQLITE_ENABLE_ICU || (pIcu && sqlite3Fts3HashInsert(pHash, "icu", 4, (void *)pIcu)) +#endif ){ rc = SQLITE_NOMEM; } } #ifdef SQLITE_TEST - sqlite3Fts3ExprInitTestInterface(db); + if( rc==SQLITE_OK ){ + rc = sqlite3Fts3ExprInitTestInterface(db); + } #endif /* Create the virtual table wrapper around the hash-table and overload @@ -104690,16 +110385,19 @@ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){ if( SQLITE_OK==rc && SQLITE_OK==(rc = sqlite3Fts3InitHashTable(db, pHash, "fts3_tokenizer")) && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1)) - && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", -1)) - && SQLITE_OK==(rc = sqlite3_overload_function(db, "optimize", -1)) -#ifdef SQLITE_TEST - && SQLITE_OK==(rc = sqlite3_overload_function(db, "dump_terms", -1)) - && SQLITE_OK==(rc = sqlite3_overload_function(db, "dump_doclist", -1)) -#endif + && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1)) + && SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", -1)) + && SQLITE_OK==(rc = sqlite3_overload_function(db, "optimize", 1)) ){ - return sqlite3_create_module_v2( + rc = sqlite3_create_module_v2( db, "fts3", &fts3Module, (void *)pHash, hashDestroy ); + if( rc==SQLITE_OK ){ + rc = sqlite3_create_module_v2( + db, "fts4", &fts3Module, (void *)pHash, 0 + ); + } + return rc; } /* An error has occurred. Delete the hash table and return the error code. */ @@ -104722,7 +110420,7 @@ SQLITE_API int sqlite3_extension_init( } #endif -#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ +#endif /************** End of fts3.c ************************************************/ /************** Begin file fts3_expr.c ***************************************/ @@ -104741,8 +110439,7 @@ SQLITE_API int sqlite3_extension_init( ** This module contains code that implements a parser for fts3 query strings ** (the right-hand argument to the MATCH operator). Because the supported ** syntax is relatively simple, the whole tokenizer/parser system is -** hand-coded. The public interface to this module is declared in source -** code file "fts3_expr.h". +** hand-coded. */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) @@ -104768,7 +110465,29 @@ SQLITE_API int sqlite3_extension_init( ** to zero causes the module to use the old syntax. If it is set to ** non-zero the new syntax is activated. This is so both syntaxes can ** be tested using a single build of testfixture. +** +** The following describes the syntax supported by the fts3 MATCH +** operator in a similar format to that used by the lemon parser +** generator. This module does not use actually lemon, it uses a +** custom parser. +** +** query ::= andexpr (OR andexpr)*. +** +** andexpr ::= notexpr (AND? notexpr)*. +** +** notexpr ::= nearexpr (NOT nearexpr|-TOKEN)*. +** notexpr ::= LP query RP. +** +** nearexpr ::= phrase (NEAR distance_opt nearexpr)*. +** +** distance_opt ::= . +** distance_opt ::= / INTEGER. +** +** phrase ::= TOKEN. +** phrase ::= COLUMN:TOKEN. +** phrase ::= "TOKEN TOKEN TOKEN...". */ + #ifdef SQLITE_TEST SQLITE_API int sqlite3_fts3_enable_parentheses = 0; #else @@ -104807,7 +110526,7 @@ struct ParseContext { ** negative values). */ static int fts3isspace(char c){ - return (c&0x80)==0 ? isspace(c) : 0; + return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; } /* @@ -104884,7 +110603,7 @@ static int getNextToken( ** Enlarge a memory allocation. If an out-of-memory allocation occurs, ** then free the old allocation. */ -void *fts3ReallocOrFree(void *pOrig, int nNew){ +static void *fts3ReallocOrFree(void *pOrig, int nNew){ void *pRet = sqlite3_realloc(pOrig, nNew); if( !pRet ){ sqlite3_free(pOrig); @@ -104955,7 +110674,7 @@ static int getNextString( if( rc==SQLITE_DONE ){ int jj; - char *zNew; + char *zNew = NULL; int nNew = 0; int nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase); nByte += (p?(p->pPhrase->nToken-1):0) * sizeof(struct PhraseToken); @@ -105014,7 +110733,7 @@ static int getNextNode( int *pnConsumed /* OUT: Number of bytes consumed */ ){ static const struct Fts3Keyword { - char z[4]; /* Keyword text */ + char *z; /* Keyword text */ unsigned char n; /* Length of the keyword */ unsigned char parenOnly; /* Only valid in paren mode */ unsigned char eType; /* Keyword code */ @@ -105077,11 +110796,14 @@ static int getNextNode( || cNext=='"' || cNext=='(' || cNext==')' || cNext==0 ){ pRet = (Fts3Expr *)sqlite3_malloc(sizeof(Fts3Expr)); + if( !pRet ){ + return SQLITE_NOMEM; + } memset(pRet, 0, sizeof(Fts3Expr)); pRet->eType = pKey->eType; pRet->nNear = nNear; *ppExpr = pRet; - *pnConsumed = (zInput - z) + nKey; + *pnConsumed = (int)((zInput - z) + nKey); return SQLITE_OK; } @@ -105101,14 +110823,14 @@ static int getNextNode( if( rc==SQLITE_OK && !*ppExpr ){ rc = SQLITE_DONE; } - *pnConsumed = (zInput - z) + 1 + nConsumed; + *pnConsumed = (int)((zInput - z) + 1 + nConsumed); return rc; } /* Check for a close bracket. */ if( *zInput==')' ){ pParse->nNest--; - *pnConsumed = (zInput - z) + 1; + *pnConsumed = (int)((zInput - z) + 1); return SQLITE_DONE; } } @@ -105120,7 +110842,7 @@ static int getNextNode( */ if( *zInput=='"' ){ for(ii=1; iinCol; ii++){ const char *zStr = pParse->azCol[ii]; - int nStr = strlen(zStr); + int nStr = (int)strlen(zStr); if( nInput>nStr && zInput[nStr]==':' && sqlite3_strnicmp(zStr, zInput, nStr)==0 ){ iCol = ii; - iColLen = ((zInput - z) + nStr + 1); + iColLen = (int)((zInput - z) + nStr + 1); break; } } @@ -105414,7 +111136,7 @@ SQLITE_PRIVATE int sqlite3Fts3ExprParse( return SQLITE_OK; } if( n<0 ){ - n = strlen(z); + n = (int)strlen(z); } rc = fts3ExprParse(&sParse, z, n, ppExpr, &nParsed); @@ -105435,6 +111157,7 @@ SQLITE_PRIVATE void sqlite3Fts3ExprFree(Fts3Expr *p){ if( p ){ sqlite3Fts3ExprFree(p->pLeft); sqlite3Fts3ExprFree(p->pRight); + sqlite3_free(p->aDoclist); sqlite3_free(p); } } @@ -105468,7 +111191,7 @@ static int queryTestTokenizer( sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); if( SQLITE_ROW==sqlite3_step(pStmt) ){ if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){ - memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); + memcpy((void *)pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); } } @@ -105612,8 +111335,8 @@ exprtest_out: ** Register the query expression parser test function fts3_exprtest() ** with database connection db. */ -SQLITE_PRIVATE void sqlite3Fts3ExprInitTestInterface(sqlite3* db){ - sqlite3_create_function( +SQLITE_PRIVATE int sqlite3Fts3ExprInitTestInterface(sqlite3* db){ + return sqlite3_create_function( db, "fts3_exprtest", -1, SQLITE_UTF8, 0, fts3ExprTest, 0, 0 ); } @@ -105676,7 +111399,7 @@ static void fts3HashFree(void *p){ ** true if the hash table should make its own private copy of keys and ** false if it should just use the supplied pointer. */ -SQLITE_PRIVATE void sqlite3Fts3HashInit(fts3Hash *pNew, int keyClass, int copyKey){ +SQLITE_PRIVATE void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey){ assert( pNew!=0 ); assert( keyClass>=FTS3_HASH_STRING && keyClass<=FTS3_HASH_BINARY ); pNew->keyClass = keyClass; @@ -105691,8 +111414,8 @@ SQLITE_PRIVATE void sqlite3Fts3HashInit(fts3Hash *pNew, int keyClass, int copyKe ** Call this routine to delete a hash table or to reset a hash table ** to the empty state. */ -SQLITE_PRIVATE void sqlite3Fts3HashClear(fts3Hash *pH){ - fts3HashElem *elem; /* For looping over all elements of the table */ +SQLITE_PRIVATE void sqlite3Fts3HashClear(Fts3Hash *pH){ + Fts3HashElem *elem; /* For looping over all elements of the table */ assert( pH!=0 ); elem = pH->first; @@ -105701,7 +111424,7 @@ SQLITE_PRIVATE void sqlite3Fts3HashClear(fts3Hash *pH){ pH->ht = 0; pH->htsize = 0; while( elem ){ - fts3HashElem *next_elem = elem->next; + Fts3HashElem *next_elem = elem->next; if( pH->copyKey && elem->pKey ){ fts3HashFree(elem->pKey); } @@ -105784,11 +111507,11 @@ static int (*ftsCompareFunction(int keyClass))(const void*,int,const void*,int){ /* Link an element into the hash table */ static void fts3HashInsertElement( - fts3Hash *pH, /* The complete hash table */ + Fts3Hash *pH, /* The complete hash table */ struct _fts3ht *pEntry, /* The entry into which pNew is inserted */ - fts3HashElem *pNew /* The element to be inserted */ + Fts3HashElem *pNew /* The element to be inserted */ ){ - fts3HashElem *pHead; /* First element already in pEntry */ + Fts3HashElem *pHead; /* First element already in pEntry */ pHead = pEntry->chain; if( pHead ){ pNew->next = pHead; @@ -105810,15 +111533,17 @@ static void fts3HashInsertElement( /* Resize the hash table so that it cantains "new_size" buckets. ** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. +** +** Return non-zero if a memory allocation error occurs. */ -static void fts3Rehash(fts3Hash *pH, int new_size){ +static int fts3Rehash(Fts3Hash *pH, int new_size){ struct _fts3ht *new_ht; /* The new hash table */ - fts3HashElem *elem, *next_elem; /* For looping over existing elements */ + Fts3HashElem *elem, *next_elem; /* For looping over existing elements */ int (*xHash)(const void*,int); /* The hash function */ assert( (new_size & (new_size-1))==0 ); new_ht = (struct _fts3ht *)fts3HashMalloc( new_size*sizeof(struct _fts3ht) ); - if( new_ht==0 ) return; + if( new_ht==0 ) return 1; fts3HashFree(pH->ht); pH->ht = new_ht; pH->htsize = new_size; @@ -105828,19 +111553,20 @@ static void fts3Rehash(fts3Hash *pH, int new_size){ next_elem = elem->next; fts3HashInsertElement(pH, &new_ht[h], elem); } + return 0; } /* This function (for internal use only) locates an element in an ** hash table that matches the given key. The hash for this key has ** already been computed and is passed as the 4th parameter. */ -static fts3HashElem *fts3FindElementByHash( - const fts3Hash *pH, /* The pH to be searched */ +static Fts3HashElem *fts3FindElementByHash( + const Fts3Hash *pH, /* The pH to be searched */ const void *pKey, /* The key we are searching for */ int nKey, int h /* The hash for this key. */ ){ - fts3HashElem *elem; /* Used to loop thru the element list */ + Fts3HashElem *elem; /* Used to loop thru the element list */ int count; /* Number of elements left to test */ int (*xCompare)(const void*,int,const void*,int); /* comparison function */ @@ -105863,8 +111589,8 @@ static fts3HashElem *fts3FindElementByHash( ** element and a hash on the element's key. */ static void fts3RemoveElementByHash( - fts3Hash *pH, /* The pH containing "elem" */ - fts3HashElem* elem, /* The element to be removed from the pH */ + Fts3Hash *pH, /* The pH containing "elem" */ + Fts3HashElem* elem, /* The element to be removed from the pH */ int h /* Hash value for the element */ ){ struct _fts3ht *pEntry; @@ -105896,13 +111622,12 @@ static void fts3RemoveElementByHash( } } -/* Attempt to locate an element of the hash table pH with a key -** that matches pKey,nKey. Return the data for this element if it is -** found, or NULL if there is no match. -*/ -SQLITE_PRIVATE void *sqlite3Fts3HashFind(const fts3Hash *pH, const void *pKey, int nKey){ - int h; /* A hash on key */ - fts3HashElem *elem; /* The element that matches key */ +SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem( + const Fts3Hash *pH, + const void *pKey, + int nKey +){ + int h; /* A hash on key */ int (*xHash)(const void*,int); /* The hash function */ if( pH==0 || pH->ht==0 ) return 0; @@ -105910,8 +111635,19 @@ SQLITE_PRIVATE void *sqlite3Fts3HashFind(const fts3Hash *pH, const void *pKey, i assert( xHash!=0 ); h = (*xHash)(pKey,nKey); assert( (pH->htsize & (pH->htsize-1))==0 ); - elem = fts3FindElementByHash(pH,pKey,nKey, h & (pH->htsize-1)); - return elem ? elem->data : 0; + return fts3FindElementByHash(pH,pKey,nKey, h & (pH->htsize-1)); +} + +/* +** Attempt to locate an element of the hash table pH with a key +** that matches pKey,nKey. Return the data for this element if it is +** found, or NULL if there is no match. +*/ +SQLITE_PRIVATE void *sqlite3Fts3HashFind(const Fts3Hash *pH, const void *pKey, int nKey){ + Fts3HashElem *pElem; /* The element that matches key (if any) */ + + pElem = sqlite3Fts3HashFindElem(pH, pKey, nKey); + return pElem ? pElem->data : 0; } /* Insert an element into the hash table pH. The key is pKey,nKey @@ -105930,15 +111666,15 @@ SQLITE_PRIVATE void *sqlite3Fts3HashFind(const fts3Hash *pH, const void *pKey, i ** element corresponding to "key" is removed from the hash table. */ SQLITE_PRIVATE void *sqlite3Fts3HashInsert( - fts3Hash *pH, /* The hash table to insert into */ + Fts3Hash *pH, /* The hash table to insert into */ const void *pKey, /* The key */ int nKey, /* Number of bytes in the key */ void *data /* The data */ ){ int hraw; /* Raw hash value of the key */ int h; /* the hash of the key modulo hash table size */ - fts3HashElem *elem; /* Used to loop thru the element list */ - fts3HashElem *new_elem; /* New element added to the pH */ + Fts3HashElem *elem; /* Used to loop thru the element list */ + Fts3HashElem *new_elem; /* New element added to the pH */ int (*xHash)(const void*,int); /* The hash function */ assert( pH!=0 ); @@ -105958,14 +111694,14 @@ SQLITE_PRIVATE void *sqlite3Fts3HashInsert( return old_data; } if( data==0 ) return 0; - if( pH->htsize==0 ){ - fts3Rehash(pH,8); - if( pH->htsize==0 ){ - pH->count = 0; - return data; - } + if( (pH->htsize==0 && fts3Rehash(pH,8)) + || (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2)) + ){ + pH->count = 0; + return data; } - new_elem = (fts3HashElem*)fts3HashMalloc( sizeof(fts3HashElem) ); + assert( pH->htsize>0 ); + new_elem = (Fts3HashElem*)fts3HashMalloc( sizeof(Fts3HashElem) ); if( new_elem==0 ) return data; if( pH->copyKey && pKey!=0 ){ new_elem->pKey = fts3HashMalloc( nKey ); @@ -105979,9 +111715,6 @@ SQLITE_PRIVATE void *sqlite3Fts3HashInsert( } new_elem->nKey = nKey; pH->count++; - if( pH->count > pH->htsize ){ - fts3Rehash(pH,pH->htsize*2); - } assert( pH->htsize>0 ); assert( (pH->htsize & (pH->htsize-1))==0 ); h = hraw & (pH->htsize-1); @@ -106044,10 +111777,6 @@ typedef struct porter_tokenizer_cursor { } porter_tokenizer_cursor; -/* Forward declaration */ -static const sqlite3_tokenizer_module porterTokenizerModule; - - /* ** Create a new tokenizer instance. */ @@ -106056,6 +111785,10 @@ static int porterCreate( sqlite3_tokenizer **ppTokenizer ){ porter_tokenizer *t; + + UNUSED_PARAMETER(argc); + UNUSED_PARAMETER(argv); + t = (porter_tokenizer *) sqlite3_malloc(sizeof(*t)); if( t==NULL ) return SQLITE_NOMEM; memset(t, 0, sizeof(*t)); @@ -106084,6 +111817,8 @@ static int porterOpen( ){ porter_tokenizer_cursor *c; + UNUSED_PARAMETER(pTokenizer); + c = (porter_tokenizer_cursor *) sqlite3_malloc(sizeof(*c)); if( c==NULL ) return SQLITE_NOMEM; @@ -106224,7 +111959,7 @@ static int hasVowel(const char *z){ ** the first two characters of z[]. */ static int doubleConsonant(const char *z){ - return isConsonant(z) && z[0]==z[1] && isConsonant(z+1); + return isConsonant(z) && z[0]==z[1]; } /* @@ -106237,15 +111972,15 @@ static int doubleConsonant(const char *z){ */ static int star_oh(const char *z){ return - z[0]!=0 && isConsonant(z) && + isConsonant(z) && z[0]!='w' && z[0]!='x' && z[0]!='y' && - z[1]!=0 && isVowel(z+1) && - z[2]!=0 && isConsonant(z+2); + isVowel(z+1) && + isConsonant(z+2); } /* ** If the word ends with zFrom and xCond() is true for the stem -** of the word that preceds the zFrom ending, then change the +** of the word that preceeds the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo @@ -106284,7 +112019,7 @@ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ int i, mx, j; int hasDigit = 0; for(i=0; i='A' && c<='Z' ){ zOut[i] = c - 'A' + 'a'; }else{ @@ -106328,7 +112063,7 @@ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ ** no chance of overflowing the zOut buffer. */ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ - int i, j, c; + int i, j; char zReverse[28]; char *z, *z2; if( nIn<3 || nIn>=sizeof(zReverse)-7 ){ @@ -106338,7 +112073,7 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ return; } for(i=0, j=sizeof(zReverse)-6; i='A' && c<='Z' ){ zReverse[j] = c + 'a' - 'A'; }else if( c>='a' && c<='z' ){ @@ -106537,7 +112272,7 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ /* z[] is now the stemmed word in reverse order. Flip it back ** around into forward order and return. */ - *pnOut = i = strlen(z); + *pnOut = i = (int)strlen(z); zOut[i] = 0; while( *z ){ zOut[--i] = *(z++); @@ -106592,9 +112327,11 @@ static int porterNext( if( c->iOffset>iStartOffset ){ int n = c->iOffset-iStartOffset; if( n>c->nAllocated ){ + char *pNew; c->nAllocated = n+20; - c->zToken = sqlite3_realloc(c->zToken, c->nAllocated); - if( c->zToken==NULL ) return SQLITE_NOMEM; + pNew = sqlite3_realloc(c->zToken, c->nAllocated); + if( !pNew ) return SQLITE_NOMEM; + c->zToken = pNew; } porter_stemmer(&z[iStartOffset], n, c->zToken, pnBytes); *pzToken = c->zToken; @@ -106690,14 +112427,14 @@ static void scalarFunc( int argc, sqlite3_value **argv ){ - fts3Hash *pHash; + Fts3Hash *pHash; void *pPtr = 0; const unsigned char *zName; int nName; assert( argc==1 || argc==2 ); - pHash = (fts3Hash *)sqlite3_user_data(context); + pHash = (Fts3Hash *)sqlite3_user_data(context); zName = sqlite3_value_text(argv[0]); nName = sqlite3_value_bytes(argv[0])+1; @@ -106728,6 +112465,127 @@ static void scalarFunc( sqlite3_result_blob(context, (void *)&pPtr, sizeof(pPtr), SQLITE_TRANSIENT); } +static int fts3IsIdChar(char c){ + static const char isFtsIdChar[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1x */ + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6x */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7x */ + }; + return (c&0x80 || isFtsIdChar[(int)(c)]); +} + +SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *zStr, int *pn){ + const char *z1; + const char *z2 = 0; + + /* Find the start of the next token. */ + z1 = zStr; + while( z2==0 ){ + char c = *z1; + switch( c ){ + case '\0': return 0; /* No more tokens here */ + case '\'': + case '"': + case '`': { + z2 = z1; + while( *++z2 && (*z2!=c || *++z2==c) ); + break; + } + case '[': + z2 = &z1[1]; + while( *z2 && z2[0]!=']' ) z2++; + if( *z2 ) z2++; + break; + + default: + if( fts3IsIdChar(*z1) ){ + z2 = &z1[1]; + while( fts3IsIdChar(*z2) ) z2++; + }else{ + z1++; + } + } + } + + *pn = (int)(z2-z1); + return z1; +} + +SQLITE_PRIVATE int sqlite3Fts3InitTokenizer( + Fts3Hash *pHash, /* Tokenizer hash table */ + const char *zArg, /* Possible tokenizer specification */ + sqlite3_tokenizer **ppTok, /* OUT: Tokenizer (if applicable) */ + const char **pzTokenizer, /* OUT: Set to zArg if is tokenizer */ + char **pzErr /* OUT: Set to malloced error message */ +){ + int rc; + char *z = (char *)zArg; + int n; + char *zCopy; + char *zEnd; /* Pointer to nul-term of zCopy */ + sqlite3_tokenizer_module *m; + + if( !z ){ + zCopy = sqlite3_mprintf("simple"); + }else{ + if( sqlite3_strnicmp(z, "tokenize", 8) || fts3IsIdChar(z[8])){ + return SQLITE_OK; + } + zCopy = sqlite3_mprintf("%s", &z[8]); + *pzTokenizer = zArg; + } + if( !zCopy ){ + return SQLITE_NOMEM; + } + + zEnd = &zCopy[strlen(zCopy)]; + + z = (char *)sqlite3Fts3NextToken(zCopy, &n); + z[n] = '\0'; + sqlite3Fts3Dequote(z); + + m = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, z, (int)strlen(z)+1); + if( !m ){ + *pzErr = sqlite3_mprintf("unknown tokenizer: %s", z); + rc = SQLITE_ERROR; + }else{ + char const **aArg = 0; + int iArg = 0; + z = &z[n+1]; + while( zxCreate(iArg, aArg, ppTok); + assert( rc!=SQLITE_OK || *ppTok ); + if( rc!=SQLITE_OK ){ + *pzErr = sqlite3_mprintf("unknown tokenizer"); + }else{ + (*ppTok)->pModule = m; + } + sqlite3_free((void *)aArg); + } + + sqlite3_free(zCopy); + return rc; +} + + #ifdef SQLITE_TEST @@ -106762,7 +112620,7 @@ static void testFunc( int argc, sqlite3_value **argv ){ - fts3Hash *pHash; + Fts3Hash *pHash; sqlite3_tokenizer_module *p; sqlite3_tokenizer *pTokenizer = 0; sqlite3_tokenizer_cursor *pCsr = 0; @@ -106795,7 +112653,7 @@ static void testFunc( zArg = (const char *)sqlite3_value_text(argv[1]); } - pHash = (fts3Hash *)sqlite3_user_data(context); + pHash = (Fts3Hash *)sqlite3_user_data(context); p = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, zName, nName+1); if( !p ){ @@ -106886,7 +112744,7 @@ int queryTokenizer( sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); if( SQLITE_ROW==sqlite3_step(pStmt) ){ if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){ - memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); + memcpy((void *)pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); } } @@ -106923,6 +112781,9 @@ static void intTestFunc( const sqlite3_tokenizer_module *p2; sqlite3 *db = (sqlite3 *)sqlite3_user_data(context); + UNUSED_PARAMETER(argc); + UNUSED_PARAMETER(argv); + /* Test the query function */ sqlite3Fts3SimpleTokenizerModule(&p1); rc = queryTokenizer(db, "simple", &p2); @@ -106964,16 +112825,16 @@ static void intTestFunc( */ SQLITE_PRIVATE int sqlite3Fts3InitHashTable( sqlite3 *db, - fts3Hash *pHash, + Fts3Hash *pHash, const char *zName ){ int rc = SQLITE_OK; void *p = (void *)pHash; const int any = SQLITE_ANY; - char *zTest = 0; - char *zTest2 = 0; #ifdef SQLITE_TEST + char *zTest = 0; + char *zTest2 = 0; void *pdb = (void *)db; zTest = sqlite3_mprintf("%s_test", zName); zTest2 = sqlite3_mprintf("%s_internal_test", zName); @@ -106982,18 +112843,21 @@ SQLITE_PRIVATE int sqlite3Fts3InitHashTable( } #endif - if( rc!=SQLITE_OK - || (rc = sqlite3_create_function(db, zName, 1, any, p, scalarFunc, 0, 0)) - || (rc = sqlite3_create_function(db, zName, 2, any, p, scalarFunc, 0, 0)) + if( SQLITE_OK!=rc + || SQLITE_OK!=(rc = sqlite3_create_function(db, zName, 1, any, p, scalarFunc, 0, 0)) + || SQLITE_OK!=(rc = sqlite3_create_function(db, zName, 2, any, p, scalarFunc, 0, 0)) #ifdef SQLITE_TEST - || (rc = sqlite3_create_function(db, zTest, 2, any, p, testFunc, 0, 0)) - || (rc = sqlite3_create_function(db, zTest, 3, any, p, testFunc, 0, 0)) - || (rc = sqlite3_create_function(db, zTest2, 0, any, pdb, intTestFunc, 0, 0)) + || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest, 2, any, p, testFunc, 0, 0)) + || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest, 3, any, p, testFunc, 0, 0)) + || SQLITE_OK!=(rc = sqlite3_create_function(db, zTest2, 0, any, pdb, intTestFunc, 0, 0)) #endif - ); + ); +#ifdef SQLITE_TEST sqlite3_free(zTest); sqlite3_free(zTest2); +#endif + return rc; } @@ -107046,12 +112910,12 @@ typedef struct simple_tokenizer_cursor { } simple_tokenizer_cursor; -/* Forward declaration */ -static const sqlite3_tokenizer_module simpleTokenizerModule; - static int simpleDelim(simple_tokenizer *t, unsigned char c){ return c<0x80 && t->delim[c]; } +static int fts3_isalnum(int x){ + return (x>='0' && x<='9') || (x>='A' && x<='Z') || (x>='a' && x<='z'); +} /* ** Create a new tokenizer instance. @@ -107072,7 +112936,7 @@ static int simpleCreate( ** information on the initial create. */ if( argc>1 ){ - int i, n = strlen(argv[1]); + int i, n = (int)strlen(argv[1]); for(i=0; idelim[i] = !isalnum(i); + t->delim[i] = !fts3_isalnum(i) ? -1 : 0; } } @@ -107115,6 +112979,8 @@ static int simpleOpen( ){ simple_tokenizer_cursor *c; + UNUSED_PARAMETER(pTokenizer); + c = (simple_tokenizer_cursor *) sqlite3_malloc(sizeof(*c)); if( c==NULL ) return SQLITE_NOMEM; @@ -107179,16 +113045,18 @@ static int simpleNext( if( c->iOffset>iStartOffset ){ int i, n = c->iOffset-iStartOffset; if( n>c->nTokenAllocated ){ + char *pNew; c->nTokenAllocated = n+20; - c->pToken = sqlite3_realloc(c->pToken, c->nTokenAllocated); - if( c->pToken==NULL ) return SQLITE_NOMEM; + pNew = sqlite3_realloc(c->pToken, c->nTokenAllocated); + if( !pNew ) return SQLITE_NOMEM; + c->pToken = pNew; } for(i=0; ipToken[i] = ch<0x80 ? tolower(ch) : ch; + c->pToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch); } *ppToken = c->pToken; *pnBytes = n; @@ -107227,6 +113095,3832 @@ SQLITE_PRIVATE void sqlite3Fts3SimpleTokenizerModule( #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ /************** End of fts3_tokenizer1.c *************************************/ +/************** Begin file fts3_write.c **************************************/ +/* +** 2009 Oct 23 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** This file is part of the SQLite FTS3 extension module. Specifically, +** this file contains code to insert, update and delete rows from FTS3 +** tables. It also contains code to merge FTS3 b-tree segments. Some +** of the sub-routines used to merge segments are also used by the query +** code in fts3.c. +*/ + +#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) + + +typedef struct PendingList PendingList; +typedef struct SegmentNode SegmentNode; +typedef struct SegmentWriter SegmentWriter; + +/* +** Data structure used while accumulating terms in the pending-terms hash +** table. The hash table entry maps from term (a string) to a malloc'd +** instance of this structure. +*/ +struct PendingList { + int nData; + char *aData; + int nSpace; + sqlite3_int64 iLastDocid; + sqlite3_int64 iLastCol; + sqlite3_int64 iLastPos; +}; + +/* +** An instance of this structure is used to iterate through the terms on +** a contiguous set of segment b-tree leaf nodes. Although the details of +** this structure are only manipulated by code in this file, opaque handles +** of type Fts3SegReader* are also used by code in fts3.c to iterate through +** terms when querying the full-text index. See functions: +** +** sqlite3Fts3SegReaderNew() +** sqlite3Fts3SegReaderFree() +** sqlite3Fts3SegReaderIterate() +** +** Methods used to manipulate Fts3SegReader structures: +** +** fts3SegReaderNext() +** fts3SegReaderFirstDocid() +** fts3SegReaderNextDocid() +*/ +struct Fts3SegReader { + int iIdx; /* Index within level, or 0x7FFFFFFF for PT */ + sqlite3_int64 iStartBlock; + sqlite3_int64 iEndBlock; + sqlite3_stmt *pStmt; /* SQL Statement to access leaf nodes */ + char *aNode; /* Pointer to node data (or NULL) */ + int nNode; /* Size of buffer at aNode (or 0) */ + int nTermAlloc; /* Allocated size of zTerm buffer */ + Fts3HashElem **ppNextElem; + + /* Variables set by fts3SegReaderNext(). These may be read directly + ** by the caller. They are valid from the time SegmentReaderNew() returns + ** until SegmentReaderNext() returns something other than SQLITE_OK + ** (i.e. SQLITE_DONE). + */ + int nTerm; /* Number of bytes in current term */ + char *zTerm; /* Pointer to current term */ + char *aDoclist; /* Pointer to doclist of current entry */ + int nDoclist; /* Size of doclist in current entry */ + + /* The following variables are used to iterate through the current doclist */ + char *pOffsetList; + sqlite3_int64 iDocid; +}; + +#define fts3SegReaderIsPending(p) ((p)->ppNextElem!=0) + +/* +** An instance of this structure is used to create a segment b-tree in the +** database. The internal details of this type are only accessed by the +** following functions: +** +** fts3SegWriterAdd() +** fts3SegWriterFlush() +** fts3SegWriterFree() +*/ +struct SegmentWriter { + SegmentNode *pTree; /* Pointer to interior tree structure */ + sqlite3_int64 iFirst; /* First slot in %_segments written */ + sqlite3_int64 iFree; /* Next free slot in %_segments */ + char *zTerm; /* Pointer to previous term buffer */ + int nTerm; /* Number of bytes in zTerm */ + int nMalloc; /* Size of malloc'd buffer at zMalloc */ + char *zMalloc; /* Malloc'd space (possibly) used for zTerm */ + int nSize; /* Size of allocation at aData */ + int nData; /* Bytes of data in aData */ + char *aData; /* Pointer to block from malloc() */ +}; + +/* +** Type SegmentNode is used by the following three functions to create +** the interior part of the segment b+-tree structures (everything except +** the leaf nodes). These functions and type are only ever used by code +** within the fts3SegWriterXXX() family of functions described above. +** +** fts3NodeAddTerm() +** fts3NodeWrite() +** fts3NodeFree() +*/ +struct SegmentNode { + SegmentNode *pParent; /* Parent node (or NULL for root node) */ + SegmentNode *pRight; /* Pointer to right-sibling */ + SegmentNode *pLeftmost; /* Pointer to left-most node of this depth */ + int nEntry; /* Number of terms written to node so far */ + char *zTerm; /* Pointer to previous term buffer */ + int nTerm; /* Number of bytes in zTerm */ + int nMalloc; /* Size of malloc'd buffer at zMalloc */ + char *zMalloc; /* Malloc'd space (possibly) used for zTerm */ + int nData; /* Bytes of valid data so far */ + char *aData; /* Node data */ +}; + +/* +** Valid values for the second argument to fts3SqlStmt(). +*/ +#define SQL_DELETE_CONTENT 0 +#define SQL_IS_EMPTY 1 +#define SQL_DELETE_ALL_CONTENT 2 +#define SQL_DELETE_ALL_SEGMENTS 3 +#define SQL_DELETE_ALL_SEGDIR 4 +#define SQL_DELETE_ALL_DOCSIZE 5 +#define SQL_DELETE_ALL_STAT 6 +#define SQL_SELECT_CONTENT_BY_ROWID 7 +#define SQL_NEXT_SEGMENT_INDEX 8 +#define SQL_INSERT_SEGMENTS 9 +#define SQL_NEXT_SEGMENTS_ID 10 +#define SQL_INSERT_SEGDIR 11 +#define SQL_SELECT_LEVEL 12 +#define SQL_SELECT_ALL_LEVEL 13 +#define SQL_SELECT_LEVEL_COUNT 14 +#define SQL_SELECT_SEGDIR_COUNT_MAX 15 +#define SQL_DELETE_SEGDIR_BY_LEVEL 16 +#define SQL_DELETE_SEGMENTS_RANGE 17 +#define SQL_CONTENT_INSERT 18 +#define SQL_GET_BLOCK 19 +#define SQL_DELETE_DOCSIZE 20 +#define SQL_REPLACE_DOCSIZE 21 +#define SQL_SELECT_DOCSIZE 22 +#define SQL_SELECT_DOCTOTAL 23 +#define SQL_REPLACE_DOCTOTAL 24 + +/* +** This function is used to obtain an SQLite prepared statement handle +** for the statement identified by the second argument. If successful, +** *pp is set to the requested statement handle and SQLITE_OK returned. +** Otherwise, an SQLite error code is returned and *pp is set to 0. +** +** If argument apVal is not NULL, then it must point to an array with +** at least as many entries as the requested statement has bound +** parameters. The values are bound to the statements parameters before +** returning. +*/ +static int fts3SqlStmt( + Fts3Table *p, /* Virtual table handle */ + int eStmt, /* One of the SQL_XXX constants above */ + sqlite3_stmt **pp, /* OUT: Statement handle */ + sqlite3_value **apVal /* Values to bind to statement */ +){ + const char *azSql[] = { +/* 0 */ "DELETE FROM %Q.'%q_content' WHERE rowid = ?", +/* 1 */ "SELECT NOT EXISTS(SELECT docid FROM %Q.'%q_content' WHERE rowid!=?)", +/* 2 */ "DELETE FROM %Q.'%q_content'", +/* 3 */ "DELETE FROM %Q.'%q_segments'", +/* 4 */ "DELETE FROM %Q.'%q_segdir'", +/* 5 */ "DELETE FROM %Q.'%q_docsize'", +/* 6 */ "DELETE FROM %Q.'%q_stat'", +/* 7 */ "SELECT * FROM %Q.'%q_content' WHERE rowid=?", +/* 8 */ "SELECT (SELECT max(idx) FROM %Q.'%q_segdir' WHERE level = ?) + 1", +/* 9 */ "INSERT INTO %Q.'%q_segments'(blockid, block) VALUES(?, ?)", +/* 10 */ "SELECT coalesce((SELECT max(blockid) FROM %Q.'%q_segments') + 1, 1)", +/* 11 */ "INSERT INTO %Q.'%q_segdir' VALUES(?,?,?,?,?,?)", + + /* Return segments in order from oldest to newest.*/ +/* 12 */ "SELECT idx, start_block, leaves_end_block, end_block, root " + "FROM %Q.'%q_segdir' WHERE level = ? ORDER BY idx ASC", +/* 13 */ "SELECT idx, start_block, leaves_end_block, end_block, root " + "FROM %Q.'%q_segdir' ORDER BY level DESC, idx ASC", + +/* 14 */ "SELECT count(*) FROM %Q.'%q_segdir' WHERE level = ?", +/* 15 */ "SELECT count(*), max(level) FROM %Q.'%q_segdir'", + +/* 16 */ "DELETE FROM %Q.'%q_segdir' WHERE level = ?", +/* 17 */ "DELETE FROM %Q.'%q_segments' WHERE blockid BETWEEN ? AND ?", +/* 18 */ "INSERT INTO %Q.'%q_content' VALUES(%z)", +/* 19 */ "SELECT block FROM %Q.'%q_segments' WHERE blockid = ?", +/* 20 */ "DELETE FROM %Q.'%q_docsize' WHERE docid = ?", +/* 21 */ "REPLACE INTO %Q.'%q_docsize' VALUES(?,?)", +/* 22 */ "SELECT size FROM %Q.'%q_docsize' WHERE docid=?", +/* 23 */ "SELECT value FROM %Q.'%q_stat' WHERE id=0", +/* 24 */ "REPLACE INTO %Q.'%q_stat' VALUES(0,?)", + }; + int rc = SQLITE_OK; + sqlite3_stmt *pStmt; + + assert( SizeofArray(azSql)==SizeofArray(p->aStmt) ); + assert( eStmt=0 ); + + pStmt = p->aStmt[eStmt]; + if( !pStmt ){ + char *zSql; + if( eStmt==SQL_CONTENT_INSERT ){ + int i; /* Iterator variable */ + char *zVarlist; /* The "?, ?, ..." string */ + zVarlist = (char *)sqlite3_malloc(2*p->nColumn+2); + if( !zVarlist ){ + *pp = 0; + return SQLITE_NOMEM; + } + zVarlist[0] = '?'; + zVarlist[p->nColumn*2+1] = '\0'; + for(i=1; i<=p->nColumn; i++){ + zVarlist[i*2-1] = ','; + zVarlist[i*2] = '?'; + } + zSql = sqlite3_mprintf(azSql[eStmt], p->zDb, p->zName, zVarlist); + }else{ + zSql = sqlite3_mprintf(azSql[eStmt], p->zDb, p->zName); + } + if( !zSql ){ + rc = SQLITE_NOMEM; + }else{ + rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, NULL); + sqlite3_free(zSql); + assert( rc==SQLITE_OK || pStmt==0 ); + p->aStmt[eStmt] = pStmt; + } + } + if( apVal ){ + int i; + int nParam = sqlite3_bind_parameter_count(pStmt); + for(i=0; rc==SQLITE_OK && inSpace = 100; + p->aData = (char *)&p[1]; + p->nData = 0; + } + else if( p->nData+FTS3_VARINT_MAX+1>p->nSpace ){ + int nNew = p->nSpace * 2; + p = sqlite3_realloc(p, sizeof(*p) + nNew); + if( !p ){ + sqlite3_free(*pp); + *pp = 0; + return SQLITE_NOMEM; + } + p->nSpace = nNew; + p->aData = (char *)&p[1]; + } + + /* Append the new serialized varint to the end of the list. */ + p->nData += sqlite3Fts3PutVarint(&p->aData[p->nData], i); + p->aData[p->nData] = '\0'; + *pp = p; + return SQLITE_OK; +} + +/* +** Add a docid/column/position entry to a PendingList structure. Non-zero +** is returned if the structure is sqlite3_realloced as part of adding +** the entry. Otherwise, zero. +** +** If an OOM error occurs, *pRc is set to SQLITE_NOMEM before returning. +** Zero is always returned in this case. Otherwise, if no OOM error occurs, +** it is set to SQLITE_OK. +*/ +static int fts3PendingListAppend( + PendingList **pp, /* IN/OUT: PendingList structure */ + sqlite3_int64 iDocid, /* Docid for entry to add */ + sqlite3_int64 iCol, /* Column for entry to add */ + sqlite3_int64 iPos, /* Position of term for entry to add */ + int *pRc /* OUT: Return code */ +){ + PendingList *p = *pp; + int rc = SQLITE_OK; + + assert( !p || p->iLastDocid<=iDocid ); + + if( !p || p->iLastDocid!=iDocid ){ + sqlite3_int64 iDelta = iDocid - (p ? p->iLastDocid : 0); + if( p ){ + assert( p->nDatanSpace ); + assert( p->aData[p->nData]==0 ); + p->nData++; + } + if( SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, iDelta)) ){ + goto pendinglistappend_out; + } + p->iLastCol = -1; + p->iLastPos = 0; + p->iLastDocid = iDocid; + } + if( iCol>0 && p->iLastCol!=iCol ){ + if( SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, 1)) + || SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, iCol)) + ){ + goto pendinglistappend_out; + } + p->iLastCol = iCol; + p->iLastPos = 0; + } + if( iCol>=0 ){ + assert( iPos>p->iLastPos || (iPos==0 && p->iLastPos==0) ); + rc = fts3PendingListAppendVarint(&p, 2+iPos-p->iLastPos); + if( rc==SQLITE_OK ){ + p->iLastPos = iPos; + } + } + + pendinglistappend_out: + *pRc = rc; + if( p!=*pp ){ + *pp = p; + return 1; + } + return 0; +} + +/* +** Tokenize the nul-terminated string zText and add all tokens to the +** pending-terms hash-table. The docid used is that currently stored in +** p->iPrevDocid, and the column is specified by argument iCol. +** +** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code. +*/ +static int fts3PendingTermsAdd( + Fts3Table *p, /* FTS table into which text will be inserted */ + const char *zText, /* Text of document to be inseted */ + int iCol, /* Column number into which text is inserted */ + u32 *pnWord /* OUT: Number of tokens inserted */ +){ + int rc; + int iStart; + int iEnd; + int iPos; + int nWord = 0; + + char const *zToken; + int nToken; + + sqlite3_tokenizer *pTokenizer = p->pTokenizer; + sqlite3_tokenizer_module const *pModule = pTokenizer->pModule; + sqlite3_tokenizer_cursor *pCsr; + int (*xNext)(sqlite3_tokenizer_cursor *pCursor, + const char**,int*,int*,int*,int*); + + assert( pTokenizer && pModule ); + + rc = pModule->xOpen(pTokenizer, zText, -1, &pCsr); + if( rc!=SQLITE_OK ){ + return rc; + } + pCsr->pTokenizer = pTokenizer; + + xNext = pModule->xNext; + while( SQLITE_OK==rc + && SQLITE_OK==(rc = xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos)) + ){ + PendingList *pList; + + if( iPos>=nWord ) nWord = iPos+1; + + /* Positions cannot be negative; we use -1 as a terminator internally. + ** Tokens must have a non-zero length. + */ + if( iPos<0 || !zToken || nToken<=0 ){ + rc = SQLITE_ERROR; + break; + } + + pList = (PendingList *)fts3HashFind(&p->pendingTerms, zToken, nToken); + if( pList ){ + p->nPendingData -= (pList->nData + nToken + sizeof(Fts3HashElem)); + } + if( fts3PendingListAppend(&pList, p->iPrevDocid, iCol, iPos, &rc) ){ + if( pList==fts3HashInsert(&p->pendingTerms, zToken, nToken, pList) ){ + /* Malloc failed while inserting the new entry. This can only + ** happen if there was no previous entry for this token. + */ + assert( 0==fts3HashFind(&p->pendingTerms, zToken, nToken) ); + sqlite3_free(pList); + rc = SQLITE_NOMEM; + } + } + if( rc==SQLITE_OK ){ + p->nPendingData += (pList->nData + nToken + sizeof(Fts3HashElem)); + } + } + + pModule->xClose(pCsr); + *pnWord = nWord; + return (rc==SQLITE_DONE ? SQLITE_OK : rc); +} + +/* +** Calling this function indicates that subsequent calls to +** fts3PendingTermsAdd() are to add term/position-list pairs for the +** contents of the document with docid iDocid. +*/ +static int fts3PendingTermsDocid(Fts3Table *p, sqlite_int64 iDocid){ + /* TODO(shess) Explore whether partially flushing the buffer on + ** forced-flush would provide better performance. I suspect that if + ** we ordered the doclists by size and flushed the largest until the + ** buffer was half empty, that would let the less frequent terms + ** generate longer doclists. + */ + if( iDocid<=p->iPrevDocid || p->nPendingData>p->nMaxPendingData ){ + int rc = sqlite3Fts3PendingTermsFlush(p); + if( rc!=SQLITE_OK ) return rc; + } + p->iPrevDocid = iDocid; + return SQLITE_OK; +} + +SQLITE_PRIVATE void sqlite3Fts3PendingTermsClear(Fts3Table *p){ + Fts3HashElem *pElem; + for(pElem=fts3HashFirst(&p->pendingTerms); pElem; pElem=fts3HashNext(pElem)){ + sqlite3_free(fts3HashData(pElem)); + } + fts3HashClear(&p->pendingTerms); + p->nPendingData = 0; +} + +/* +** This function is called by the xUpdate() method as part of an INSERT +** operation. It adds entries for each term in the new record to the +** pendingTerms hash table. +** +** Argument apVal is the same as the similarly named argument passed to +** fts3InsertData(). Parameter iDocid is the docid of the new row. +*/ +static int fts3InsertTerms(Fts3Table *p, sqlite3_value **apVal, u32 *aSz){ + int i; /* Iterator variable */ + for(i=2; inColumn+2; i++){ + const char *zText = (const char *)sqlite3_value_text(apVal[i]); + if( zText ){ + int rc = fts3PendingTermsAdd(p, zText, i-2, &aSz[i-2]); + if( rc!=SQLITE_OK ){ + return rc; + } + } + } + return SQLITE_OK; +} + +/* +** This function is called by the xUpdate() method for an INSERT operation. +** The apVal parameter is passed a copy of the apVal argument passed by +** SQLite to the xUpdate() method. i.e: +** +** apVal[0] Not used for INSERT. +** apVal[1] rowid +** apVal[2] Left-most user-defined column +** ... +** apVal[p->nColumn+1] Right-most user-defined column +** apVal[p->nColumn+2] Hidden column with same name as table +** apVal[p->nColumn+3] Hidden "docid" column (alias for rowid) +*/ +static int fts3InsertData( + Fts3Table *p, /* Full-text table */ + sqlite3_value **apVal, /* Array of values to insert */ + sqlite3_int64 *piDocid /* OUT: Docid for row just inserted */ +){ + int rc; /* Return code */ + sqlite3_stmt *pContentInsert; /* INSERT INTO %_content VALUES(...) */ + + /* Locate the statement handle used to insert data into the %_content + ** table. The SQL for this statement is: + ** + ** INSERT INTO %_content VALUES(?, ?, ?, ...) + ** + ** The statement features N '?' variables, where N is the number of user + ** defined columns in the FTS3 table, plus one for the docid field. + */ + rc = fts3SqlStmt(p, SQL_CONTENT_INSERT, &pContentInsert, &apVal[1]); + if( rc!=SQLITE_OK ){ + return rc; + } + + /* There is a quirk here. The users INSERT statement may have specified + ** a value for the "rowid" field, for the "docid" field, or for both. + ** Which is a problem, since "rowid" and "docid" are aliases for the + ** same value. For example: + ** + ** INSERT INTO fts3tbl(rowid, docid) VALUES(1, 2); + ** + ** In FTS3, this is an error. It is an error to specify non-NULL values + ** for both docid and some other rowid alias. + */ + if( SQLITE_NULL!=sqlite3_value_type(apVal[3+p->nColumn]) ){ + if( SQLITE_NULL==sqlite3_value_type(apVal[0]) + && SQLITE_NULL!=sqlite3_value_type(apVal[1]) + ){ + /* A rowid/docid conflict. */ + return SQLITE_ERROR; + } + rc = sqlite3_bind_value(pContentInsert, 1, apVal[3+p->nColumn]); + if( rc!=SQLITE_OK ) return rc; + } + + /* Execute the statement to insert the record. Set *piDocid to the + ** new docid value. + */ + sqlite3_step(pContentInsert); + rc = sqlite3_reset(pContentInsert); + + *piDocid = sqlite3_last_insert_rowid(p->db); + return rc; +} + + + +/* +** Remove all data from the FTS3 table. Clear the hash table containing +** pending terms. +*/ +static int fts3DeleteAll(Fts3Table *p){ + int rc = SQLITE_OK; /* Return code */ + + /* Discard the contents of the pending-terms hash table. */ + sqlite3Fts3PendingTermsClear(p); + + /* Delete everything from the %_content, %_segments and %_segdir tables. */ + fts3SqlExec(&rc, p, SQL_DELETE_ALL_CONTENT, 0); + fts3SqlExec(&rc, p, SQL_DELETE_ALL_SEGMENTS, 0); + fts3SqlExec(&rc, p, SQL_DELETE_ALL_SEGDIR, 0); + if( p->bHasDocsize ){ + fts3SqlExec(&rc, p, SQL_DELETE_ALL_DOCSIZE, 0); + fts3SqlExec(&rc, p, SQL_DELETE_ALL_STAT, 0); + } + return rc; +} + +/* +** The first element in the apVal[] array is assumed to contain the docid +** (an integer) of a row about to be deleted. Remove all terms from the +** full-text index. +*/ +static void fts3DeleteTerms( + int *pRC, /* Result code */ + Fts3Table *p, /* The FTS table to delete from */ + sqlite3_value **apVal, /* apVal[] contains the docid to be deleted */ + u32 *aSz /* Sizes of deleted document written here */ +){ + int rc; + sqlite3_stmt *pSelect; + + if( *pRC ) return; + rc = fts3SqlStmt(p, SQL_SELECT_CONTENT_BY_ROWID, &pSelect, apVal); + if( rc==SQLITE_OK ){ + if( SQLITE_ROW==sqlite3_step(pSelect) ){ + int i; + for(i=1; i<=p->nColumn; i++){ + const char *zText = (const char *)sqlite3_column_text(pSelect, i); + rc = fts3PendingTermsAdd(p, zText, -1, &aSz[i-1]); + if( rc!=SQLITE_OK ){ + sqlite3_reset(pSelect); + *pRC = rc; + return; + } + } + } + rc = sqlite3_reset(pSelect); + }else{ + sqlite3_reset(pSelect); + } + *pRC = rc; +} + +/* +** Forward declaration to account for the circular dependency between +** functions fts3SegmentMerge() and fts3AllocateSegdirIdx(). +*/ +static int fts3SegmentMerge(Fts3Table *, int); + +/* +** This function allocates a new level iLevel index in the segdir table. +** Usually, indexes are allocated within a level sequentially starting +** with 0, so the allocated index is one greater than the value returned +** by: +** +** SELECT max(idx) FROM %_segdir WHERE level = :iLevel +** +** However, if there are already FTS3_MERGE_COUNT indexes at the requested +** level, they are merged into a single level (iLevel+1) segment and the +** allocated index is 0. +** +** If successful, *piIdx is set to the allocated index slot and SQLITE_OK +** returned. Otherwise, an SQLite error code is returned. +*/ +static int fts3AllocateSegdirIdx(Fts3Table *p, int iLevel, int *piIdx){ + int rc; /* Return Code */ + sqlite3_stmt *pNextIdx; /* Query for next idx at level iLevel */ + int iNext = 0; /* Result of query pNextIdx */ + + /* Set variable iNext to the next available segdir index at level iLevel. */ + rc = fts3SqlStmt(p, SQL_NEXT_SEGMENT_INDEX, &pNextIdx, 0); + if( rc==SQLITE_OK ){ + sqlite3_bind_int(pNextIdx, 1, iLevel); + if( SQLITE_ROW==sqlite3_step(pNextIdx) ){ + iNext = sqlite3_column_int(pNextIdx, 0); + } + rc = sqlite3_reset(pNextIdx); + } + + if( rc==SQLITE_OK ){ + /* If iNext is FTS3_MERGE_COUNT, indicating that level iLevel is already + ** full, merge all segments in level iLevel into a single iLevel+1 + ** segment and allocate (newly freed) index 0 at level iLevel. Otherwise, + ** if iNext is less than FTS3_MERGE_COUNT, allocate index iNext. + */ + if( iNext>=FTS3_MERGE_COUNT ){ + rc = fts3SegmentMerge(p, iLevel); + *piIdx = 0; + }else{ + *piIdx = iNext; + } + } + + return rc; +} + +/* +** Move the iterator passed as the first argument to the next term in the +** segment. If successful, SQLITE_OK is returned. If there is no next term, +** SQLITE_DONE. Otherwise, an SQLite error code. +*/ +static int fts3SegReaderNext(Fts3SegReader *pReader){ + char *pNext; /* Cursor variable */ + int nPrefix; /* Number of bytes in term prefix */ + int nSuffix; /* Number of bytes in term suffix */ + + if( !pReader->aDoclist ){ + pNext = pReader->aNode; + }else{ + pNext = &pReader->aDoclist[pReader->nDoclist]; + } + + if( !pNext || pNext>=&pReader->aNode[pReader->nNode] ){ + int rc; + if( fts3SegReaderIsPending(pReader) ){ + Fts3HashElem *pElem = *(pReader->ppNextElem); + if( pElem==0 ){ + pReader->aNode = 0; + }else{ + PendingList *pList = (PendingList *)fts3HashData(pElem); + pReader->zTerm = (char *)fts3HashKey(pElem); + pReader->nTerm = fts3HashKeysize(pElem); + pReader->nNode = pReader->nDoclist = pList->nData + 1; + pReader->aNode = pReader->aDoclist = pList->aData; + pReader->ppNextElem++; + assert( pReader->aNode ); + } + return SQLITE_OK; + } + if( !pReader->pStmt ){ + pReader->aNode = 0; + return SQLITE_OK; + } + rc = sqlite3_step(pReader->pStmt); + if( rc!=SQLITE_ROW ){ + pReader->aNode = 0; + return (rc==SQLITE_DONE ? SQLITE_OK : rc); + } + pReader->nNode = sqlite3_column_bytes(pReader->pStmt, 0); + pReader->aNode = (char *)sqlite3_column_blob(pReader->pStmt, 0); + pNext = pReader->aNode; + } + + pNext += sqlite3Fts3GetVarint32(pNext, &nPrefix); + pNext += sqlite3Fts3GetVarint32(pNext, &nSuffix); + + if( nPrefix+nSuffix>pReader->nTermAlloc ){ + int nNew = (nPrefix+nSuffix)*2; + char *zNew = sqlite3_realloc(pReader->zTerm, nNew); + if( !zNew ){ + return SQLITE_NOMEM; + } + pReader->zTerm = zNew; + pReader->nTermAlloc = nNew; + } + memcpy(&pReader->zTerm[nPrefix], pNext, nSuffix); + pReader->nTerm = nPrefix+nSuffix; + pNext += nSuffix; + pNext += sqlite3Fts3GetVarint32(pNext, &pReader->nDoclist); + assert( pNext<&pReader->aNode[pReader->nNode] ); + pReader->aDoclist = pNext; + pReader->pOffsetList = 0; + return SQLITE_OK; +} + +/* +** Set the SegReader to point to the first docid in the doclist associated +** with the current term. +*/ +static void fts3SegReaderFirstDocid(Fts3SegReader *pReader){ + int n; + assert( pReader->aDoclist ); + assert( !pReader->pOffsetList ); + n = sqlite3Fts3GetVarint(pReader->aDoclist, &pReader->iDocid); + pReader->pOffsetList = &pReader->aDoclist[n]; +} + +/* +** Advance the SegReader to point to the next docid in the doclist +** associated with the current term. +** +** If arguments ppOffsetList and pnOffsetList are not NULL, then +** *ppOffsetList is set to point to the first column-offset list +** in the doclist entry (i.e. immediately past the docid varint). +** *pnOffsetList is set to the length of the set of column-offset +** lists, not including the nul-terminator byte. For example: +*/ +static void fts3SegReaderNextDocid( + Fts3SegReader *pReader, + char **ppOffsetList, + int *pnOffsetList +){ + char *p = pReader->pOffsetList; + char c = 0; + + /* Pointer p currently points at the first byte of an offset list. The + ** following two lines advance it to point one byte past the end of + ** the same offset list. + */ + while( *p | c ) c = *p++ & 0x80; + p++; + + /* If required, populate the output variables with a pointer to and the + ** size of the previous offset-list. + */ + if( ppOffsetList ){ + *ppOffsetList = pReader->pOffsetList; + *pnOffsetList = (int)(p - pReader->pOffsetList - 1); + } + + /* If there are no more entries in the doclist, set pOffsetList to + ** NULL. Otherwise, set Fts3SegReader.iDocid to the next docid and + ** Fts3SegReader.pOffsetList to point to the next offset list before + ** returning. + */ + if( p>=&pReader->aDoclist[pReader->nDoclist] ){ + pReader->pOffsetList = 0; + }else{ + sqlite3_int64 iDelta; + pReader->pOffsetList = p + sqlite3Fts3GetVarint(p, &iDelta); + pReader->iDocid += iDelta; + } +} + +/* +** Free all allocations associated with the iterator passed as the +** second argument. +*/ +SQLITE_PRIVATE void sqlite3Fts3SegReaderFree(Fts3Table *p, Fts3SegReader *pReader){ + if( pReader ){ + if( pReader->pStmt ){ + /* Move the leaf-range SELECT statement to the aLeavesStmt[] array, + ** so that it can be reused when required by another query. + */ + assert( p->nLeavesStmtnLeavesTotal ); + sqlite3_reset(pReader->pStmt); + p->aLeavesStmt[p->nLeavesStmt++] = pReader->pStmt; + } + if( !fts3SegReaderIsPending(pReader) ){ + sqlite3_free(pReader->zTerm); + } + sqlite3_free(pReader); + } +} + +/* +** Allocate a new SegReader object. +*/ +SQLITE_PRIVATE int sqlite3Fts3SegReaderNew( + Fts3Table *p, /* Virtual table handle */ + int iAge, /* Segment "age". */ + sqlite3_int64 iStartLeaf, /* First leaf to traverse */ + sqlite3_int64 iEndLeaf, /* Final leaf to traverse */ + sqlite3_int64 iEndBlock, /* Final block of segment */ + const char *zRoot, /* Buffer containing root node */ + int nRoot, /* Size of buffer containing root node */ + Fts3SegReader **ppReader /* OUT: Allocated Fts3SegReader */ +){ + int rc = SQLITE_OK; /* Return code */ + Fts3SegReader *pReader; /* Newly allocated SegReader object */ + int nExtra = 0; /* Bytes to allocate segment root node */ + + if( iStartLeaf==0 ){ + nExtra = nRoot; + } + + pReader = (Fts3SegReader *)sqlite3_malloc(sizeof(Fts3SegReader) + nExtra); + if( !pReader ){ + return SQLITE_NOMEM; + } + memset(pReader, 0, sizeof(Fts3SegReader)); + pReader->iStartBlock = iStartLeaf; + pReader->iIdx = iAge; + pReader->iEndBlock = iEndBlock; + + if( nExtra ){ + /* The entire segment is stored in the root node. */ + pReader->aNode = (char *)&pReader[1]; + pReader->nNode = nRoot; + memcpy(pReader->aNode, zRoot, nRoot); + }else{ + /* If the text of the SQL statement to iterate through a contiguous + ** set of entries in the %_segments table has not yet been composed, + ** compose it now. + */ + if( !p->zSelectLeaves ){ + p->zSelectLeaves = sqlite3_mprintf( + "SELECT block FROM %Q.'%q_segments' WHERE blockid BETWEEN ? AND ? " + "ORDER BY blockid", p->zDb, p->zName + ); + if( !p->zSelectLeaves ){ + rc = SQLITE_NOMEM; + goto finished; + } + } + + /* If there are no free statements in the aLeavesStmt[] array, prepare + ** a new statement now. Otherwise, reuse a prepared statement from + ** aLeavesStmt[]. + */ + if( p->nLeavesStmt==0 ){ + if( p->nLeavesTotal==p->nLeavesAlloc ){ + int nNew = p->nLeavesAlloc + 16; + sqlite3_stmt **aNew = (sqlite3_stmt **)sqlite3_realloc( + p->aLeavesStmt, nNew*sizeof(sqlite3_stmt *) + ); + if( !aNew ){ + rc = SQLITE_NOMEM; + goto finished; + } + p->nLeavesAlloc = nNew; + p->aLeavesStmt = aNew; + } + rc = sqlite3_prepare_v2(p->db, p->zSelectLeaves, -1, &pReader->pStmt, 0); + if( rc!=SQLITE_OK ){ + goto finished; + } + p->nLeavesTotal++; + }else{ + pReader->pStmt = p->aLeavesStmt[--p->nLeavesStmt]; + } + + /* Bind the start and end leaf blockids to the prepared SQL statement. */ + sqlite3_bind_int64(pReader->pStmt, 1, iStartLeaf); + sqlite3_bind_int64(pReader->pStmt, 2, iEndLeaf); + } + rc = fts3SegReaderNext(pReader); + + finished: + if( rc==SQLITE_OK ){ + *ppReader = pReader; + }else{ + sqlite3Fts3SegReaderFree(p, pReader); + } + return rc; +} + +/* +** This is a comparison function used as a qsort() callback when sorting +** an array of pending terms by term. This occurs as part of flushing +** the contents of the pending-terms hash table to the database. +*/ +static int fts3CompareElemByTerm(const void *lhs, const void *rhs){ + char *z1 = fts3HashKey(*(Fts3HashElem **)lhs); + char *z2 = fts3HashKey(*(Fts3HashElem **)rhs); + int n1 = fts3HashKeysize(*(Fts3HashElem **)lhs); + int n2 = fts3HashKeysize(*(Fts3HashElem **)rhs); + + int n = (n1pendingTerms); pE; pE=fts3HashNext(pE)){ + char *zKey = (char *)fts3HashKey(pE); + int nKey = fts3HashKeysize(pE); + if( nTerm==0 || (nKey>=nTerm && 0==memcmp(zKey, zTerm, nTerm)) ){ + if( nElem==nAlloc ){ + Fts3HashElem **aElem2; + nAlloc += 16; + aElem2 = (Fts3HashElem **)sqlite3_realloc( + aElem, nAlloc*sizeof(Fts3HashElem *) + ); + if( !aElem2 ){ + rc = SQLITE_NOMEM; + nElem = 0; + break; + } + aElem = aElem2; + } + aElem[nElem++] = pE; + } + } + + /* If more than one term matches the prefix, sort the Fts3HashElem + ** objects in term order using qsort(). This uses the same comparison + ** callback as is used when flushing terms to disk. + */ + if( nElem>1 ){ + qsort(aElem, nElem, sizeof(Fts3HashElem *), fts3CompareElemByTerm); + } + + }else{ + Fts3HashElem *pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm); + if( pE ){ + aElem = &pE; + nElem = 1; + } + } + + if( nElem>0 ){ + int nByte = sizeof(Fts3SegReader) + (nElem+1)*sizeof(Fts3HashElem *); + pReader = (Fts3SegReader *)sqlite3_malloc(nByte); + if( !pReader ){ + rc = SQLITE_NOMEM; + }else{ + memset(pReader, 0, nByte); + pReader->iIdx = 0x7FFFFFFF; + pReader->ppNextElem = (Fts3HashElem **)&pReader[1]; + memcpy(pReader->ppNextElem, aElem, nElem*sizeof(Fts3HashElem *)); + fts3SegReaderNext(pReader); + } + } + + if( isPrefix ){ + sqlite3_free(aElem); + } + *ppReader = pReader; + return rc; +} + + +/* +** The second argument to this function is expected to be a statement of +** the form: +** +** SELECT +** idx, -- col 0 +** start_block, -- col 1 +** leaves_end_block, -- col 2 +** end_block, -- col 3 +** root -- col 4 +** FROM %_segdir ... +** +** This function allocates and initializes a Fts3SegReader structure to +** iterate through the terms stored in the segment identified by the +** current row that pStmt is pointing to. +** +** If successful, the Fts3SegReader is left pointing to the first term +** in the segment and SQLITE_OK is returned. Otherwise, an SQLite error +** code is returned. +*/ +static int fts3SegReaderNew( + Fts3Table *p, /* Virtual table handle */ + sqlite3_stmt *pStmt, /* See above */ + int iAge, /* Segment "age". */ + Fts3SegReader **ppReader /* OUT: Allocated Fts3SegReader */ +){ + return sqlite3Fts3SegReaderNew(p, iAge, + sqlite3_column_int64(pStmt, 1), + sqlite3_column_int64(pStmt, 2), + sqlite3_column_int64(pStmt, 3), + sqlite3_column_blob(pStmt, 4), + sqlite3_column_bytes(pStmt, 4), + ppReader + ); +} + +/* +** Compare the entries pointed to by two Fts3SegReader structures. +** Comparison is as follows: +** +** 1) EOF is greater than not EOF. +** +** 2) The current terms (if any) are compared using memcmp(). If one +** term is a prefix of another, the longer term is considered the +** larger. +** +** 3) By segment age. An older segment is considered larger. +*/ +static int fts3SegReaderCmp(Fts3SegReader *pLhs, Fts3SegReader *pRhs){ + int rc; + if( pLhs->aNode && pRhs->aNode ){ + int rc2 = pLhs->nTerm - pRhs->nTerm; + if( rc2<0 ){ + rc = memcmp(pLhs->zTerm, pRhs->zTerm, pLhs->nTerm); + }else{ + rc = memcmp(pLhs->zTerm, pRhs->zTerm, pRhs->nTerm); + } + if( rc==0 ){ + rc = rc2; + } + }else{ + rc = (pLhs->aNode==0) - (pRhs->aNode==0); + } + if( rc==0 ){ + rc = pRhs->iIdx - pLhs->iIdx; + } + assert( rc!=0 ); + return rc; +} + +/* +** A different comparison function for SegReader structures. In this +** version, it is assumed that each SegReader points to an entry in +** a doclist for identical terms. Comparison is made as follows: +** +** 1) EOF (end of doclist in this case) is greater than not EOF. +** +** 2) By current docid. +** +** 3) By segment age. An older segment is considered larger. +*/ +static int fts3SegReaderDoclistCmp(Fts3SegReader *pLhs, Fts3SegReader *pRhs){ + int rc = (pLhs->pOffsetList==0)-(pRhs->pOffsetList==0); + if( rc==0 ){ + if( pLhs->iDocid==pRhs->iDocid ){ + rc = pRhs->iIdx - pLhs->iIdx; + }else{ + rc = (pLhs->iDocid > pRhs->iDocid) ? 1 : -1; + } + } + assert( pLhs->aNode && pRhs->aNode ); + return rc; +} + +/* +** Compare the term that the Fts3SegReader object passed as the first argument +** points to with the term specified by arguments zTerm and nTerm. +** +** If the pSeg iterator is already at EOF, return 0. Otherwise, return +** -ve if the pSeg term is less than zTerm/nTerm, 0 if the two terms are +** equal, or +ve if the pSeg term is greater than zTerm/nTerm. +*/ +static int fts3SegReaderTermCmp( + Fts3SegReader *pSeg, /* Segment reader object */ + const char *zTerm, /* Term to compare to */ + int nTerm /* Size of term zTerm in bytes */ +){ + int res = 0; + if( pSeg->aNode ){ + if( pSeg->nTerm>nTerm ){ + res = memcmp(pSeg->zTerm, zTerm, nTerm); + }else{ + res = memcmp(pSeg->zTerm, zTerm, pSeg->nTerm); + } + if( res==0 ){ + res = pSeg->nTerm-nTerm; + } + } + return res; +} + +/* +** Argument apSegment is an array of nSegment elements. It is known that +** the final (nSegment-nSuspect) members are already in sorted order +** (according to the comparison function provided). This function shuffles +** the array around until all entries are in sorted order. +*/ +static void fts3SegReaderSort( + Fts3SegReader **apSegment, /* Array to sort entries of */ + int nSegment, /* Size of apSegment array */ + int nSuspect, /* Unsorted entry count */ + int (*xCmp)(Fts3SegReader *, Fts3SegReader *) /* Comparison function */ +){ + int i; /* Iterator variable */ + + assert( nSuspect<=nSegment ); + + if( nSuspect==nSegment ) nSuspect--; + for(i=nSuspect-1; i>=0; i--){ + int j; + for(j=i; j<(nSegment-1); j++){ + Fts3SegReader *pTmp; + if( xCmp(apSegment[j], apSegment[j+1])<0 ) break; + pTmp = apSegment[j+1]; + apSegment[j+1] = apSegment[j]; + apSegment[j] = pTmp; + } + } + +#ifndef NDEBUG + /* Check that the list really is sorted now. */ + for(i=0; i<(nSuspect-1); i++){ + assert( xCmp(apSegment[i], apSegment[i+1])<0 ); + } +#endif +} + +/* +** Insert a record into the %_segments table. +*/ +static int fts3WriteSegment( + Fts3Table *p, /* Virtual table handle */ + sqlite3_int64 iBlock, /* Block id for new block */ + char *z, /* Pointer to buffer containing block data */ + int n /* Size of buffer z in bytes */ +){ + sqlite3_stmt *pStmt; + int rc = fts3SqlStmt(p, SQL_INSERT_SEGMENTS, &pStmt, 0); + if( rc==SQLITE_OK ){ + sqlite3_bind_int64(pStmt, 1, iBlock); + sqlite3_bind_blob(pStmt, 2, z, n, SQLITE_STATIC); + sqlite3_step(pStmt); + rc = sqlite3_reset(pStmt); + } + return rc; +} + +/* +** Insert a record into the %_segdir table. +*/ +static int fts3WriteSegdir( + Fts3Table *p, /* Virtual table handle */ + int iLevel, /* Value for "level" field */ + int iIdx, /* Value for "idx" field */ + sqlite3_int64 iStartBlock, /* Value for "start_block" field */ + sqlite3_int64 iLeafEndBlock, /* Value for "leaves_end_block" field */ + sqlite3_int64 iEndBlock, /* Value for "end_block" field */ + char *zRoot, /* Blob value for "root" field */ + int nRoot /* Number of bytes in buffer zRoot */ +){ + sqlite3_stmt *pStmt; + int rc = fts3SqlStmt(p, SQL_INSERT_SEGDIR, &pStmt, 0); + if( rc==SQLITE_OK ){ + sqlite3_bind_int(pStmt, 1, iLevel); + sqlite3_bind_int(pStmt, 2, iIdx); + sqlite3_bind_int64(pStmt, 3, iStartBlock); + sqlite3_bind_int64(pStmt, 4, iLeafEndBlock); + sqlite3_bind_int64(pStmt, 5, iEndBlock); + sqlite3_bind_blob(pStmt, 6, zRoot, nRoot, SQLITE_STATIC); + sqlite3_step(pStmt); + rc = sqlite3_reset(pStmt); + } + return rc; +} + +/* +** Return the size of the common prefix (if any) shared by zPrev and +** zNext, in bytes. For example, +** +** fts3PrefixCompress("abc", 3, "abcdef", 6) // returns 3 +** fts3PrefixCompress("abX", 3, "abcdef", 6) // returns 2 +** fts3PrefixCompress("abX", 3, "Xbcdef", 6) // returns 0 +*/ +static int fts3PrefixCompress( + const char *zPrev, /* Buffer containing previous term */ + int nPrev, /* Size of buffer zPrev in bytes */ + const char *zNext, /* Buffer containing next term */ + int nNext /* Size of buffer zNext in bytes */ +){ + int n; + UNUSED_PARAMETER(nNext); + for(n=0; nnData; /* Current size of node in bytes */ + int nReq = nData; /* Required space after adding zTerm */ + int nPrefix; /* Number of bytes of prefix compression */ + int nSuffix; /* Suffix length */ + + nPrefix = fts3PrefixCompress(pTree->zTerm, pTree->nTerm, zTerm, nTerm); + nSuffix = nTerm-nPrefix; + + nReq += sqlite3Fts3VarintLen(nPrefix)+sqlite3Fts3VarintLen(nSuffix)+nSuffix; + if( nReq<=p->nNodeSize || !pTree->zTerm ){ + + if( nReq>p->nNodeSize ){ + /* An unusual case: this is the first term to be added to the node + ** and the static node buffer (p->nNodeSize bytes) is not large + ** enough. Use a separately malloced buffer instead This wastes + ** p->nNodeSize bytes, but since this scenario only comes about when + ** the database contain two terms that share a prefix of almost 2KB, + ** this is not expected to be a serious problem. + */ + assert( pTree->aData==(char *)&pTree[1] ); + pTree->aData = (char *)sqlite3_malloc(nReq); + if( !pTree->aData ){ + return SQLITE_NOMEM; + } + } + + if( pTree->zTerm ){ + /* There is no prefix-length field for first term in a node */ + nData += sqlite3Fts3PutVarint(&pTree->aData[nData], nPrefix); + } + + nData += sqlite3Fts3PutVarint(&pTree->aData[nData], nSuffix); + memcpy(&pTree->aData[nData], &zTerm[nPrefix], nSuffix); + pTree->nData = nData + nSuffix; + pTree->nEntry++; + + if( isCopyTerm ){ + if( pTree->nMalloczMalloc, nTerm*2); + if( !zNew ){ + return SQLITE_NOMEM; + } + pTree->nMalloc = nTerm*2; + pTree->zMalloc = zNew; + } + pTree->zTerm = pTree->zMalloc; + memcpy(pTree->zTerm, zTerm, nTerm); + pTree->nTerm = nTerm; + }else{ + pTree->zTerm = (char *)zTerm; + pTree->nTerm = nTerm; + } + return SQLITE_OK; + } + } + + /* If control flows to here, it was not possible to append zTerm to the + ** current node. Create a new node (a right-sibling of the current node). + ** If this is the first node in the tree, the term is added to it. + ** + ** Otherwise, the term is not added to the new node, it is left empty for + ** now. Instead, the term is inserted into the parent of pTree. If pTree + ** has no parent, one is created here. + */ + pNew = (SegmentNode *)sqlite3_malloc(sizeof(SegmentNode) + p->nNodeSize); + if( !pNew ){ + return SQLITE_NOMEM; + } + memset(pNew, 0, sizeof(SegmentNode)); + pNew->nData = 1 + FTS3_VARINT_MAX; + pNew->aData = (char *)&pNew[1]; + + if( pTree ){ + SegmentNode *pParent = pTree->pParent; + rc = fts3NodeAddTerm(p, &pParent, isCopyTerm, zTerm, nTerm); + if( pTree->pParent==0 ){ + pTree->pParent = pParent; + } + pTree->pRight = pNew; + pNew->pLeftmost = pTree->pLeftmost; + pNew->pParent = pParent; + pNew->zMalloc = pTree->zMalloc; + pNew->nMalloc = pTree->nMalloc; + pTree->zMalloc = 0; + }else{ + pNew->pLeftmost = pNew; + rc = fts3NodeAddTerm(p, &pNew, isCopyTerm, zTerm, nTerm); + } + + *ppTree = pNew; + return rc; +} + +/* +** Helper function for fts3NodeWrite(). +*/ +static int fts3TreeFinishNode( + SegmentNode *pTree, + int iHeight, + sqlite3_int64 iLeftChild +){ + int nStart; + assert( iHeight>=1 && iHeight<128 ); + nStart = FTS3_VARINT_MAX - sqlite3Fts3VarintLen(iLeftChild); + pTree->aData[nStart] = (char)iHeight; + sqlite3Fts3PutVarint(&pTree->aData[nStart+1], iLeftChild); + return nStart; +} + +/* +** Write the buffer for the segment node pTree and all of its peers to the +** database. Then call this function recursively to write the parent of +** pTree and its peers to the database. +** +** Except, if pTree is a root node, do not write it to the database. Instead, +** set output variables *paRoot and *pnRoot to contain the root node. +** +** If successful, SQLITE_OK is returned and output variable *piLast is +** set to the largest blockid written to the database (or zero if no +** blocks were written to the db). Otherwise, an SQLite error code is +** returned. +*/ +static int fts3NodeWrite( + Fts3Table *p, /* Virtual table handle */ + SegmentNode *pTree, /* SegmentNode handle */ + int iHeight, /* Height of this node in tree */ + sqlite3_int64 iLeaf, /* Block id of first leaf node */ + sqlite3_int64 iFree, /* Block id of next free slot in %_segments */ + sqlite3_int64 *piLast, /* OUT: Block id of last entry written */ + char **paRoot, /* OUT: Data for root node */ + int *pnRoot /* OUT: Size of root node in bytes */ +){ + int rc = SQLITE_OK; + + if( !pTree->pParent ){ + /* Root node of the tree. */ + int nStart = fts3TreeFinishNode(pTree, iHeight, iLeaf); + *piLast = iFree-1; + *pnRoot = pTree->nData - nStart; + *paRoot = &pTree->aData[nStart]; + }else{ + SegmentNode *pIter; + sqlite3_int64 iNextFree = iFree; + sqlite3_int64 iNextLeaf = iLeaf; + for(pIter=pTree->pLeftmost; pIter && rc==SQLITE_OK; pIter=pIter->pRight){ + int nStart = fts3TreeFinishNode(pIter, iHeight, iNextLeaf); + int nWrite = pIter->nData - nStart; + + rc = fts3WriteSegment(p, iNextFree, &pIter->aData[nStart], nWrite); + iNextFree++; + iNextLeaf += (pIter->nEntry+1); + } + if( rc==SQLITE_OK ){ + assert( iNextLeaf==iFree ); + rc = fts3NodeWrite( + p, pTree->pParent, iHeight+1, iFree, iNextFree, piLast, paRoot, pnRoot + ); + } + } + + return rc; +} + +/* +** Free all memory allocations associated with the tree pTree. +*/ +static void fts3NodeFree(SegmentNode *pTree){ + if( pTree ){ + SegmentNode *p = pTree->pLeftmost; + fts3NodeFree(p->pParent); + while( p ){ + SegmentNode *pRight = p->pRight; + if( p->aData!=(char *)&p[1] ){ + sqlite3_free(p->aData); + } + assert( pRight==0 || p->zMalloc==0 ); + sqlite3_free(p->zMalloc); + sqlite3_free(p); + p = pRight; + } + } +} + +/* +** Add a term to the segment being constructed by the SegmentWriter object +** *ppWriter. When adding the first term to a segment, *ppWriter should +** be passed NULL. This function will allocate a new SegmentWriter object +** and return it via the input/output variable *ppWriter in this case. +** +** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code. +*/ +static int fts3SegWriterAdd( + Fts3Table *p, /* Virtual table handle */ + SegmentWriter **ppWriter, /* IN/OUT: SegmentWriter handle */ + int isCopyTerm, /* True if buffer zTerm must be copied */ + const char *zTerm, /* Pointer to buffer containing term */ + int nTerm, /* Size of term in bytes */ + const char *aDoclist, /* Pointer to buffer containing doclist */ + int nDoclist /* Size of doclist in bytes */ +){ + int nPrefix; /* Size of term prefix in bytes */ + int nSuffix; /* Size of term suffix in bytes */ + int nReq; /* Number of bytes required on leaf page */ + int nData; + SegmentWriter *pWriter = *ppWriter; + + if( !pWriter ){ + int rc; + sqlite3_stmt *pStmt; + + /* Allocate the SegmentWriter structure */ + pWriter = (SegmentWriter *)sqlite3_malloc(sizeof(SegmentWriter)); + if( !pWriter ) return SQLITE_NOMEM; + memset(pWriter, 0, sizeof(SegmentWriter)); + *ppWriter = pWriter; + + /* Allocate a buffer in which to accumulate data */ + pWriter->aData = (char *)sqlite3_malloc(p->nNodeSize); + if( !pWriter->aData ) return SQLITE_NOMEM; + pWriter->nSize = p->nNodeSize; + + /* Find the next free blockid in the %_segments table */ + rc = fts3SqlStmt(p, SQL_NEXT_SEGMENTS_ID, &pStmt, 0); + if( rc!=SQLITE_OK ) return rc; + if( SQLITE_ROW==sqlite3_step(pStmt) ){ + pWriter->iFree = sqlite3_column_int64(pStmt, 0); + pWriter->iFirst = pWriter->iFree; + } + rc = sqlite3_reset(pStmt); + if( rc!=SQLITE_OK ) return rc; + } + nData = pWriter->nData; + + nPrefix = fts3PrefixCompress(pWriter->zTerm, pWriter->nTerm, zTerm, nTerm); + nSuffix = nTerm-nPrefix; + + /* Figure out how many bytes are required by this new entry */ + nReq = sqlite3Fts3VarintLen(nPrefix) + /* varint containing prefix size */ + sqlite3Fts3VarintLen(nSuffix) + /* varint containing suffix size */ + nSuffix + /* Term suffix */ + sqlite3Fts3VarintLen(nDoclist) + /* Size of doclist */ + nDoclist; /* Doclist data */ + + if( nData>0 && nData+nReq>p->nNodeSize ){ + int rc; + + /* The current leaf node is full. Write it out to the database. */ + rc = fts3WriteSegment(p, pWriter->iFree++, pWriter->aData, nData); + if( rc!=SQLITE_OK ) return rc; + + /* Add the current term to the interior node tree. The term added to + ** the interior tree must: + ** + ** a) be greater than the largest term on the leaf node just written + ** to the database (still available in pWriter->zTerm), and + ** + ** b) be less than or equal to the term about to be added to the new + ** leaf node (zTerm/nTerm). + ** + ** In other words, it must be the prefix of zTerm 1 byte longer than + ** the common prefix (if any) of zTerm and pWriter->zTerm. + */ + assert( nPrefixpTree, isCopyTerm, zTerm, nPrefix+1); + if( rc!=SQLITE_OK ) return rc; + + nData = 0; + pWriter->nTerm = 0; + + nPrefix = 0; + nSuffix = nTerm; + nReq = 1 + /* varint containing prefix size */ + sqlite3Fts3VarintLen(nTerm) + /* varint containing suffix size */ + nTerm + /* Term suffix */ + sqlite3Fts3VarintLen(nDoclist) + /* Size of doclist */ + nDoclist; /* Doclist data */ + } + + /* If the buffer currently allocated is too small for this entry, realloc + ** the buffer to make it large enough. + */ + if( nReq>pWriter->nSize ){ + char *aNew = sqlite3_realloc(pWriter->aData, nReq); + if( !aNew ) return SQLITE_NOMEM; + pWriter->aData = aNew; + pWriter->nSize = nReq; + } + assert( nData+nReq<=pWriter->nSize ); + + /* Append the prefix-compressed term and doclist to the buffer. */ + nData += sqlite3Fts3PutVarint(&pWriter->aData[nData], nPrefix); + nData += sqlite3Fts3PutVarint(&pWriter->aData[nData], nSuffix); + memcpy(&pWriter->aData[nData], &zTerm[nPrefix], nSuffix); + nData += nSuffix; + nData += sqlite3Fts3PutVarint(&pWriter->aData[nData], nDoclist); + memcpy(&pWriter->aData[nData], aDoclist, nDoclist); + pWriter->nData = nData + nDoclist; + + /* Save the current term so that it can be used to prefix-compress the next. + ** If the isCopyTerm parameter is true, then the buffer pointed to by + ** zTerm is transient, so take a copy of the term data. Otherwise, just + ** store a copy of the pointer. + */ + if( isCopyTerm ){ + if( nTerm>pWriter->nMalloc ){ + char *zNew = sqlite3_realloc(pWriter->zMalloc, nTerm*2); + if( !zNew ){ + return SQLITE_NOMEM; + } + pWriter->nMalloc = nTerm*2; + pWriter->zMalloc = zNew; + pWriter->zTerm = zNew; + } + assert( pWriter->zTerm==pWriter->zMalloc ); + memcpy(pWriter->zTerm, zTerm, nTerm); + }else{ + pWriter->zTerm = (char *)zTerm; + } + pWriter->nTerm = nTerm; + + return SQLITE_OK; +} + +/* +** Flush all data associated with the SegmentWriter object pWriter to the +** database. This function must be called after all terms have been added +** to the segment using fts3SegWriterAdd(). If successful, SQLITE_OK is +** returned. Otherwise, an SQLite error code. +*/ +static int fts3SegWriterFlush( + Fts3Table *p, /* Virtual table handle */ + SegmentWriter *pWriter, /* SegmentWriter to flush to the db */ + int iLevel, /* Value for 'level' column of %_segdir */ + int iIdx /* Value for 'idx' column of %_segdir */ +){ + int rc; /* Return code */ + if( pWriter->pTree ){ + sqlite3_int64 iLast = 0; /* Largest block id written to database */ + sqlite3_int64 iLastLeaf; /* Largest leaf block id written to db */ + char *zRoot = NULL; /* Pointer to buffer containing root node */ + int nRoot = 0; /* Size of buffer zRoot */ + + iLastLeaf = pWriter->iFree; + rc = fts3WriteSegment(p, pWriter->iFree++, pWriter->aData, pWriter->nData); + if( rc==SQLITE_OK ){ + rc = fts3NodeWrite(p, pWriter->pTree, 1, + pWriter->iFirst, pWriter->iFree, &iLast, &zRoot, &nRoot); + } + if( rc==SQLITE_OK ){ + rc = fts3WriteSegdir( + p, iLevel, iIdx, pWriter->iFirst, iLastLeaf, iLast, zRoot, nRoot); + } + }else{ + /* The entire tree fits on the root node. Write it to the segdir table. */ + rc = fts3WriteSegdir( + p, iLevel, iIdx, 0, 0, 0, pWriter->aData, pWriter->nData); + } + return rc; +} + +/* +** Release all memory held by the SegmentWriter object passed as the +** first argument. +*/ +static void fts3SegWriterFree(SegmentWriter *pWriter){ + if( pWriter ){ + sqlite3_free(pWriter->aData); + sqlite3_free(pWriter->zMalloc); + fts3NodeFree(pWriter->pTree); + sqlite3_free(pWriter); + } +} + +/* +** The first value in the apVal[] array is assumed to contain an integer. +** This function tests if there exist any documents with docid values that +** are different from that integer. i.e. if deleting the document with docid +** apVal[0] would mean the FTS3 table were empty. +** +** If successful, *pisEmpty is set to true if the table is empty except for +** document apVal[0], or false otherwise, and SQLITE_OK is returned. If an +** error occurs, an SQLite error code is returned. +*/ +static int fts3IsEmpty(Fts3Table *p, sqlite3_value **apVal, int *pisEmpty){ + sqlite3_stmt *pStmt; + int rc; + rc = fts3SqlStmt(p, SQL_IS_EMPTY, &pStmt, apVal); + if( rc==SQLITE_OK ){ + if( SQLITE_ROW==sqlite3_step(pStmt) ){ + *pisEmpty = sqlite3_column_int(pStmt, 0); + } + rc = sqlite3_reset(pStmt); + } + return rc; +} + +/* +** Set *pnSegment to the number of segments of level iLevel in the database. +** +** Return SQLITE_OK if successful, or an SQLite error code if not. +*/ +static int fts3SegmentCount(Fts3Table *p, int iLevel, int *pnSegment){ + sqlite3_stmt *pStmt; + int rc; + + assert( iLevel>=0 ); + rc = fts3SqlStmt(p, SQL_SELECT_LEVEL_COUNT, &pStmt, 0); + if( rc!=SQLITE_OK ) return rc; + sqlite3_bind_int(pStmt, 1, iLevel); + if( SQLITE_ROW==sqlite3_step(pStmt) ){ + *pnSegment = sqlite3_column_int(pStmt, 0); + } + return sqlite3_reset(pStmt); +} + +/* +** Set *pnSegment to the total number of segments in the database. Set +** *pnMax to the largest segment level in the database (segment levels +** are stored in the 'level' column of the %_segdir table). +** +** Return SQLITE_OK if successful, or an SQLite error code if not. +*/ +static int fts3SegmentCountMax(Fts3Table *p, int *pnSegment, int *pnMax){ + sqlite3_stmt *pStmt; + int rc; + + rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR_COUNT_MAX, &pStmt, 0); + if( rc!=SQLITE_OK ) return rc; + if( SQLITE_ROW==sqlite3_step(pStmt) ){ + *pnSegment = sqlite3_column_int(pStmt, 0); + *pnMax = sqlite3_column_int(pStmt, 1); + } + return sqlite3_reset(pStmt); +} + +/* +** This function is used after merging multiple segments into a single large +** segment to delete the old, now redundant, segment b-trees. Specifically, +** it: +** +** 1) Deletes all %_segments entries for the segments associated with +** each of the SegReader objects in the array passed as the third +** argument, and +** +** 2) deletes all %_segdir entries with level iLevel, or all %_segdir +** entries regardless of level if (iLevel<0). +** +** SQLITE_OK is returned if successful, otherwise an SQLite error code. +*/ +static int fts3DeleteSegdir( + Fts3Table *p, /* Virtual table handle */ + int iLevel, /* Level of %_segdir entries to delete */ + Fts3SegReader **apSegment, /* Array of SegReader objects */ + int nReader /* Size of array apSegment */ +){ + int rc; /* Return Code */ + int i; /* Iterator variable */ + sqlite3_stmt *pDelete; /* SQL statement to delete rows */ + + rc = fts3SqlStmt(p, SQL_DELETE_SEGMENTS_RANGE, &pDelete, 0); + for(i=0; rc==SQLITE_OK && iiStartBlock ){ + sqlite3_bind_int64(pDelete, 1, pSegment->iStartBlock); + sqlite3_bind_int64(pDelete, 2, pSegment->iEndBlock); + sqlite3_step(pDelete); + rc = sqlite3_reset(pDelete); + } + } + if( rc!=SQLITE_OK ){ + return rc; + } + + if( iLevel>=0 ){ + rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_BY_LEVEL, &pDelete, 0); + if( rc==SQLITE_OK ){ + sqlite3_bind_int(pDelete, 1, iLevel); + sqlite3_step(pDelete); + rc = sqlite3_reset(pDelete); + } + }else{ + fts3SqlExec(&rc, p, SQL_DELETE_ALL_SEGDIR, 0); + } + + return rc; +} + +/* +** When this function is called, buffer *ppList (size *pnList bytes) contains +** a position list that may (or may not) feature multiple columns. This +** function adjusts the pointer *ppList and the length *pnList so that they +** identify the subset of the position list that corresponds to column iCol. +** +** If there are no entries in the input position list for column iCol, then +** *pnList is set to zero before returning. +*/ +static void fts3ColumnFilter( + int iCol, /* Column to filter on */ + char **ppList, /* IN/OUT: Pointer to position list */ + int *pnList /* IN/OUT: Size of buffer *ppList in bytes */ +){ + char *pList = *ppList; + int nList = *pnList; + char *pEnd = &pList[nList]; + int iCurrent = 0; + char *p = pList; + + assert( iCol>=0 ); + while( 1 ){ + char c = 0; + while( pflags & FTS3_SEGMENT_IGNORE_EMPTY); + int isRequirePos = (pFilter->flags & FTS3_SEGMENT_REQUIRE_POS); + int isColFilter = (pFilter->flags & FTS3_SEGMENT_COLUMN_FILTER); + int isPrefix = (pFilter->flags & FTS3_SEGMENT_PREFIX); + + /* If there are zero segments, this function is a no-op. This scenario + ** comes about only when reading from an empty database. + */ + if( nSegment==0 ) goto finished; + + /* If the Fts3SegFilter defines a specific term (or term prefix) to search + ** for, then advance each segment iterator until it points to a term of + ** equal or greater value than the specified term. This prevents many + ** unnecessary merge/sort operations for the case where single segment + ** b-tree leaf nodes contain more than one term. + */ + if( pFilter->zTerm ){ + int nTerm = pFilter->nTerm; + const char *zTerm = pFilter->zTerm; + for(i=0; iaNode ){ + int nTerm = apSegment[0]->nTerm; + char *zTerm = apSegment[0]->zTerm; + int nMerge = 1; + + /* If this is a prefix-search, and if the term that apSegment[0] points + ** to does not share a suffix with pFilter->zTerm/nTerm, then all + ** required callbacks have been made. In this case exit early. + ** + ** Similarly, if this is a search for an exact match, and the first term + ** of segment apSegment[0] is not a match, exit early. + */ + if( pFilter->zTerm ){ + if( nTermnTerm + || (!isPrefix && nTerm>pFilter->nTerm) + || memcmp(zTerm, pFilter->zTerm, pFilter->nTerm) + ){ + goto finished; + } + } + + while( nMergeaNode + && apSegment[nMerge]->nTerm==nTerm + && 0==memcmp(zTerm, apSegment[nMerge]->zTerm, nTerm) + ){ + nMerge++; + } + + assert( isIgnoreEmpty || (isRequirePos && !isColFilter) ); + if( nMerge==1 && !isIgnoreEmpty ){ + Fts3SegReader *p0 = apSegment[0]; + rc = xFunc(p, pContext, zTerm, nTerm, p0->aDoclist, p0->nDoclist); + if( rc!=SQLITE_OK ) goto finished; + }else{ + int nDoclist = 0; /* Size of doclist */ + sqlite3_int64 iPrev = 0; /* Previous docid stored in doclist */ + + /* The current term of the first nMerge entries in the array + ** of Fts3SegReader objects is the same. The doclists must be merged + ** and a single term added to the new segment. + */ + for(i=0; ipOffsetList ){ + int j; /* Number of segments that share a docid */ + char *pList; + int nList; + int nByte; + sqlite3_int64 iDocid = apSegment[0]->iDocid; + fts3SegReaderNextDocid(apSegment[0], &pList, &nList); + j = 1; + while( jpOffsetList + && apSegment[j]->iDocid==iDocid + ){ + fts3SegReaderNextDocid(apSegment[j], 0, 0); + j++; + } + + if( isColFilter ){ + fts3ColumnFilter(pFilter->iCol, &pList, &nList); + } + + if( !isIgnoreEmpty || nList>0 ){ + nByte = sqlite3Fts3VarintLen(iDocid-iPrev) + (isRequirePos?nList+1:0); + if( nDoclist+nByte>nAlloc ){ + char *aNew; + nAlloc = nDoclist+nByte*2; + aNew = sqlite3_realloc(aBuffer, nAlloc); + if( !aNew ){ + rc = SQLITE_NOMEM; + goto finished; + } + aBuffer = aNew; + } + nDoclist += sqlite3Fts3PutVarint(&aBuffer[nDoclist], iDocid-iPrev); + iPrev = iDocid; + if( isRequirePos ){ + memcpy(&aBuffer[nDoclist], pList, nList); + nDoclist += nList; + aBuffer[nDoclist++] = '\0'; + } + } + + fts3SegReaderSort(apSegment, nMerge, j, fts3SegReaderDoclistCmp); + } + + if( nDoclist>0 ){ + rc = xFunc(p, pContext, zTerm, nTerm, aBuffer, nDoclist); + if( rc!=SQLITE_OK ) goto finished; + } + } + + /* If there is a term specified to filter on, and this is not a prefix + ** search, return now. The callback that corresponds to the required + ** term (if such a term exists in the index) has already been made. + */ + if( pFilter->zTerm && !isPrefix ){ + goto finished; + } + + for(i=0; i0 ); + assert( iNewLevel>=0 ); + + /* Allocate space for an array of pointers to segment iterators. */ + apSegment = (Fts3SegReader**)sqlite3_malloc(sizeof(Fts3SegReader *)*nSegment); + if( !apSegment ){ + rc = SQLITE_NOMEM; + goto finished; + } + memset(apSegment, 0, sizeof(Fts3SegReader *)*nSegment); + + /* Allocate a Fts3SegReader structure for each segment being merged. A + ** Fts3SegReader stores the state data required to iterate through all + ** entries on all leaves of a single segment. + */ + assert( SQL_SELECT_LEVEL+1==SQL_SELECT_ALL_LEVEL); + rc = fts3SqlStmt(p, SQL_SELECT_LEVEL+(iLevel<0), &pStmt, 0); + if( rc!=SQLITE_OK ) goto finished; + sqlite3_bind_int(pStmt, 1, iLevel); + for(i=0; SQLITE_ROW==(sqlite3_step(pStmt)); i++){ + rc = fts3SegReaderNew(p, pStmt, i, &apSegment[i]); + if( rc!=SQLITE_OK ){ + goto finished; + } + } + rc = sqlite3_reset(pStmt); + if( pPending ){ + apSegment[i] = pPending; + pPending = 0; + } + pStmt = 0; + if( rc!=SQLITE_OK ) goto finished; + + memset(&filter, 0, sizeof(Fts3SegFilter)); + filter.flags = FTS3_SEGMENT_REQUIRE_POS; + filter.flags |= (iLevel<0 ? FTS3_SEGMENT_IGNORE_EMPTY : 0); + rc = sqlite3Fts3SegReaderIterate(p, apSegment, nSegment, + &filter, fts3MergeCallback, (void *)&pWriter + ); + if( rc!=SQLITE_OK ) goto finished; + + rc = fts3DeleteSegdir(p, iLevel, apSegment, nSegment); + if( rc==SQLITE_OK ){ + rc = fts3SegWriterFlush(p, pWriter, iNewLevel, iIdx); + } + + finished: + fts3SegWriterFree(pWriter); + if( apSegment ){ + for(i=0; ibase.pVtab; + rc = fts3SqlStmt(p, SQL_SELECT_DOCSIZE, &pStmt, 0); + if( rc ){ + return rc; + } + sqlite3_bind_int64(pStmt, 1, pCur->iPrevId); + if( sqlite3_step(pStmt)==SQLITE_ROW ){ + nBlob = sqlite3_column_bytes(pStmt, 0); + pBlob = (const char*)sqlite3_column_blob(pStmt, 0); + for(i=j=0; inColumn && jbase.pVtab; + rc = fts3SqlStmt(p, SQL_SELECT_DOCTOTAL, &pStmt, 0); + if( rc ){ + return rc; + } + if( sqlite3_step(pStmt)==SQLITE_ROW ){ + nBlob = sqlite3_column_bytes(pStmt, 0); + pBlob = (const char*)sqlite3_column_blob(pStmt, 0); + j = sqlite3Fts3GetVarint(pBlob, &x); + a[0] = nDoc = (u32)(x & 0xffffffff); + for(i=0; inColumn && jiPrevDocid. The sizes are encoded as +** a blob of varints. +*/ +static void fts3InsertDocsize( + int *pRC, /* Result code */ + Fts3Table *p, /* Table into which to insert */ + u32 *aSz /* Sizes of each column */ +){ + char *pBlob; /* The BLOB encoding of the document size */ + int nBlob; /* Number of bytes in the BLOB */ + sqlite3_stmt *pStmt; /* Statement used to insert the encoding */ + int rc; /* Result code from subfunctions */ + + if( *pRC ) return; + pBlob = sqlite3_malloc( 10*p->nColumn ); + if( pBlob==0 ){ + *pRC = SQLITE_NOMEM; + return; + } + fts3EncodeIntArray(p->nColumn, aSz, pBlob, &nBlob); + rc = fts3SqlStmt(p, SQL_REPLACE_DOCSIZE, &pStmt, 0); + if( rc ){ + sqlite3_free(pBlob); + *pRC = rc; + return; + } + sqlite3_bind_int64(pStmt, 1, p->iPrevDocid); + sqlite3_bind_blob(pStmt, 2, pBlob, nBlob, sqlite3_free); + sqlite3_step(pStmt); + *pRC = sqlite3_reset(pStmt); +} + +/* +** Update the 0 record of the %_stat table so that it holds a blob +** which contains the document count followed by the cumulative +** document sizes for all columns. +*/ +static void fts3UpdateDocTotals( + int *pRC, /* The result code */ + Fts3Table *p, /* Table being updated */ + u32 *aSzIns, /* Size increases */ + u32 *aSzDel, /* Size decreases */ + int nChng /* Change in the number of documents */ +){ + char *pBlob; /* Storage for BLOB written into %_stat */ + int nBlob; /* Size of BLOB written into %_stat */ + u32 *a; /* Array of integers that becomes the BLOB */ + sqlite3_stmt *pStmt; /* Statement for reading and writing */ + int i; /* Loop counter */ + int rc; /* Result code from subfunctions */ + + if( *pRC ) return; + a = sqlite3_malloc( (sizeof(u32)+10)*(p->nColumn+1) ); + if( a==0 ){ + *pRC = SQLITE_NOMEM; + return; + } + pBlob = (char*)&a[p->nColumn+1]; + rc = fts3SqlStmt(p, SQL_SELECT_DOCTOTAL, &pStmt, 0); + if( rc ){ + sqlite3_free(a); + *pRC = rc; + return; + } + if( sqlite3_step(pStmt)==SQLITE_ROW ){ + fts3DecodeIntArray(p->nColumn+1, a, + sqlite3_column_blob(pStmt, 0), + sqlite3_column_bytes(pStmt, 0)); + }else{ + memset(a, 0, sizeof(u32)*(p->nColumn+1) ); + } + sqlite3_reset(pStmt); + if( nChng<0 && a[0]<(u32)(-nChng) ){ + a[0] = 0; + }else{ + a[0] += nChng; + } + for(i=0; inColumn; i++){ + u32 x = a[i+1]; + if( x+aSzIns[i] < aSzDel[i] ){ + x = 0; + }else{ + x = x + aSzIns[i] - aSzDel[i]; + } + a[i+1] = x; + } + fts3EncodeIntArray(p->nColumn+1, a, pBlob, &nBlob); + rc = fts3SqlStmt(p, SQL_REPLACE_DOCTOTAL, &pStmt, 0); + if( rc ){ + sqlite3_free(a); + *pRC = rc; + return; + } + sqlite3_bind_blob(pStmt, 1, pBlob, nBlob, SQLITE_STATIC); + sqlite3_step(pStmt); + *pRC = sqlite3_reset(pStmt); + sqlite3_free(a); +} + +/* +** Handle a 'special' INSERT of the form: +** +** "INSERT INTO tbl(tbl) VALUES()" +** +** Argument pVal contains the result of . Currently the only +** meaningful value to insert is the text 'optimize'. +*/ +static int fts3SpecialInsert(Fts3Table *p, sqlite3_value *pVal){ + int rc; /* Return Code */ + const char *zVal = (const char *)sqlite3_value_text(pVal); + int nVal = sqlite3_value_bytes(pVal); + + if( !zVal ){ + return SQLITE_NOMEM; + }else if( nVal==8 && 0==sqlite3_strnicmp(zVal, "optimize", 8) ){ + rc = fts3SegmentMerge(p, -1); + if( rc==SQLITE_DONE ){ + rc = SQLITE_OK; + }else{ + sqlite3Fts3PendingTermsClear(p); + } +#ifdef SQLITE_TEST + }else if( nVal>9 && 0==sqlite3_strnicmp(zVal, "nodesize=", 9) ){ + p->nNodeSize = atoi(&zVal[9]); + rc = SQLITE_OK; + }else if( nVal>11 && 0==sqlite3_strnicmp(zVal, "maxpending=", 9) ){ + p->nMaxPendingData = atoi(&zVal[11]); + rc = SQLITE_OK; +#endif + }else{ + rc = SQLITE_ERROR; + } + + return rc; +} + +/* +** This function does the work for the xUpdate method of FTS3 virtual +** tables. +*/ +SQLITE_PRIVATE int sqlite3Fts3UpdateMethod( + sqlite3_vtab *pVtab, /* FTS3 vtab object */ + int nArg, /* Size of argument array */ + sqlite3_value **apVal, /* Array of arguments */ + sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */ +){ + Fts3Table *p = (Fts3Table *)pVtab; + int rc = SQLITE_OK; /* Return Code */ + int isRemove = 0; /* True for an UPDATE or DELETE */ + sqlite3_int64 iRemove = 0; /* Rowid removed by UPDATE or DELETE */ + u32 *aSzIns; /* Sizes of inserted documents */ + u32 *aSzDel; /* Sizes of deleted documents */ + int nChng = 0; /* Net change in number of documents */ + + + /* Allocate space to hold the change in document sizes */ + aSzIns = sqlite3_malloc( sizeof(aSzIns[0])*p->nColumn*2 ); + if( aSzIns==0 ) return SQLITE_NOMEM; + aSzDel = &aSzIns[p->nColumn]; + memset(aSzIns, 0, sizeof(aSzIns[0])*p->nColumn*2); + + /* If this is a DELETE or UPDATE operation, remove the old record. */ + if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){ + int isEmpty; + rc = fts3IsEmpty(p, apVal, &isEmpty); + if( rc==SQLITE_OK ){ + if( isEmpty ){ + /* Deleting this row means the whole table is empty. In this case + ** delete the contents of all three tables and throw away any + ** data in the pendingTerms hash table. + */ + rc = fts3DeleteAll(p); + }else{ + isRemove = 1; + iRemove = sqlite3_value_int64(apVal[0]); + rc = fts3PendingTermsDocid(p, iRemove); + fts3DeleteTerms(&rc, p, apVal, aSzDel); + fts3SqlExec(&rc, p, SQL_DELETE_CONTENT, apVal); + if( p->bHasDocsize ){ + fts3SqlExec(&rc, p, SQL_DELETE_DOCSIZE, apVal); + nChng--; + } + } + } + }else if( sqlite3_value_type(apVal[p->nColumn+2])!=SQLITE_NULL ){ + sqlite3_free(aSzIns); + return fts3SpecialInsert(p, apVal[p->nColumn+2]); + } + + /* If this is an INSERT or UPDATE operation, insert the new record. */ + if( nArg>1 && rc==SQLITE_OK ){ + rc = fts3InsertData(p, apVal, pRowid); + if( rc==SQLITE_OK && (!isRemove || *pRowid!=iRemove) ){ + rc = fts3PendingTermsDocid(p, *pRowid); + } + if( rc==SQLITE_OK ){ + rc = fts3InsertTerms(p, apVal, aSzIns); + } + if( p->bHasDocsize ){ + nChng++; + fts3InsertDocsize(&rc, p, aSzIns); + } + } + + if( p->bHasDocsize ){ + fts3UpdateDocTotals(&rc, p, aSzIns, aSzDel, nChng); + } + + sqlite3_free(aSzIns); + return rc; +} + +/* +** Flush any data in the pending-terms hash table to disk. If successful, +** merge all segments in the database (including the new segment, if +** there was any data to flush) into a single segment. +*/ +SQLITE_PRIVATE int sqlite3Fts3Optimize(Fts3Table *p){ + int rc; + rc = sqlite3_exec(p->db, "SAVEPOINT fts3", 0, 0, 0); + if( rc==SQLITE_OK ){ + rc = fts3SegmentMerge(p, -1); + if( rc==SQLITE_OK ){ + rc = sqlite3_exec(p->db, "RELEASE fts3", 0, 0, 0); + if( rc==SQLITE_OK ){ + sqlite3Fts3PendingTermsClear(p); + } + }else{ + sqlite3_exec(p->db, "ROLLBACK TO fts3", 0, 0, 0); + sqlite3_exec(p->db, "RELEASE fts3", 0, 0, 0); + } + } + return rc; +} + +#endif + +/************** End of fts3_write.c ******************************************/ +/************** Begin file fts3_snippet.c ************************************/ +/* +** 2009 Oct 23 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +*/ + +#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) + + + +/* +** Used as an fts3ExprIterate() context when loading phrase doclists to +** Fts3Expr.aDoclist[]/nDoclist. +*/ +typedef struct LoadDoclistCtx LoadDoclistCtx; +struct LoadDoclistCtx { + Fts3Table *pTab; /* FTS3 Table */ + int nPhrase; /* Number of phrases seen so far */ + int nToken; /* Number of tokens seen so far */ +}; + +/* +** The following types are used as part of the implementation of the +** fts3BestSnippet() routine. +*/ +typedef struct SnippetIter SnippetIter; +typedef struct SnippetPhrase SnippetPhrase; +typedef struct SnippetFragment SnippetFragment; + +struct SnippetIter { + Fts3Cursor *pCsr; /* Cursor snippet is being generated from */ + int iCol; /* Extract snippet from this column */ + int nSnippet; /* Requested snippet length (in tokens) */ + int nPhrase; /* Number of phrases in query */ + SnippetPhrase *aPhrase; /* Array of size nPhrase */ + int iCurrent; /* First token of current snippet */ +}; + +struct SnippetPhrase { + int nToken; /* Number of tokens in phrase */ + char *pList; /* Pointer to start of phrase position list */ + int iHead; /* Next value in position list */ + char *pHead; /* Position list data following iHead */ + int iTail; /* Next value in trailing position list */ + char *pTail; /* Position list data following iTail */ +}; + +struct SnippetFragment { + int iCol; /* Column snippet is extracted from */ + int iPos; /* Index of first token in snippet */ + u64 covered; /* Mask of query phrases covered */ + u64 hlmask; /* Mask of snippet terms to highlight */ +}; + +/* +** This type is used as an fts3ExprIterate() context object while +** accumulating the data returned by the matchinfo() function. +*/ +typedef struct MatchInfo MatchInfo; +struct MatchInfo { + Fts3Cursor *pCursor; /* FTS3 Cursor */ + int nCol; /* Number of columns in table */ + u32 *aMatchinfo; /* Pre-allocated buffer */ +}; + + + +/* +** The snippet() and offsets() functions both return text values. An instance +** of the following structure is used to accumulate those values while the +** functions are running. See fts3StringAppend() for details. +*/ +typedef struct StrBuffer StrBuffer; +struct StrBuffer { + char *z; /* Pointer to buffer containing string */ + int n; /* Length of z in bytes (excl. nul-term) */ + int nAlloc; /* Allocated size of buffer z in bytes */ +}; + + +/* +** This function is used to help iterate through a position-list. A position +** list is a list of unique integers, sorted from smallest to largest. Each +** element of the list is represented by an FTS3 varint that takes the value +** of the difference between the current element and the previous one plus +** two. For example, to store the position-list: +** +** 4 9 113 +** +** the three varints: +** +** 6 7 106 +** +** are encoded. +** +** When this function is called, *pp points to the start of an element of +** the list. *piPos contains the value of the previous entry in the list. +** After it returns, *piPos contains the value of the next element of the +** list and *pp is advanced to the following varint. +*/ +static void fts3GetDeltaPosition(char **pp, int *piPos){ + int iVal; + *pp += sqlite3Fts3GetVarint32(*pp, &iVal); + *piPos += (iVal-2); +} + +/* +** Helper function for fts3ExprIterate() (see below). +*/ +static int fts3ExprIterate2( + Fts3Expr *pExpr, /* Expression to iterate phrases of */ + int *piPhrase, /* Pointer to phrase counter */ + int (*x)(Fts3Expr*,int,void*), /* Callback function to invoke for phrases */ + void *pCtx /* Second argument to pass to callback */ +){ + int rc; /* Return code */ + int eType = pExpr->eType; /* Type of expression node pExpr */ + + if( eType!=FTSQUERY_PHRASE ){ + assert( pExpr->pLeft && pExpr->pRight ); + rc = fts3ExprIterate2(pExpr->pLeft, piPhrase, x, pCtx); + if( rc==SQLITE_OK && eType!=FTSQUERY_NOT ){ + rc = fts3ExprIterate2(pExpr->pRight, piPhrase, x, pCtx); + } + }else{ + rc = x(pExpr, *piPhrase, pCtx); + (*piPhrase)++; + } + return rc; +} + +/* +** Iterate through all phrase nodes in an FTS3 query, except those that +** are part of a sub-tree that is the right-hand-side of a NOT operator. +** For each phrase node found, the supplied callback function is invoked. +** +** If the callback function returns anything other than SQLITE_OK, +** the iteration is abandoned and the error code returned immediately. +** Otherwise, SQLITE_OK is returned after a callback has been made for +** all eligible phrase nodes. +*/ +static int fts3ExprIterate( + Fts3Expr *pExpr, /* Expression to iterate phrases of */ + int (*x)(Fts3Expr*,int,void*), /* Callback function to invoke for phrases */ + void *pCtx /* Second argument to pass to callback */ +){ + int iPhrase = 0; /* Variable used as the phrase counter */ + return fts3ExprIterate2(pExpr, &iPhrase, x, pCtx); +} + +/* +** The argument to this function is always a phrase node. Its doclist +** (Fts3Expr.aDoclist[]) and the doclists associated with all phrase nodes +** to the left of this one in the query tree have already been loaded. +** +** If this phrase node is part of a series of phrase nodes joined by +** NEAR operators (and is not the left-most of said series), then elements are +** removed from the phrases doclist consistent with the NEAR restriction. If +** required, elements may be removed from the doclists of phrases to the +** left of this one that are part of the same series of NEAR operator +** connected phrases. +** +** If an OOM error occurs, SQLITE_NOMEM is returned. Otherwise, SQLITE_OK. +*/ +static int fts3ExprNearTrim(Fts3Expr *pExpr){ + int rc = SQLITE_OK; + Fts3Expr *pParent = pExpr->pParent; + + assert( pExpr->eType==FTSQUERY_PHRASE ); + while( rc==SQLITE_OK + && pParent + && pParent->eType==FTSQUERY_NEAR + && pParent->pRight==pExpr + ){ + /* This expression (pExpr) is the right-hand-side of a NEAR operator. + ** Find the expression to the left of the same operator. + */ + int nNear = pParent->nNear; + Fts3Expr *pLeft = pParent->pLeft; + + if( pLeft->eType!=FTSQUERY_PHRASE ){ + assert( pLeft->eType==FTSQUERY_NEAR ); + assert( pLeft->pRight->eType==FTSQUERY_PHRASE ); + pLeft = pLeft->pRight; + } + + rc = sqlite3Fts3ExprNearTrim(pLeft, pExpr, nNear); + + pExpr = pLeft; + pParent = pExpr->pParent; + } + + return rc; +} + +/* +** This is an fts3ExprIterate() callback used while loading the doclists +** for each phrase into Fts3Expr.aDoclist[]/nDoclist. See also +** fts3ExprLoadDoclists(). +*/ +static int fts3ExprLoadDoclistsCb1(Fts3Expr *pExpr, int iPhrase, void *ctx){ + int rc = SQLITE_OK; + LoadDoclistCtx *p = (LoadDoclistCtx *)ctx; + + UNUSED_PARAMETER(iPhrase); + + p->nPhrase++; + p->nToken += pExpr->pPhrase->nToken; + + if( pExpr->isLoaded==0 ){ + rc = sqlite3Fts3ExprLoadDoclist(p->pTab, pExpr); + pExpr->isLoaded = 1; + if( rc==SQLITE_OK ){ + rc = fts3ExprNearTrim(pExpr); + } + } + + return rc; +} + +/* +** This is an fts3ExprIterate() callback used while loading the doclists +** for each phrase into Fts3Expr.aDoclist[]/nDoclist. See also +** fts3ExprLoadDoclists(). +*/ +static int fts3ExprLoadDoclistsCb2(Fts3Expr *pExpr, int iPhrase, void *ctx){ + UNUSED_PARAMETER(iPhrase); + UNUSED_PARAMETER(ctx); + if( pExpr->aDoclist ){ + pExpr->pCurrent = pExpr->aDoclist; + pExpr->iCurrent = 0; + pExpr->pCurrent += sqlite3Fts3GetVarint(pExpr->pCurrent, &pExpr->iCurrent); + } + return SQLITE_OK; +} + +/* +** Load the doclists for each phrase in the query associated with FTS3 cursor +** pCsr. +** +** If pnPhrase is not NULL, then *pnPhrase is set to the number of matchable +** phrases in the expression (all phrases except those directly or +** indirectly descended from the right-hand-side of a NOT operator). If +** pnToken is not NULL, then it is set to the number of tokens in all +** matchable phrases of the expression. +*/ +static int fts3ExprLoadDoclists( + Fts3Cursor *pCsr, /* Fts3 cursor for current query */ + int *pnPhrase, /* OUT: Number of phrases in query */ + int *pnToken /* OUT: Number of tokens in query */ +){ + int rc; /* Return Code */ + LoadDoclistCtx sCtx = {0,0,0}; /* Context for fts3ExprIterate() */ + sCtx.pTab = (Fts3Table *)pCsr->base.pVtab; + rc = fts3ExprIterate(pCsr->pExpr, fts3ExprLoadDoclistsCb1, (void *)&sCtx); + if( rc==SQLITE_OK ){ + (void)fts3ExprIterate(pCsr->pExpr, fts3ExprLoadDoclistsCb2, 0); + } + if( pnPhrase ) *pnPhrase = sCtx.nPhrase; + if( pnToken ) *pnToken = sCtx.nToken; + return rc; +} + +/* +** Advance the position list iterator specified by the first two +** arguments so that it points to the first element with a value greater +** than or equal to parameter iNext. +*/ +static void fts3SnippetAdvance(char **ppIter, int *piIter, int iNext){ + char *pIter = *ppIter; + if( pIter ){ + int iIter = *piIter; + + while( iIteriCurrent<0 ){ + /* The SnippetIter object has just been initialized. The first snippet + ** candidate always starts at offset 0 (even if this candidate has a + ** score of 0.0). + */ + pIter->iCurrent = 0; + + /* Advance the 'head' iterator of each phrase to the first offset that + ** is greater than or equal to (iNext+nSnippet). + */ + for(i=0; inPhrase; i++){ + SnippetPhrase *pPhrase = &pIter->aPhrase[i]; + fts3SnippetAdvance(&pPhrase->pHead, &pPhrase->iHead, pIter->nSnippet); + } + }else{ + int iStart; + int iEnd = 0x7FFFFFFF; + + for(i=0; inPhrase; i++){ + SnippetPhrase *pPhrase = &pIter->aPhrase[i]; + if( pPhrase->pHead && pPhrase->iHeadiHead; + } + } + if( iEnd==0x7FFFFFFF ){ + return 1; + } + + pIter->iCurrent = iStart = iEnd - pIter->nSnippet + 1; + for(i=0; inPhrase; i++){ + SnippetPhrase *pPhrase = &pIter->aPhrase[i]; + fts3SnippetAdvance(&pPhrase->pHead, &pPhrase->iHead, iEnd+1); + fts3SnippetAdvance(&pPhrase->pTail, &pPhrase->iTail, iStart); + } + } + + return 0; +} + +/* +** Retrieve information about the current candidate snippet of snippet +** iterator pIter. +*/ +static void fts3SnippetDetails( + SnippetIter *pIter, /* Snippet iterator */ + u64 mCovered, /* Bitmask of phrases already covered */ + int *piToken, /* OUT: First token of proposed snippet */ + int *piScore, /* OUT: "Score" for this snippet */ + u64 *pmCover, /* OUT: Bitmask of phrases covered */ + u64 *pmHighlight /* OUT: Bitmask of terms to highlight */ +){ + int iStart = pIter->iCurrent; /* First token of snippet */ + int iScore = 0; /* Score of this snippet */ + int i; /* Loop counter */ + u64 mCover = 0; /* Mask of phrases covered by this snippet */ + u64 mHighlight = 0; /* Mask of tokens to highlight in snippet */ + + for(i=0; inPhrase; i++){ + SnippetPhrase *pPhrase = &pIter->aPhrase[i]; + if( pPhrase->pTail ){ + char *pCsr = pPhrase->pTail; + int iCsr = pPhrase->iTail; + + while( iCsr<(iStart+pIter->nSnippet) ){ + int j; + u64 mPhrase = (u64)1 << i; + u64 mPos = (u64)1 << (iCsr - iStart); + assert( iCsr>=iStart ); + if( (mCover|mCovered)&mPhrase ){ + iScore++; + }else{ + iScore += 1000; + } + mCover |= mPhrase; + + for(j=0; jnToken; j++){ + mHighlight |= (mPos>>j); + } + + if( 0==(*pCsr & 0x0FE) ) break; + fts3GetDeltaPosition(&pCsr, &iCsr); + } + } + } + + /* Set the output variables before returning. */ + *piToken = iStart; + *piScore = iScore; + *pmCover = mCover; + *pmHighlight = mHighlight; +} + +/* +** This function is an fts3ExprIterate() callback used by fts3BestSnippet(). +** Each invocation populates an element of the SnippetIter.aPhrase[] array. +*/ +static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ + SnippetIter *p = (SnippetIter *)ctx; + SnippetPhrase *pPhrase = &p->aPhrase[iPhrase]; + char *pCsr; + + pPhrase->nToken = pExpr->pPhrase->nToken; + + pCsr = sqlite3Fts3FindPositions(pExpr, p->pCsr->iPrevId, p->iCol); + if( pCsr ){ + int iFirst = 0; + pPhrase->pList = pCsr; + fts3GetDeltaPosition(&pCsr, &iFirst); + pPhrase->pHead = pCsr; + pPhrase->pTail = pCsr; + pPhrase->iHead = iFirst; + pPhrase->iTail = iFirst; + }else{ + assert( pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0 ); + } + + return SQLITE_OK; +} + +/* +** Select the fragment of text consisting of nFragment contiguous tokens +** from column iCol that represent the "best" snippet. The best snippet +** is the snippet with the highest score, where scores are calculated +** by adding: +** +** (a) +1 point for each occurence of a matchable phrase in the snippet. +** +** (b) +1000 points for the first occurence of each matchable phrase in +** the snippet for which the corresponding mCovered bit is not set. +** +** The selected snippet parameters are stored in structure *pFragment before +** returning. The score of the selected snippet is stored in *piScore +** before returning. +*/ +static int fts3BestSnippet( + int nSnippet, /* Desired snippet length */ + Fts3Cursor *pCsr, /* Cursor to create snippet for */ + int iCol, /* Index of column to create snippet from */ + u64 mCovered, /* Mask of phrases already covered */ + u64 *pmSeen, /* IN/OUT: Mask of phrases seen */ + SnippetFragment *pFragment, /* OUT: Best snippet found */ + int *piScore /* OUT: Score of snippet pFragment */ +){ + int rc; /* Return Code */ + int nList; /* Number of phrases in expression */ + SnippetIter sIter; /* Iterates through snippet candidates */ + int nByte; /* Number of bytes of space to allocate */ + int iBestScore = -1; /* Best snippet score found so far */ + int i; /* Loop counter */ + + memset(&sIter, 0, sizeof(sIter)); + + /* Iterate through the phrases in the expression to count them. The same + ** callback makes sure the doclists are loaded for each phrase. + */ + rc = fts3ExprLoadDoclists(pCsr, &nList, 0); + if( rc!=SQLITE_OK ){ + return rc; + } + + /* Now that it is known how many phrases there are, allocate and zero + ** the required space using malloc(). + */ + nByte = sizeof(SnippetPhrase) * nList; + sIter.aPhrase = (SnippetPhrase *)sqlite3_malloc(nByte); + if( !sIter.aPhrase ){ + return SQLITE_NOMEM; + } + memset(sIter.aPhrase, 0, nByte); + + /* Initialize the contents of the SnippetIter object. Then iterate through + ** the set of phrases in the expression to populate the aPhrase[] array. + */ + sIter.pCsr = pCsr; + sIter.iCol = iCol; + sIter.nSnippet = nSnippet; + sIter.nPhrase = nList; + sIter.iCurrent = -1; + (void)fts3ExprIterate(pCsr->pExpr, fts3SnippetFindPositions, (void *)&sIter); + + /* Set the *pmSeen output variable. */ + for(i=0; iiCol = iCol; + while( !fts3SnippetNextCandidate(&sIter) ){ + int iPos; + int iScore; + u64 mCover; + u64 mHighlight; + fts3SnippetDetails(&sIter, mCovered, &iPos, &iScore, &mCover, &mHighlight); + assert( iScore>=0 ); + if( iScore>iBestScore ){ + pFragment->iPos = iPos; + pFragment->hlmask = mHighlight; + pFragment->covered = mCover; + iBestScore = iScore; + } + } + + sqlite3_free(sIter.aPhrase); + *piScore = iBestScore; + return SQLITE_OK; +} + + +/* +** Append a string to the string-buffer passed as the first argument. +** +** If nAppend is negative, then the length of the string zAppend is +** determined using strlen(). +*/ +static int fts3StringAppend( + StrBuffer *pStr, /* Buffer to append to */ + const char *zAppend, /* Pointer to data to append to buffer */ + int nAppend /* Size of zAppend in bytes (or -1) */ +){ + if( nAppend<0 ){ + nAppend = (int)strlen(zAppend); + } + + /* If there is insufficient space allocated at StrBuffer.z, use realloc() + ** to grow the buffer until so that it is big enough to accomadate the + ** appended data. + */ + if( pStr->n+nAppend+1>=pStr->nAlloc ){ + int nAlloc = pStr->nAlloc+nAppend+100; + char *zNew = sqlite3_realloc(pStr->z, nAlloc); + if( !zNew ){ + return SQLITE_NOMEM; + } + pStr->z = zNew; + pStr->nAlloc = nAlloc; + } + + /* Append the data to the string buffer. */ + memcpy(&pStr->z[pStr->n], zAppend, nAppend); + pStr->n += nAppend; + pStr->z[pStr->n] = '\0'; + + return SQLITE_OK; +} + +/* +** The fts3BestSnippet() function often selects snippets that end with a +** query term. That is, the final term of the snippet is always a term +** that requires highlighting. For example, if 'X' is a highlighted term +** and '.' is a non-highlighted term, BestSnippet() may select: +** +** ........X.....X +** +** This function "shifts" the beginning of the snippet forward in the +** document so that there are approximately the same number of +** non-highlighted terms to the right of the final highlighted term as there +** are to the left of the first highlighted term. For example, to this: +** +** ....X.....X.... +** +** This is done as part of extracting the snippet text, not when selecting +** the snippet. Snippet selection is done based on doclists only, so there +** is no way for fts3BestSnippet() to know whether or not the document +** actually contains terms that follow the final highlighted term. +*/ +static int fts3SnippetShift( + Fts3Table *pTab, /* FTS3 table snippet comes from */ + int nSnippet, /* Number of tokens desired for snippet */ + const char *zDoc, /* Document text to extract snippet from */ + int nDoc, /* Size of buffer zDoc in bytes */ + int *piPos, /* IN/OUT: First token of snippet */ + u64 *pHlmask /* IN/OUT: Mask of tokens to highlight */ +){ + u64 hlmask = *pHlmask; /* Local copy of initial highlight-mask */ + + if( hlmask ){ + int nLeft; /* Tokens to the left of first highlight */ + int nRight; /* Tokens to the right of last highlight */ + int nDesired; /* Ideal number of tokens to shift forward */ + + for(nLeft=0; !(hlmask & ((u64)1 << nLeft)); nLeft++); + for(nRight=0; !(hlmask & ((u64)1 << (nSnippet-1-nRight))); nRight++); + nDesired = (nLeft-nRight)/2; + + /* Ideally, the start of the snippet should be pushed forward in the + ** document nDesired tokens. This block checks if there are actually + ** nDesired tokens to the right of the snippet. If so, *piPos and + ** *pHlMask are updated to shift the snippet nDesired tokens to the + ** right. Otherwise, the snippet is shifted by the number of tokens + ** available. + */ + if( nDesired>0 ){ + int nShift; /* Number of tokens to shift snippet by */ + int iCurrent = 0; /* Token counter */ + int rc; /* Return Code */ + sqlite3_tokenizer_module *pMod; + sqlite3_tokenizer_cursor *pC; + pMod = (sqlite3_tokenizer_module *)pTab->pTokenizer->pModule; + + /* Open a cursor on zDoc/nDoc. Check if there are (nSnippet+nDesired) + ** or more tokens in zDoc/nDoc. + */ + rc = pMod->xOpen(pTab->pTokenizer, zDoc, nDoc, &pC); + if( rc!=SQLITE_OK ){ + return rc; + } + pC->pTokenizer = pTab->pTokenizer; + while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){ + const char *ZDUMMY; int DUMMY1, DUMMY2, DUMMY3; + rc = pMod->xNext(pC, &ZDUMMY, &DUMMY1, &DUMMY2, &DUMMY3, &iCurrent); + } + pMod->xClose(pC); + if( rc!=SQLITE_OK && rc!=SQLITE_DONE ){ return rc; } + + nShift = (rc==SQLITE_DONE)+iCurrent-nSnippet; + assert( nShift<=nDesired ); + if( nShift>0 ){ + *piPos += nShift; + *pHlmask = hlmask >> nShift; + } + } + } + return SQLITE_OK; +} + +/* +** Extract the snippet text for fragment pFragment from cursor pCsr and +** append it to string buffer pOut. +*/ +static int fts3SnippetText( + Fts3Cursor *pCsr, /* FTS3 Cursor */ + SnippetFragment *pFragment, /* Snippet to extract */ + int iFragment, /* Fragment number */ + int isLast, /* True for final fragment in snippet */ + int nSnippet, /* Number of tokens in extracted snippet */ + const char *zOpen, /* String inserted before highlighted term */ + const char *zClose, /* String inserted after highlighted term */ + const char *zEllipsis, /* String inserted between snippets */ + StrBuffer *pOut /* Write output here */ +){ + Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; + int rc; /* Return code */ + const char *zDoc; /* Document text to extract snippet from */ + int nDoc; /* Size of zDoc in bytes */ + int iCurrent = 0; /* Current token number of document */ + int iEnd = 0; /* Byte offset of end of current token */ + int isShiftDone = 0; /* True after snippet is shifted */ + int iPos = pFragment->iPos; /* First token of snippet */ + u64 hlmask = pFragment->hlmask; /* Highlight-mask for snippet */ + int iCol = pFragment->iCol+1; /* Query column to extract text from */ + sqlite3_tokenizer_module *pMod; /* Tokenizer module methods object */ + sqlite3_tokenizer_cursor *pC; /* Tokenizer cursor open on zDoc/nDoc */ + const char *ZDUMMY; /* Dummy argument used with tokenizer */ + int DUMMY1; /* Dummy argument used with tokenizer */ + + zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol); + if( zDoc==0 ){ + if( sqlite3_column_type(pCsr->pStmt, iCol)!=SQLITE_NULL ){ + return SQLITE_NOMEM; + } + return SQLITE_OK; + } + nDoc = sqlite3_column_bytes(pCsr->pStmt, iCol); + + /* Open a token cursor on the document. */ + pMod = (sqlite3_tokenizer_module *)pTab->pTokenizer->pModule; + rc = pMod->xOpen(pTab->pTokenizer, zDoc, nDoc, &pC); + if( rc!=SQLITE_OK ){ + return rc; + } + pC->pTokenizer = pTab->pTokenizer; + + while( rc==SQLITE_OK ){ + int iBegin; /* Offset in zDoc of start of token */ + int iFin; /* Offset in zDoc of end of token */ + int isHighlight; /* True for highlighted terms */ + + rc = pMod->xNext(pC, &ZDUMMY, &DUMMY1, &iBegin, &iFin, &iCurrent); + if( rc!=SQLITE_OK ){ + if( rc==SQLITE_DONE ){ + /* Special case - the last token of the snippet is also the last token + ** of the column. Append any punctuation that occurred between the end + ** of the previous token and the end of the document to the output. + ** Then break out of the loop. */ + rc = fts3StringAppend(pOut, &zDoc[iEnd], -1); + } + break; + } + if( iCurrent0 || iFragment>0) ){ + rc = fts3StringAppend(pOut, zEllipsis, -1); + } + if( rc!=SQLITE_OK || iCurrent=(iPos+nSnippet) ){ + if( isLast ){ + rc = fts3StringAppend(pOut, zEllipsis, -1); + } + break; + } + + /* Set isHighlight to true if this term should be highlighted. */ + isHighlight = (hlmask & ((u64)1 << (iCurrent-iPos)))!=0; + + if( iCurrent>iPos ) rc = fts3StringAppend(pOut, &zDoc[iEnd], iBegin-iEnd); + if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zOpen, -1); + if( rc==SQLITE_OK ) rc = fts3StringAppend(pOut, &zDoc[iBegin], iFin-iBegin); + if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zClose, -1); + + iEnd = iFin; + } + + pMod->xClose(pC); + return rc; +} + + +/* +** This function is used to count the entries in a column-list (a +** delta-encoded list of term offsets within a single column of a single +** row). When this function is called, *ppCollist should point to the +** beginning of the first varint in the column-list (the varint that +** contains the position of the first matching term in the column data). +** Before returning, *ppCollist is set to point to the first byte after +** the last varint in the column-list (either the 0x00 signifying the end +** of the position-list, or the 0x01 that precedes the column number of +** the next column in the position-list). +** +** The number of elements in the column-list is returned. +*/ +static int fts3ColumnlistCount(char **ppCollist){ + char *pEnd = *ppCollist; + char c = 0; + int nEntry = 0; + + /* A column-list is terminated by either a 0x01 or 0x00. */ + while( 0xFE & (*pEnd | c) ){ + c = *pEnd++ & 0x80; + if( !c ) nEntry++; + } + + *ppCollist = pEnd; + return nEntry; +} + +static void fts3LoadColumnlistCounts(char **pp, u32 *aOut, int isGlobal){ + char *pCsr = *pp; + while( *pCsr ){ + int nHit; + sqlite3_int64 iCol = 0; + if( *pCsr==0x01 ){ + pCsr++; + pCsr += sqlite3Fts3GetVarint(pCsr, &iCol); + } + nHit = fts3ColumnlistCount(&pCsr); + assert( nHit>0 ); + if( isGlobal ){ + aOut[iCol*3+1]++; + } + aOut[iCol*3] += nHit; + } + pCsr++; + *pp = pCsr; +} + +/* +** fts3ExprIterate() callback used to collect the "global" matchinfo stats +** for a single query. The "global" stats are those elements of the matchinfo +** array that are constant for all rows returned by the current query. +*/ +static int fts3ExprGlobalMatchinfoCb( + Fts3Expr *pExpr, /* Phrase expression node */ + int iPhrase, /* Phrase number (numbered from zero) */ + void *pCtx /* Pointer to MatchInfo structure */ +){ + MatchInfo *p = (MatchInfo *)pCtx; + char *pCsr; + char *pEnd; + const int iStart = 2 + (iPhrase * p->nCol * 3) + 1; + + assert( pExpr->isLoaded ); + + /* Fill in the global hit count matrix row for this phrase. */ + pCsr = pExpr->aDoclist; + pEnd = &pExpr->aDoclist[pExpr->nDoclist]; + while( pCsraMatchinfo[iStart], 1); + } + + return SQLITE_OK; +} + +/* +** fts3ExprIterate() callback used to collect the "local" matchinfo stats +** for a single query. The "local" stats are those elements of the matchinfo +** array that are different for each row returned by the query. +*/ +static int fts3ExprLocalMatchinfoCb( + Fts3Expr *pExpr, /* Phrase expression node */ + int iPhrase, /* Phrase number */ + void *pCtx /* Pointer to MatchInfo structure */ +){ + MatchInfo *p = (MatchInfo *)pCtx; + + if( pExpr->aDoclist ){ + char *pCsr; + int iStart = 2 + (iPhrase * p->nCol * 3); + int i; + + for(i=0; inCol; i++) p->aMatchinfo[iStart+i*3] = 0; + + pCsr = sqlite3Fts3FindPositions(pExpr, p->pCursor->iPrevId, -1); + if( pCsr ){ + fts3LoadColumnlistCounts(&pCsr, &p->aMatchinfo[iStart], 0); + } + } + + return SQLITE_OK; +} + +/* +** Populate pCsr->aMatchinfo[] with data for the current row. The +** 'matchinfo' data is an array of 32-bit unsigned integers (C type u32). +*/ +static int fts3GetMatchinfo(Fts3Cursor *pCsr){ + MatchInfo sInfo; + Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; + int rc = SQLITE_OK; + + sInfo.pCursor = pCsr; + sInfo.nCol = pTab->nColumn; + + if( pCsr->aMatchinfo==0 ){ + /* If Fts3Cursor.aMatchinfo[] is NULL, then this is the first time the + ** matchinfo function has been called for this query. In this case + ** allocate the array used to accumulate the matchinfo data and + ** initialize those elements that are constant for every row. + */ + int nPhrase; /* Number of phrases */ + int nMatchinfo; /* Number of u32 elements in match-info */ + + /* Load doclists for each phrase in the query. */ + rc = fts3ExprLoadDoclists(pCsr, &nPhrase, 0); + if( rc!=SQLITE_OK ){ + return rc; + } + nMatchinfo = 2 + 3*sInfo.nCol*nPhrase; + if( pTab->bHasDocsize ){ + nMatchinfo += 1 + 2*pTab->nColumn; + } + + sInfo.aMatchinfo = (u32 *)sqlite3_malloc(sizeof(u32)*nMatchinfo); + if( !sInfo.aMatchinfo ){ + return SQLITE_NOMEM; + } + memset(sInfo.aMatchinfo, 0, sizeof(u32)*nMatchinfo); + + + /* First element of match-info is the number of phrases in the query */ + sInfo.aMatchinfo[0] = nPhrase; + sInfo.aMatchinfo[1] = sInfo.nCol; + (void)fts3ExprIterate(pCsr->pExpr, fts3ExprGlobalMatchinfoCb,(void*)&sInfo); + if( pTab->bHasDocsize ){ + int ofst = 2 + 3*sInfo.aMatchinfo[0]*sInfo.aMatchinfo[1]; + rc = sqlite3Fts3MatchinfoDocsizeGlobal(pCsr, &sInfo.aMatchinfo[ofst]); + } + pCsr->aMatchinfo = sInfo.aMatchinfo; + pCsr->isMatchinfoNeeded = 1; + } + + sInfo.aMatchinfo = pCsr->aMatchinfo; + if( rc==SQLITE_OK && pCsr->isMatchinfoNeeded ){ + (void)fts3ExprIterate(pCsr->pExpr, fts3ExprLocalMatchinfoCb, (void*)&sInfo); + if( pTab->bHasDocsize ){ + int ofst = 2 + 3*sInfo.aMatchinfo[0]*sInfo.aMatchinfo[1]; + rc = sqlite3Fts3MatchinfoDocsizeLocal(pCsr, &sInfo.aMatchinfo[ofst]); + } + pCsr->isMatchinfoNeeded = 0; + } + + return SQLITE_OK; +} + +/* +** Implementation of snippet() function. +*/ +SQLITE_PRIVATE void sqlite3Fts3Snippet( + sqlite3_context *pCtx, /* SQLite function call context */ + Fts3Cursor *pCsr, /* Cursor object */ + const char *zStart, /* Snippet start text - "" */ + const char *zEnd, /* Snippet end text - "" */ + const char *zEllipsis, /* Snippet ellipsis text - "..." */ + int iCol, /* Extract snippet from this column */ + int nToken /* Approximate number of tokens in snippet */ +){ + Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; + int rc = SQLITE_OK; + int i; + StrBuffer res = {0, 0, 0}; + + /* The returned text includes up to four fragments of text extracted from + ** the data in the current row. The first iteration of the for(...) loop + ** below attempts to locate a single fragment of text nToken tokens in + ** size that contains at least one instance of all phrases in the query + ** expression that appear in the current row. If such a fragment of text + ** cannot be found, the second iteration of the loop attempts to locate + ** a pair of fragments, and so on. + */ + int nSnippet = 0; /* Number of fragments in this snippet */ + SnippetFragment aSnippet[4]; /* Maximum of 4 fragments per snippet */ + int nFToken = -1; /* Number of tokens in each fragment */ + + if( !pCsr->pExpr ){ + sqlite3_result_text(pCtx, "", 0, SQLITE_STATIC); + return; + } + + for(nSnippet=1; 1; nSnippet++){ + + int iSnip; /* Loop counter 0..nSnippet-1 */ + u64 mCovered = 0; /* Bitmask of phrases covered by snippet */ + u64 mSeen = 0; /* Bitmask of phrases seen by BestSnippet() */ + + if( nToken>=0 ){ + nFToken = (nToken+nSnippet-1) / nSnippet; + }else{ + nFToken = -1 * nToken; + } + + for(iSnip=0; iSnipnColumn; iRead++){ + SnippetFragment sF; + int iS; + if( iCol>=0 && iRead!=iCol ) continue; + + /* Find the best snippet of nFToken tokens in column iRead. */ + rc = fts3BestSnippet(nFToken, pCsr, iRead, mCovered, &mSeen, &sF, &iS); + if( rc!=SQLITE_OK ){ + goto snippet_out; + } + if( iS>iBestScore ){ + *pFragment = sF; + iBestScore = iS; + } + } + + mCovered |= pFragment->covered; + } + + /* If all query phrases seen by fts3BestSnippet() are present in at least + ** one of the nSnippet snippet fragments, break out of the loop. + */ + assert( (mCovered&mSeen)==mCovered ); + if( mSeen==mCovered || nSnippet==SizeofArray(aSnippet) ) break; + } + + assert( nFToken>0 ); + + for(i=0; iiDocid, p->iCol); + nTerm = pExpr->pPhrase->nToken; + if( pList ){ + fts3GetDeltaPosition(&pList, &iPos); + assert( iPos>=0 ); + } + + for(iTerm=0; iTermaTerm[p->iTerm++]; + pT->iOff = nTerm-iTerm-1; + pT->pList = pList; + pT->iPos = iPos; + } + + return SQLITE_OK; +} + +/* +** Implementation of offsets() function. +*/ +SQLITE_PRIVATE void sqlite3Fts3Offsets( + sqlite3_context *pCtx, /* SQLite function call context */ + Fts3Cursor *pCsr /* Cursor object */ +){ + Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; + sqlite3_tokenizer_module const *pMod = pTab->pTokenizer->pModule; + const char *ZDUMMY; /* Dummy argument used with xNext() */ + int NDUMMY; /* Dummy argument used with xNext() */ + int rc; /* Return Code */ + int nToken; /* Number of tokens in query */ + int iCol; /* Column currently being processed */ + StrBuffer res = {0, 0, 0}; /* Result string */ + TermOffsetCtx sCtx; /* Context for fts3ExprTermOffsetInit() */ + + if( !pCsr->pExpr ){ + sqlite3_result_text(pCtx, "", 0, SQLITE_STATIC); + return; + } + + memset(&sCtx, 0, sizeof(sCtx)); + assert( pCsr->isRequireSeek==0 ); + + /* Count the number of terms in the query */ + rc = fts3ExprLoadDoclists(pCsr, 0, &nToken); + if( rc!=SQLITE_OK ) goto offsets_out; + + /* Allocate the array of TermOffset iterators. */ + sCtx.aTerm = (TermOffset *)sqlite3_malloc(sizeof(TermOffset)*nToken); + if( 0==sCtx.aTerm ){ + rc = SQLITE_NOMEM; + goto offsets_out; + } + sCtx.iDocid = pCsr->iPrevId; + + /* Loop through the table columns, appending offset information to + ** string-buffer res for each column. + */ + for(iCol=0; iColnColumn; iCol++){ + sqlite3_tokenizer_cursor *pC; /* Tokenizer cursor */ + int iStart; + int iEnd; + int iCurrent; + const char *zDoc; + int nDoc; + + /* Initialize the contents of sCtx.aTerm[] for column iCol. There is + ** no way that this operation can fail, so the return code from + ** fts3ExprIterate() can be discarded. + */ + sCtx.iCol = iCol; + sCtx.iTerm = 0; + (void)fts3ExprIterate(pCsr->pExpr, fts3ExprTermOffsetInit, (void *)&sCtx); + + /* Retreive the text stored in column iCol. If an SQL NULL is stored + ** in column iCol, jump immediately to the next iteration of the loop. + ** If an OOM occurs while retrieving the data (this can happen if SQLite + ** needs to transform the data from utf-16 to utf-8), return SQLITE_NOMEM + ** to the caller. + */ + zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol+1); + nDoc = sqlite3_column_bytes(pCsr->pStmt, iCol+1); + if( zDoc==0 ){ + if( sqlite3_column_type(pCsr->pStmt, iCol+1)==SQLITE_NULL ){ + continue; + } + rc = SQLITE_NOMEM; + goto offsets_out; + } + + /* Initialize a tokenizer iterator to iterate through column iCol. */ + rc = pMod->xOpen(pTab->pTokenizer, zDoc, nDoc, &pC); + if( rc!=SQLITE_OK ) goto offsets_out; + pC->pTokenizer = pTab->pTokenizer; + + rc = pMod->xNext(pC, &ZDUMMY, &NDUMMY, &iStart, &iEnd, &iCurrent); + while( rc==SQLITE_OK ){ + int i; /* Used to loop through terms */ + int iMinPos = 0x7FFFFFFF; /* Position of next token */ + TermOffset *pTerm = 0; /* TermOffset associated with next token */ + + for(i=0; ipList && (pT->iPos-pT->iOff)iPos-pT->iOff; + pTerm = pT; + } + } + + if( !pTerm ){ + /* All offsets for this column have been gathered. */ + break; + }else{ + assert( iCurrent<=iMinPos ); + if( 0==(0xFE&*pTerm->pList) ){ + pTerm->pList = 0; + }else{ + fts3GetDeltaPosition(&pTerm->pList, &pTerm->iPos); + } + while( rc==SQLITE_OK && iCurrentxNext(pC, &ZDUMMY, &NDUMMY, &iStart, &iEnd, &iCurrent); + } + if( rc==SQLITE_OK ){ + char aBuffer[64]; + sqlite3_snprintf(sizeof(aBuffer), aBuffer, + "%d %d %d %d ", iCol, pTerm-sCtx.aTerm, iStart, iEnd-iStart + ); + rc = fts3StringAppend(&res, aBuffer, -1); + }else if( rc==SQLITE_DONE ){ + rc = SQLITE_CORRUPT; + } + } + } + if( rc==SQLITE_DONE ){ + rc = SQLITE_OK; + } + + pMod->xClose(pC); + if( rc!=SQLITE_OK ) goto offsets_out; + } + + offsets_out: + sqlite3_free(sCtx.aTerm); + assert( rc!=SQLITE_DONE ); + if( rc!=SQLITE_OK ){ + sqlite3_result_error_code(pCtx, rc); + sqlite3_free(res.z); + }else{ + sqlite3_result_text(pCtx, res.z, res.n-1, sqlite3_free); + } + return; +} + +/* +** Implementation of matchinfo() function. +*/ +SQLITE_PRIVATE void sqlite3Fts3Matchinfo(sqlite3_context *pContext, Fts3Cursor *pCsr){ + int rc; + if( !pCsr->pExpr ){ + sqlite3_result_blob(pContext, "", 0, SQLITE_STATIC); + return; + } + rc = fts3GetMatchinfo(pCsr); + if( rc!=SQLITE_OK ){ + sqlite3_result_error_code(pContext, rc); + }else{ + Fts3Table *pTab = (Fts3Table*)pCsr->base.pVtab; + int n = sizeof(u32)*(2+pCsr->aMatchinfo[0]*pCsr->aMatchinfo[1]*3); + if( pTab->bHasDocsize ){ + n += sizeof(u32)*(1 + 2*pTab->nColumn); + } + sqlite3_result_blob(pContext, pCsr->aMatchinfo, n, SQLITE_TRANSIENT); + } +} + +#endif + +/************** End of fts3_snippet.c ****************************************/ /************** Begin file rtree.c *******************************************/ /* ** 2001 September 15 @@ -107241,8 +116935,45 @@ SQLITE_PRIVATE void sqlite3Fts3SimpleTokenizerModule( ************************************************************************* ** This file contains code for implementations of the r-tree and r*-tree ** algorithms packaged as an SQLite virtual table module. +*/ + +/* +** Database Format of R-Tree Tables +** -------------------------------- ** -** $Id: rtree.c,v 1.14 2009/08/06 18:36:47 danielk1977 Exp $ +** The data structure for a single virtual r-tree table is stored in three +** native SQLite tables declared as follows. In each case, the '%' character +** in the table name is replaced with the user-supplied name of the r-tree +** table. +** +** CREATE TABLE %_node(nodeno INTEGER PRIMARY KEY, data BLOB) +** CREATE TABLE %_parent(nodeno INTEGER PRIMARY KEY, parentnode INTEGER) +** CREATE TABLE %_rowid(rowid INTEGER PRIMARY KEY, nodeno INTEGER) +** +** The data for each node of the r-tree structure is stored in the %_node +** table. For each node that is not the root node of the r-tree, there is +** an entry in the %_parent table associating the node with its parent. +** And for each row of data in the table, there is an entry in the %_rowid +** table that maps from the entries rowid to the id of the node that it +** is stored on. +** +** The root node of an r-tree always exists, even if the r-tree table is +** empty. The nodeno of the root node is always 1. All other nodes in the +** table must be the same size as the root node. The content of each node +** is formatted as follows: +** +** 1. If the node is the root node (node 1), then the first 2 bytes +** of the node contain the tree depth as a big-endian integer. +** For non-root nodes, the first 2 bytes are left unused. +** +** 2. The next 2 bytes contain the number of entries currently +** stored in the node. +** +** 3. The remainder of the node contains the node entries. Each entry +** consists of a single 8-byte integer followed by an even number +** of 4-byte coordinates. For leaf nodes the integer is the rowid +** of a record. For internal nodes it is the node number of a +** child page. */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RTREE) @@ -107285,6 +117016,9 @@ SQLITE_PRIVATE void sqlite3Fts3SimpleTokenizerModule( #define AssignCells splitNodeStartree #endif +#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) +# define NDEBUG 1 +#endif #ifndef SQLITE_CORE SQLITE_EXTENSION_INIT1 @@ -107293,6 +117027,7 @@ SQLITE_PRIVATE void sqlite3Fts3SimpleTokenizerModule( #ifndef SQLITE_AMALGAMATION +#include "sqlite3rtree.h" typedef sqlite3_int64 i64; typedef unsigned char u8; typedef unsigned int u32; @@ -107303,6 +117038,8 @@ typedef struct RtreeCursor RtreeCursor; typedef struct RtreeNode RtreeNode; typedef struct RtreeCell RtreeCell; typedef struct RtreeConstraint RtreeConstraint; +typedef struct RtreeMatchArg RtreeMatchArg; +typedef struct RtreeGeomCallback RtreeGeomCallback; typedef union RtreeCoord RtreeCoord; /* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ @@ -107372,6 +117109,15 @@ struct Rtree { #define RTREE_REINSERT(p) RTREE_MINCELLS(p) #define RTREE_MAXCELLS 51 +/* +** The smallest possible node-size is (512-64)==448 bytes. And the largest +** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). +** Therefore all non-root nodes must contain at least 3 entries. Since +** 2^40 is greater than 2^64, an r-tree structure always has a depth of +** 40 or less. +*/ +#define RTREE_MAX_DEPTH 40 + /* ** An rtree cursor object. */ @@ -107404,35 +117150,23 @@ union RtreeCoord { ** A search constraint. */ struct RtreeConstraint { - int iCoord; /* Index of constrained coordinate */ - int op; /* Constraining operation */ - double rValue; /* Constraint value. */ + int iCoord; /* Index of constrained coordinate */ + int op; /* Constraining operation */ + double rValue; /* Constraint value. */ + int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *); + sqlite3_rtree_geometry *pGeom; /* Constraint callback argument for a MATCH */ }; /* Possible values for RtreeConstraint.op */ -#define RTREE_EQ 0x41 -#define RTREE_LE 0x42 -#define RTREE_LT 0x43 -#define RTREE_GE 0x44 -#define RTREE_GT 0x45 +#define RTREE_EQ 0x41 +#define RTREE_LE 0x42 +#define RTREE_LT 0x43 +#define RTREE_GE 0x44 +#define RTREE_GT 0x45 +#define RTREE_MATCH 0x46 /* ** An rtree structure node. -** -** Data format (RtreeNode.zData): -** -** 1. If the node is the root node (node 1), then the first 2 bytes -** of the node contain the tree depth as a big-endian integer. -** For non-root nodes, the first 2 bytes are left unused. -** -** 2. The next 2 bytes contain the number of entries currently -** stored in the node. -** -** 3. The remainder of the node contains the node entries. Each entry -** consists of a single 8-byte integer followed by an even number -** of 4-byte coordinates. For leaf nodes the integer is the rowid -** of a record. For internal nodes it is the node number of a -** child page. */ struct RtreeNode { RtreeNode *pParent; /* Parent node */ @@ -107452,6 +117186,40 @@ struct RtreeCell { RtreeCoord aCoord[RTREE_MAX_DIMENSIONS*2]; }; + +/* +** Value for the first field of every RtreeMatchArg object. The MATCH +** operator tests that the first field of a blob operand matches this +** value to avoid operating on invalid blobs (which could cause a segfault). +*/ +#define RTREE_GEOMETRY_MAGIC 0x891245AB + +/* +** An instance of this structure must be supplied as a blob argument to +** the right-hand-side of an SQL MATCH operator used to constrain an +** r-tree query. +*/ +struct RtreeMatchArg { + u32 magic; /* Always RTREE_GEOMETRY_MAGIC */ + int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *); + void *pContext; + int nParam; + double aParam[1]; +}; + +/* +** When a geometry callback is created (see sqlite3_rtree_geometry_callback), +** a single instance of the following structure is allocated. It is used +** as the context for the user-function created by by s_r_g_c(). The object +** is eventually deleted by the destructor mechanism provided by +** sqlite3_create_function_v2() (which is called by s_r_g_c() to create +** the geometry callback function). +*/ +struct RtreeGeomCallback { + int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *); + void *pContext; +}; + #ifndef MAX # define MAX(x,y) ((x) < (y) ? (y) : (x)) #endif @@ -107534,10 +117302,8 @@ static void nodeReference(RtreeNode *p){ ** Clear the content of node p (set all bytes to 0x00). */ static void nodeZero(Rtree *pRtree, RtreeNode *p){ - if( p ){ - memset(&p->zData[2], 0, pRtree->iNodeSize-2); - p->isDirty = 1; - } + memset(&p->zData[2], 0, pRtree->iNodeSize-2); + p->isDirty = 1; } /* @@ -107557,7 +117323,6 @@ static int nodeHash(i64 iNode){ */ static RtreeNode *nodeHashLookup(Rtree *pRtree, i64 iNode){ RtreeNode *p; - assert( iNode!=0 ); for(p=pRtree->aHash[nodeHash(iNode)]; p && p->iNode!=iNode; p=p->pNext); return p; } @@ -107566,13 +117331,11 @@ static RtreeNode *nodeHashLookup(Rtree *pRtree, i64 iNode){ ** Add node pNode to the node hash table. */ static void nodeHashInsert(Rtree *pRtree, RtreeNode *pNode){ - if( pNode ){ - int iHash; - assert( pNode->pNext==0 ); - iHash = nodeHash(pNode->iNode); - pNode->pNext = pRtree->aHash[iHash]; - pRtree->aHash[iHash] = pNode; - } + int iHash; + assert( pNode->pNext==0 ); + iHash = nodeHash(pNode->iNode); + pNode->pNext = pRtree->aHash[iHash]; + pRtree->aHash[iHash] = pNode; } /* @@ -107594,11 +117357,11 @@ static void nodeHashDelete(Rtree *pRtree, RtreeNode *pNode){ ** assigned a node number when nodeWrite() is called to write the ** node contents out to the database. */ -static RtreeNode *nodeNew(Rtree *pRtree, RtreeNode *pParent, int zero){ +static RtreeNode *nodeNew(Rtree *pRtree, RtreeNode *pParent){ RtreeNode *pNode; pNode = (RtreeNode *)sqlite3_malloc(sizeof(RtreeNode) + pRtree->iNodeSize); if( pNode ){ - memset(pNode, 0, sizeof(RtreeNode) + (zero?pRtree->iNodeSize:0)); + memset(pNode, 0, sizeof(RtreeNode) + pRtree->iNodeSize); pNode->zData = (u8 *)&pNode[1]; pNode->nRef = 1; pNode->pParent = pParent; @@ -107619,6 +117382,7 @@ nodeAcquire( RtreeNode **ppNode /* OUT: Acquired node */ ){ int rc; + int rc2 = SQLITE_OK; RtreeNode *pNode; /* Check if the requested node is already in the hash table. If so, @@ -107635,39 +117399,64 @@ nodeAcquire( return SQLITE_OK; } - pNode = (RtreeNode *)sqlite3_malloc(sizeof(RtreeNode) + pRtree->iNodeSize); - if( !pNode ){ - *ppNode = 0; - return SQLITE_NOMEM; - } - pNode->pParent = pParent; - pNode->zData = (u8 *)&pNode[1]; - pNode->nRef = 1; - pNode->iNode = iNode; - pNode->isDirty = 0; - pNode->pNext = 0; - sqlite3_bind_int64(pRtree->pReadNode, 1, iNode); rc = sqlite3_step(pRtree->pReadNode); if( rc==SQLITE_ROW ){ const u8 *zBlob = sqlite3_column_blob(pRtree->pReadNode, 0); - memcpy(pNode->zData, zBlob, pRtree->iNodeSize); - nodeReference(pParent); + if( pRtree->iNodeSize==sqlite3_column_bytes(pRtree->pReadNode, 0) ){ + pNode = (RtreeNode *)sqlite3_malloc(sizeof(RtreeNode)+pRtree->iNodeSize); + if( !pNode ){ + rc2 = SQLITE_NOMEM; + }else{ + pNode->pParent = pParent; + pNode->zData = (u8 *)&pNode[1]; + pNode->nRef = 1; + pNode->iNode = iNode; + pNode->isDirty = 0; + pNode->pNext = 0; + memcpy(pNode->zData, zBlob, pRtree->iNodeSize); + nodeReference(pParent); + } + } + } + rc = sqlite3_reset(pRtree->pReadNode); + if( rc==SQLITE_OK ) rc = rc2; + + /* If the root node was just loaded, set pRtree->iDepth to the height + ** of the r-tree structure. A height of zero means all data is stored on + ** the root node. A height of one means the children of the root node + ** are the leaves, and so on. If the depth as specified on the root node + ** is greater than RTREE_MAX_DEPTH, the r-tree structure must be corrupt. + */ + if( pNode && iNode==1 ){ + pRtree->iDepth = readInt16(pNode->zData); + if( pRtree->iDepth>RTREE_MAX_DEPTH ){ + rc = SQLITE_CORRUPT; + } + } + + /* If no error has occurred so far, check if the "number of entries" + ** field on the node is too large. If so, set the return code to + ** SQLITE_CORRUPT. + */ + if( pNode && rc==SQLITE_OK ){ + if( NCELL(pNode)>((pRtree->iNodeSize-4)/pRtree->nBytesPerCell) ){ + rc = SQLITE_CORRUPT; + } + } + + if( rc==SQLITE_OK ){ + if( pNode!=0 ){ + nodeHashInsert(pRtree, pNode); + }else{ + rc = SQLITE_CORRUPT; + } + *ppNode = pNode; }else{ sqlite3_free(pNode); - pNode = 0; + *ppNode = 0; } - *ppNode = pNode; - rc = sqlite3_reset(pRtree->pReadNode); - - if( rc==SQLITE_OK && iNode==1 ){ - pRtree->iDepth = readInt16(pNode->zData); - } - - assert( (rc==SQLITE_OK && pNode) || (pNode==0 && rc!=SQLITE_OK) ); - nodeHashInsert(pRtree, pNode); - return rc; } @@ -107719,8 +117508,7 @@ nodeInsertCell( nMaxCell = (pRtree->iNodeSize-4)/pRtree->nBytesPerCell; nCell = NCELL(pNode); - assert(nCell<=nMaxCell); - + assert( nCell<=nMaxCell ); if( nCellzData[2], nCell+1); @@ -107940,6 +117728,25 @@ static int rtreeOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ return rc; } + +/* +** Free the RtreeCursor.aConstraint[] array and its contents. +*/ +static void freeCursorConstraints(RtreeCursor *pCsr){ + if( pCsr->aConstraint ){ + int i; /* Used to iterate through constraint array */ + for(i=0; inConstraint; i++){ + sqlite3_rtree_geometry *pGeom = pCsr->aConstraint[i].pGeom; + if( pGeom ){ + if( pGeom->xDelUser ) pGeom->xDelUser(pGeom->pUser); + sqlite3_free(pGeom); + } + } + sqlite3_free(pCsr->aConstraint); + pCsr->aConstraint = 0; + } +} + /* ** Rtree virtual table module xClose method. */ @@ -107947,7 +117754,7 @@ static int rtreeClose(sqlite3_vtab_cursor *cur){ Rtree *pRtree = (Rtree *)(cur->pVtab); int rc; RtreeCursor *pCsr = (RtreeCursor *)cur; - sqlite3_free(pCsr->aConstraint); + freeCursorConstraints(pCsr); rc = nodeRelease(pRtree, pCsr->pNode); sqlite3_free(pCsr); return rc; @@ -107964,13 +117771,39 @@ static int rtreeEof(sqlite3_vtab_cursor *cur){ return (pCsr->pNode==0); } +/* +** The r-tree constraint passed as the second argument to this function is +** guaranteed to be a MATCH constraint. +*/ +static int testRtreeGeom( + Rtree *pRtree, /* R-Tree object */ + RtreeConstraint *pConstraint, /* MATCH constraint to test */ + RtreeCell *pCell, /* Cell to test */ + int *pbRes /* OUT: Test result */ +){ + int i; + double aCoord[RTREE_MAX_DIMENSIONS*2]; + int nCoord = pRtree->nDim*2; + + assert( pConstraint->op==RTREE_MATCH ); + assert( pConstraint->pGeom ); + + for(i=0; iaCoord[i]); + } + return pConstraint->xGeom(pConstraint->pGeom, nCoord, aCoord, pbRes); +} + /* ** Cursor pCursor currently points to a cell in a non-leaf page. -** Return true if the sub-tree headed by the cell is filtered +** Set *pbEof to true if the sub-tree headed by the cell is filtered ** (excluded) by the constraints in the pCursor->aConstraint[] ** array, or false otherwise. +** +** Return SQLITE_OK if successful or an SQLite error code if an error +** occurs within a geometry callback. */ -static int testRtreeCell(Rtree *pRtree, RtreeCursor *pCursor){ +static int testRtreeCell(Rtree *pRtree, RtreeCursor *pCursor, int *pbEof){ RtreeCell cell; int ii; int bRes = 0; @@ -107982,31 +117815,55 @@ static int testRtreeCell(Rtree *pRtree, RtreeCursor *pCursor){ double cell_max = DCOORD(cell.aCoord[(p->iCoord>>1)*2+1]); assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE - || p->op==RTREE_GT || p->op==RTREE_EQ + || p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_MATCH ); switch( p->op ){ - case RTREE_LE: case RTREE_LT: bRes = p->rValuerValue>cell_max; break; - case RTREE_EQ: + case RTREE_LE: case RTREE_LT: + bRes = p->rValuerValue>cell_max; + break; + + case RTREE_EQ: bRes = (p->rValue>cell_max || p->rValueop==RTREE_MATCH ); + rc = testRtreeGeom(pRtree, p, &cell, &bRes); + if( rc!=SQLITE_OK ){ + return rc; + } + bRes = !bRes; + break; + } } } - return bRes; + *pbEof = bRes; + return SQLITE_OK; } /* -** Return true if the cell that cursor pCursor currently points to +** Test if the cell that cursor pCursor currently points to ** would be filtered (excluded) by the constraints in the -** pCursor->aConstraint[] array, or false otherwise. +** pCursor->aConstraint[] array. If so, set *pbEof to true before +** returning. If the cell is not filtered (excluded) by the constraints, +** set pbEof to zero. +** +** Return SQLITE_OK if successful or an SQLite error code if an error +** occurs within a geometry callback. ** ** This function assumes that the cell is part of a leaf node. */ -static int testRtreeEntry(Rtree *pRtree, RtreeCursor *pCursor){ +static int testRtreeEntry(Rtree *pRtree, RtreeCursor *pCursor, int *pbEof){ RtreeCell cell; int ii; + *pbEof = 0; nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell); for(ii=0; iinConstraint; ii++){ @@ -108014,7 +117871,7 @@ static int testRtreeEntry(Rtree *pRtree, RtreeCursor *pCursor){ double coord = DCOORD(cell.aCoord[p->iCoord]); int res; assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE - || p->op==RTREE_GT || p->op==RTREE_EQ + || p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_MATCH ); switch( p->op ){ case RTREE_LE: res = (coord<=p->rValue); break; @@ -108022,12 +117879,24 @@ static int testRtreeEntry(Rtree *pRtree, RtreeCursor *pCursor){ case RTREE_GE: res = (coord>=p->rValue); break; case RTREE_GT: res = (coord>p->rValue); break; case RTREE_EQ: res = (coord==p->rValue); break; + default: { + int rc; + assert( p->op==RTREE_MATCH ); + rc = testRtreeGeom(pRtree, p, &cell, &res); + if( rc!=SQLITE_OK ){ + return rc; + } + break; + } } - if( !res ) return 1; + if( !res ){ + *pbEof = 1; + return SQLITE_OK; + } } - return 0; + return SQLITE_OK; } /* @@ -108054,13 +117923,13 @@ static int descendToCell( assert( iHeight>=0 ); if( iHeight==0 ){ - isEof = testRtreeEntry(pRtree, pCursor); + rc = testRtreeEntry(pRtree, pCursor, &isEof); }else{ - isEof = testRtreeCell(pRtree, pCursor); + rc = testRtreeCell(pRtree, pCursor, &isEof); } - if( isEof || iHeight==0 ){ + if( rc!=SQLITE_OK || isEof || iHeight==0 ){ *pEof = isEof; - return SQLITE_OK; + return rc; } iRowid = nodeGetRowid(pRtree, pCursor->pNode, pCursor->iCell); @@ -108096,24 +117965,34 @@ static int descendToCell( ** One of the cells in node pNode is guaranteed to have a 64-bit ** integer value equal to iRowid. Return the index of this cell. */ -static int nodeRowidIndex(Rtree *pRtree, RtreeNode *pNode, i64 iRowid){ +static int nodeRowidIndex( + Rtree *pRtree, + RtreeNode *pNode, + i64 iRowid, + int *piIndex +){ int ii; - for(ii=0; nodeGetRowid(pRtree, pNode, ii)!=iRowid; ii++){ - assert( ii<(NCELL(pNode)-1) ); + int nCell = NCELL(pNode); + for(ii=0; iipParent; if( pParent ){ - return nodeRowidIndex(pRtree, pParent, pNode->iNode); + return nodeRowidIndex(pRtree, pParent, pNode->iNode, piIndex); } - return -1; + *piIndex = -1; + return SQLITE_OK; } /* @@ -108124,13 +118003,17 @@ static int rtreeNext(sqlite3_vtab_cursor *pVtabCursor){ RtreeCursor *pCsr = (RtreeCursor *)pVtabCursor; int rc = SQLITE_OK; + /* RtreeCursor.pNode must not be NULL. If is is NULL, then this cursor is + ** already at EOF. It is against the rules to call the xNext() method of + ** a cursor that has already reached EOF. + */ + assert( pCsr->pNode ); + if( pCsr->iStrategy==1 ){ /* This "scan" is a direct lookup by rowid. There is no next entry. */ nodeRelease(pRtree, pCsr->pNode); pCsr->pNode = 0; - } - - else if( pCsr->pNode ){ + }else{ /* Move to the next entry that matches the configured constraints. */ int iHeight = 0; while( pCsr->pNode ){ @@ -108144,7 +118027,10 @@ static int rtreeNext(sqlite3_vtab_cursor *pVtabCursor){ } } pCsr->pNode = pNode->pParent; - pCsr->iCell = nodeParentIndex(pRtree, pNode); + rc = nodeParentIndex(pRtree, pNode, &pCsr->iCell); + if( rc!=SQLITE_OK ){ + return rc; + } nodeReference(pCsr->pNode); nodeRelease(pRtree, pNode); iHeight++; @@ -108212,6 +118098,51 @@ static int findLeafNode(Rtree *pRtree, i64 iRowid, RtreeNode **ppLeaf){ return rc; } +/* +** This function is called to configure the RtreeConstraint object passed +** as the second argument for a MATCH constraint. The value passed as the +** first argument to this function is the right-hand operand to the MATCH +** operator. +*/ +static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){ + RtreeMatchArg *p; + sqlite3_rtree_geometry *pGeom; + int nBlob; + + /* Check that value is actually a blob. */ + if( !sqlite3_value_type(pValue)==SQLITE_BLOB ) return SQLITE_ERROR; + + /* Check that the blob is roughly the right size. */ + nBlob = sqlite3_value_bytes(pValue); + if( nBlobmagic!=RTREE_GEOMETRY_MAGIC + || nBlob!=(sizeof(RtreeMatchArg) + (p->nParam-1)*sizeof(double)) + ){ + sqlite3_free(pGeom); + return SQLITE_ERROR; + } + + pGeom->pContext = p->pContext; + pGeom->nParam = p->nParam; + pGeom->aParam = p->aParam; + + pCons->xGeom = p->xGeom; + pCons->pGeom = pGeom; + return SQLITE_OK; +} /* ** Rtree virtual table module xFilter method. @@ -108230,8 +118161,7 @@ static int rtreeFilter( rtreeReference(pRtree); - sqlite3_free(pCsr->aConstraint); - pCsr->aConstraint = 0; + freeCursorConstraints(pCsr); pCsr->iStrategy = idxNum; if( idxNum==1 ){ @@ -108240,8 +118170,9 @@ static int rtreeFilter( i64 iRowid = sqlite3_value_int64(argv[0]); rc = findLeafNode(pRtree, iRowid, &pLeaf); pCsr->pNode = pLeaf; - if( pLeaf && rc==SQLITE_OK ){ - pCsr->iCell = nodeRowidIndex(pRtree, pLeaf, iRowid); + if( pLeaf ){ + assert( rc==SQLITE_OK ); + rc = nodeRowidIndex(pRtree, pLeaf, iRowid, &pCsr->iCell); } }else{ /* Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array @@ -108253,12 +118184,24 @@ static int rtreeFilter( if( !pCsr->aConstraint ){ rc = SQLITE_NOMEM; }else{ + memset(pCsr->aConstraint, 0, sizeof(RtreeConstraint)*argc); assert( (idxStr==0 && argc==0) || strlen(idxStr)==argc*2 ); for(ii=0; iiaConstraint[ii]; p->op = idxStr[ii*2]; p->iCoord = idxStr[ii*2+1]-'a'; - p->rValue = sqlite3_value_double(argv[ii]); + if( p->op==RTREE_MATCH ){ + /* A MATCH operator. The right-hand-side must be a blob that + ** can be cast into an RtreeMatchArg object. One created using + ** an sqlite3_rtree_geometry_callback() SQL user function. + */ + rc = deserializeGeometry(argv[ii], p); + if( rc!=SQLITE_OK ){ + break; + } + }else{ + p->rValue = sqlite3_value_double(argv[ii]); + } } } } @@ -108299,11 +118242,10 @@ static int rtreeFilter( ** idxNum idxStr Strategy ** ------------------------------------------------ ** 1 Unused Direct lookup by rowid. -** 2 See below R-tree query. -** 3 Unused Full table scan. +** 2 See below R-tree query or full-table scan. ** ------------------------------------------------ ** -** If strategy 1 or 3 is used, then idxStr is not meaningful. If strategy +** If strategy 1 is used, then idxStr is not meaningful. If strategy ** 2 is used, idxStr is formatted to contain 2 bytes for each ** constraint used. The first two bytes of idxStr correspond to ** the constraint in sqlite3_index_info.aConstraintUsage[] with @@ -108319,6 +118261,7 @@ static int rtreeFilter( ** < 0x43 ('C') ** >= 0x44 ('D') ** > 0x45 ('E') +** MATCH 0x46 ('F') ** ---------------------- ** ** The second of each pair of bytes identifies the coordinate column @@ -108357,7 +118300,9 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ return SQLITE_OK; } - if( p->usable && p->iColumn>0 ){ + if( p->usable && (p->iColumn>0 || p->op==SQLITE_INDEX_CONSTRAINT_MATCH) ){ + int j, opmsk; + static const unsigned char compatible[] = { 0, 0, 1, 1, 2, 2 }; u8 op = 0; switch( p->op ){ case SQLITE_INDEX_CONSTRAINT_EQ: op = RTREE_EQ; break; @@ -108365,31 +118310,33 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ case SQLITE_INDEX_CONSTRAINT_LE: op = RTREE_LE; break; case SQLITE_INDEX_CONSTRAINT_LT: op = RTREE_LT; break; case SQLITE_INDEX_CONSTRAINT_GE: op = RTREE_GE; break; + default: + assert( p->op==SQLITE_INDEX_CONSTRAINT_MATCH ); + op = RTREE_MATCH; + break; } - if( op ){ - /* Make sure this particular constraint has not been used before. - ** If it has been used before, ignore it. - ** - ** A <= or < can be used if there is a prior >= or >. - ** A >= or > can be used if there is a prior < or <=. - ** A <= or < is disqualified if there is a prior <=, <, or ==. - ** A >= or > is disqualified if there is a prior >=, >, or ==. - ** A == is disqualifed if there is any prior constraint. - */ - int j, opmsk; - static const unsigned char compatible[] = { 0, 0, 1, 1, 2, 2 }; - assert( compatible[RTREE_EQ & 7]==0 ); - assert( compatible[RTREE_LT & 7]==1 ); - assert( compatible[RTREE_LE & 7]==1 ); - assert( compatible[RTREE_GT & 7]==2 ); - assert( compatible[RTREE_GE & 7]==2 ); - cCol = p->iColumn - 1 + 'a'; - opmsk = compatible[op & 7]; - for(j=0; j= or >. + ** A >= or > can be used if there is a prior < or <=. + ** A <= or < is disqualified if there is a prior <=, <, or ==. + ** A >= or > is disqualified if there is a prior >=, >, or ==. + ** A == is disqualifed if there is any prior constraint. + */ + assert( compatible[RTREE_EQ & 7]==0 ); + assert( compatible[RTREE_LT & 7]==1 ); + assert( compatible[RTREE_LE & 7]==1 ); + assert( compatible[RTREE_GT & 7]==2 ); + assert( compatible[RTREE_GE & 7]==2 ); + cCol = p->iColumn - 1 + 'a'; + opmsk = compatible[op & 7]; + for(j=0; jnDim*2); jj+=2){ @@ -108590,22 +118542,31 @@ static int ChooseLeaf( ** the smallest area. */ for(iCell=0; iCelliDepth-1) ){ overlap = cellOverlapEnlargement(pRtree,&cell,pCell,aCell,nCell,iCell); } -#endif if( (iCell==0) || (overlappParent ){ - RtreeCell cell; RtreeNode *pParent = p->pParent; - int iCell = nodeParentIndex(pRtree, p); + RtreeCell cell; + int iCell; + + if( nodeParentIndex(pRtree, p, &iCell) ){ + return SQLITE_CORRUPT; + } nodeGetCell(pRtree, pParent, iCell, &cell); if( !cellContains(pRtree, &cell, pCell) ){ @@ -108647,6 +118612,7 @@ static void AdjustTree( p = pParent; } + return SQLITE_OK; } /* @@ -109175,14 +119141,14 @@ static int SplitNode( nCell++; if( pNode->iNode==1 ){ - pRight = nodeNew(pRtree, pNode, 1); - pLeft = nodeNew(pRtree, pNode, 1); + pRight = nodeNew(pRtree, pNode); + pLeft = nodeNew(pRtree, pNode); pRtree->iDepth++; pNode->isDirty = 1; writeInt16(pNode->zData, pRtree->iDepth); }else{ pLeft = pNode; - pRight = nodeNew(pRtree, pLeft->pParent, 1); + pRight = nodeNew(pRtree, pLeft->pParent); nodeReference(pLeft); } @@ -109199,8 +119165,12 @@ static int SplitNode( goto splitnode_out; } - /* Ensure both child nodes have node numbers assigned to them. */ - if( (0==pRight->iNode && SQLITE_OK!=(rc = nodeWrite(pRtree, pRight))) + /* Ensure both child nodes have node numbers assigned to them by calling + ** nodeWrite(). Node pRight always needs a node number, as it was created + ** by nodeNew() above. But node pLeft sometimes already has a node number. + ** In this case avoid the all to nodeWrite(). + */ + if( SQLITE_OK!=(rc = nodeWrite(pRtree, pRight)) || (0==pLeft->iNode && SQLITE_OK!=(rc = nodeWrite(pRtree, pLeft))) ){ goto splitnode_out; @@ -109216,9 +119186,15 @@ static int SplitNode( } }else{ RtreeNode *pParent = pLeft->pParent; - int iCell = nodeParentIndex(pRtree, pLeft); - nodeOverwriteCell(pRtree, pParent, &leftbbox, iCell); - AdjustTree(pRtree, pParent, &leftbbox); + int iCell; + rc = nodeParentIndex(pRtree, pLeft, &iCell); + if( rc==SQLITE_OK ){ + nodeOverwriteCell(pRtree, pParent, &leftbbox, iCell); + rc = AdjustTree(pRtree, pParent, &leftbbox); + } + if( rc!=SQLITE_OK ){ + goto splitnode_out; + } } if( (rc = rtreeInsertCell(pRtree, pRight->pParent, &rightbbox, iHeight+1)) ){ goto splitnode_out; @@ -109262,20 +119238,43 @@ splitnode_out: return rc; } +/* +** If node pLeaf is not the root of the r-tree and its pParent pointer is +** still NULL, load all ancestor nodes of pLeaf into memory and populate +** the pLeaf->pParent chain all the way up to the root node. +** +** This operation is required when a row is deleted (or updated - an update +** is implemented as a delete followed by an insert). SQLite provides the +** rowid of the row to delete, which can be used to find the leaf on which +** the entry resides (argument pLeaf). Once the leaf is located, this +** function is called to determine its ancestry. +*/ static int fixLeafParent(Rtree *pRtree, RtreeNode *pLeaf){ int rc = SQLITE_OK; - if( pLeaf->iNode!=1 && pLeaf->pParent==0 ){ - sqlite3_bind_int64(pRtree->pReadParent, 1, pLeaf->iNode); - if( sqlite3_step(pRtree->pReadParent)==SQLITE_ROW ){ - i64 iNode = sqlite3_column_int64(pRtree->pReadParent, 0); - rc = nodeAcquire(pRtree, iNode, 0, &pLeaf->pParent); - }else{ - rc = SQLITE_ERROR; - } - sqlite3_reset(pRtree->pReadParent); - if( rc==SQLITE_OK ){ - rc = fixLeafParent(pRtree, pLeaf->pParent); + RtreeNode *pChild = pLeaf; + while( rc==SQLITE_OK && pChild->iNode!=1 && pChild->pParent==0 ){ + int rc2 = SQLITE_OK; /* sqlite3_reset() return code */ + sqlite3_bind_int64(pRtree->pReadParent, 1, pChild->iNode); + rc = sqlite3_step(pRtree->pReadParent); + if( rc==SQLITE_ROW ){ + RtreeNode *pTest; /* Used to test for reference loops */ + i64 iNode; /* Node number of parent node */ + + /* Before setting pChild->pParent, test that we are not creating a + ** loop of references (as we would if, say, pChild==pParent). We don't + ** want to do this as it leads to a memory leak when trying to delete + ** the referenced counted node structures. + */ + iNode = sqlite3_column_int64(pRtree->pReadParent, 0); + for(pTest=pLeaf; pTest && pTest->iNode!=iNode; pTest=pTest->pParent); + if( !pTest ){ + rc2 = nodeAcquire(pRtree, iNode, 0, &pChild->pParent); + } } + rc = sqlite3_reset(pRtree->pReadParent); + if( rc==SQLITE_OK ) rc = rc2; + if( rc==SQLITE_OK && !pChild->pParent ) rc = SQLITE_CORRUPT; + pChild = pChild->pParent; } return rc; } @@ -109284,18 +119283,24 @@ static int deleteCell(Rtree *, RtreeNode *, int, int); static int removeNode(Rtree *pRtree, RtreeNode *pNode, int iHeight){ int rc; + int rc2; RtreeNode *pParent; int iCell; assert( pNode->nRef==1 ); /* Remove the entry in the parent cell. */ - iCell = nodeParentIndex(pRtree, pNode); - pParent = pNode->pParent; - pNode->pParent = 0; - if( SQLITE_OK!=(rc = deleteCell(pRtree, pParent, iCell, iHeight+1)) - || SQLITE_OK!=(rc = nodeRelease(pRtree, pParent)) - ){ + rc = nodeParentIndex(pRtree, pNode, &iCell); + if( rc==SQLITE_OK ){ + pParent = pNode->pParent; + pNode->pParent = 0; + rc = deleteCell(pRtree, pParent, iCell, iHeight+1); + } + rc2 = nodeRelease(pRtree, pParent); + if( rc==SQLITE_OK ){ + rc = rc2; + } + if( rc!=SQLITE_OK ){ return rc; } @@ -109325,8 +119330,9 @@ static int removeNode(Rtree *pRtree, RtreeNode *pNode, int iHeight){ return SQLITE_OK; } -static void fixBoundingBox(Rtree *pRtree, RtreeNode *pNode){ +static int fixBoundingBox(Rtree *pRtree, RtreeNode *pNode){ RtreeNode *pParent = pNode->pParent; + int rc = SQLITE_OK; if( pParent ){ int ii; int nCell = NCELL(pNode); @@ -109338,10 +119344,13 @@ static void fixBoundingBox(Rtree *pRtree, RtreeNode *pNode){ cellUnion(pRtree, &box, &cell); } box.iRowid = pNode->iNode; - ii = nodeParentIndex(pRtree, pNode); - nodeOverwriteCell(pRtree, pParent, &box, ii); - fixBoundingBox(pRtree, pParent); + rc = nodeParentIndex(pRtree, pNode, &ii); + if( rc==SQLITE_OK ){ + nodeOverwriteCell(pRtree, pParent, &box, ii); + rc = fixBoundingBox(pRtree, pParent); + } } + return rc; } /* @@ -109349,6 +119358,7 @@ static void fixBoundingBox(Rtree *pRtree, RtreeNode *pNode){ ** cell, adjust the r-tree data structure if required. */ static int deleteCell(Rtree *pRtree, RtreeNode *pNode, int iCell, int iHeight){ + RtreeNode *pParent; int rc; if( SQLITE_OK!=(rc = fixLeafParent(pRtree, pNode)) ){ @@ -109365,14 +119375,13 @@ static int deleteCell(Rtree *pRtree, RtreeNode *pNode, int iCell, int iHeight){ ** cell in the parent node so that it tightly contains the updated ** node. */ - if( pNode->iNode!=1 ){ - RtreeNode *pParent = pNode->pParent; - if( (pParent->iNode!=1 || NCELL(pParent)!=1) - && (NCELL(pNode)pParent; + assert( pParent || pNode->iNode==1 ); + if( pParent ){ + if( NCELL(pNode)iNode currently contains @@ -109509,11 +119518,13 @@ static int rtreeInsertCell( rc = SplitNode(pRtree, pNode, pCell, iHeight); #endif }else{ - AdjustTree(pRtree, pNode, pCell); - if( iHeight==0 ){ - rc = rowidWrite(pRtree, pCell->iRowid, pNode->iNode); - }else{ - rc = parentWrite(pRtree, pCell->iRowid, pNode->iNode); + rc = AdjustTree(pRtree, pNode, pCell); + if( rc==SQLITE_OK ){ + if( iHeight==0 ){ + rc = rowidWrite(pRtree, pCell->iRowid, pNode->iNode); + }else{ + rc = parentWrite(pRtree, pCell->iRowid, pNode->iNode); + } } } return rc; @@ -109583,7 +119594,6 @@ static int rtreeUpdate( rtreeReference(pRtree); assert(nData>=1); - assert(hashIsEmpty(pRtree)); /* If azData[0] is not an SQL NULL value, it is the rowid of a ** record to delete from the r-tree table. The following block does @@ -109609,8 +119619,10 @@ static int rtreeUpdate( /* Delete the cell in question from the leaf node. */ if( rc==SQLITE_OK ){ int rc2; - iCell = nodeRowidIndex(pRtree, pLeaf, iDelete); - rc = deleteCell(pRtree, pLeaf, iCell, 0); + rc = nodeRowidIndex(pRtree, pLeaf, iDelete, &iCell); + if( rc==SQLITE_OK ){ + rc = deleteCell(pRtree, pLeaf, iCell, 0); + } rc2 = nodeRelease(pRtree, pLeaf); if( rc==SQLITE_OK ){ rc = rc2; @@ -109632,19 +119644,20 @@ static int rtreeUpdate( ** the root node (the operation that Gutman's paper says to perform ** in this scenario). */ - if( rc==SQLITE_OK && pRtree->iDepth>0 ){ - if( rc==SQLITE_OK && NCELL(pRoot)==1 ){ - RtreeNode *pChild; - i64 iChild = nodeGetRowid(pRtree, pRoot, 0); - rc = nodeAcquire(pRtree, iChild, pRoot, &pChild); - if( rc==SQLITE_OK ){ - rc = removeNode(pRtree, pChild, pRtree->iDepth-1); - } - if( rc==SQLITE_OK ){ - pRtree->iDepth--; - writeInt16(pRoot->zData, pRtree->iDepth); - pRoot->isDirty = 1; - } + if( rc==SQLITE_OK && pRtree->iDepth>0 && NCELL(pRoot)==1 ){ + int rc2; + RtreeNode *pChild; + i64 iChild = nodeGetRowid(pRtree, pRoot, 0); + rc = nodeAcquire(pRtree, iChild, pRoot, &pChild); + if( rc==SQLITE_OK ){ + rc = removeNode(pRtree, pChild, pRtree->iDepth-1); + } + rc2 = nodeRelease(pRtree, pChild); + if( rc==SQLITE_OK ) rc = rc2; + if( rc==SQLITE_OK ){ + pRtree->iDepth--; + writeInt16(pRoot->zData, pRtree->iDepth); + pRoot->isDirty = 1; } } @@ -109710,6 +119723,7 @@ static int rtreeUpdate( } rc = sqlite3_reset(pRtree->pReadRowid); } + *pRowid = cell.iRowid; if( rc==SQLITE_OK ){ rc = ChooseLeaf(pRtree, &cell, 0, &pLeaf); @@ -109847,31 +119861,69 @@ static int rtreeSqlInit( } /* -** This routine queries database handle db for the page-size used by -** database zDb. If successful, the page-size in bytes is written to -** *piPageSize and SQLITE_OK returned. Otherwise, and an SQLite error -** code is returned. +** The second argument to this function contains the text of an SQL statement +** that returns a single integer value. The statement is compiled and executed +** using database connection db. If successful, the integer value returned +** is written to *piVal and SQLITE_OK returned. Otherwise, an SQLite error +** code is returned and the value of *piVal after returning is not defined. */ -static int getPageSize(sqlite3 *db, const char *zDb, int *piPageSize){ +static int getIntFromStmt(sqlite3 *db, const char *zSql, int *piVal){ int rc = SQLITE_NOMEM; + if( zSql ){ + sqlite3_stmt *pStmt = 0; + rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); + if( rc==SQLITE_OK ){ + if( SQLITE_ROW==sqlite3_step(pStmt) ){ + *piVal = sqlite3_column_int(pStmt, 0); + } + rc = sqlite3_finalize(pStmt); + } + } + return rc; +} + +/* +** This function is called from within the xConnect() or xCreate() method to +** determine the node-size used by the rtree table being created or connected +** to. If successful, pRtree->iNodeSize is populated and SQLITE_OK returned. +** Otherwise, an SQLite error code is returned. +** +** If this function is being called as part of an xConnect(), then the rtree +** table already exists. In this case the node-size is determined by inspecting +** the root node of the tree. +** +** Otherwise, for an xCreate(), use 64 bytes less than the database page-size. +** This ensures that each node is stored on a single database page. If the +** database page-size is so large that more than RTREE_MAXCELLS entries +** would fit in a single node, use a smaller node-size. +*/ +static int getNodeSize( + sqlite3 *db, /* Database handle */ + Rtree *pRtree, /* Rtree handle */ + int isCreate /* True for xCreate, false for xConnect */ +){ + int rc; char *zSql; - sqlite3_stmt *pStmt = 0; - - zSql = sqlite3_mprintf("PRAGMA %Q.page_size", zDb); - if( !zSql ){ - return SQLITE_NOMEM; + if( isCreate ){ + int iPageSize; + zSql = sqlite3_mprintf("PRAGMA %Q.page_size", pRtree->zDb); + rc = getIntFromStmt(db, zSql, &iPageSize); + if( rc==SQLITE_OK ){ + pRtree->iNodeSize = iPageSize-64; + if( (4+pRtree->nBytesPerCell*RTREE_MAXCELLS)iNodeSize ){ + pRtree->iNodeSize = 4+pRtree->nBytesPerCell*RTREE_MAXCELLS; + } + } + }else{ + zSql = sqlite3_mprintf( + "SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1", + pRtree->zDb, pRtree->zName + ); + rc = getIntFromStmt(db, zSql, &pRtree->iNodeSize); } - rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); - if( rc!=SQLITE_OK ){ - return rc; - } - - if( SQLITE_ROW==sqlite3_step(pStmt) ){ - *piPageSize = sqlite3_column_int(pStmt, 0); - } - return sqlite3_finalize(pStmt); + return rc; } /* @@ -109892,11 +119944,10 @@ static int rtreeInit( int isCreate /* True for xCreate, false for xConnect */ ){ int rc = SQLITE_OK; - int iPageSize = 0; Rtree *pRtree; int nDb; /* Length of string argv[1] */ int nName; /* Length of string argv[2] */ - int eCoordType = (int)pAux; + int eCoordType = (pAux ? RTREE_COORD_INT32 : RTREE_COORD_REAL32); const char *aErrMsg[] = { 0, /* 0 */ @@ -109911,11 +119962,6 @@ static int rtreeInit( return SQLITE_ERROR; } - rc = getPageSize(db, argv[1], &iPageSize); - if( rc!=SQLITE_OK ){ - return rc; - } - /* Allocate the sqlite3_vtab structure */ nDb = strlen(argv[1]); nName = strlen(argv[2]); @@ -109934,44 +119980,37 @@ static int rtreeInit( memcpy(pRtree->zDb, argv[1], nDb); memcpy(pRtree->zName, argv[2], nName); - /* Figure out the node size to use. By default, use 64 bytes less than - ** the database page-size. This ensures that each node is stored on - ** a single database page. - ** - ** If the databasd page-size is so large that more than RTREE_MAXCELLS - ** entries would fit in a single node, use a smaller node-size. - */ - pRtree->iNodeSize = iPageSize-64; - if( (4+pRtree->nBytesPerCell*RTREE_MAXCELLS)iNodeSize ){ - pRtree->iNodeSize = 4+pRtree->nBytesPerCell*RTREE_MAXCELLS; - } + /* Figure out the node size to use. */ + rc = getNodeSize(db, pRtree, isCreate); /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ - if( (rc = rtreeSqlInit(pRtree, db, argv[1], argv[2], isCreate)) ){ - *pzErr = sqlite3_mprintf("%s", sqlite3_errmsg(db)); - }else{ - char *zSql = sqlite3_mprintf("CREATE TABLE x(%s", argv[3]); - char *zTmp; - int ii; - for(ii=4; zSql && iimagic = RTREE_GEOMETRY_MAGIC; + pBlob->xGeom = pGeomCtx->xGeom; + pBlob->pContext = pGeomCtx->pContext; + pBlob->nParam = nArg; + for(i=0; iaParam[i] = sqlite3_value_double(aArg[i]); + } + sqlite3_result_blob(ctx, pBlob, nBlob, doSqlite3Free); + } +} + +/* +** Register a new geometry function for use with the r-tree MATCH operator. +*/ +SQLITE_API int sqlite3_rtree_geometry_callback( + sqlite3 *db, + const char *zGeom, + int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *), + void *pContext +){ + RtreeGeomCallback *pGeomCtx; /* Context object for new user-function */ + + /* Allocate and populate the context object. */ + pGeomCtx = (RtreeGeomCallback *)sqlite3_malloc(sizeof(RtreeGeomCallback)); + if( !pGeomCtx ) return SQLITE_NOMEM; + pGeomCtx->xGeom = xGeom; + pGeomCtx->pContext = pContext; + + /* Create the new user-function. Register a destructor function to delete + ** the context object when it is no longer required. */ + return sqlite3_create_function_v2(db, zGeom, -1, SQLITE_ANY, + (void *)pGeomCtx, geomCallback, 0, 0, doSqlite3Free + ); +} + #if !SQLITE_CORE SQLITE_API int sqlite3_extension_init( sqlite3 *db, @@ -110544,7 +120645,7 @@ SQLITE_PRIVATE int sqlite3IcuInit(sqlite3 *db){ void *pContext; /* sqlite3_user_data() context */ void (*xFunc)(sqlite3_context*,int,sqlite3_value**); } scalars[] = { - {"regexp",-1, SQLITE_ANY, 0, icuRegexpFunc}, + {"regexp", 2, SQLITE_ANY, 0, icuRegexpFunc}, {"lower", 1, SQLITE_UTF16, 0, icuCaseFunc16}, {"lower", 2, SQLITE_UTF16, 0, icuCaseFunc16}, diff --git a/src/plugins/offline_editing/offline_editing.cpp b/src/plugins/offline_editing/offline_editing.cpp index d6d9f1525b4..75fc43ebf9b 100644 --- a/src/plugins/offline_editing/offline_editing.cpp +++ b/src/plugins/offline_editing/offline_editing.cpp @@ -253,8 +253,56 @@ void QgsOfflineEditing::synchronize( QgsLegendInterface* legendInterface ) sqlite3_close( db ); } +void QgsOfflineEditing::initializeSpatialMetadata(sqlite3 *sqlite_handle) +{ +// attempting to perform self-initialization for a newly created DB + int ret; + char sql[1024]; + char *errMsg = NULL; + int count; + int i; + char **results; + int rows; + int columns; + + if (sqlite_handle == NULL) + return; + // checking if this DB is really empty + strcpy(sql, "SELECT Count(*) from sqlite_master"); + ret = sqlite3_get_table(sqlite_handle, sql, &results, &rows, &columns, NULL); + if (ret != SQLITE_OK) + return; + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + count = atoi(results[(i * columns) + 0]); + } + sqlite3_free_table(results); + + if (count > 0) + return; + + // all right, it's empty: proceding to initialize + strcpy(sql, "SELECT InitSpatialMetadata()"); + ret = sqlite3_exec(sqlite_handle, sql, NULL, NULL, &errMsg); + if (ret != SQLITE_OK) + { + QString errCause = tr( "Unable to initialize SpatialMetedata:\n" ); + errCause += QString::fromUtf8(errMsg); + showWarning( errCause ); + sqlite3_free(errMsg); + return; + } + spatial_ref_sys_init(sqlite_handle, 0); +} + bool QgsOfflineEditing::createSpatialiteDB( const QString& offlineDbPath ) { + int ret; + sqlite3 *sqlite_handle; + char *errMsg = NULL; QFile newDb( offlineDbPath ); if ( newDb.exists() ) { @@ -263,22 +311,38 @@ bool QgsOfflineEditing::createSpatialiteDB( const QString& offlineDbPath ) // see also QgsNewSpatialiteLayerDialog::createDb() - // copy the spatialite template to the user specified path - QString spatialiteTemplate = QgsApplication::qgisSpatialiteDbTemplatePath(); - QFile spatialiteTemplateDb( spatialiteTemplate ); - QFileInfo fullPath = QFileInfo( offlineDbPath ); QDir path = fullPath.dir(); // Must be sure there is destination directory ~/.qgis QDir().mkpath( path.absolutePath( ) ); - // now copy the template db file into the chosen location - if ( !spatialiteTemplateDb.copy( newDb.fileName() ) ) + // creating/opening the new database + QString dbPath = newDb.fileName(); + spatialite_init(0); + ret = sqlite3_open_v2(dbPath.toUtf8().constData(), &sqlite_handle, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL); + if (ret) { - showWarning( tr( "Could not copy the template database to new location" ) ); + // an error occurred + QString errCause = tr( "Could not create a new database\n" ); + errCause += QString::fromUtf8(sqlite3_errmsg(sqlite_handle)); + sqlite3_close(sqlite_handle); + showWarning( errCause ); return false; } + // activating Foreign Key constraints + ret = sqlite3_exec(sqlite_handle, "PRAGMA foreign_keys = 1", NULL, 0, &errMsg); + if (ret != SQLITE_OK) + { + showWarning( tr( "Unable to activate FOREIGN_KEY constraints" ) ); + sqlite3_free(errMsg); + sqlite3_close(sqlite_handle); + return false; + } + initializeSpatialMetadata(sqlite_handle); + + // all done: closing the DB connection + sqlite3_close(sqlite_handle); return true; } diff --git a/src/plugins/offline_editing/offline_editing.h b/src/plugins/offline_editing/offline_editing.h index 5cdbb0f9cda..b8b1ecdfde9 100644 --- a/src/plugins/offline_editing/offline_editing.h +++ b/src/plugins/offline_editing/offline_editing.h @@ -44,6 +44,7 @@ class QgsOfflineEditing : public QObject void synchronize( QgsLegendInterface* legendInterface ); private: + void initializeSpatialMetadata( sqlite3 *sqlite_handle ); bool createSpatialiteDB( const QString& offlineDbPath ); void createLoggingTables( sqlite3* db ); void copyVectorLayer( QgsVectorLayer* layer, sqlite3* db, const QString& offlineDbPath ); diff --git a/src/providers/spatialite/qgsspatialiteprovider.h b/src/providers/spatialite/qgsspatialiteprovider.h index 5b3f59fa4c1..d3b9e938718 100644 --- a/src/providers/spatialite/qgsspatialiteprovider.h +++ b/src/providers/spatialite/qgsspatialiteprovider.h @@ -16,6 +16,7 @@ email : a.furieri@lqt.it extern "C" { +#include #include #include #include